/* R49.3 corrective layer: verified Book 57, physical-period world animations and virtual production catalogue. */
:root {
  --r491-gold: #f0cf69;
  --r491-cyan: #71ddff;
  --r491-line: rgba(113, 221, 255, .28);
  --r491-panel: rgba(3, 11, 17, .96);
}

body[data-build="2026.08.31-R49.1"],
body[data-build="2026.08.31-R49.2"],
body[data-build="2026.08.31-R49.3"] { background: #020609; }

.r491-book-boundary {
  margin: .65rem 0;
  padding: .72rem .8rem;
  border-left: 3px solid var(--r491-gold);
  background: rgba(240, 207, 105, .065);
  color: #c6d5dc;
}

.r491-formula-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: .6rem;
  align-items: end;
  margin-bottom: .7rem;
}

.r491-formula-tools label { display: grid; gap: .3rem; color: var(--r491-cyan); }
.r491-formula-tools input {
  width: 100%;
  box-sizing: border-box;
  padding: .7rem;
  color: #edf9ff;
  background: #02080d;
  border: 1px solid rgba(113, 221, 255, .42);
}
.r491-formula-count { color: var(--r491-gold); white-space: nowrap; }
.r491-formula-table { min-width: 1120px; }
.r491-formula-table code { white-space: normal; color: #c7e7f2; font-size: .74rem; }
.r491-source-hash { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; }

.r491-stage-column { min-width: 0; }
.r491-stage-column .biomatrix-world-stage { width: min(100%, 860px) !important; min-height: 0 !important; }
.r491-stage-column .biomatrix-image-viewport { opacity: 0 !important; pointer-events: none; }

.r491-world-object {
  --r491-texture: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

.r493-world-rotator {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  transform: none !important;
  background: #010509;
}

.r491-world-sphere {
  position: relative;
  width: 96%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background-color: #020508;
  background-image: var(--r491-texture);
  background-position: 50% 50%, 50% 50%;
  background-size: auto 166%, cover;
  background-repeat: no-repeat;
  box-shadow:
    inset -70px -28px 90px rgba(0, 0, 0, .8),
    inset 28px 18px 38px rgba(182, 238, 255, .14),
    0 0 22px rgba(85, 210, 255, .6),
    0 0 78px rgba(51, 151, 205, .28);
  animation: r491SurfaceRotation 28s ease-in-out infinite alternate;
}

.r491-world-sphere::before {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 31% 24%, rgba(255,255,255,.30), transparent 18%),
    linear-gradient(104deg, transparent 35%, rgba(255,255,255,.10) 48%, transparent 61%);
  mix-blend-mode: screen;
  animation: r491CloudRotation 19s linear infinite;
}

.r491-world-sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 38% 31%, transparent 0 40%, rgba(0,0,0,.12) 60%, rgba(0,0,0,.82) 100%);
  box-shadow: inset 0 0 22px rgba(143, 226, 255, .55);
}

.r491-world-object.is-structure .r491-world-sphere {
  width: 94%;
  aspect-ratio: 1.22;
  border-radius: 18%;
  background-size: cover;
  box-shadow: inset 0 0 90px #000, 0 0 58px rgba(240, 207, 105, .28);
  animation: r491StructureDrift 16s ease-in-out infinite alternate;
}

.r491-world-object.is-structure::before,
.r491-world-object.is-structure::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 86%;
  height: 37%;
  border: 2px solid rgba(240, 207, 105, .68);
  border-radius: 50%;
  transform: rotate(-14deg);
  box-shadow: 0 0 20px rgba(113, 221, 255, .35), inset 0 0 18px rgba(240, 207, 105, .22);
  animation: r491RingPrecession 12s linear infinite;
}
.r491-world-object.is-structure::after { width: 61%; height: 24%; transform: rotate(48deg); animation-direction: reverse; }

.r491-world-badge {
  position: absolute;
  z-index: 4;
  top: .55rem;
  left: .55rem;
  padding: .36rem .5rem;
  border: 1px solid rgba(113, 221, 255, .45);
  color: #dff7ff;
  background: rgba(0, 6, 10, .8);
  font-size: .69rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.r491-world-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
  margin-top: .45rem;
}
.r491-world-data span {
  display: grid;
  gap: .12rem;
  min-width: 0;
  padding: .5rem;
  border: 1px solid var(--r491-line);
  background: rgba(2, 10, 15, .92);
  color: #9fb4bf;
  font-size: .68rem;
}
.r491-world-data b { color: var(--r491-gold); font-size: .8rem; overflow-wrap: anywhere; }
.r491-world-data .wide { grid-column: 1 / -1; }

.biomatrix-exoplanet-thumb.r491-round,
.r49-atlas-cell span.r491-round {
  width: min(92%, 150px) !important;
  height: auto !important;
  aspect-ratio: 1 !important;
  margin-inline: auto;
  border-radius: 50%;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: 50% 50% !important;
  box-shadow: inset -18px -10px 24px rgba(0,0,0,.75), 0 0 15px rgba(91,205,255,.3) !important;
  animation: r491ThumbRotation 20s ease-in-out infinite alternate;
}
.r49-atlas-cell { width: 150px !important; text-align: center; }
.r49-atlas-cell span.r491-round { width: 120px !important; }

.r491-catalogue {
  margin: .8rem 0 1rem;
  padding: .8rem;
  border: 1px solid rgba(240, 207, 105, .45);
  background: linear-gradient(145deg, rgba(7,20,27,.98), rgba(2,7,11,.98));
}
.r491-catalogue h3 { margin: 0 0 .35rem; color: var(--r491-gold); }
.r491-catalogue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
  margin: .7rem 0;
}
.r491-catalogue-metrics article { padding: .65rem; border: 1px solid var(--r491-line); background: rgba(2,9,14,.92); }
.r491-catalogue-metrics b { display: block; color: var(--r491-gold); font-size: clamp(1rem, 1.5vw, 1.5rem); }
.r491-catalogue-metrics span { color: #9eb2bc; font-size: .7rem; }
.r491-catalogue-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.r491-catalogue-controls label { display: grid; gap: .2rem; min-width: 210px; color: var(--r491-cyan); font-size: .72rem; }
.r491-catalogue-controls select,
.r491-ai-grid input,
.r491-ai-grid select { padding: .62rem; color: #eefaff; background: #02080d; border: 1px solid rgba(113,221,255,.38); }
.r491-sample-list { max-height: 250px; margin-top: .7rem; overflow: auto; border: 1px solid rgba(255,255,255,.1); }
.r491-sample-list code { display: block; padding: .3rem .5rem; border-bottom: 1px solid rgba(255,255,255,.06); color: #bedbe5; font-size: .7rem; }

.r491-ai-config { margin-top: .8rem; }
.r491-ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.r491-ai-grid label { display: grid; gap: .25rem; color: var(--r491-cyan); font-size: .72rem; }
.r491-ai-status { margin-top: .55rem; padding: .55rem; border-left: 3px solid var(--r491-gold); background: rgba(240,207,105,.06); color: #c8d7de; }

@keyframes r491SurfaceRotation { from { background-position: 47% 50%; } to { background-position: 53% 50%; } }
@keyframes r491CloudRotation { to { transform: rotate(360deg); } }
@keyframes r491ThumbRotation { from { background-position: 48% 50%; } to { background-position: 52% 50%; } }
@keyframes r491StructureDrift { from { transform: perspective(950px) rotateY(-7deg) rotateX(2deg); } to { transform: perspective(950px) rotateY(7deg) rotateX(-2deg); } }
@keyframes r491RingPrecession { to { transform: rotate(346deg); } }

@media (max-width: 1250px) {
  .r491-catalogue-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r491-ai-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .r491-formula-tools, .r491-world-data, .r491-catalogue-metrics { grid-template-columns: 1fr; }
  .r491-world-data .wide { grid-column: auto; }
  .r491-world-badge { font-size: .58rem; }
}

@media (prefers-reduced-motion: reduce) {
  .r491-world-sphere,
  .r491-world-sphere::before,
  .r491-world-object::before,
  .r491-world-object::after,
  .biomatrix-exoplanet-thumb.r491-round,
  .r49-atlas-cell span.r491-round { animation: none !important; }
}

/* R49.3 exact-fit rules: no crop, no scale-up and no combined atlas presentation. */
#r33ExoplanetObservatory,
.r49-top10-hero { display: none !important; }

.r491-stage-column,
.r491-stage-column .biomatrix-world-stage {
  aspect-ratio: 1 / 1 !important;
  width: min(100%, 768px) !important;
  max-width: 768px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.r491-world-object.is-structure .r493-world-rotator {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.r493-reference-rotator,
.r49-reference-image img.r493-reference-rotator {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  background: #010509;
}

.r49-reference-image {
  aspect-ratio: 1 / 1;
  height: auto !important;
  min-height: 0 !important;
}

.r49-atlas-cell,
.r49-atlas-cell span.r491-round {
  width: 132px !important;
  max-width: 132px !important;
}

.r49-atlas-cell span.r491-round {
  height: 132px !important;
  border-radius: 0 !important;
  background-color: #010509 !important;
  box-shadow: none !important;
  animation: none !important;
}
