:root {
  --bg: #0c0b09;
  --card: #16140f;
  --ink: #f3ead7;
  --dim: #9a917f;
  --line: #2a261c;
  --red: #d4482a;
  --amber: #e3b341;
  --ok: #7dba6a;
  --max: 1080px;
  --foot-h: calc(44px + env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.5 "IBM Plex Sans", "Helvetica Neue", sans-serif;
}
.mono, button, input, .kicker, .feed, .stat b, code, .brand {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
a { color: var(--amber); }
.wrap { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.brand { letter-spacing: 0.28em; font-size: 13px; text-decoration: none; color: var(--ink); }
.nav { display: flex; gap: 16px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav a { color: var(--dim); text-decoration: none; }
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; padding: 40px 0 20px; }
h1 { font-size: clamp(34px, 6vw, 58px); line-height: 0.95; margin: 8px 0 14px; letter-spacing: -0.03em; }
.kicker { color: var(--amber); letter-spacing: 0.2em; font-size: 11px; text-transform: uppercase; }
.lede { color: var(--dim); max-width: 38ch; }
.stamp {
  width: 220px; height: 220px; margin: 10px auto;
  border: 6px double var(--amber);
  border-radius: 12px; transform: rotate(-8deg);
  display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(-45deg, #1b1812 0 8px, #14120e 8px 16px);
}
.stamp b { font-size: 28px; letter-spacing: 0.2em; }
.stamp span { display: block; color: var(--dim); font-size: 11px; letter-spacing: 0.16em; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.stat { flex: 1 1 130px; background: var(--card); border: 1px solid var(--line); padding: 12px; }
.stat b { display: block; font-size: 26px; color: var(--amber); }
.stat span { color: var(--dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
section { padding: 28px 0; border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); padding: 16px; }
label { display: block; color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin: 10px 0 4px; }
input {
  width: 100%; background: #0c0b09; color: var(--ink);
  border: 1px solid var(--line); padding: 10px;
}
button {
  margin-top: 10px; border: 0; background: var(--amber); color: #111;
  padding: 10px 12px; letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 11px; cursor: pointer; font-weight: 700;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--red); color: #fff; }
.err { min-height: 1.2em; color: var(--red); font-size: 13px; margin-top: 8px; }
.ok { color: var(--ok); }
.feed { font-size: 13px; }
.feed li { list-style: none; border-bottom: 1px solid var(--line); padding: 8px 0; }
.feed { margin: 0; padding: 0; }
.kind { color: var(--amber); }
.kind.slash, .kind.reject { color: var(--red); }
.kind.speak { color: var(--ok); }
.kind.graduate { color: var(--amber); }
.kind.airdrop { color: var(--ok); }
.post { border-left: 3px solid var(--ok); padding: 8px 10px; margin: 8px 0; background: #12100c; }
.ghost { border-left-color: var(--red); opacity: 0.7; }
.foot { color: var(--dim); font-size: 12px; padding: 24px 0 48px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.note { color: var(--dim); font-size: 14px; }
.player audio { width: 100%; margin-top: 8px; }
.roadmap .card { min-height: 140px; }
.roadmap .now { border-color: var(--amber); }
.mint a { word-break: break-all; }
.essay { padding-bottom: 64px; max-width: 720px; }
.essay h1 { font-size: clamp(32px, 5vw, 48px); }
.essay h2 { margin-top: 2em; border-top: 1px solid var(--line); padding-top: 0.8em; }
.essay p { color: #ddd4c2; }
.essay .step { color: var(--ink); }
.essay ul { padding-left: 1.2em; color: #ddd4c2; }
.essay .tbl { display: none; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.top { gap: 16px; position: sticky; top: 0; z-index: 5; background: rgba(12,11,9,0.92); backdrop-filter: blur(8px); }
.hdr-status { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.08em; }
.lamp { width: 10px; height: 10px; border-radius: 50%; background: #5a2a22; box-shadow: 0 0 0 3px #2a1a16; }
.lamp.on { background: #7dba6a; box-shadow: 0 0 10px #7dba6a; }
.lamp.off { background: #d4482a; box-shadow: 0 0 10px #d4482a55; }
.desk-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.desk-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 16px; }
.idcard { min-width: 240px; background: var(--card); border: 1px solid var(--line); padding: 12px 14px; }
.idcard-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { font-size: 10px; letter-spacing: 0.14em; padding: 3px 8px; border: 1px solid var(--line); }
.pill.good { color: #111; background: var(--ok); border-color: var(--ok); }
.pill.dead { color: #fff; background: var(--red); border-color: var(--red); }
.meters { display: flex; gap: 16px; margin: 10px 0 8px; }
.meters span { display: block; color: var(--dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.meters b { font-size: 20px; }
.meter { height: 8px; background: #2a261c; overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.25s ease; }
.meter > i.thin { background: var(--red); }
.btnrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btnrow .note { margin-left: auto; }
.feed li { display: grid; grid-template-columns: 72px 90px 1fr auto; gap: 8px; align-items: baseline; }
.feed .who { color: var(--ink); }
.feed .detail { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .ago, .post .ago { color: var(--dim); font-size: 11px; }
.feed .empty { grid-template-columns: 1fr; color: var(--dim); }
.post { border-left: 3px solid var(--ok); padding: 10px 12px; margin: 8px 0; background: #12100c; }
.post header { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--dim); }
.post header b { color: var(--ink); }
.post p { margin: 6px 0 0; }
.wall-card { min-height: 180px; }
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  background: #1c1812; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 14px; max-width: min(420px, 90vw); font-size: 13px;
}
.toast.ok { border-color: var(--ok); }
.toast.bad { border-color: var(--red); }
input:focus, button:focus { outline: 1px solid var(--amber); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: wait; }
@media (max-width: 800px) {
  .hero, .grid, .grid3, .desk-grid { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: 64px 1fr; }
  .feed .ago { display: none; }
}

/* livestream overlay — pinned onto the planetary system, not a blank plate */
body.live { background: #050504; }
body.live.globe-page { background: #050504; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  min-height: var(--vh, 100dvh);
  padding: 0;
  display: block;
  background: none;
}
.live-top {
  position: fixed;
  top: max(64px, calc(env(safe-area-inset-top) + 56px));
  left: max(14px, env(safe-area-inset-left));
  z-index: 8;
  pointer-events: auto;
  width: min(520px, 46vw);
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(8,7,5,0.72), rgba(8,7,5,0.28));
  border: 1px solid rgba(227,179,65,0.18);
  backdrop-filter: blur(12px);
}
.live-stats { margin-top: 10px; }
.live-stats .stat {
  flex: 1 1 72px;
  background: rgba(12,11,9,0.55);
  border-color: rgba(227,179,65,0.2);
  padding: 8px;
}
.live-stats .stat b { font-size: 20px; }
.live-feed {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  top: 248px;
  bottom: calc(var(--foot-h) + 12px);
  z-index: 8;
  pointer-events: auto;
  width: min(340px, 36vw);
  max-width: 420px;
  overflow: auto;
  margin: 0;
  padding: 0;
}
.live-feed li {
  background: rgba(12,11,9,0.78);
  padding: 6px 8px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.live-bot { display: none; }
.site-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  height: calc(44px + env(safe-area-inset-bottom, 0px));
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left));
  background: rgba(8, 7, 5, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}
.site-foot a,
.site-foot button {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 8px;
  min-height: 44px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  width: auto;
  appearance: none;
  -webkit-appearance: none;
}
.site-foot a[aria-current="page"],
.site-foot button.on {
  color: var(--amber);
}
.site-foot button.on {
  background: transparent;
  border: 0;
}
html[data-screen="xs"] .site-foot a,
html[data-screen="xs"] .site-foot button {
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 0 6px;
}

/* Mobile overlay only. Desktop rules above are unchanged. */
html[data-mobile="1"] body.landing .land-copy,
html[data-mobile="1"] .globe-hint,
html[data-mobile="1"] body.landing .grad-hud {
  display: none !important;
}
body.landing #live-overlay { display: none; }
html[data-mobile="1"] body.landing #live-overlay {
  display: block;
  position: static;
  inset: auto;
  min-height: 0;
  height: 0;
  overflow: visible;
  background: none;
  pointer-events: none;
}
html[data-mobile="1"] #system,
html[data-mobile="1"] #system canvas {
  z-index: 1;
}
body.landing:not(.live) .ship-login,
body.landing:not(.live) #select-rocket,
body.landing:not(.live) #select-mine,
body.landing:not(.live) #back-system {
  display: none;
}
html[data-mobile="1"] body.live .live-feed,
html[data-mobile="1"] body.live .globe-hint {
  display: none;
}
html[data-mobile="1"] body.landing .live-top,
html[data-mobile="1"] body.live .live-top {
  width: auto;
  left: 10px;
  right: 10px;
  top: max(8px, calc(env(safe-area-inset-top) + 44px));
  padding: 8px 10px;
  pointer-events: none;
}
html[data-mobile="1"] body.landing .live-stats .stat,
html[data-mobile="1"] body.live .live-stats .stat {
  flex: 1 1 56px;
  padding: 6px;
}
html[data-mobile="1"] body.landing .live-stats .stat b,
html[data-mobile="1"] body.live .live-stats .stat b { font-size: 15px; }
html[data-mobile="1"] body.landing .live-top .brand,
html[data-mobile="1"] body.live .live-top .brand { display: none; }
html[data-mobile="1"] body.live .grad-hud { display: none; }
html[data-mobile="1"] body.live .ship-login { display: none; }
html[data-mobile="1"] .globe-bar {
  gap: 6px;
  padding: 6px 10px;
}
html[data-mobile="1"] #system,
html[data-mobile="1"] #earth,
html[data-mobile="1"] #system canvas,
html[data-mobile="1"] #earth canvas {
  touch-action: none;
}
html[data-mobile="1"] body.globe-page {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
html[data-mobile="1"] .orbit-lab.moon { display: none !important; }
html[data-mobile="1"] {
  --foot-h: calc(58px + env(safe-area-inset-bottom, 0px));
}
html[data-mobile="1"] .site-foot [data-foot="overlay"] {
  display: none !important;
}
html[data-mobile="1"] .site-foot {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  height: var(--foot-h);
  overflow: hidden;
  padding: 4px 4px env(safe-area-inset-bottom, 0px);
}
html[data-mobile="1"] .site-foot a,
html[data-mobile="1"] .site-foot button {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px 2px;
  font-size: 8px;
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  overflow: hidden;
  word-break: break-word;
}
html[data-mobile="1"] .dock {
  left: auto;
  right: max(10px, env(safe-area-inset-right));
  top: auto;
  bottom: calc(var(--foot-h) + 8px);
  width: 50vw;
  max-width: 50vw;
  max-height: 21vh;
  padding: 8px 10px 10px;
}
html[data-mobile="1"] .dock h2 { font-size: 14px; margin: 2px 0 4px; }
html[data-mobile="1"] .dock #d-detail { font-size: 11px; line-height: 1.3; }
html[data-mobile="1"] .dock-meta { margin: 6px 0 0; gap: 4px; }
html[data-mobile="1"] .dock-meta div { grid-template-columns: 52px 1fr; gap: 6px; font-size: 11px; }
html[data-mobile="1"] .dock-link { margin-top: 8px; font-size: 11px; }
html[data-mobile="1"] #back-system { display: none !important; }
.exit-world { display: none; }
html[data-mobile="1"] .exit-world:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  bottom: calc(var(--foot-h) + 10px);
  z-index: 22;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8, 7, 5, 0.88);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
}
body.has-foot { padding-bottom: var(--foot-h); }
.essay.has-foot,
body.has-foot .essay { padding-bottom: calc(var(--foot-h) + 48px); }
.live-eco {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  pointer-events: auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(5,5,4,0.88), rgba(5,5,4,0));
}
.eco-node,
button.eco-node {
  flex: 0 0 auto;
  min-width: 72px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: rgba(12,11,9,0.7);
  color: var(--ink);
  cursor: pointer;
  font-weight: 400;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
}
.eco-node b { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.eco-node span { color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.eco-node.open { border-color: var(--ok); }
.eco-node.open span { color: var(--ok); }
.eco-node.next { border-color: var(--amber); }
.eco-node.next span { color: var(--amber); }
.eco-node.lock { opacity: 0.84; border-style: dashed; }
body.live .grad-hud { top: max(64px, calc(env(safe-area-inset-top) + 56px)); }
body.live .globe-hint { bottom: calc(var(--foot-h) + 10px); }
body.live .dock { z-index: 9; }

.globe-page { overflow: hidden; height: 100vh; }
.earth { position: fixed; inset: 0; }
.globe-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(5,5,4,0.82), rgba(5,5,4,0));
}
.globe-filters { display: flex; gap: 8px; }
.chip {
  margin: 0; background: transparent; color: var(--dim);
  border: 1px solid var(--line); padding: 6px 10px; letter-spacing: 0.12em;
}
.chip.on { color: #111; background: var(--amber); border-color: var(--amber); }
.dock {
  position: fixed; right: 18px; top: 72px; width: min(340px, 92vw); z-index: 7;
  background: rgba(16,14,10,0.92); border: 1px solid var(--line);
  padding: 16px 16px 18px; backdrop-filter: blur(10px);
  animation: dock-in 0.28s ease;
}
@keyframes dock-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.dock h2 { font-size: 22px; margin: 6px 0 8px; }
.dock-x {
  position: absolute; right: 8px; top: 6px; margin: 0;
  background: transparent; color: var(--ink); border: 0; font-size: 22px;
}
.dock-meta { display: grid; gap: 8px; margin: 12px 0 0; }
.dock-meta div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 13px; }
.dock-meta dt { color: var(--dim); }
.dock-link { display: inline-block; margin-top: 14px; }
.globe-hint {
  position: fixed; left: 18px; bottom: calc(var(--foot-h) + 8px); z-index: 6;
  color: var(--dim); font-size: 11px; letter-spacing: 0.08em;
}
@media (max-width: 800px) {
  .dock { left: 12px; right: 12px; width: auto; top: auto; bottom: 40px; }
}

.landing .land-copy {
  position: fixed; z-index: 6;
  left: 22px; top: 78px;
  width: min(460px, calc(100vw - 36px));
  padding: 22px 22px 20px;
  background: linear-gradient(180deg, rgba(8,7,5,0.62), rgba(8,7,5,0.28));
  border: 1px solid rgba(227,179,65,0.18);
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.landing .land-copy h1 { font-size: clamp(34px, 5vw, 56px); }
.landing .land-copy .cta,
.landing .land-copy a,
.landing .land-copy button { pointer-events: auto; }
.landing .land-stats .stat {
  background: rgba(12,11,9,0.55);
  border-color: rgba(227,179,65,0.2);
}
.sheet { position: fixed; inset: 0; z-index: 12; }
.sheet-back { position: absolute; inset: 0; background: rgba(5,5,4,0.45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: min(86vh, 920px); overflow: auto;
  background: rgba(10,9,7,0.94);
  border-top: 1px solid var(--line);
  padding: 18px 22px 32px;
  animation: sheet-up 0.32s ease;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-panel .dock-x { position: sticky; top: 0; float: right; }
.board-strip { margin-top: 16px; pointer-events: none; }
.podium { display: grid; gap: 6px; margin-top: 8px; }
.pod { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; align-items: center;
  background: rgba(12,11,9,0.55); border: 1px solid rgba(227,179,65,0.22); padding: 7px 10px; }
.pod span:last-child { grid-column: 2; color: var(--dim); font-size: 11px; }
.pod.r1 { border-color: #e3b341; }
.pod.r2 { border-color: #9a917f; }
.pod.r3 { border-color: #8a5a32; }
.pod.mine { outline: 1px solid var(--ok); }
.pod, table.board tbody tr[data-pilot] { cursor: pointer; }
.pod.pilot, table.board tr.pilot td { box-shadow: inset 0 0 0 1px var(--amber); }
.landing .board-strip .podium { pointer-events: auto; }
.medal { font-size: 12px; letter-spacing: 0.12em; color: var(--amber); }
table.board { width: 100%; border-collapse: collapse; font-size: 13px; }
table.board th, table.board td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.board th { color: var(--dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
table.board tr.mine td { color: var(--ok); }
@media (max-width: 800px) {
  .landing .land-copy { top: auto; bottom: calc(var(--foot-h) + 8px); left: 12px; right: 12px; width: auto; }
}

/* viewport-fit: desktop source, any screen stays interactive */
html {
  --vw: 100vw;
  --vh: 100dvh;
  --vvx: 0px;
  --vvy: 0px;
  --foot-h: calc(44px + env(safe-area-inset-bottom, 0px));
}
html, body { min-height: var(--vh, 100dvh); }
body.globe-page {
  height: var(--vh, 100dvh);
  width: var(--vw, 100vw);
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}
.earth {
  width: var(--vw, 100vw);
  height: var(--vh, 100dvh);
  touch-action: none;
}
.earth canvas { display: block; width: 100% !important; height: 100% !important; }
.globe-bar {
  max-width: var(--vw, 100vw);
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
.globe-hint {
  left: max(14px, env(safe-area-inset-left));
  bottom: max(10px, env(safe-area-inset-bottom));
  max-width: calc(var(--vw, 100vw) - 28px);
}
.landing .land-copy {
  max-height: calc(var(--vh, 100dvh) - 96px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.landing .land-copy .cta,
.landing .land-copy a,
.landing .land-copy button,
.landing .land-copy .chip { pointer-events: auto; }
.sheet-panel {
  max-height: min(86vh, calc(var(--vh, 100dvh) - 24px));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.dock {
  max-height: calc(var(--vh, 100dvh) - 88px);
  overflow: auto;
}
.toast {
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
}
html[data-pointer="coarse"] button,
html[data-pointer="coarse"] .chip,
html[data-pointer="coarse"] input {
  min-height: 44px;
}
html[data-pointer="coarse"] .site-foot a,
html[data-pointer="coarse"] .site-foot button {
  min-height: 0;
}
html[data-pointer="coarse"] .dock-x {
  min-width: 44px;
  min-height: 44px;
}
html[data-screen="md"] .globe-bar,
html[data-screen="sm"] .globe-bar,
html[data-screen="xs"] .globe-bar {
  gap: 8px;
  padding: 8px 12px;
}
html[data-screen="sm"] .nav,
html[data-screen="xs"] .nav { gap: 10px; font-size: 11px; }
html[data-screen="sm"] .hdr-status .mono:not(#door-label),
html[data-screen="xs"] .hdr-status #world-label { display: none; }
html[data-screen="xs"] .globe-hint { display: none; }
html[data-screen="xs"] .board-strip { display: none; }
.globe-bar,
.dock,
.sheet,
.sheet-panel,
.sheet-back,
.toast,
.landing .land-copy .cta,
.landing .land-copy a,
.landing .land-copy button {
  touch-action: manipulation;
}

.desk-chat {
  position: fixed; z-index: 20;
  right: 14px; top: 62px;
  width: min(420px, calc(100vw - 24px));
  height: min(560px, calc(var(--vh, 100dvh) - 80px));
  display: flex; flex-direction: column;
  background: rgba(12,11,9,0.94);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  touch-action: manipulation;
}
body.chat-only {
  touch-action: auto;
  height: 100dvh;
  overflow: hidden;
}
body.chat-only .desk-chat,
.desk-chat.desk-page {
  left: 0;
  right: 0;
  bottom: var(--foot-h);
  top: 0;
  width: 100%;
  height: auto;
  z-index: 20;
  border: 0;
  border-radius: 0;
}
.desk-chat[hidden] { display: none !important; }
.desk-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.desk-title { letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.desk-tabs { display: flex; gap: 6px; margin-left: auto; }
.desk-x { margin: 0; background: transparent; color: var(--ink); border: 0; font-size: 22px; }
.desk-panes { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.desk-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.desk-pane[hidden] { display: none !important; }
.desk-log {
  flex: 1; overflow: auto; margin: 0; padding: 10px 12px;
  list-style: none; -webkit-overflow-scrolling: touch;
}
.desk-msg { padding: 8px 0; border-bottom: 1px solid var(--line); }
.desk-msg .who { color: var(--amber); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; margin-right: 8px; }
.desk-msg.user .who { color: var(--ok); }
.desk-msg.trader .who { color: var(--dim); }
.desk-msg .when { color: var(--dim); font-size: 10px; }
.desk-msg .txt { white-space: pre-wrap; font-size: 13px; margin-top: 4px; }
.desk-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.desk-form input { flex: 1; margin: 0; }
.desk-form button { margin: 0; }
.desk-meta { padding: 0 12px 10px; color: var(--dim); font-size: 11px; }
.desk-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.desk-stats .stat { margin: 0; padding: 8px; }
.desk-stats .stat b { font-size: 13px; word-break: break-word; }
body.desk-open { touch-action: auto; }
body.desk-open .earth { pointer-events: none; }
@media (max-width: 800px) {
  .desk-chat {
    inset: auto 0 var(--foot-h) 0; width: auto; top: auto;
    height: min(72dvh, 620px);
    border-left: 0; border-right: 0;
  }
}
html[data-compact="1"] .landing .land-copy {
  top: auto;
  bottom: calc(var(--foot-h) + 8px);
  left: 10px;
  right: 10px;
  width: auto;
  padding: 12px 12px 10px;
  max-height: min(46vh, calc(var(--vh, 100dvh) - 72px));
}
html[data-compact="1"] .landing .land-copy h1 {
  font-size: clamp(22px, 7vw, 34px);
  margin: 4px 0 8px;
}
html[data-compact="1"] .landing .lede { display: none; }
html[data-compact="1"] .landing .land-stats .stat { padding: 8px; }
html[data-compact="1"] .landing .land-stats .stat b { font-size: 18px; }
html[data-compact="1"] .board-strip { margin-top: 10px; }
html[data-compact="1"] .pod { padding: 5px 8px; }
html[data-orient="land"][data-short="1"] .landing .land-copy {
  top: 56px;
  bottom: auto;
  left: 10px;
  right: auto;
  width: min(360px, calc(var(--vw, 100vw) - 20px));
  max-height: calc(var(--vh, 100dvh) - 72px);
}
html[data-orient="land"][data-short="1"] .landing .board-strip { display: none; }
html[data-orient="land"][data-short="1"] .dock {
  top: auto;
  bottom: 10px;
  left: auto;
  right: 10px;
  width: min(300px, 46vw);
}
html[data-compact="1"] .sheet-panel {
  max-height: calc(var(--vh, 100dvh) - 8px);
  padding: 12px 12px 24px;
}
html[data-compact="1"] .desk-grid { grid-template-columns: 1fr; }
html[data-compact="1"] table.board { display: block; overflow-x: auto; }
html[data-screen="xs"] .feed li { grid-template-columns: 56px 1fr; }
html[data-screen="xs"] .feed .ago { display: none; }
html[data-compact="1"] .live-top {
  width: auto;
  right: 10px;
  left: 10px;
  padding: 8px 10px;
}
html[data-compact="1"] .live-stats .stat b { font-size: 16px; }
html[data-compact="1"] .live-feed {
  top: auto;
  bottom: calc(var(--foot-h) + 8px);
  max-height: 28vh;
  width: auto;
  right: 10px;
}
html[data-orient="land"][data-short="1"] .live-bot,
html[data-orient="land"][data-short="1"] .live-feed { display: none; }
html[data-screen="xs"] .live-top .brand { display: none; }
html[data-compact="1"] body.live .grad-hud {
  top: max(64px, calc(env(safe-area-inset-top) + 56px));
  bottom: auto;
  max-width: 42vw;
}
body.live .live-top,
body.live .live-feed,
body.live .live-eco { touch-action: manipulation; }
html.desk-open .land-copy,
html.desk-open .globe-hint { visibility: hidden; }
html.desk-open .earth { pointer-events: none; }
html.desk-open body.globe-page { touch-action: auto; }
.wrap { width: min(var(--max), calc(var(--vw, 100vw) - 36px)); }

.world-rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: min(780px, 62vw);
  padding-bottom: 2px;
  scrollbar-width: thin;
  touch-action: pan-x;
}
.chip.lock {
  opacity: 0.82;
  border-style: dashed;
}
.chip.next { box-shadow: 0 0 0 1px var(--amber); }
.orbit-labels {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.orbit-lab {
  position: absolute;
  transform: translate(-50%, -140%);
  pointer-events: auto;
  margin: 0;
  background: rgba(8,7,5,0.72);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 3px 7px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.orbit-lab.lock { opacity: 0.92; }
.orbit-lab.moon { font-size: 8px; padding: 2px 5px; letter-spacing: 0.08em; }
.orbit-lab.dwarf { border-style: dashed; }
.orbit-lab.open { border-color: var(--ok); }
.orbit-lab.next { border-color: var(--amber); }
.orbit-lab.on { background: var(--amber); color: #111; }
.rocket-lab {
  background: rgba(227,179,65,0.92);
  color: #111;
  font-weight: 700;
  letter-spacing: 0.08em;
  z-index: 6;
  pointer-events: none;
}
.rocket-lab.empty { background: rgba(80,70,55,0.8); color: var(--dim); }
.rocket-lab.on,
body.rocket-follow .rocket-lab {
  background: rgba(227,179,65,0.95);
  color: #111;
}
body.rocket-follow #select-rocket.on,
body.rocket-follow #select-mine.on {
  color: #111;
  background: var(--amber);
  border-color: var(--amber);
}
.ship-login {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ship-login input {
  width: 110px;
  margin: 0;
  padding: 6px 8px;
}
.ship-login button { margin: 0; }
.rocket-lab.mine { background: rgba(80,100,140,0.85); color: #e8eef8; }
.rocket-hud {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  top: 198px;
  z-index: 6;
  width: min(250px, 40vw);
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(8,7,5,0.62), rgba(8,7,5,0.28));
  border: 1px solid rgba(227,179,65,0.18);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.rocket-hud #rocket-pilot { font-size: 14px; margin: 4px 0; }
.rocket-hud .mono { color: var(--dim); font-size: 11px; line-height: 1.35; word-break: break-word; }
html.desk-open .rocket-hud,
html.desk-open .rocket-lab { pointer-events: none; visibility: hidden; }
body.live .rocket-hud { top: max(250px, calc(env(safe-area-inset-top) + 240px)); }
html[data-compact="1"] .rocket-hud {
  top: auto;
  bottom: max(52px, env(safe-area-inset-bottom));
  right: 10px;
  width: auto;
  max-width: 48vw;
  padding: 8px 10px;
}
html[data-compact="1"] .rocket-hud #rocket-eq { display: none; }
html[data-orient="land"][data-short="1"] .rocket-hud { display: none; }
.nav a[aria-current="page"] { color: var(--ink); }
.grad-hud {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  top: 78px;
  z-index: 6;
  width: min(250px, 40vw);
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(8,7,5,0.62), rgba(8,7,5,0.28));
  border: 1px solid rgba(227,179,65,0.18);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.grad-hud #grad-lead { font-size: 14px; margin: 4px 0; }
.system-stage canvas { display: block; width: 100%; height: 100%; }
body.surface-mode .orbit-labels,
body.surface-mode .system-stage { visibility: hidden; }
html.desk-open #system,
html.desk-open .orbit-labels,
html.desk-open .grad-hud { pointer-events: none; }
html.desk-open .orbit-labels { visibility: hidden; }
html[data-compact="1"] .world-rail {
  max-width: 100%;
  order: 5;
  flex: 1 0 100%;
}
html[data-compact="1"] .grad-hud {
  top: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  right: 10px;
  left: auto;
  width: auto;
  max-width: 46vw;
  padding: 8px 10px;
}
html[data-compact="1"] .grad-hud #grad-lead { display: none; }
html[data-orient="land"][data-short="1"] .grad-hud { display: none; }
html[data-screen="xs"] .world-rail .chip { padding: 6px 8px; font-size: 10px; }

.paper-id {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 8px;
}
.paper-id div {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.paper-id span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.paper-id b { font-size: 16px; letter-spacing: 0.04em; }
.paper-toc { margin: 22px 0; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); }
.paper-toc ol { margin: 8px 0 0; padding-left: 1.3em; color: #ddd4c2; }
.paper-toc a { color: var(--ink); text-decoration: none; }
.paper-toc a:hover { color: var(--amber); }
.paper-tbl { width: 100%; border-collapse: collapse; margin: 14px 0 8px; font-size: 14px; }
.paper-tbl th, .paper-tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.paper-tbl th { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.paper-tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 800px) {
  .paper-id { grid-template-columns: 1fr 1fr; }
  .essay { width: min(720px, calc(100% - 24px)); }
  .paper-tbl { font-size: 13px; }
  .paper-tbl th, .paper-tbl td { padding: 8px 8px; }
}
html[data-mobile="1"] .essay {
  padding-top: 12px;
  padding-bottom: calc(var(--foot-h) + 36px);
}
html[data-mobile="1"] .paper-id { grid-template-columns: 1fr 1fr; gap: 8px; }
html[data-mobile="1"] .paper-id b { font-size: 14px; word-break: break-word; }
html[data-mobile="1"] .paper-toc { padding: 12px; }

/* Gate (login) — keep form chrome here so the page cannot restyle the footer. */
body.gate-page .wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 24px calc(24px + var(--foot-h));
}
body.gate-page #gate {
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 22px 20px 20px;
}
body.gate-page #gate .kicker { color: var(--amber); }
body.gate-page #gate h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 8px 0 8px;
}
body.gate-page #gate p { color: var(--dim); font-size: 13px; margin: 0 0 16px; }
body.gate-page #gate button[type="submit"] {
  margin-top: 14px;
  width: 100%;
  border: 0;
  background: var(--amber);
  color: #111;
  padding: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}

/*
  Footer lock — last in the sheet so chat / login cannot fall back to the
  old wrapping row. data-mobile covers phones; the width query covers the
  same pages if JS is late or a stale sheet is cached.
*/
html[data-mobile="1"] {
  --foot-h: calc(58px + env(safe-area-inset-bottom, 0px));
}
html[data-mobile="1"] footer.site-foot > [data-foot="overlay"] {
  display: none !important;
}
html[data-mobile="1"] footer.site-foot {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  height: var(--foot-h);
  overflow: hidden;
  padding: 4px 4px env(safe-area-inset-bottom, 0px);
}
html[data-mobile="1"] footer.site-foot > a,
html[data-mobile="1"] footer.site-foot > button {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  overflow: hidden;
  word-break: break-word;
  appearance: none;
  -webkit-appearance: none;
}
@media (max-width: 720px) {
  html:not([data-mobile="0"]) {
    --foot-h: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  html:not([data-mobile="0"]) footer.site-foot > [data-foot="overlay"] {
    display: none !important;
  }
  html:not([data-mobile="0"]) footer.site-foot {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    height: var(--foot-h);
    overflow: hidden;
    padding: 4px 4px env(safe-area-inset-bottom, 0px);
  }
  html:not([data-mobile="0"]) footer.site-foot > a,
  html:not([data-mobile="0"]) footer.site-foot > button {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: var(--dim);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    overflow: hidden;
    word-break: break-word;
    appearance: none;
    -webkit-appearance: none;
  }
  html:not([data-mobile="0"]) footer.site-foot > a[aria-current="page"],
  html:not([data-mobile="0"]) footer.site-foot > button.on {
    color: var(--amber);
    background: transparent;
  }
}
html[data-mobile="0"] {
  --foot-h: calc(44px + env(safe-area-inset-bottom, 0px));
}

body.core-stats { padding-top: 16px; }
.core-wrap h1 { font-size: clamp(26px, 4vw, 40px); }
.core-h { font-size: 20px; margin: 4px 0 0; letter-spacing: -0.02em; font-weight: 600; }
.core-window { margin: 14px 0; }
.core-filter { color: var(--amber); }
.core-up { color: var(--ok); }
.core-down { color: var(--red); }
.core-strip .stat i {
  display: block; font-style: normal; color: var(--dim);
  font-size: 11px; margin-top: 4px; letter-spacing: 0; text-transform: none;
}
.core-ranges { gap: 8px; margin: 12px 0 8px; }
.core-strip { display: flex; flex-wrap: wrap; gap: 10px; border-top: 0; padding-top: 8px; }
.core-strip .stat { flex: 1 1 110px; }
.core-strip .stat.stat-primary {
  flex: 2 1 220px;
  border-color: var(--amber);
  background: #1a1710;
}
.core-strip .stat.stat-primary b { font-size: 32px; }
.core-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 16px;
}
.core-legend div {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--card);
}
.core-legend dt {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.core-legend dd {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.4;
}
.core-chart-card canvas { width: 100%; height: auto; display: block; background: #12100c; border: 1px solid var(--line); cursor: pointer; }
.core-grid { margin-top: 0; }
.core-hours { display: flex; flex-wrap: wrap; gap: 6px; }
.core-hours .chip { margin: 0; }
#clear-filter { margin-left: 8px; display: inline-block; width: auto; padding: 4px 8px; }
html[data-mobile="1"] .core-strip .stat b { font-size: 16px; }
html[data-mobile="1"] .core-strip .stat.stat-primary b { font-size: 22px; }
html[data-mobile="1"] .core-wrap { width: min(100% - 16px, var(--max)); }
.core-forecast .kicker { margin-top: 14px; }
.core-fc-controls { align-items: flex-end; gap: 16px; }
.core-fc-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.core-fc-presets .chip { margin: 0; }
#fc-date { max-width: 200px; font-size: 16px; }
html[data-mobile="1"] .core-fc-controls { display: block; }
html[data-mobile="1"] #fc-date { width: 100%; max-width: none; }
.core-toc ol { margin: 8px 0 0; padding-left: 1.3em; color: #ddd4c2; }
.core-toc a { color: var(--ink); text-decoration: none; }
.core-toc a:hover { color: var(--amber); }
.core-block-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.core-block-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.core-block .core-toggle { margin: 0; padding: 6px 10px; min-height: 36px; }
.core-block[data-stowed="1"] .core-block-body { display: none; }
.core-block { scroll-margin-top: 12px; }
.core-term {
  color: #fff;
  border-bottom: 1px dotted #fff;
  cursor: help;
  text-decoration: none;
}
.core-tip {
  position: fixed;
  z-index: 40;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 10px;
  background: #16140f;
  color: var(--ink);
  border: 1px solid var(--amber);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  pointer-events: none;
}
