:root {
  --bg: #000;
  --fg: #f4f6f8;
  --fg-2: rgba(244, 246, 248, .72);
  --fg-3: rgba(244, 246, 248, .46);
  --line: rgba(255, 255, 255, .16);
  --line-2: rgba(255, 255, 255, .32);
  --glass: rgba(8, 10, 14, .62);
  --glass-2: rgba(16, 19, 25, .82);
  --accent: #ffffff;
  --ship: #9fd0ff;
  --booster: #ffb067;
  --ok: #5fe0a0;
  --warn: #ffb347;
  --bad: #ff6b6b;
  --live: #ff3b3b;
  --font: 'Barlow', 'Noto Sans SC', system-ui, sans-serif;
  --cond: 'Barlow Semi Condensed', 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'Barlow Semi Condensed', ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --strip-h: calc(44px + var(--safe-t));   /* mission timeline strip along the top edge (+ notch / Dynamic Island) */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- labels ---------- */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; font: 600 11px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--fg); text-shadow: 0 0 6px #000, 0 0 2px #000; padding-bottom: 10px; will-change: transform; }
.lbl::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 1px; height: 8px; background: currentColor; opacity: .7; }
.lbl small { display: block; font: 500 10px/1.2 var(--font); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.lbl.ship { color: var(--ship); }
.lbl.booster { color: var(--booster); }
.lbl.site { color: #d9e3ee; font-size: 10px; }
.lbl.zone { color: #ffd479; font-size: 10px; }
.lbl.wp { color: #b9c6d6; font-size: 9px; opacity: .85; }

/* ---------- top bar ---------- */
.topbar { position: absolute; top: var(--strip-h); left: 0; right: 0; display: flex; align-items: center; gap: 24px; padding: 14px 18px; background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(0,0,0,0)); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand-mark { font: 700 22px/1 var(--cond); letter-spacing: .34em; }
.brand-sub { margin-top: 4px; font: 500 12px/1.2 var(--cond); letter-spacing: .18em; color: var(--fg-2); text-transform: uppercase; }
.brand-sub .dot { opacity: .5; }
.top-actions { margin-left: auto; }   /* clocks moved to the HUD */
.clock { display: flex; flex-direction: column; align-items: flex-end; font: 600 15px/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.clock .k { font: 500 10px/1 var(--cond); letter-spacing: .16em; color: var(--fg-3); margin-bottom: 3px; }
.top-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); color: var(--fg); text-decoration: none; font: 600 12px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; border-radius: 2px; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(255,255,255,.12); border-color: var(--fg-2); }
.btn.icon { width: 34px; padding: 0; justify-content: center; font-size: 16px; letter-spacing: 0; }
.btn-live { border-color: rgba(255,59,59,.7); }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- countdown cards ---------- */
.cards { position: absolute; top: calc(var(--strip-h) + 66px); left: 18px; display: flex; flex-direction: column; gap: 8px; width: 260px; pointer-events: none; }
.card { background: var(--glass); border-left: 2px solid var(--fg); padding: 9px 12px 10px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card-k { font: 500 10px/1.2 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); }
.card-k span { color: var(--fg-2); }
.card-v { margin-top: 4px; font: 600 15px/1.25 var(--font); }
.card-v.mono { font: 600 22px/1.1 var(--mono); letter-spacing: .03em; }
.card-t { margin-top: 3px; font: 500 12px/1.3 var(--mono); color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ---------- camera bar ---------- */
.cambar { position: absolute; top: calc(var(--strip-h) + 66px); left: 50%; transform: translateX(-50%); display: flex; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cambar button { white-space: nowrap; background: none; border: 0; padding: 8px 14px; font: 600 12px/1 var(--cond); letter-spacing: .14em; color: var(--fg-2); cursor: pointer; text-transform: uppercase; }
.cambar button + button { border-left: 1px solid var(--line); }
.cambar button.active { color: #000; background: var(--fg); }
.cambar button:hover:not(.active) { color: var(--fg); background: rgba(255,255,255,.08); }

/* ---------- side panel ---------- */
.panel { position: absolute; top: calc(var(--strip-h) + 56px); right: 0; bottom: 192px; width: 380px; max-width: 92vw; background: var(--glass-2); border-left: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; transform: translateX(0); transition: transform .25s ease; }
.panel.closed { transform: translateX(102%); }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; background: none; border: 0; padding: 11px 4px; font: 600 12px/1 var(--cond); letter-spacing: .1em; color: var(--fg-3); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--fg); }
.tab-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.tab-body section { display: none; }
.tab-body section.active { display: block; }
.tab-body h3 { margin: 18px 0 8px; font: 600 12px/1.2 var(--cond); letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); }
.tab-body h3:first-child { margin-top: 0; }
.tab-body p, .tab-body li { font-size: 13px; line-height: 1.6; color: var(--fg-2); }
.tab-body ul { padding-left: 18px; margin: 6px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 13px; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; }
.rep { list-style: none; padding: 0; margin: 0; }
.rep li { position: relative; padding: 6px 0 6px 20px; border-bottom: 1px solid var(--line); }
.rep li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.rep li.ok::before { background: var(--ok); }
.rep li.bad::before { background: var(--warn); }
.note { font-size: 12px !important; color: var(--fg-3) !important; }

.tl { list-style: none; padding: 0; margin: 0; }
.tl li { display: grid; grid-template-columns: 74px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.tl li:hover { background: rgba(255,255,255,.06); }
.tl li .tt { font: 600 13px/1.2 var(--mono); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tl li .nm { color: var(--fg); line-height: 1.35; }
.tl li .nm small { display: block; color: var(--fg-3); font-size: 11px; }
.tl li .st { font: 600 10px/1 var(--cond); letter-spacing: .12em; padding: 3px 5px; border: 1px solid var(--line-2); color: var(--fg-3); white-space: nowrap; }
.tl li .st.ok { color: var(--ok); border-color: rgba(95,224,160,.5); }
.tl li .st.bad { color: var(--warn); border-color: rgba(255,179,71,.6); }
.tl li .st.past { color: var(--fg-2); }
.tl li.now { background: rgba(255,255,255,.1); box-shadow: inset 2px 0 0 var(--fg); }
.tl li.past .nm { color: var(--fg-2); }
.tl .sep { display: block; padding: 12px 6px 4px; font: 600 11px/1 var(--cond); letter-spacing: .2em; color: var(--fg-3); cursor: default; border: 0; }
.tl .sep:hover { background: none; }

.links .grp { margin-bottom: 18px; }
.links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); text-decoration: none; transition: background .15s, border-color .15s; }
.links a:hover { background: rgba(255,255,255,.07); border-color: var(--line-2); }
.links a b { display: block; font-weight: 600; font-size: 13px; }
.links a small { display: block; color: var(--fg-3); font-size: 11px; margin-top: 2px; }
.links a .arr { margin-left: auto; color: var(--fg-3); }
.links a.live { border-color: rgba(255,59,59,.45); }

/* ---------- time controls ---------- */
.timectl { position: absolute; top: 0; left: 0; right: 0; height: var(--strip-h); box-sizing: border-box; z-index: 6; display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--safe-t)) calc(14px + var(--safe-r)) 6px calc(12px + var(--safe-l)); background: rgba(6,8,11,.72); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.timectl button, .timectl select { height: 28px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 2px; cursor: pointer; font: 600 12px/1 var(--cond); letter-spacing: .08em; padding: 0 9px; }
.timectl button:hover, .timectl select:hover { background: rgba(255,255,255,.14); }
.timectl button.icon { width: 30px; padding: 0; font-size: 12px; }
.timectl select { appearance: none; -webkit-appearance: none; padding: 0 10px; background: rgba(255,255,255,.06); }
.timectl select option { background: #111; }
.live-btn { display: inline-flex; align-items: center; gap: 6px; }
.live-btn .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); }
.live-btn.on { border-color: rgba(255,59,59,.7) !important; }
.live-btn.on .pulse { background: var(--live); box-shadow: 0 0 6px var(--live); animation: blink 1.4s infinite; }
#scrub { flex: 1; min-width: 80px; accent-color: #fff; height: 4px; }
.toggles { display: flex; gap: 8px; font: 500 11px/1 var(--cond); letter-spacing: .06em; color: var(--fg-2); }
.toggles label { display: inline-flex; gap: 3px; align-items: center; cursor: pointer; white-space: nowrap; }
.toggles input { accent-color: #fff; margin: 0; }

/* ---------- HUD ---------- */
.hud { position: absolute; left: 0; right: 0; bottom: 0; height: calc(190px + var(--safe-b)); display: grid; grid-template-columns: 1fr minmax(500px, 680px) 1fr; align-items: end; padding: 0 calc(22px + var(--safe-r)) calc(14px + var(--safe-b)) calc(22px + var(--safe-l)); background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 55%, rgba(0,0,0,0) 100%); pointer-events: none; }
.stage { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto auto; column-gap: 14px; align-items: center; }
.stage-b { justify-self: start; }
.stage-s { justify-self: end; }
.stage-name { grid-column: 1 / -1; font: 700 12px/1 var(--cond); letter-spacing: .3em; margin-bottom: 6px; }
.stage-b .stage-name { color: var(--booster); }
.stage-s .stage-name { color: var(--ship); }
.gauges { display: flex; gap: 10px; }
.gauge { position: relative; width: 112px; height: 112px; }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gauge .gv { position: absolute; left: 0; right: 0; top: 37px; text-align: center; font: 600 23px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.gauge .gk { position: absolute; left: 0; right: 0; top: 64px; text-align: center; font: 600 10px/1 var(--cond); letter-spacing: .2em; color: var(--fg-2); }
.gauge .gu { position: absolute; left: 0; right: 0; top: 77px; text-align: center; font: 500 10px/1 var(--cond); letter-spacing: .12em; color: var(--fg-3); }
.stage-sys { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.engines { width: 70px; height: 70px; }
.engines circle { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 1.4; }
.engines circle.on { fill: #fff; stroke: #fff; }
.engines circle.shell { stroke: rgba(255,255,255,.55); stroke-width: 1.2; }
.props { display: flex; flex-direction: column; gap: 4px; width: 92px; }
.prop { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 6px; font: 600 10px/1 var(--cond); letter-spacing: .1em; color: var(--fg-2); }
.prop i { display: block; height: 4px; background: rgba(255,255,255,.18); position: relative; }
.prop b { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; width: 0%; }
.stage-note { grid-column: 1 / -1; min-height: 14px; margin-top: 6px; font: 500 11px/1.2 var(--font); color: var(--fg-3); letter-spacing: .02em; }
.stage-note.warn { color: var(--warn); }
.stage.dim .gauges, .stage.dim .stage-sys { opacity: .38; }

.center { position: relative; height: 176px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; column-gap: 26px; }
.tblock { display: flex; flex-direction: column; align-items: center; }
/* wall clocks and the current phase either side of the mission clock */
.hclk { display: flex; flex-direction: column; gap: 9px; padding-bottom: 4px; min-width: 0; }
.hclk-l { align-items: flex-end; } .hclk-l .clock { align-items: flex-end; }
.hclk-r { align-items: flex-start; } .hclk-r .clock { align-items: flex-start; }
#hudPhase { font: 600 12px/1.15 var(--font); letter-spacing: .02em; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg-2); }
#arc { position: absolute; left: -40px; right: -40px; top: 0; width: calc(100% + 80px); height: 120px; }
.tclock { position: relative; font: 600 40px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; display: flex; gap: 6px; align-items: baseline; text-shadow: 0 0 18px rgba(0,0,0,.8); }
#tSign { font-size: 24px; color: var(--fg-2); }
.tclock.ended { font: 600 30px/1.15 var(--font); letter-spacing: .12em; }
.tclock.ended #tSign { display: none; }
.mname { margin-top: 6px; font: 600 11px/1 var(--cond); letter-spacing: .34em; color: var(--fg-2); }
.sim-state { margin-top: 6px; font: 600 10px/1 var(--cond); letter-spacing: .2em; color: var(--live); }
.sim-state.replay { color: var(--fg-3); }

/* ---------- toast ---------- */
.toast { position: absolute; left: 50%; top: calc(var(--strip-h) + 120px); transform: translate(-50%, -10px); opacity: 0; transition: opacity .35s, transform .35s; text-align: center; pointer-events: none; padding: 10px 26px; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.7) 20%, rgba(0,0,0,.7) 80%, rgba(0,0,0,0)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-k { font: 700 22px/1.1 var(--cond); letter-spacing: .28em; }
.toast-v { margin-top: 4px; font-size: 13px; color: var(--fg-2); }

/* ---------- loading / boot screen ---------- */
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: #000; transition: opacity .6s; z-index: 10; }
.loading.done { opacity: 0; pointer-events: none; }
.boot { width: min(420px, 100%); font: 500 13px/1.5 var(--font); color: var(--fg-2); }
.boot-brand { font: 700 26px/1 var(--cond); letter-spacing: .4em; color: var(--fg); }
.boot-sub { margin-top: 6px; font: 600 11px/1 var(--cond); letter-spacing: .18em; color: var(--fg-3); }
.boot-env { margin: 22px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; color: var(--fg-2); }
.boot-env b { color: var(--fg); } .boot-env .warn { color: var(--warn); } .boot-env .bad { color: var(--bad); }
.boot-tasks { list-style: none; margin: 0 0 14px; padding: 0; }
.boot-tasks li { display: flex; align-items: center; gap: 10px; padding: 4px 0; color: var(--fg-3); }
.boot-tasks li i { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--fg-3); }
.boot-tasks li span { flex: 1; }
.boot-tasks li em { font: 500 11px/1 var(--mono); font-style: normal; color: var(--fg-3); }
.boot-tasks li.load { color: var(--fg-2); } .boot-tasks li.load i { border-color: var(--fg); animation: bootPulse 1s infinite; }
.boot-tasks li.done { color: var(--fg); } .boot-tasks li.done i { background: var(--ok); border-color: var(--ok); }
.boot-tasks li.fail i { background: var(--warn); border-color: var(--warn); } .boot-tasks li.fail em { color: var(--warn); }
.boot-tasks li.opt span::after { content: '（后台）'; color: var(--fg-3); font-size: 11px; }
@keyframes bootPulse { 50% { opacity: .3; } }
.boot-bar { height: 2px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--fg); transition: width .3s; }
.boot-skip { margin-top: 16px; padding: 8px 12px; background: none; border: 1px solid var(--line-2); border-radius: 3px; color: var(--fg-2); font-size: 12px; cursor: pointer; }
.boot-skip:hover { color: var(--fg); border-color: var(--fg-2); }
.spin { width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .panel { bottom: 192px; width: 340px; }
  .hud { grid-template-columns: 1fr minmax(420px, 560px) 1fr; } .center { column-gap: 16px; }
  .gauge { width: 96px; height: 96px; }
  .gauge .gv { top: 31px; font-size: 19px; }
  .gauge .gk { top: 54px; } .gauge .gu { top: 66px; }
  .engines { width: 56px; height: 56px; }
}
@media (max-width: 820px) {
  .hide-sm { display: none !important; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .brand-mark { font-size: 17px; letter-spacing: .24em; }
  .brand-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
  .btn-live { padding: 0 10px; white-space: nowrap; }
  .cards { top: calc(var(--strip-h) + 96px); left: 12px; right: 12px; width: auto; flex-direction: row; }
  .card { flex: 1; min-width: 0; padding: 6px 9px; } .card-v.mono { font-size: 16px; } .card-v { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-t { display: none; } .card-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cambar { top: calc(var(--strip-h) + 50px); } .cambar button { padding: 7px 9px; font-size: 11px; letter-spacing: .08em; }
  .panel { top: calc(var(--strip-h) + 50px); bottom: 0; width: 100vw; max-width: 100vw; z-index: 5; }
  .hud { height: calc(200px + var(--safe-b)); grid-template-columns: 1fr 1fr; padding: 0 calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l)); }
  .hud .center { grid-column: 1 / -1; grid-row: 1; height: 92px; column-gap: 10px; margin-bottom: 6px; }
  .mname { display: none; }
  .sim-state { font-size: 9px; letter-spacing: .12em; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hclk { gap: 4px; padding-bottom: 2px; } .hclk .clock { font-size: 11px; } .hclk .clock .k { font-size: 8px; margin-bottom: 1px; } #hudPhase { font-size: 10px; max-width: 26vw; }
  #arc { display: none; }
  .tclock { font-size: 28px; } #tSign { font-size: 17px; } .tclock.ended { font-size: 22px; }
  .mname, .sim-state { margin-top: 3px; }
  .stage { grid-row: 2; }
  .stage-sys, .stage-note { display: none; }
  .gauge { width: 76px; height: 76px; }
  .gauge .gv { top: 25px; font-size: 15px; } .gauge .gk { top: 43px; font-size: 8px; } .gauge .gu { top: 53px; font-size: 8px; }
  .timectl { padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) 6px calc(8px + var(--safe-l)); gap: 4px; }
  #btnPrev, #btnNext, .toggles { display: none; }   /* single row on phones: mode, play, speed, timeline */
  .toast { top: calc(var(--strip-h) + 150px); } .toast-k { font-size: 16px; }
}
@media (max-width: 440px) {
  .hclk-r .clock:nth-child(2) { display: none; }
  .brand-sub { max-width: 36vw; }
}
/* ---------- display settings (physics tab) ---------- */
.settings { display: grid; gap: 10px; }
.settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--fg-2); }
.settings select { flex: 0 1 230px; background: rgba(255,255,255,.06); border: 1px solid var(--line-2); border-radius: 3px; padding: 6px 8px; color: var(--fg); }
.settings select option { background: #111; }
/* ---------- position card ---------- */
.card-pos .card-v.mono { font-size: 17px; }
.card-p { margin-top: 4px; font: 500 12px/1.35 var(--font); color: var(--fg); }
@media (max-width: 760px) { .card-pos .card-v.mono { font-size: 13px; } .card-p { font-size: 11px; } }
/* ---------- live / sim mode switch ---------- */
.mode { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; flex: none; }
.timectl .mode button { border: 0; border-radius: 0; height: 26px; }
.timectl .mode button + button { border-left: 1px solid var(--line); }
.timectl .mode button.on { background: rgba(255,255,255,.16); color: var(--fg); }
#btnSim.on { box-shadow: inset 0 -2px 0 var(--warn); }
.timectl.sim select, .timectl.sim .icon { opacity: 1; }
.timectl.live #selRate { opacity: .45; }

/* ---------- mission timeline bar (piecewise time scale) ---------- */
.tbar { position: relative; flex: 1; min-width: 120px; height: 30px; cursor: pointer; outline: none; touch-action: none; }
.tbar:focus-visible { box-shadow: 0 0 0 1px var(--fg-2); }
.tbar-track { position: absolute; left: 0; right: 0; top: 7px; height: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.tbar-phases i { position: absolute; top: 0; bottom: 0; border-right: 1px solid rgba(0,0,0,.6); }
.tbar-phases i:nth-child(odd) { background: rgba(255,255,255,.05); }
.tbar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.75)); }
.timectl.sim .tbar-fill { background: linear-gradient(90deg, rgba(255,179,71,.35), rgba(255,179,71,.8)); }
.tbar-marks i { position: absolute; top: 4px; width: 2px; height: 12px; margin-left: -1px; background: var(--fg-3); border-radius: 1px; }
.tbar-marks i.done { background: var(--ok); } .tbar-marks i.dev { background: var(--warn); } .tbar-marks i.fail { background: var(--bad); }
.tbar-labels span { position: absolute; top: 18px; font: 500 9px/1 var(--cond); letter-spacing: .06em; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: clip; padding-left: 3px; }
.tbar-labels span.cur { color: var(--fg); }
.tbar-live { position: absolute; top: 2px; width: 2px; height: 16px; margin-left: -1px; background: var(--live); box-shadow: 0 0 6px var(--live); pointer-events: none; }
.tbar-thumb { position: absolute; top: 3px; width: 12px; height: 14px; margin-left: -6px; border-radius: 2px; background: var(--fg); box-shadow: 0 0 0 2px rgba(0,0,0,.5); pointer-events: none; }
.timectl.sim .tbar-thumb { background: var(--warn); }
.tbar-tip { position: absolute; top: 34px; transform: translateX(-50%); padding: 5px 8px; background: var(--glass-2); border: 1px solid var(--line-2); font: 500 11px/1.35 var(--font); color: var(--fg); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 3; }
.tbar-tip b { font: 600 11px/1 var(--mono); margin-right: 6px; }
.tbar:hover .tbar-tip, .tbar.drag .tbar-tip { opacity: 1; }
@media (max-width: 760px) { .tbar-labels { display: none; } .tbar { height: 20px; } }
/* ---------- mission result card ---------- */
.card-result { border-left-color: var(--ok); pointer-events: auto; }
.card-result .card-v { font-size: 13px; line-height: 1.4; }
.res-list { list-style: none; margin: 8px 0 0; padding: 0; }
.res-list li { position: relative; padding: 3px 0 3px 16px; font: 500 12px/1.4 var(--font); color: var(--fg-2); }
.res-list li::before { content: '✓'; position: absolute; left: 0; top: 3px; color: var(--ok); font-weight: 700; }
.res-list li.bad::before { content: '✕'; color: var(--warn); }
.res-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.res-btns button { height: 24px; padding: 0 8px; background: rgba(255,255,255,.07); border: 1px solid var(--line-2); border-radius: 2px; font: 600 11px/1 var(--cond); letter-spacing: .06em; color: var(--fg); cursor: pointer; }
.res-btns button:hover { background: rgba(255,255,255,.16); }
@media (max-width: 760px) { .card-result .res-list { display: none; } }
/* ---------- complete timeline ---------- */
.tl li .ck { display: block; font: 500 10.5px/1.3 var(--mono); color: var(--fg-3); margin-top: 2px; }
.tl li .rp { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--fg-2); }
.tl li .rp.ok { color: #bfeed6; } .tl li .rp.bad { color: #ffd9a8; }
.tl li .src { color: var(--fg-3); font-size: 11px; }
.tl li.news { cursor: pointer; }
.tl li.news .nm { color: var(--fg-2); font-size: 12.5px; }
.tl li.news .tt { color: var(--fg-3); }
.tl li .st.news { color: var(--accent); border-color: var(--line-2); }
.tl-filter { display: flex; gap: 6px; margin: 0 0 8px; }
.tl-filter button { height: 24px; padding: 0 10px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 12px; font: 600 11px/1 var(--cond); letter-spacing: .06em; color: var(--fg-2); cursor: pointer; }
.tl-filter button.on { background: rgba(255,255,255,.16); color: var(--fg); }
.tl.hide-news li.news { display: none; }
/* ---------- narrow screens: keep the top-bar buttons on one line ---------- */
.top-actions .btn { white-space: nowrap; }
@media (max-width: 440px) { .top-actions .btn-live { display: none; } }
/* ---------- landscape phones (short screens): compact three-column HUD, cards in one row ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar { padding: 6px calc(12px + var(--safe-r)) 6px calc(12px + var(--safe-l)); gap: 10px; }
  .brand-mark { font-size: 15px; letter-spacing: .24em; } .brand-sub { font-size: 10px; max-width: 28vw; }
  .top-actions .btn { height: 28px; }
  .cambar { top: calc(var(--strip-h) + 8px); } .cambar button { padding: 6px 9px; font-size: 10.5px; letter-spacing: .06em; }
  .cards { top: calc(var(--strip-h) + 50px); left: calc(12px + var(--safe-l)); right: auto; width: auto; max-width: 64vw; flex-direction: row; gap: 6px; }
  .card { flex: 0 1 200px; min-width: 0; padding: 5px 8px; }
  .card-t, .card-p, .card-result .res-list { display: none; }
  .card-result .card-v { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .res-btns { margin-top: 5px; gap: 4px; } .res-btns button { height: 20px; padding: 0 6px; font-size: 10px; }
  .hud { height: calc(116px + var(--safe-b)); grid-template-columns: 1fr auto 1fr; padding: 0 calc(12px + var(--safe-r)) calc(6px + var(--safe-b)) calc(12px + var(--safe-l)); }
  .hud .center { grid-column: 2; grid-row: 1; height: 66px; column-gap: 14px; margin-bottom: 0; }
  .stage { grid-row: 1; } .stage-b { grid-column: 1; } .stage-s { grid-column: 3; }
  .stage-name { font-size: 10px; margin-bottom: 3px; }
  .gauge { width: 60px; height: 60px; }
  .gauge .gv { top: 19px; font-size: 13px; } .gauge .gk { top: 34px; font-size: 7px; } .gauge .gu { top: 42px; font-size: 7px; }
  .gauges { gap: 6px; }
  .tclock { font-size: 26px; } #tSign { font-size: 15px; } .tclock.ended { font-size: 20px; }
  .mname { display: none; }
  .hclk { gap: 3px; } .hclk .clock { font-size: 11px; } .hclk .clock .k { font-size: 8px; margin-bottom: 1px; }
  .panel { top: calc(var(--strip-h) + 44px); bottom: 0; width: min(420px, 62vw); max-width: 62vw; }
  .toast { top: calc(var(--strip-h) + 96px); }
}
