:root {
  --r49-content-width: 80vw;
  --r49-max-width: 2800px;
}

body[data-build="2026.08.31-R49.0"] {
  background: #020609;
}

@media (min-width: 1200px) {
  body :is(.header-inner,.container,.scientific-control-inner,.login-inner,.r43-shell,.biomatrix-lab-inner,.planet-simulation-inner,.r33-shell,.r43-section-bar,.spatial-hero,.regional-market-tapes > div,.noblesse-coin-tape > div),
  body main > section:not(.regional-market-tapes):not(.noblesse-coin-tape) > :is(.container,.r43-shell,.biomatrix-lab-inner),
  body footer > :is(.container,.footer-inner) {
    width: var(--r49-content-width) !important;
    max-width: var(--r49-max-width) !important;
    margin-inline: auto !important;
  }

  body #showroom.spatial-hero,
  body #r43-command-hub,
  body .r43-suite,
  body .r43-section-bar,
  body #biomatrix-technology > .biomatrix-lab-inner {
    width: var(--r49-content-width) !important;
    max-width: var(--r49-max-width) !important;
    margin-inline: auto !important;
  }

  body .regional-market-tapes,
  body .noblesse-coin-tape {
    width: var(--r49-content-width) !important;
    max-width: var(--r49-max-width) !important;
    margin-inline: auto !important;
    overflow: hidden !important;
  }
}

.r49-command-hub .r43-theme-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.r49-chapter {
  border-color: rgba(240, 202, 104, .48);
  background: linear-gradient(155deg, rgba(9, 20, 27, .98), rgba(3, 8, 12, .98));
  min-width: 0;
}

.r49-chapter > summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .2rem .65rem;
  align-items: center;
  padding: .85rem;
}

.r49-chapter > summary > span {
  grid-row: 1 / 3;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 2.7rem;
  border: 1px solid rgba(240, 202, 104, .44);
  color: #f3d478;
  font-size: 1.05rem;
  font-weight: 800;
}

.r49-chapter > summary b { color: #f7e4a6; }
.r49-chapter > summary small { line-height: 1.35; color: #9fb2bd; }
.r49-chapter .r43-link-grid { grid-template-columns: 1fr; }
.r49-chapter .r43-link-grid button.lead {
  border-color: #f0ca68;
  background: linear-gradient(100deg, rgba(240,202,104,.2), rgba(81,196,235,.08));
  color: #ffe79a;
}

.r49-book57 .r43-section-bar { margin-bottom: 0; }
.r49-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
  margin: .9rem 0;
}

.r49-stat-grid article {
  display: grid;
  gap: .25rem;
  padding: .8rem;
  border: 1px solid rgba(114, 217, 255, .25);
  background: rgba(2, 11, 17, .82);
}

.r49-stat-grid b { color: #f2d16e; font-size: 1.25rem; }
.r49-stat-grid span { color: #9fb1bc; font-size: .78rem; }
.r49-details-body { padding: .85rem; }
.r49-book-table td:first-child { white-space: nowrap; color: #f2d16e; }
.r49-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .8rem; }
.r49-module-search { display: grid; gap: .35rem; max-width: 760px; margin-bottom: .7rem; color: #75d9ff; }
.r49-module-search input { width: 100%; padding: .7rem; color: #e9f5f8; background: #02090e; border: 1px solid rgba(114,217,255,.38); }
.r49-module-table { min-width: 1380px; }
.r49-module-table code { white-space: normal; color: #cbe9f3; font-size: .75rem; }
.r49-status-indexed { color: #f2d16e; white-space: nowrap; }

.r49-top10-hero {
  position: relative;
  margin: .8rem 0 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(240, 202, 104, .55);
  background: #000;
  aspect-ratio: 16 / 9;
}

.r49-top10-hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.r49-top10-hero figcaption {
  position: absolute;
  inset: auto .65rem .65rem;
  padding: .45rem .6rem;
  color: #d7edf7;
  background: rgba(0, 5, 9, .82);
  border: 1px solid rgba(114,217,255,.28);
  font-size: .76rem;
}

.r49-reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin-block: 1rem;
}

.r49-reference-grid article {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(114,217,255,.27);
  background: linear-gradient(150deg, rgba(7,20,27,.98), rgba(2,7,11,.98));
}

.r49-reference-image {
  height: clamp(260px, 22vw, 520px);
  overflow: hidden;
  background: radial-gradient(circle, #10242e 0, #000 72%);
}

.r49-reference-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
  transform-origin: center;
}

.r49-reference-grid h3 { margin: .75rem .8rem .45rem; color: #f2d16e; }
.r49-reference-grid dl {
  display: grid;
  grid-template-columns: minmax(95px, .55fr) 1fr;
  gap: .3rem .65rem;
  margin: 0;
  padding: 0 .8rem .9rem;
  font-size: .78rem;
}
.r49-reference-grid dt { color: #75d9ff; }
.r49-reference-grid dd { margin: 0; color: #d7e3e8; }

.r49-sort-note {
  margin: .65rem 0;
  padding: .6rem .75rem;
  border-left: 3px solid #f0ca68;
  color: #b9c8cf;
  background: rgba(240,202,104,.06);
}

.r49-top10-table { min-width: 2600px; }
.r49-top10-table th[data-key] { cursor: pointer; user-select: none; }
.r49-top10-table th[data-key]::after { content: " ↕"; color: #75d9ff; }
.r49-top10-table td { vertical-align: top; }
.r49-top10-table td > small { display: block; margin-top: .25rem; color: #8ea3af; }
.r49-unknown { color: #f2d16e; white-space: nowrap; }

.r49-atlas-cell { width: 136px; margin: 0; }
.r49-atlas-cell span {
  display: block;
  width: 136px;
  height: 82px;
  border: 1px solid rgba(114,217,255,.28);
  background-image: url("exoplanet-top10-atlas-r49-4k.webp?v=20260831-r49");
  background-size: 500% 200%;
  background-repeat: no-repeat;
  background-color: #000;
}
.r49-atlas-cell figcaption { margin-top: .2rem; font-size: .67rem; color: #99b1bd; }

.r49-product-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 1rem;
  align-items: stretch;
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid rgba(240,202,104,.55);
  background: #03090e;
}
.r49-product-feature img { width: 100%; height: clamp(360px, 36vw, 760px); object-fit: cover; display: block; }
.r49-product-feature > div { align-self: center; padding: 1rem; }
.r49-product-feature span { color: #75d9ff; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.r49-product-feature h3 { color: #f2d16e; font-size: clamp(1.25rem, 2vw, 2.2rem); }
.r49-product-feature strong { color: #f3d478; font-size: .78rem; }

.biomatrix-world-stage {
  width: min(768px, 100%) !important;
  min-height: min(768px, 72vw) !important;
}

@media (max-width: 1540px) {
  .r49-command-hub .r43-theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r49-product-feature { grid-template-columns: 1fr; }
}

@media (max-width: 1199px) {
  :root { --r49-content-width: calc(100vw - 1rem); }
  .r49-command-hub .r43-theme-grid,
  .r49-stat-grid,
  .r49-reference-grid { grid-template-columns: 1fr; }
  .r49-reference-image { height: min(78vw, 520px); }
  .r49-product-feature img { height: min(65vw, 600px); }
}

@media (prefers-reduced-motion: reduce) {
  .r49-reference-image img { transform: scale(1.2); }
}
