/* ==========================================================================
   Solar System Observatory
   A quiet, editorial interface for a very large place.
   ========================================================================== */

:root {
  --bg: #040609;
  --bg-soft: #080c11;
  --panel: #0a0e13;
  --text: #e9e7df;
  --text-bright: #f7f5ed;
  --muted: #939ba2;
  --faint: #5e6770;
  --whisper: #40484f;
  --line: rgba(235, 240, 242, 0.12);
  --line-soft: rgba(235, 240, 242, 0.07);
  --line-faint: rgba(235, 240, 242, 0.045);
  --accent: #d9c3a0;
  --accent-cool: #aabcc3;
  --sans: "Avenir Next", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --panel-width: 430px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  overscroll-behavior: none;
}

::selection {
  color: #16120b;
  background: var(--accent);
}

button {
  color: inherit;
  font: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 1px solid rgba(217, 195, 160, 0.85);
  outline-offset: 4px;
}

svg { display: block; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Background & atmosphere
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 43%, rgba(33, 48, 58, 0.22), transparent 66%),
    radial-gradient(ellipse 36% 38% at 14% 20%, rgba(41, 58, 68, 0.12), transparent 70%),
    radial-gradient(ellipse 35% 42% at 85% 74%, rgba(52, 43, 35, 0.10), transparent 72%),
    linear-gradient(165deg, #06090d 0%, #040609 48%, #030508 100%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 72%);
  opacity: 0.5;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  isolation: isolate;
}

.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transition: opacity 1.4s var(--ease);
}

.is-ready .scene canvas { opacity: 1; }
.scene canvas.is-dragging { cursor: grabbing; }
.scene canvas.is-over-body { cursor: pointer; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, transparent 42%, rgba(2, 4, 7, 0.42) 100%),
    linear-gradient(180deg, rgba(2, 4, 7, 0.32) 0%, transparent 16%, transparent 72%, rgba(2, 4, 7, 0.78) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 86px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.9s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
}

.is-ready .topbar {
  opacity: 1;
  transform: none;
}

.topbar > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #d7c4a1;
  border: 1px solid rgba(226, 211, 183, 0.24);
  border-radius: 50%;
  transition: transform 1.1s var(--ease), border-color 0.35s ease;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  transform: rotate(-12deg);
  transition: transform 1.2s var(--ease);
}

.brand:hover .brand-mark { border-color: rgba(226, 211, 183, 0.55); }
.brand:hover .brand-mark svg { transform: rotate(28deg); }

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-zh {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(246, 243, 234, 0.93);
  line-height: 1;
}

.brand-en {
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.24em;
  color: rgba(111, 121, 127, 0.78);
}

.scope-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(211, 215, 215, 0.68);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s ease 0.5s;
}

.is-ready .scope-status { opacity: 1; }

.scope-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b7cfb6;
  box-shadow: 0 0 9px rgba(183, 207, 182, 0.8);
  animation: status-pulse 3.4s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}

.scope-divider {
  width: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.scope-count { color: var(--whisper); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.quiet-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  background: transparent;
  color: rgba(209, 213, 213, 0.7);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  transition: color 0.25s ease;
}

.quiet-button svg { width: 14px; height: 14px; opacity: 0.72; }
.quiet-button:hover { color: var(--text-bright); }

.quiet-button.is-muted,
.quiet-button:disabled {
  color: var(--whisper);
  pointer-events: none;
  cursor: default;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.012);
  color: rgba(220, 223, 220, 0.72);
  font-family: var(--mono);
  font-size: 11px;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.icon-button:hover {
  color: var(--text-bright);
  border-color: rgba(235, 240, 242, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.icon-button svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   Edge annotation
   -------------------------------------------------------------------------- */

.edge-note {
  position: fixed;
  left: 33px;
  top: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 11px;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  color: rgba(163, 170, 173, 0.34);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.22em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease 0.8s;
}

.is-ready .edge-note { opacity: 1; }
.has-panel .edge-note { opacity: 0; }

.edge-note-line {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, transparent, rgba(190, 196, 195, 0.32), transparent);
}

/* --------------------------------------------------------------------------
   Overview caption
   -------------------------------------------------------------------------- */

.view-caption {
  position: fixed;
  left: 48px;
  top: 18.5%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.8s var(--ease) 0.55s,
    transform 0.8s var(--ease) 0.55s,
    visibility 0.8s;
}

.is-ready .view-caption {
  opacity: 1;
  transform: none;
}

.has-panel .view-caption,
.has-guide .view-caption {
  opacity: 0;
  transform: translateY(-7px);
  visibility: hidden;
  transition-delay: 0s;
}

.view-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  color: rgba(184, 170, 148, 0.55);
}

.view-kicker::before {
  content: "";
  width: 19px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.view-caption h1 {
  position: relative;
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(44px, 4.1vw, 61px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0.06em;
  color: rgba(245, 241, 232, 0.92);
  text-shadow: 0 6px 36px rgba(0, 0, 0, 0.45);
}

.view-caption h1 span {
  display: block;
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.26em;
  color: rgba(160, 166, 166, 0.48);
  text-shadow: none;
}

.view-caption > p {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: 0.13em;
  color: rgba(175, 178, 172, 0.62);
}

.view-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 21px;
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.11em;
  color: rgba(114, 123, 126, 0.58);
}

.view-meta span + span::before {
  content: "璺?;
  margin-right: 14px;
  color: rgba(114, 123, 126, 0.38);
}

.view-hint {
  display: none;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: rgba(126, 134, 137, 0.65);
}

/* --------------------------------------------------------------------------
   Scene labels
   -------------------------------------------------------------------------- */

.labels {
  position: fixed;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease 0.7s;
}

.is-ready .labels { opacity: 1; }
.has-panel .labels { opacity: 0.66; }

.body-label {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  pointer-events: auto;
  transform-origin: 0 0;
  transition: opacity 0.3s ease;
  opacity: 0;
  will-change: transform;
}

.body-label.is-visible { opacity: 1; visibility: visible; }
.body-label.is-dim { opacity: 0.3; }
.body-label.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.label-dot {
  position: absolute;
  left: -2.5px;
  top: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dot, #d6d2c8);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 12px color-mix(in srgb, var(--dot, #d6d2c8) 65%, transparent);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.label-leader {
  position: absolute;
  left: 0;
  top: -0.5px;
  width: 10px;
  height: 1px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(203, 202, 192, 0.34), rgba(203, 202, 192, 0.035));
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.body-label:hover .label-leader,
.body-label.is-hover .label-leader,
.body-label.is-active .label-leader { opacity: 0.64; }

.label-copy {
  position: absolute;
  left: var(--label-gap, 10px);
  top: 0;
  transform: translateY(calc(-50% + var(--label-dy, 0px)));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(2, 4, 7, 0.95), 0 0 3px rgba(2, 4, 7, 0.8);
}

.label-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.14em;
  color: rgba(234, 233, 226, 0.82);
  transition: color 0.25s ease;
}

.label-en {
  font-family: var(--mono);
  font-size: 6.2px;
  line-height: 1;
  letter-spacing: 0.17em;
  color: rgba(156, 163, 165, 0.54);
  transition: color 0.25s ease;
}

.body-label:hover .label-name,
.body-label.is-hover .label-name,
.body-label.is-active .label-name { color: #fffdf5; }

.body-label:hover .label-en,
.body-label.is-hover .label-en,
.body-label.is-active .label-en { color: rgba(205, 200, 185, 0.8); }

.body-label:hover .label-dot,
.body-label.is-hover .label-dot,
.body-label.is-active .label-dot {
  transform: scale(1.65);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.42),
    0 0 16px 2px color-mix(in srgb, var(--dot, #d6d2c8) 72%, transparent);
}

.body-label:focus-visible { outline: none; }

.body-label:focus-visible .label-dot {
  transform: scale(2);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 18px 3px color-mix(in srgb, var(--dot, #d6d2c8) 72%, transparent);
}

.body-label:focus-visible .label-name {
  color: #fffdf5;
  text-decoration: underline;
  text-decoration-color: rgba(217, 195, 160, 0.8);
  text-underline-offset: 3px;
}

.body-label.is-left .label-dot { left: auto; right: -2.5px; }

.body-label.is-left .label-copy {
  left: auto;
  right: var(--label-gap, 10px);
  align-items: flex-end;
}

.body-label[data-body="sun"] .label-name { font-size: 11.5px; }
.body-label[data-body="sun"] .label-copy { gap: 4px; }

/* --------------------------------------------------------------------------
   HUD 閳?time, navigation
   -------------------------------------------------------------------------- */

.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 32;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 24px;
  padding: 0 32px calc(24px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s var(--ease) 0.25s, transform 0.9s var(--ease) 0.25s;
}

.is-ready .hud { opacity: 1; transform: none; }
.hud > * { pointer-events: auto; }

.time-panel {
  justify-self: start;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 5px 0 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(7, 10, 14, 0.56);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px) saturate(0.9);
  -webkit-backdrop-filter: blur(18px) saturate(0.9);
}

.play-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.018);
  color: rgba(240, 238, 230, 0.82);
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.play-button:hover {
  border-color: rgba(217, 195, 160, 0.5);
  background: rgba(217, 195, 160, 0.07);
  color: #fff9ed;
}

.play-button svg { width: 14px; height: 14px; }
.play-button .play-icon { display: none; margin-left: 1px; }
.play-button.is-paused .pause-icon { display: none; }
.play-button.is-paused .play-icon { display: block; }

.sim-clock {
  min-width: 137px;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
}

.clock-label {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.15em;
  color: rgba(104, 113, 120, 0.9);
  white-space: nowrap;
}

.clock-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

#sim-date {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(235, 233, 225, 0.88);
}

#sim-time {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: rgba(112, 122, 128, 0.9);
}

.speed-wrap {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.speed-button {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  background: transparent;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: rgba(201, 204, 202, 0.78);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.speed-button svg { width: 10px; height: 10px; opacity: 0.55; }
.speed-button:hover { color: var(--text-bright); }

.speed-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 148px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(9, 13, 18, 0.94);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: menu-in 0.25s var(--ease);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.speed-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.speed-option:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.speed-option.is-active { color: var(--accent); background: rgba(217, 195, 160, 0.055); }

.speed-option .check {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
}

.speed-option.is-active .check { opacity: 1; }

.planet-rail {
  justify-self: center;
  height: 56px;
  display: flex;
  align-items: stretch;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(7, 10, 14, 0.56);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px) saturate(0.9);
  -webkit-backdrop-filter: blur(18px) saturate(0.9);
}

.planet-tab {
  position: relative;
  min-width: 53px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 2px;
  background: transparent;
  color: rgba(205, 208, 204, 0.56);
  transition: color 0.25s ease, background 0.25s ease;
}

.planet-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.planet-tab.is-active {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.048);
}

.planet-tab .tab-index {
  font-family: var(--mono);
  font-size: 6px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: rgba(95, 105, 112, 0.9);
  transition: color 0.25s ease;
}

.planet-tab.is-active .tab-index { color: var(--tab-accent, var(--accent)); }

.planet-tab .tab-main {
  display: flex;
  align-items: center;
  gap: 5px;
}

.planet-tab .tab-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tab-accent, #8b8d8b);
  box-shadow: 0 0 5px color-mix(in srgb, var(--tab-accent, #8b8d8b) 52%, transparent);
}

.planet-tab .tab-name {
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.planet-tab::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 2px;
  height: 1px;
  background: var(--tab-accent, var(--accent));
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 0.3s ease, transform 0.35s var(--ease);
}

.planet-tab.is-active::after { opacity: 0.7; transform: none; }

.planet-tab[data-body="sun"] { min-width: 58px; margin-right: 4px; }
.planet-tab[data-body="sun"]::before {
  content: "";
  position: absolute;
  right: -2px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line-soft);
}

.hud-help {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 20px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  color: rgba(139, 146, 149, 0.5);
  white-space: nowrap;
}

.hud-help span + span::before {
  content: "璺?;
  margin-right: 13px;
  color: var(--whisper);
}

/* --------------------------------------------------------------------------
   Gravity lab
   -------------------------------------------------------------------------- */

.lab-launch {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(217, 195, 160, 0.27);
  border-radius: 999px;
  background: rgba(217, 195, 160, 0.045);
  color: rgba(225, 211, 188, 0.84);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.lab-launch svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
  opacity: 0.85;
}

.lab-launch:hover {
  border-color: rgba(217, 195, 160, 0.58);
  background: rgba(217, 195, 160, 0.09);
  color: var(--text-bright);
}

.lab-ui {
  position: fixed;
  inset: 0;
  z-index: 42;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.is-lab .lab-ui {
  opacity: 1;
  visibility: visible;
}

.is-lab .hud,
.is-lab .detail-panel,
.is-lab .view-caption,
.is-lab .edge-note {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.is-lab .topbar-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.is-lab .scope-dot {
  background: #e0bc82;
  box-shadow: 0 0 10px rgba(224, 188, 130, 0.75);
}

.is-lab .labels { opacity: 0.82; }
.is-lab .body-label { pointer-events: auto; cursor: pointer; }
.is-lab .body-label[data-body="sun"] { pointer-events: none; }
.is-lab .body-label .label-dot,
.is-lab .body-label .label-leader { pointer-events: none; }
.is-lab .body-label .label-copy { pointer-events: auto; }
.is-lab .scene canvas.is-over-body { cursor: grab; }
.is-lab .scene canvas.is-dragging { cursor: grabbing; }

.lab-header {
  position: absolute;
  left: 48px;
  top: 98px;
  width: min(320px, 34vw);
  pointer-events: none;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 0.8s var(--ease) 0.2s, transform 0.8s var(--ease) 0.2s;
}

.is-lab .lab-header {
  opacity: 1;
  transform: none;
}

.lab-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: rgba(213, 191, 158, 0.66);
}

.lab-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dfb676;
  box-shadow: 0 0 10px rgba(223, 182, 118, 0.7);
  animation: status-pulse 2.8s ease-in-out infinite;
}

.lab-header h2 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.045em;
  color: rgba(244, 240, 230, 0.94);
}

.lab-header h2 em {
  font-style: normal;
  color: #ddb77d;
}

.lab-header p {
  margin: 15px 0 0;
  font-size: 11px;
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: rgba(144, 152, 156, 0.9);
}

.lab-exit {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 2;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 10, 14, 0.62);
  color: rgba(209, 207, 198, 0.78);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  pointer-events: auto;
  backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.lab-exit svg { width: 13px; height: 13px; opacity: 0.72; }
.lab-exit:hover {
  border-color: rgba(217, 195, 160, 0.45);
  background: rgba(18, 22, 26, 0.8);
  color: var(--text-bright);
}

.lab-tasks {
  position: absolute;
  top: 98px;
  right: 32px;
  width: 268px;
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(7, 10, 14, 0.64);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px) saturate(0.9);
  -webkit-backdrop-filter: blur(20px) saturate(0.9);
  pointer-events: auto;
}

.lab-tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: rgba(178, 172, 158, 0.68);
}

.lab-tasks-head span:last-child { color: rgba(104, 114, 119, 0.9); }

.lab-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-task-list li {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-faint);
}

.lab-task-list li:last-child { border-bottom: 0; padding-bottom: 2px; }

.task-mark {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 1px;
  border: 1px solid rgba(188, 181, 164, 0.33);
  border-radius: 50%;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.lab-task-list li.is-done .task-mark {
  border-color: rgba(217, 195, 160, 0.74);
  background: rgba(217, 195, 160, 0.18);
}

.lab-task-list li.is-done .task-mark::after {
  content: "閴?;
  position: absolute;
  left: 2px;
  top: -1px;
  font-family: var(--mono);
  font-size: 7px;
  color: #e2c18c;
}

.task-copy { display: flex; flex-direction: column; gap: 3px; }
.task-copy strong {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(221, 216, 204, 0.86);
}
.task-copy small {
  font-size: 9px;
  line-height: 1.5;
  color: rgba(119, 129, 134, 0.88);
}
.lab-task-list li.is-done .task-copy strong { color: rgba(219, 191, 147, 0.9); }
.lab-task-list li.is-done .task-copy small { color: rgba(122, 124, 119, 0.62); }

.lab-tasks-close {
  display: none;
  margin-top: 9px;
  padding: 4px 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: rgba(163, 154, 137, 0.7);
}

.lab-instruction {
  position: absolute;
  left: 48px;
  bottom: 105px;
  display: flex;
  gap: 15px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  color: rgba(129, 137, 141, 0.52);
  pointer-events: none;
}

.lab-instruction span + span::before {
  content: "璺?;
  margin-right: 15px;
  color: rgba(99, 107, 112, 0.56);
}

.lab-toolbar {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  max-width: calc(100vw - 48px);
  min-height: 56px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(7, 10, 14, 0.68);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(20px) saturate(0.9);
  -webkit-backdrop-filter: blur(20px) saturate(0.9);
  pointer-events: auto;
}

.lab-primary {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--line-soft);
  padding-right: 8px;
}

.lab-play {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.018);
  color: rgba(240, 238, 230, 0.82);
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.lab-play:hover {
  border-color: rgba(217, 195, 160, 0.5);
  background: rgba(217, 195, 160, 0.07);
}
.lab-play svg { width: 14px; height: 14px; }
.lab-play .lab-play-icon { display: none; margin-left: 1px; }
.lab-play.is-paused .lab-pause-icon { display: none; }
.lab-play.is-paused .lab-play-icon { display: block; }

.lab-clock {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 11px 0 10px;
}
.lab-clock span {
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.14em;
  color: rgba(101, 110, 116, 0.9);
}
.lab-clock b {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(231, 228, 219, 0.84);
}

.lab-speeds {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
  border-right: 1px solid var(--line-soft);
}

.lab-speeds button {
  height: 27px;
  min-width: 32px;
  padding: 0 6px;
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 7px;
  color: rgba(139, 146, 148, 0.74);
  transition: color 0.2s ease, background 0.2s ease;
}
.lab-speeds button:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.lab-speeds button.is-active {
  color: var(--accent);
  background: rgba(217, 195, 160, 0.09);
}

.lab-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border-right: 1px solid var(--line-soft);
}

.lab-selected-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lab-accent, #7fa7c9);
  box-shadow: 0 0 12px color-mix(in srgb, var(--lab-accent, #7fa7c9) 65%, transparent);
}

.lab-selected-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 42px;
}
.lab-selected-copy small {
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.09em;
  color: rgba(101, 110, 116, 0.9);
}
.lab-selected-copy b {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(233, 228, 216, 0.9);
}

.lab-selected-meta {
  font-family: var(--mono);
  font-size: 6.5px;
  color: rgba(124, 134, 139, 0.82);
  white-space: nowrap;
}

.lab-selected > button {
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--mono);
  font-size: 6.5px;
  color: rgba(197, 194, 184, 0.82);
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.lab-selected > button:hover {
  border-color: rgba(217, 195, 160, 0.38);
  color: var(--text-bright);
  background: rgba(217, 195, 160, 0.07);
}
.lab-selected .lab-deselect {
  width: 23px;
  padding: 0;
  border-color: transparent;
  color: rgba(125, 133, 137, 0.8);
  font-size: 12px;
}

.lab-secondary {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 8px;
}

.lab-action {
  height: 33px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.02em;
  color: rgba(138, 146, 148, 0.8);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.lab-action:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.lab-action b { font-weight: 400; color: rgba(220, 199, 164, 0.9); }
.lab-action svg { width: 12px; height: 12px; opacity: 0.72; }
.lab-action-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d5b57f;
  box-shadow: 0 0 8px rgba(213, 181, 127, 0.6);
}
.lab-action:not(.is-on) { color: rgba(120, 128, 132, 0.72); }
.lab-action:not(.is-on) .lab-action-dot {
  background: rgba(121, 127, 129, 0.48);
  box-shadow: none;
}
.lab-action:not(.is-on) b { color: rgba(147, 151, 146, 0.7); }

.lab-tasks-toggle { display: none; }

.lab-toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 8px);
  z-index: 3;
  padding: 9px 15px;
  border: 1px solid rgba(217, 195, 160, 0.28);
  border-radius: 999px;
  background: rgba(10, 14, 18, 0.9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  color: rgba(226, 208, 178, 0.9);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}
.lab-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1100px) {
  .lab-toolbar { max-width: calc(100vw - 32px); }
  .lab-selected-meta { display: none; }
}

@media (max-width: 900px) {
  .lab-launch { height: 30px; padding: 0 9px 0 8px; gap: 5px; font-size: 7px; }
  .lab-launch svg { width: 13px; height: 13px; }

  .lab-exit {
    top: 14px;
    right: 14px;
    height: 31px;
    padding: 0 11px;
    font-size: 6.5px;
  }
  .lab-header {
    left: 18px;
    top: 82px;
    width: min(260px, 68vw);
  }
  .lab-header h2 { margin-top: 12px; font-size: 32px; }
  .lab-header p { margin-top: 11px; font-size: 10px; line-height: 1.7; }

  .lab-tasks {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 130px;
    width: auto;
    max-height: 42vh;
    overflow-y: auto;
    display: none;
    z-index: 4;
    padding: 15px 16px 12px;
  }
  .lab-tasks.is-open { display: block; }
  .lab-tasks-close { display: block; }

  .lab-instruction { display: none; }

  .lab-toolbar {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: none;
    max-width: none;
    padding: 6px;
    flex-wrap: wrap;
    row-gap: 3px;
  }

  .lab-primary { flex: 0 0 auto; border-right: 0; padding-right: 2px; }
  .lab-play { width: 35px; height: 35px; }
  .lab-clock { padding: 0 8px 0 8px; }
  .lab-clock b { font-size: 9px; }
  .lab-speeds {
    padding: 0 3px;
    border-right: 0;
    margin-left: auto;
  }
  .lab-speeds button { min-width: 29px; padding: 0 4px; }

  .lab-secondary {
    flex: 1 1 100%;
    justify-content: space-between;
    padding: 4px 3px 0;
    border-top: 1px solid var(--line-faint);
  }
  .lab-action { height: 30px; padding: 0 6px; }
  .lab-tasks-toggle { display: flex; }

  .lab-selected {
    order: 3;
    flex: 1 1 100%;
    min-height: 36px;
    padding: 5px 3px 0;
    border-top: 1px solid var(--line-faint);
    border-right: 0;
    flex-wrap: wrap;
  }
  .lab-selected-copy { flex-direction: row; align-items: baseline; gap: 6px; min-width: 0; }
  .lab-selected-copy small { font-size: 5px; }
  .lab-selected-copy b { font-size: 9.5px; }
  .lab-selected-meta { display: none; }
  .lab-selected > button:not(.lab-deselect) { margin-left: auto; }
  .lab-selected > button + button { margin-left: 0; }
  .lab-deselect { margin-left: 0 !important; }

  .lab-toast {
    bottom: 144px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lab-tasks-toggle { pointer-events: auto; }
}

@media (max-width: 560px) {
  .lab-header { top: 77px; width: min(245px, 72vw); }
  .lab-header h2 { font-size: 29px; }
  .lab-header p { display: none; }
  .lab-kicker { font-size: 5.8px; }
  .lab-exit { top: 13px; right: 13px; height: 29px; padding: 0 9px; }
  .lab-exit svg { width: 11px; height: 11px; }
  .lab-exit span { font-size: 6px; }
  .lab-toolbar { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .lab-tasks { left: 8px; right: 8px; bottom: 122px; }
  .lab-toast { bottom: 136px; }
  .lab-selected > button { height: 28px; padding: 0 7px; font-size: 6.5px; }
  .lab-selected .lab-deselect { width: 27px; }
  .lab-action { font-size: 6px; padding: 0 5px; }
  .lab-speeds button { min-width: 27px; font-size: 6.5px; }
  .lab-primary .lab-clock span { display: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .lab-header { top: 66px; left: 16px; }
  .lab-header h2 { font-size: 25px; }
  .lab-header p { display: none; }
  .lab-exit { top: 10px; right: 12px; height: 28px; }
  .lab-toolbar { left: 12px; right: 12px; bottom: 8px; transform: none; max-width: none; min-height: 44px; padding: 4px 6px; }
  .lab-instruction { display: none; }
  .lab-tasks { top: 58px; right: 12px; bottom: auto; left: auto; width: 250px; max-height: 55vh; display: none; }
  .lab-tasks.is-open { display: block; }
  .lab-play { width: 32px; height: 32px; }
  .lab-selected { min-height: 32px; }
  .lab-toast { bottom: 66px; }
}

/* --------------------------------------------------------------------------
   Detail panel
   -------------------------------------------------------------------------- */

.detail-panel {
  position: fixed;
  top: 86px;
  right: 28px;
  bottom: 108px;
  z-index: 36;
  width: var(--panel-width);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    radial-gradient(ellipse 220px 180px at 88% 0%, rgba(84, 72, 55, 0.09), transparent 70%),
    linear-gradient(145deg, #0d1218 0%, #090d12 58%, #070a0e 100%);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px) saturate(0.9);
  -webkit-backdrop-filter: blur(24px) saturate(0.9);
  opacity: 0;
  transform: translateX(26px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.65s var(--ease);
  overflow: hidden;
}

.detail-panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.detail-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 195, 160, 0.6), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.panel-chrome {
  flex: 0 0 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  background: transparent;
  color: rgba(194, 199, 199, 0.62);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  transition: color 0.25s ease;
}

.panel-back svg { width: 13px; height: 13px; }
.panel-back:hover { color: var(--text-bright); }

.panel-position {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: var(--whisper);
}

.panel-scroll {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 27px 27px 30px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(208, 199, 180, 0.25) transparent;
}

.panel-scroll::-webkit-scrollbar { width: 4px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(208, 199, 180, 0.22);
  border-radius: 2px;
}

.panel-footer {
  position: relative;
  flex: 0 0 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--line-soft);
  background: rgba(5, 8, 11, 0.32);
  z-index: 2;
}

.panel-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 36px;
  background: linear-gradient(to top, rgba(8, 12, 16, 0.96), rgba(8, 12, 16, 0));
  pointer-events: none;
}

.panel-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 3px;
  background: transparent;
  color: rgba(198, 202, 201, 0.56);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  transition: color 0.25s ease;
}

.panel-arrow svg { width: 13px; height: 13px; }
.panel-arrow:hover { color: var(--text-bright); }

.panel-footer-mark {
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.18em;
  color: var(--whisper);
}

/* Panel 閳?generated content */

.panel-hero {
  position: relative;
  padding: 0 0 2px;
}

.panel-hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 240px;
  right: -72px;
  top: -94px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow, rgba(217, 195, 160, 0.13)) 0%, transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.8;
}

.panel-eyebrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--accent, var(--accent));
  text-transform: uppercase;
}

.panel-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.panel-name-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 13px;
  margin-top: 12px;
}

.panel-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--text-bright);
}

.panel-en {
  padding-bottom: 5px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.19em;
  color: rgba(111, 120, 125, 0.9);
}

.panel-watermark {
  position: absolute;
  right: -4px;
  top: -24px;
  font-family: var(--mono);
  font-size: 84px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.07em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.075);
  pointer-events: none;
  user-select: none;
}

.panel-tagline {
  position: relative;
  margin: 20px 0 0;
  padding-left: 13px;
  border-left: 1px solid color-mix(in srgb, var(--accent, #d9c3a0) 55%, transparent);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.75;
  color: rgba(224, 216, 203, 0.9);
}

.panel-intro {
  position: relative;
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.95;
  letter-spacing: 0.015em;
  color: rgba(158, 166, 170, 0.96);
}

.body-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}

.body-tag {
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.09em;
  color: rgba(169, 176, 178, 0.65);
  background: rgba(255, 255, 255, 0.014);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 25px;
  border-top: 1px solid var(--line);
}

.stat-cell {
  padding: 13px 14px 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.stat-cell:nth-child(2n) {
  padding-left: 16px;
  border-left: 1px solid var(--line-soft);
}

.stat-label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  color: rgba(112, 121, 126, 0.92);
  white-space: nowrap;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: rgba(240, 237, 229, 0.96);
}

.stat-value.is-small { font-size: 16px; white-space: nowrap; }
.stat-value em {
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.stat-sub {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.02em;
  color: rgba(91, 100, 106, 0.92);
}

.data-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.11em;
  color: var(--whisper);
}

.data-label span:first-child { color: rgba(161, 167, 166, 0.52); }

.orbit-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin-top: 4px;
}

.orbit-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-faint);
}

.orbit-fact span {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.02em;
  color: var(--whisper);
  white-space: nowrap;
}

.orbit-fact strong {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  color: rgba(184, 190, 190, 0.78);
  text-align: right;
}

.panel-section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.section-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.045em;
  color: rgba(242, 239, 231, 0.92);
}

.section-head span {
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.13em;
  color: var(--whisper);
}

.section-note {
  margin: 0 0 15px;
  font-size: 10px;
  line-height: 1.75;
  color: rgba(131, 140, 146, 0.88);
}

.comp-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.comp-item {
  display: grid;
  grid-template-columns: 63px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
}

.comp-name {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(191, 195, 193, 0.82);
  white-space: nowrap;
}

.comp-track {
  position: relative;
  height: 2px;
  background: rgba(255, 255, 255, 0.065);
  overflow: hidden;
}

.comp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent, #d9c3a0) 45%, transparent), var(--accent, #d9c3a0));
  transform-origin: left center;
  animation: comp-in 0.85s var(--ease);
}

@keyframes comp-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.comp-value {
  font-family: var(--mono);
  font-size: 7.5px;
  color: rgba(174, 180, 180, 0.7);
  text-align: right;
  white-space: nowrap;
}

.prose {
  margin: 0;
  font-size: 11px;
  line-height: 1.95;
  letter-spacing: 0.012em;
  color: rgba(150, 159, 164, 0.92);
}

.prose + .prose { margin-top: 12px; }

.prose strong {
  font-weight: 500;
  color: rgba(214, 212, 203, 0.9);
}

.split-copy {
  display: grid;
  gap: 16px;
}

.split-copy h4 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: rgba(213, 209, 199, 0.8);
}

.fact-list {
  display: flex;
  flex-direction: column;
}

.fact-item {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-faint);
}

.fact-item:first-child { padding-top: 0; }
.fact-item:last-child { border-bottom: 0; padding-bottom: 0; }

.fact-number {
  padding-top: 2px;
  border-top: 1px solid color-mix(in srgb, var(--accent, #d9c3a0) 56%, transparent);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--accent, #d9c3a0) 80%, #ffffff 10%);
}

.fact-item h4 {
  margin: 0 0 5px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(230, 227, 218, 0.94);
}

.fact-item p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.82;
  color: rgba(136, 145, 151, 0.92);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.mission-item {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-faint);
}

.mission-item:first-child { padding-top: 0; }
.mission-item:last-child { border-bottom: 0; padding-bottom: 0; }

.mission-year {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.02em;
  color: rgba(190, 174, 148, 0.7);
}

.mission-item h4 {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  color: rgba(220, 218, 210, 0.9);
}

.mission-item p {
  margin: 0;
  font-size: 10px;
  line-height: 1.75;
  color: rgba(129, 138, 144, 0.9);
}

.satellite-note {
  margin: 0 0 12px;
  font-size: 9.5px;
  line-height: 1.7;
  color: rgba(128, 136, 141, 0.85);
}

.satellite-list {
  display: flex;
  flex-direction: column;
}

.satellite-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--line-faint);
}

.satellite-item:last-child { border-bottom: 0; padding-bottom: 0; }

.satellite-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.satellite-head h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(224, 220, 211, 0.92);
}

.satellite-meta {
  font-family: var(--mono);
  font-size: 6.5px;
  color: var(--whisper);
  text-align: right;
}

.satellite-item p {
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.7;
  color: rgba(131, 140, 146, 0.9);
}

.panel-end {
  margin-top: 28px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.13em;
  color: var(--whisper);
}

.panel-end span:first-child { color: rgba(170, 176, 175, 0.4); }

/* --------------------------------------------------------------------------
   Guide modal
   -------------------------------------------------------------------------- */

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(2, 4, 7, 0.7);
  backdrop-filter: blur(14px) saturate(0.8);
  -webkit-backdrop-filter: blur(14px) saturate(0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.guide-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.guide-card {
  position: relative;
  width: min(880px, 100%);
  max-height: min(86vh, 900px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 44px 48px 36px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(54, 65, 69, 0.16), transparent 70%),
    linear-gradient(155deg, #0c1116, #070b0f 72%);
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.58);
  transform: translateY(16px) scale(0.99);
  transition: transform 0.55s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: rgba(208, 199, 180, 0.22) transparent;
}

.guide-overlay.is-open .guide-card { transform: none; }

.guide-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.guide-heading { max-width: 610px; }

.kicker {
  display: block;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  color: rgba(190, 173, 147, 0.68);
}

.guide-heading h2 {
  margin: 15px 0 12px;
  font-family: var(--serif);
  font-size: clamp(31px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--text-bright);
}

.guide-heading p {
  margin: 0;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(146, 154, 159, 0.92);
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px 54px;
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
}

.guide-section { position: relative; }

.guide-section-wide { grid-column: 1 / -1; }

.guide-number {
  position: absolute;
  top: 2px;
  right: 0;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.1em;
  color: var(--whisper);
}

.guide-section h3 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(235, 231, 220, 0.94);
}

.guide-copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.9;
  color: rgba(142, 151, 156, 0.92);
}

.guide-fine {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-faint);
  font-size: 9.5px;
  line-height: 1.8;
  color: rgba(111, 121, 126, 0.82);
}

.control-list {
  display: flex;
  flex-direction: column;
  margin: 0 0 17px;
}

.control-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-faint);
}

.control-list dt { margin: 0; }
.control-list dd {
  margin: 0;
  font-size: 10px;
  color: rgba(151, 159, 163, 0.92);
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: rgba(207, 202, 189, 0.84);
  background: rgba(255, 255, 255, 0.02);
}

.scale-notes {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line-faint);
}

.scale-notes > div {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-faint);
}

.scale-notes span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  color: rgba(185, 171, 146, 0.7);
}

.scale-notes p {
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
  color: rgba(138, 147, 152, 0.92);
}

.planet-table {
  border-top: 1px solid var(--line-soft);
}

.planet-table-head,
.planet-table-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.planet-table-head {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
  color: rgba(96, 106, 111, 0.9);
}

.planet-table-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-faint);
  font-family: var(--mono);
  font-size: 8.5px;
  color: rgba(171, 177, 178, 0.86);
}

.planet-table-row span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(225, 222, 212, 0.9);
}

.planet-table-row i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 7px color-mix(in srgb, var(--dot) 60%, transparent);
}

.guide-source { padding-top: 0; }

.guide-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line-faint);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.12em;
  color: var(--whisper);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin-top: 32px;
  padding: 11px 16px;
  border: 1px solid rgba(217, 195, 160, 0.3);
  border-radius: 2px;
  background: rgba(217, 195, 160, 0.06);
  color: rgba(239, 232, 218, 0.9);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.primary-button svg { width: 15px; height: 15px; }
.primary-button:hover {
  background: rgba(217, 195, 160, 0.12);
  border-color: rgba(217, 195, 160, 0.55);
}

/* --------------------------------------------------------------------------
   Loading
   -------------------------------------------------------------------------- */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 45% 38% at 50% 48%, rgba(24, 34, 41, 0.3), transparent 70%),
    #040609;
  opacity: 1;
  visibility: visible;
  transition: opacity 1s var(--ease) 0.1s, visibility 1s ease 0.1s;
}

.loading-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-core {
  width: min(390px, 78vw);
  position: relative;
}

.loading-orbit {
  width: 46px;
  height: 46px;
  margin-bottom: 28px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  animation: loading-spin 9s linear infinite;
}

.loading-orbit::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.loading-orbit span {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #d9c3a0;
  box-shadow: 0 0 12px rgba(217, 195, 160, 0.7);
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.loading-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.25em;
  color: rgba(188, 172, 146, 0.57);
}

.loading-title {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--text-bright);
}

.loading-rule {
  height: 1px;
  margin: 30px 0 13px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.loading-rule span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(217, 195, 160, 0.35), #d9c3a0);
  box-shadow: 0 0 10px rgba(217, 195, 160, 0.35);
  transition: width 0.35s ease;
}

.loading-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
  color: var(--whisper);
}

.loading-core.is-error .loading-orbit {
  animation: none;
  border-color: rgba(205, 130, 102, 0.35);
}

.loading-core.is-error .loading-orbit span {
  background: #bb7e68;
  box-shadow: 0 0 12px rgba(187, 126, 104, 0.5);
}

.loading-core.is-error #loading-status {
  color: rgba(203, 157, 137, 0.85);
  line-height: 1.8;
}

#loading-percent { color: rgba(175, 162, 140, 0.65); }

.no-script {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1320px) {
  .hud { gap: 16px; padding-left: 24px; padding-right: 24px; }
  .hud-help { display: none; }
  .hud { grid-template-columns: minmax(0, 1fr) auto; }
  .planet-rail { justify-self: end; }
  .planet-tab { min-width: 50px; padding-left: 7px; padding-right: 7px; }
  :root { --panel-width: 410px; }
}

@media (max-width: 1100px) {
  .topbar { padding-left: 24px; padding-right: 24px; }
  .detail-panel { top: 82px; bottom: 96px; right: 20px; }
  .hud { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .time-panel { height: 52px; }
  .planet-rail { height: 52px; }
  .planet-tab { height: 42px; min-width: 47px; }
  .planet-tab .tab-name { font-size: 9px; }
  .sim-clock { min-width: 126px; padding: 0 11px; }
  .speed-button { font-size: 7.5px; padding: 0 7px; }
  .play-button { width: 37px; height: 37px; flex-basis: 37px; }
  .edge-note { display: none; }
}

@media (max-width: 900px) {
  .topbar {
    height: 72px;
    padding: 16px 18px;
  }
  .brand-mark { width: 32px; height: 32px; }
  .brand-zh { font-size: 14px; }
  .brand-en { font-size: 5.8px; }
  .scope-status { display: none; }

  .view-caption {
    left: 18px;
    top: 91px;
  }

  .view-kicker { font-size: 6px; }

  .labels { opacity: 0.92; }
  .has-panel .labels { opacity: 0.4; }
  .label-name { font-size: 10px; }
  .label-en { display: none; }
  .label-dot { width: 4px; height: 4px; left: -2px; top: -2px; }
  .body-label.is-left .label-dot { right: -2px; }

  .view-caption h1 {
    margin-top: 13px;
    font-size: 37px;
    letter-spacing: 0.08em;
  }

  .view-caption h1 span {
    margin-top: 9px;
    font-size: 6.2px;
  }

  .view-caption > p {
    margin-top: 14px;
    font-size: 11px;
    letter-spacing: 0.09em;
  }

  .view-meta { display: none; }
  .view-hint { display: block; }

  .hud {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .time-panel {
    height: 48px;
    width: 100%;
    justify-content: flex-start;
    padding: 0 4px 0 5px;
  }

  .play-button { width: 36px; height: 36px; flex-basis: 36px; }
  .sim-clock { flex: 1; min-width: 0; padding: 0 10px; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .clock-label { display: none; }
  .clock-values { gap: 6px; min-width: 0; }
  .clock-values::before {
    content: "SIM";
    font-family: var(--mono);
    font-size: 5px;
    letter-spacing: 0.12em;
    color: rgba(112, 121, 126, 0.72);
  }
  #sim-date { font-size: 9px; }
  #sim-time { font-size: 7px; }
  .speed-button { height: 36px; }
  .speed-menu { left: auto; right: 0; }

  .planet-rail {
    width: 100%;
    height: 48px;
    padding: 3px;
    justify-content: space-between;
    overflow: hidden;
    scrollbar-width: none;
  }
  .planet-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    padding: 4px 2px;
    gap: 2px;
  }
  .planet-tab .tab-index { display: none; }
  .planet-tab .tab-main { gap: 3px; }
  .planet-tab .tab-name { font-size: 8.4px; letter-spacing: 0.04em; }
  .planet-tab .tab-dot { width: 2.5px; height: 2.5px; }
  .planet-tab[data-body="sun"] { flex: 1 1 0; min-width: 0; margin-right: 0; }
  .planet-tab[data-body="sun"]::before { display: none; }
  .planet-tab::after { left: 5px; right: 5px; bottom: 1px; }

  .detail-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(122px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: 57vh;
    max-height: calc(100vh - 220px);
    transform: translateY(20px);
    border-radius: 4px;
  }

  .detail-panel.is-open { transform: none; }

  .panel-scroll { padding: 23px 23px 26px; }
  .panel-name { font-size: 47px; }
  .panel-footer { flex-basis: 46px; }

  .guide-overlay { padding: 16px; align-items: end; }
  .guide-card {
    width: 100%;
    max-height: 88vh;
    padding: 32px 24px 26px;
  }
  .guide-grid { grid-template-columns: 1fr; gap: 26px; margin-top: 30px; padding-top: 24px; }
  .guide-section-wide { grid-column: auto; }
  .guide-heading h2 { font-size: 30px; margin-top: 12px; }
  .guide-grid { gap: 28px; }
  .guide-section + .guide-section { border-top: 1px solid var(--line-faint); padding-top: 24px; }
  .planet-table-head, .planet-table-row { grid-template-columns: 1.3fr 0.9fr 1fr 0.7fr; gap: 8px; }
  .planet-table-row { font-size: 7.5px; }
  .planet-table-row span:first-child { font-size: 9px; }
  .guide-close { top: 14px; right: 14px; background: rgba(7, 10, 14, 0.7); }
  .primary-button { margin-top: 26px; }
}

@media (max-width: 560px) {
  .topbar { padding: 14px 14px; }
  .brand { gap: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-en { display: none; }
  .brand-zh { font-size: 13px; letter-spacing: 0.13em; }
  .topbar-actions { gap: 10px; }
  .quiet-button { font-size: 7px; gap: 5px; }
  .quiet-button svg { width: 12px; height: 12px; }
  .icon-button { width: 31px; height: 31px; }

  .view-caption { top: 80px; }
  .view-caption h1 { font-size: 34px; }
  .view-caption > p { font-size: 10.5px; }

  .labels { opacity: 0.9; }
  .has-panel .labels { opacity: 0.4; }
  .label-name { font-size: 9.8px; }
  .label-en { display: none; }
  .label-dot { width: 4px; height: 4px; left: -2px; top: -2px; }
  .body-label.is-left .label-dot { right: -2px; }

  .detail-panel {
    left: 8px;
    right: 8px;
    bottom: calc(114px + env(safe-area-inset-bottom, 0px));
    height: 61vh;
    max-height: calc(100vh - 190px);
  }
  .panel-chrome { flex-basis: 45px; padding: 0 14px; }
  .panel-scroll { padding: 20px 18px 24px; }
  .panel-name { font-size: 43px; }
  .panel-watermark { font-size: 68px; top: -15px; }
  .panel-tagline { font-size: 13.5px; margin-top: 17px; }
  .panel-intro { font-size: 11px; line-height: 1.85; }
  .stat-value { font-size: 19px; }
  .stat-value.is-small { font-size: 14px; }
  .stat-cell { padding-top: 11px; padding-bottom: 12px; }
  .stat-cell:nth-child(2n) { padding-left: 13px; }
  .orbit-facts { column-gap: 13px; }
  .orbit-fact strong { font-size: 6.5px; }
  .panel-footer { padding: 0 10px; }

  .hud { padding-left: 8px; padding-right: 8px; gap: 6px; }
  .time-panel { height: 44px; }
  .play-button { width: 32px; height: 32px; flex-basis: 32px; }
  .sim-clock { padding: 0 8px; }
  .speed-button { height: 32px; font-size: 7px; }
  .planet-rail { height: 44px; }
  .planet-tab { flex: 1 1 0; min-width: 0; height: 36px; padding: 3px 1px; }
  .planet-tab .tab-name { font-size: 8px; letter-spacing: 0.02em; }
  .planet-tab[data-body="sun"] { flex: 1 1 0; min-width: 0; }
  .planet-tab .tab-dot { display: block; width: 2.5px; height: 2.5px; }
  .planet-tab .tab-main { gap: 2.5px; }
  .planet-tab::after { left: 4px; right: 4px; }

  .guide-overlay { padding: 0; }
  .guide-card {
    max-height: 92vh;
    padding: 28px 18px 22px;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
  }
  .guide-heading h2 { font-size: 26px; }
  .guide-grid { margin-top: 24px; }
  .guide-section h3 { font-size: 15px; }
  .planet-table-head, .planet-table-row { grid-template-columns: 1.2fr 0.9fr 1fr 0.6fr; gap: 6px; }
  .planet-table-row { font-size: 7px; padding: 8px 0; }
  .planet-table-row span:first-child { font-size: 8.5px; gap: 6px; }
  .planet-table-head { font-size: 5.5px; }
  .guide-meta { font-size: 5px; }
}

@media (max-height: 710px) and (min-width: 901px) {
  .detail-panel { top: 78px; bottom: 92px; }
  .hud { padding-bottom: 16px; }
  .topbar { height: 78px; }
  .panel-scroll { padding-top: 22px; }
  .panel-name { font-size: 47px; }
  .panel-section { margin-top: 25px; }
  .panel-tagline { margin-top: 16px; }
}

/* --------------------------------------------------------------------------
   Compact & landscape layouts
   -------------------------------------------------------------------------- */

@media (max-width: 900px) and (max-height: 720px) {
  .has-panel .hud {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s ease;
  }

  .has-panel .detail-panel {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    height: 61vh;
    max-height: calc(100vh - 88px);
  }
}

@media (max-width: 900px) and (max-height: 680px) {
  .has-panel .detail-panel { height: 56vh; }
}

@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  .topbar {
    height: 60px;
    padding: 10px 14px;
  }

  .brand-en,
  .view-caption { display: none; }

  .has-panel .hud { display: none; }

  .hud {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .time-panel {
    width: auto;
    height: 42px;
    flex: 0 0 auto;
    padding: 0 4px;
  }

  .play-button { width: 32px; height: 32px; flex-basis: 32px; }
  .sim-clock {
    flex: 0 0 auto;
    min-width: 118px;
    padding: 0 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .clock-label { display: none; }
  #sim-date { font-size: 9px; }
  #sim-time { font-size: 7px; }
  .speed-button { height: 34px; padding: 0 6px; font-size: 7px; }

  .planet-rail {
    flex: 1 1 auto;
    width: auto;
    height: 42px;
    min-width: 0;
    justify-content: space-between;
    overflow: hidden;
  }

  .planet-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 34px;
    padding: 3px 2px;
    gap: 1px;
  }

  .planet-tab .tab-index { display: none; }
  .planet-tab .tab-name { font-size: 7.8px; letter-spacing: 0.02em; }
  .planet-tab .tab-dot { display: none; }
  .planet-tab .tab-main { gap: 0; }
  .planet-tab[data-body="sun"] { flex: 1 1 0; min-width: 0; }
  .planet-tab[data-body="sun"]::before { display: none; }
  .planet-tab::after { left: 3px; right: 3px; bottom: 1px; }

  .detail-panel {
    top: 68px;
    right: 10px;
    bottom: 10px;
    left: auto;
    width: min(390px, 46vw);
    height: auto;
    max-height: none;
    transform: translateX(22px);
  }

  .detail-panel.is-open { transform: none; }

  .panel-scroll { padding: 20px 22px 24px; }
  .panel-name { font-size: 42px; }

  .guide-card {
    max-height: 94vh;
    padding: 24px 22px 20px;
  }

  .guide-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px 30px;
    margin-top: 20px;
    padding-top: 18px;
  }

  .guide-section-wide { grid-column: 1 / -1; }
  .guide-heading h2 { font-size: 27px; }
  .guide-heading p { font-size: 11px; }
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Free gravity field v2
   ========================================================================== */

.is-lab .body-label[data-body="sun"] { pointer-events: auto; }
.is-lab .body-label .label-copy { pointer-events: auto; }

.lab-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.12em;
  color: rgba(112, 121, 125, 0.62);
}

.lab-badges span {
  padding-top: 7px;
  border-top: 1px solid rgba(170, 182, 187, 0.12);
}

.lab-inspector {
  position: absolute;
  top: 98px;
  right: 32px;
  z-index: 4;
  width: 286px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(7, 10, 14, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px) saturate(0.9);
  -webkit-backdrop-filter: blur(20px) saturate(0.9);
  pointer-events: auto;
}

.lab-inspector-kicker,
.lab-inspector-top span {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.14em;
  color: rgba(168, 158, 139, 0.64);
}

.lab-inspector h3 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(240, 236, 226, 0.94);
}

.lab-inspector-empty p {
  margin: 11px 0 0;
  font-size: 10px;
  line-height: 1.75;
  color: rgba(136, 146, 151, 0.86);
}

.lab-inspector-empty dl {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.lab-inspector-empty dl div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
}

.lab-inspector-empty dt {
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.08em;
  color: rgba(113, 121, 125, 0.8);
}

.lab-inspector-empty dd {
  margin: 0;
  font-size: 9px;
  line-height: 1.55;
  color: rgba(164, 170, 170, 0.8);
}

.lab-inspector-body[hidden],
.lab-inspector-empty[hidden] { display: none; }

.lab-inspector-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lab-inspector-top button {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(154, 159, 158, 0.65);
  font-size: 14px;
  line-height: 1;
}

.lab-inspector-top button:hover {
  border-color: var(--line);
  color: var(--text-bright);
}

.lab-object-en {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.16em;
  color: var(--lab-accent, rgba(218, 192, 154, 0.72));
  opacity: 0.72;
}

.lab-object-stats {
  display: grid;
  gap: 1px;
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.lab-object-stats div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-faint);
}

.lab-object-stats div:last-child { border-bottom: 0; }

.lab-object-stats span {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  color: rgba(112, 122, 126, 0.84);
}

.lab-object-stats strong {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(231, 227, 216, 0.86);
}

.lab-object-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
}

.lab-object-actions button {
  min-height: 29px;
  padding: 0 7px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--mono);
  font-size: 6.3px;
  letter-spacing: 0.02em;
  color: rgba(198, 195, 184, 0.82);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lab-object-actions button:hover {
  border-color: rgba(217, 195, 160, 0.4);
  color: var(--text-bright);
  background: rgba(217, 195, 160, 0.07);
}

.lab-object-actions button.is-danger {
  color: rgba(185, 120, 105, 0.82);
}

.lab-object-actions button.is-danger:hover {
  border-color: rgba(201, 132, 116, 0.42);
  color: rgba(238, 178, 162, 0.95);
  background: rgba(156, 70, 55, 0.08);
}

.lab-inspector-note {
  margin: 12px 0 0;
  font-size: 8.5px;
  line-height: 1.65;
  color: rgba(113, 123, 127, 0.74);
}

.lab-clock small {
  display: block;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.05em;
  color: rgba(112, 122, 126, 0.72);
}

.lab-speed-unit {
  padding: 0 4px 0 5px;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.04em;
  color: rgba(106, 115, 119, 0.68);
  white-space: nowrap;
}

.lab-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-left: 1px solid var(--line-soft);
}

.lab-nav > span {
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.08em;
  color: rgba(112, 121, 125, 0.8);
}

.lab-nav select {
  width: 65px;
  height: 27px;
  border: 0;
  border-radius: 2px;
  outline: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 7px;
  color: rgba(220, 214, 201, 0.86);
  cursor: pointer;
}

.lab-nav select:hover { background: rgba(255, 255, 255, 0.035); }
.lab-nav select:focus-visible { outline: 1px solid rgba(217, 195, 160, 0.55); }
.lab-nav option { background: #0b0f13; color: #d9d5ca; }

.lab-inspector-toggle { display: none; }

.lab-add {
  color: rgba(220, 203, 172, 0.92);
}
.lab-add:hover {
  background: rgba(217, 195, 160, 0.08);
}

@media (max-width: 1180px) {
  .lab-inspector { width: 258px; right: 22px; }
  .lab-nav { padding: 0 5px; }
  .lab-nav select { width: 58px; }
  .lab-action { font-size: 6.2px; padding: 0 6px; }
}

@media (max-width: 900px) {
  .lab-header { top: 78px; width: min(280px, 70vw); }
  .lab-badges { margin-top: 15px; }

  .lab-inspector {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(50vh, 420px);
    overflow-y: auto;
    display: none;
  }

  .lab-inspector.is-open { display: block; }
  .lab-inspector-toggle { display: flex; }

  .lab-toolbar {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: none;
    max-width: none;
    padding: 6px;
    flex-wrap: wrap;
    row-gap: 3px;
  }

  .lab-primary { flex: 0 0 auto; border-right: 0; padding-right: 2px; }
  .lab-play { width: 35px; height: 35px; }
  .lab-clock { padding: 0 8px; }
  .lab-clock b { font-size: 9px; }

  .lab-speeds {
    margin-left: auto;
    border-right: 0;
    padding: 0 3px;
  }
  .lab-speeds button { min-width: 27px; padding: 0 4px; }
  .lab-speed-unit { display: none; }

  .lab-nav {
    order: 3;
    flex: 1 1 auto;
    justify-content: flex-end;
    padding: 4px 3px 0;
    border-left: 0;
    border-top: 1px solid var(--line-faint);
  }

  .lab-secondary {
    order: 4;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 2px;
    padding: 4px 3px 0;
    border-top: 1px solid var(--line-faint);
  }

  .lab-action { height: 30px; padding: 0 6px; }
  .lab-toast { bottom: 132px; }
}

@media (max-width: 560px) {
  .lab-header { top: 71px; width: min(245px, 72vw); }
  .lab-header h2 { font-size: 29px; }
  .lab-header p { display: none; }
  .lab-badges { display: none; }
  .lab-kicker { font-size: 5.8px; }
  .lab-exit { top: 13px; right: 13px; height: 29px; padding: 0 9px; }
  .lab-exit svg { width: 11px; height: 11px; }
  .lab-exit span { font-size: 6px; }

  .lab-inspector {
    left: 8px;
    right: 8px;
    bottom: calc(142px + env(safe-area-inset-bottom, 0px));
    max-height: min(50vh, 390px);
    padding: 14px;
  }

  .lab-inspector h3 { font-size: 22px; }
  .lab-inspector-empty p { font-size: 9px; }
  .lab-object-actions button { min-height: 31px; font-size: 7px; }

  .lab-toolbar { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .lab-speeds button { min-width: 25px; font-size: 6.5px; padding: 0 3px; }
  .lab-play { width: 32px; height: 32px; }
  .lab-clock b { font-size: 8px; }
  .lab-clock small { font-size: 5px; }
  .lab-clock span { display: none; }
  .lab-nav { justify-content: space-between; }
  .lab-nav select { width: 88px; }
  .lab-secondary { justify-content: space-between; }
  .lab-action { font-size: 6px; padding: 0 5px; }
  .lab-action svg { width: 11px; height: 11px; }
  .lab-toast { bottom: 136px; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .lab-header { top: 60px; left: 14px; }
  .lab-header h2 { font-size: 24px; }
  .lab-header p, .lab-badges { display: none; }
  .lab-exit { top: 9px; right: 11px; height: 27px; }
  .lab-inspector {
    top: 54px;
    right: 11px;
    bottom: auto;
    left: auto;
    width: 252px;
    max-height: 58vh;
    display: none;
  }
  .lab-inspector.is-open { display: block; }
  .lab-toolbar {
    left: 10px;
    right: 10px;
    bottom: 7px;
    padding: 4px 5px;
    max-width: none;
    min-height: 42px;
  }
  .lab-play { width: 31px; height: 31px; }
  .lab-speeds button { height: 25px; min-width: 25px; }
  .lab-nav { flex: 1 1 auto; border-top: 0; padding: 0 4px; justify-content: flex-end; }
  .lab-secondary { flex: 1 1 100%; justify-content: flex-end; padding-top: 3px; }
  .lab-action { height: 26px; }
  .lab-instruction { display: none; }
  .lab-toast { bottom: 96px; }
}

/* ==========================================================================
   Control legibility pass 鈥?larger type, explicit labels
   ========================================================================== */

.lab-toolbar {
  width: max-content;
  max-width: calc(100vw - 40px);
  gap: 6px;
  min-height: 72px;
  padding: 10px 12px;
  border-color: rgba(196, 186, 166, 0.26);
  background: rgba(7, 10, 14, 0.86);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.lab-primary { gap: 3px; padding-right: 12px; }
.lab-play { width: 48px; height: 48px; }
.lab-play svg { width: 20px; height: 20px; }

.lab-clock {
  min-width: 118px;
  gap: 3px;
  padding: 0 14px;
}
.lab-clock span {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(172, 180, 183, 0.95);
}
.lab-clock b {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(250, 246, 235, 0.96);
}
.lab-clock small {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(165, 173, 175, 0.9);
}

.lab-speeds {
  gap: 4px;
  padding: 0 12px;
}
.lab-speeds button {
  min-width: 70px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(184, 189, 188, 0.94);
}
.lab-speeds button:hover { color: var(--text-bright); }
.lab-speeds button.is-active {
  border-color: rgba(219, 196, 158, 0.38);
  background: rgba(219, 196, 158, 0.16);
  color: #f4e2c3;
}
.lab-speed-unit { display: none; }

.lab-nav {
  gap: 9px;
  padding: 0 14px;
}
.lab-nav > span {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(172, 180, 183, 0.95);
  white-space: nowrap;
}
.lab-nav select {
  width: 122px;
  height: 40px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(245, 240, 229, 0.96);
}
.lab-nav select:hover { background: rgba(255, 255, 255, 0.06); }

.lab-secondary {
  gap: 5px;
  padding-left: 12px;
}
.lab-action {
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(215, 211, 200, 0.94);
}
.lab-action b { font-weight: 500; }
.lab-action svg { width: 14px; height: 14px; opacity: 0.85; }
.lab-add {
  border-color: rgba(219, 196, 158, 0.3);
  background: rgba(219, 196, 158, 0.07);
  color: rgba(246, 232, 209, 0.98);
}

.lab-exit {
  height: 40px;
  padding: 0 17px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(232, 229, 218, 0.94);
}
.lab-exit svg { width: 15px; height: 15px; }

.lab-instruction {
  bottom: 114px;
  font-size: 8.5px;
  color: rgba(153, 162, 165, 0.78);
}
.lab-instruction span + span::before { margin-right: 12px; }

.lab-toast {
  bottom: 116px;
  padding: 11px 18px;
  font-size: 9.5px;
  line-height: 1.5;
}

/* Inspector controls */
.lab-inspector {
  width: 300px;
  padding: 18px;
}
.lab-inspector-kicker,
.lab-inspector-top span {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.lab-inspector h3 { font-size: 27px; }
.lab-inspector-empty p {
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(164, 172, 175, 0.95);
}
.lab-inspector-empty dl div { grid-template-columns: 42px minmax(0, 1fr); }
.lab-inspector-empty dt { font-size: 8.5px; font-weight: 500; }
.lab-inspector-empty dd { font-size: 11px; line-height: 1.6; color: rgba(185, 190, 189, 0.92); }
.lab-object-en { font-size: 8.5px; font-weight: 500; }
.lab-object-stats span { font-size: 9px; font-weight: 500; }
.lab-object-stats strong { font-size: 12px; font-weight: 500; }
.lab-object-stats div { padding: 11px 0; }
.lab-object-actions { gap: 5px; margin-top: 16px; }
.lab-object-actions button {
  min-height: 38px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(222, 218, 207, 0.95);
}
.lab-inspector-note { font-size: 11px; line-height: 1.65; color: rgba(148, 157, 160, 0.9); }
.lab-inspector-top button { width: 29px; height: 29px; font-size: 17px; }

/* Compact desktop widths: keep the type readable, allow a second line */
@media (max-width: 1180px) {
  .lab-toolbar {
    max-width: calc(100vw - 32px);
    gap: 4px;
    padding: 9px 10px;
  }
  .lab-inspector { width: 284px; }
  .lab-clock { min-width: 108px; padding: 0 10px; }
  .lab-clock b { font-size: 13px; }
  .lab-speeds { padding: 0 8px; }
  .lab-speeds button { min-width: 62px; height: 38px; padding: 0 7px; font-size: 10.5px; }
  .lab-nav { padding: 0 9px; gap: 7px; }
  .lab-nav select { width: 108px; font-size: 10.5px; }
  .lab-action { height: 38px; padding: 0 9px; font-size: 10.5px; }
}

/* Tablet / phone: larger three-row control dock */
@media (max-width: 900px) {
  .lab-exit {
    top: 13px;
    right: 13px;
    height: 36px;
    padding: 0 12px;
    font-size: 9px;
  }
  .lab-exit svg { width: 13px; height: 13px; }

  .lab-toolbar {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    flex-wrap: wrap;
    row-gap: 7px;
    padding: 9px;
    min-height: 0;
  }

  .lab-primary { flex: 0 0 auto; padding-right: 2px; border-right: 0; }
  .lab-play { width: 40px; height: 40px; }
  .lab-play svg { width: 17px; height: 17px; }
  .lab-clock { min-width: 90px; padding: 0 8px 0 7px; }
  .lab-clock span { display: block; font-size: 7px; }
  .lab-clock b { font-size: 12px; }
  .lab-clock small { font-size: 9px; }

  .lab-speeds {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 3px;
    padding: 0;
  }
  .lab-speeds button {
    min-width: 50px;
    height: 34px;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .lab-nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 2px 0;
    border-top: 1px solid var(--line-faint);
    border-left: 0;
  }
  .lab-nav > span { font-size: 9px; }
  .lab-nav select {
    flex: 1 1 auto;
    width: auto;
    max-width: 172px;
    height: 36px;
    font-size: 11px;
  }

  .lab-secondary {
    order: 4;
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 0 0;
    border-top: 1px solid var(--line-faint);
  }
  .lab-action {
    height: 38px;
    padding: 0 3px;
    font-size: 9.5px;
    white-space: nowrap;
  }
  .lab-add { font-size: 9.5px; }
  .lab-inspector-toggle { display: flex; }

  .lab-inspector {
    left: 10px;
    right: 10px;
    bottom: calc(184px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(45vh, 350px);
    padding: 16px;
  }
  .lab-inspector h3 { font-size: 25px; }
  .lab-inspector-empty p { font-size: 11px; }
  .lab-object-actions button { min-height: 38px; font-size: 10.5px; }

  .lab-toast {
    bottom: calc(176px + env(safe-area-inset-bottom, 0px));
    font-size: 9px;
    max-width: calc(100vw - 36px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 560px) {
  .lab-header { top: 68px; }
  .lab-toolbar {
    left: 6px;
    right: 6px;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    padding: 8px 7px;
    row-gap: 6px;
  }
  .lab-play { width: 38px; height: 38px; }
  .lab-clock { min-width: 84px; padding: 0 6px; }
  .lab-clock span { font-size: 6.5px; }
  .lab-clock b { font-size: 11px; }
  .lab-clock small { font-size: 8.5px; }
  .lab-speeds { gap: 3px; }
  .lab-speeds button {
    min-width: 47px;
    height: 33px;
    padding: 0 3px;
    font-size: 9.5px;
  }
  .lab-nav { padding-top: 7px; }
  .lab-nav > span { font-size: 8.5px; }
  .lab-nav select { max-width: 168px; height: 35px; font-size: 10.5px; }
  .lab-secondary { padding-top: 7px; gap: 3px; }
  .lab-action { height: 37px; font-size: 9.5px; padding: 0 2px; }
  .lab-add { font-size: 9.5px; }
  .lab-inspector {
    left: 6px;
    right: 6px;
    bottom: calc(182px + env(safe-area-inset-bottom, 0px));
    max-height: min(44vh, 338px);
    padding: 15px;
  }
  .lab-object-actions button { min-height: 38px; font-size: 10.5px; }
  .lab-inspector-note { font-size: 10px; }
  .lab-toast { bottom: calc(174px + env(safe-area-inset-bottom, 0px)); }
}

/* Landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .lab-exit { top: 9px; right: 10px; height: 32px; font-size: 8px; padding: 0 10px; }
  .lab-toolbar {
    left: 8px;
    right: 8px;
    bottom: 6px;
    width: auto;
    max-width: none;
    flex-wrap: wrap;
    padding: 5px 6px;
    min-height: 0;
    row-gap: 4px;
  }
  .lab-primary { flex: 0 0 auto; }
  .lab-play { width: 32px; height: 32px; }
  .lab-clock { min-width: 0; padding: 0 6px; }
  .lab-clock span { display: none; }
  .lab-clock b { font-size: 9.5px; }
  .lab-clock small { font-size: 7.5px; }
  .lab-speeds { margin-left: auto; padding: 0; gap: 2px; }
  .lab-speeds button { min-width: 40px; height: 28px; font-size: 8px; padding: 0 3px; }
  .lab-nav {
    order: 3;
    flex: 1 1 auto;
    padding: 0 8px;
    border-top: 0;
    border-left: 1px solid var(--line-soft);
  }
  .lab-nav > span { font-size: 8px; }
  .lab-nav select { width: 88px; max-width: none; height: 29px; font-size: 8.5px; }
  .lab-secondary {
    order: 4;
    flex: 1 1 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 3px;
    padding: 4px 0 0;
    border-top: 1px solid var(--line-faint);
  }
  .lab-action { height: 29px; padding: 0 5px; font-size: 8px; }
  .lab-inspector {
    top: 50px;
    right: 10px;
    bottom: auto;
    left: auto;
    width: 264px;
    max-height: 60vh;
    padding: 14px;
  }
  .lab-inspector h3 { font-size: 22px; }
  .lab-object-actions button { min-height: 30px; font-size: 8px; }
  .lab-toast { bottom: 76px; }
}