@charset "UTF-8";

/* Expedition control. Local fonts and code-native imagery keep the station offline-ready. */
:root {
  color-scheme: dark;
  --bg: #0a1112;
  --rail: #080e0f;
  --panel: #10191a;
  --panel-raised: #152021;
  --panel-soft: #111c1d;
  --text: #e5e8df;
  --muted: #85958f;
  --faint: #506760;
  --line: rgba(157, 182, 170, .13);
  --line-strong: rgba(157, 182, 170, .23);
  --amber: #e7a66a;
  --amber-soft: #f3c899;
  --amber-dim: rgba(231, 166, 106, .1);
  --sage: #91b7a5;
  --sage-dim: rgba(145, 183, 165, .09);
  --red: #df897a;
  --blue: #85b4c0;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --radius: 8px;
  --radius-small: 4px;
  --shadow: 0 22px 80px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--amber-soft); text-decoration-color: rgba(231, 166, 106, .4); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}
::selection { color: var(--bg); background: var(--sage); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 8px; background: #2d403a; }
::-webkit-scrollbar-thumb:hover { background: #4e665c; }
svg { display: block; }
button svg { flex-shrink: 0; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 500; }
p:last-child { margin-bottom: 0; }
pre { font-family: var(--mono); }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.amber { color: var(--amber); }
.sage { color: var(--sage); }
.danger-text { color: var(--red); }
.nowrap { white-space: nowrap; }
.divider { height: 1px; margin: 22px 0; background: var(--line); border: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Station frame */
.app-shell { display: grid; grid-template-columns: 74px minmax(0, 1fr); min-height: 100svh; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.brand-mark {
  height: 84px;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--amber);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at center, rgba(231, 166, 106, .07), transparent 65%);
}
.brand-mark svg { width: 34px; height: 34px; }
.brand-mark::after { content: ""; width: 3px; height: 3px; background: var(--amber); position: absolute; right: 16px; top: 25px; }
.nav-list { display: flex; flex-direction: column; gap: 8px; padding: 28px 7px; }
.nav-item {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 65px;
  padding: 10px 2px;
  color: #6e8279;
  border-radius: 5px;
  position: relative;
  transition: color .18s, background .18s;
}
.nav-item:hover { color: var(--text); background: rgba(145, 183, 165, .05); }
.nav-item.active { color: var(--amber); background: var(--amber-dim); }
.nav-item.active::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: -7px; width: 2px; background: var(--amber); }
.nav-icon, .nav-icon svg { width: 22px; height: 22px; }
.nav-label { font: 9px/1.2 var(--sans); letter-spacing: .02em; }
.sidebar-foot { margin-top: auto; padding: 15px 10px 24px; display: flex; align-items: center; flex-direction: column; gap: 18px; color: var(--faint); }
.sidebar-foot .icon-button { color: var(--muted); width: 38px; height: 38px; }
.sidebar-foot small { writing-mode: vertical-rl; font: 8px var(--mono); letter-spacing: .2em; opacity: .8; }
.main-shell { grid-column: 2; min-width: 0; display: flex; flex-direction: column; min-height: 100svh; }
.topbar {
  min-height: 84px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 19, 20, .96);
  position: relative;
  z-index: 10;
}
.expedition-id { flex-shrink: 0; line-height: 1.4; }
.expedition-id > strong { display: block; font-size: 13px; font-weight: 500; letter-spacing: .11em; }
.expedition-id > span, .expedition-id > small { display: block; color: var(--faint); font: 9px/1.6 var(--mono); letter-spacing: .08em; margin-top: 5px; }
.resource-strip { display: flex; align-items: center; gap: 27px; margin-left: auto; }
.resource { display: grid; grid-template-columns: 18px auto; column-gap: 9px; row-gap: 2px; position: relative; min-width: 74px; }
.resource-icon { grid-row: 1 / 3; align-self: center; color: var(--sage); }
.resource-icon svg { width: 17px; height: 17px; }
.resource:first-child .resource-icon { color: var(--amber); }
.resource-number { font: 15px/1.2 var(--mono); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.resource-number small { color: var(--faint); font: 10px/1 var(--mono); }
.resource-label { color: var(--muted); font: 9px/1.3 var(--sans); letter-spacing: .02em; }
.resource-meter { grid-column: 2; height: 2px; background: rgba(145, 183, 165, .12); margin-top: 4px; width: 70px; }
.resource-fill { height: 100%; background: var(--sage); max-width: 100%; transition: width .4s; }
.resource:first-child .resource-fill { background: var(--amber); }
.resource.low .resource-number, .resource.low .resource-icon { color: var(--red); }
.topbar-actions { display: flex; align-items: center; gap: 14px; margin-left: 7px; padding-left: 23px; border-left: 1px solid var(--line); }
.save-indicator { display: flex; align-items: center; gap: 7px; color: var(--faint); font: 9px var(--mono); white-space: nowrap; }
.save-indicator::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 7px rgba(145, 183, 165, .3); }
.icon-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { color: var(--text); background: var(--sage-dim); border-color: var(--line); }
.icon-button:disabled { opacity: .35; }
.workspace { width: 100%; flex: 1; min-width: 0; padding: 27px 30px 24px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.eyebrow { color: var(--sage); font: 9px/1.5 var(--mono); letter-spacing: .18em; text-transform: uppercase; margin-bottom: 8px; }
.eyebrow::before { content: ""; display: inline-block; width: 13px; height: 1px; background: currentColor; margin-right: 9px; vertical-align: middle; opacity: .7; }
.page-title { font-size: clamp(25px, 2.5vw, 35px); font-weight: 400; letter-spacing: -.045em; margin: 0; }
.page-subtitle { color: var(--muted); margin: 8px 0 0; font-size: 12px; line-height: 1.65; }
.heading-actions { display: flex; gap: 9px; align-items: center; padding-bottom: 2px; }
.heading-actions .button { font-size: 11px; }
.sector-number { font: 10px var(--mono); color: var(--faint); letter-spacing: .09em; }

/* Controls */
.button {
  min-height: 39px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(145, 183, 165, .045);
  color: var(--text);
  font: 12px/1.4 var(--sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  text-decoration: none;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.button svg { width: 15px; height: 15px; }
.button:hover:not(:disabled) { background: rgba(145, 183, 165, .11); border-color: rgba(145, 183, 165, .45); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { color: #1d211c; background: var(--amber); border-color: var(--amber); font-weight: 600; }
.button.primary:hover:not(:disabled) { background: #f2ba82; border-color: #f2ba82; box-shadow: 0 4px 25px rgba(231, 166, 106, .1); }
.button.secondary { color: var(--sage); background: var(--sage-dim); }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.ghost:hover:not(:disabled) { border-color: var(--line); color: var(--text); }
.button.danger { color: var(--red); border-color: rgba(223, 137, 122, .27); background: rgba(223, 137, 122, .055); }
.button.danger:hover:not(:disabled) { border-color: rgba(223, 137, 122, .6); background: rgba(223, 137, 122, .1); }
.button.small { min-height: 31px; font-size: 10px; padding: 7px 11px; gap: 6px; }
.button.wide, .button.full-width { width: 100%; }
.button:disabled { color: #6a7771; background: rgba(100, 120, 108, .04); border-color: rgba(100, 120, 108, .1); opacity: .62; box-shadow: none; }
.button.primary:disabled { color: #829084; background: #29342b; border-color: #29342b; opacity: .8; }
.button .button-meta { font: 10px var(--mono); opacity: .7; margin-left: auto; }
.button-group, .inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #0b1414; padding: 3px; border: 1px solid var(--line); border-radius: 5px; }
.segment { border: 0; background: transparent; border-radius: 3px; padding: 7px 12px; color: var(--muted); font: 10px var(--mono); }
.segment.active { color: var(--text); background: var(--panel-raised); box-shadow: 0 1px 3px #0003; }
.segment:hover { color: var(--text); }
.tab-row { display: flex; gap: 25px; border-bottom: 1px solid var(--line); margin: 0 0 25px; }
.tab-button { position: relative; border: 0; background: transparent; color: var(--muted); padding: 10px 1px 14px; font-size: 12px; white-space: nowrap; }
.tab-button.active { color: var(--amber); }
.tab-button.active::after { content: ""; position: absolute; height: 2px; background: var(--amber); bottom: -1px; left: 0; right: 0; }
.tab-button:hover { color: var(--text); }
.tab-button small { color: var(--faint); font: 9px var(--mono); margin-left: 5px; }

/* Cartography */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 334px; gap: 18px; align-items: stretch; }
.map-panel { position: relative; min-width: 0; min-height: 570px; display: flex; flex-direction: column; background: #0c1516; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-toolbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 19px; border-bottom: 1px solid var(--line); background: rgba(16, 25, 26, .7); z-index: 4; }
.map-toolbar h2, .map-toolbar h3 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .01em; }
.map-meta { display: flex; align-items: center; gap: 12px; color: var(--faint); font: 9px var(--mono); letter-spacing: .04em; }
.map-meta .live-dot, .live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sage); display: inline-block; box-shadow: 0 0 8px #91b7a51a; }
.star-map { position: relative; width: 100%; height: clamp(420px, 53vh, 680px); min-height: 420px; flex: 1; overflow: hidden; isolation: isolate; aspect-ratio: 1.36; background: radial-gradient(ellipse at 46% 51%, rgba(75, 112, 91, .09) 0%, transparent 54%), radial-gradient(ellipse at 65% 65%, rgba(137, 102, 61, .035), transparent 46%), #0a1415; }
.star-map::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle at 23px 16px, #9ab2a766 .65px, transparent .9px), radial-gradient(circle at 44px 50px, #a5b7a33b .6px, transparent .85px), radial-gradient(circle at 112px 85px, #9ba8a43b .5px, transparent .9px), radial-gradient(circle at 38px 104px, #abbcad4d .8px, transparent 1px), radial-gradient(circle at 87px 33px, #91b7a52b .55px, transparent .9px); background-size: 117px 127px, 163px 191px, 229px 237px, 307px 281px, 369px 313px; opacity: .65; z-index: -1; }
.star-map::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px 18px rgba(5, 12, 13, .65); z-index: 1; }
.map-world { position: absolute; inset: 0; transform: scale(var(--map-zoom, 1)); transform-origin: 50% 50%; transition: transform .35s ease; }
.map-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(145, 183, 165, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(145, 183, 165, .025) 1px, transparent 1px); background-size: 56px 56px; pointer-events: none; }
.map-orbits, .map-lines { position: absolute; inset: 0; height: 100%; width: 100%; overflow: visible; pointer-events: none; }
.map-orbits { color: rgba(145, 183, 165, .065); }
.map-orbits circle, .map-orbits ellipse { fill: none; stroke: currentColor; stroke-width: 1; }
.map-lines line, .map-lines path { stroke: rgba(145, 183, 165, .14); stroke-width: 1; fill: none; }
.map-lines .reachable-line, .map-lines .route { stroke: rgba(231, 166, 106, .35); stroke-dasharray: 4 7; }
.map-lines .selected-route { stroke: var(--amber); opacity: .65; stroke-width: 1.2; stroke-dasharray: 4 6; animation: route-flow 30s linear infinite; }
.map-lines circle.range-circle { fill: rgba(145, 183, 165, .022); stroke: rgba(145, 183, 165, .15); stroke-dasharray: 3 7; }
.map-ambient { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.coordinate-label { position: absolute; font: 8px/1.6 var(--mono); letter-spacing: .09em; color: rgba(145, 183, 165, .3); }
.coordinate-label.top-left { left: 19px; top: 16px; }
.coordinate-label.top-right { right: 19px; top: 16px; text-align: right; }
.coordinate-label.bottom-left { bottom: 20px; left: 19px; }
.coordinate-label.bottom-right { bottom: 20px; right: 19px; text-align: right; }
.star-node { position: absolute; z-index: 3; transform: translate(-50%, -50%); padding: 16px 12px 11px; min-width: 44px; min-height: 44px; border: 0; background: transparent; line-height: 1; color: var(--muted); text-align: center; overflow: visible; border-radius: 4px; }
.star-node:hover { z-index: 8; color: var(--text); }
.star-dot { display: block; position: relative; margin: 0 auto 9px; width: 6px; height: 6px; background: var(--star-color, #b3c4b9); color: var(--star-color, #b3c4b9); border-radius: 50%; box-shadow: 0 0 10px 1px color-mix(in srgb, var(--star-color, #b3c4b9) 18%, transparent); transition: transform .2s, box-shadow .2s; }
.star-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; transform: translate(-50%, -50%); border: 1px solid transparent; border-radius: 50%; transition: border-color .2s, width .2s, height .2s; }
.star-node:hover .star-dot { transform: scale(1.3); box-shadow: 0 0 16px 3px color-mix(in srgb, var(--star-color, #b3c4b9) 30%, transparent); }
.star-node:hover .star-dot::before { border-color: rgba(145, 183, 165, .35); }
.star-node.selected .star-dot { width: 9px; height: 9px; }
.star-node.selected .star-dot::before { width: 33px; height: 33px; border-color: var(--amber); opacity: .85; }
.star-node.selected .star-dot::after { content: ""; position: absolute; inset: -17px; border: 1px solid rgba(231, 166, 106, .17); border-radius: 50%; }
.star-node.selected .star-label { color: var(--amber-soft); }
.star-node.current .star-dot { width: 9px; height: 9px; background: var(--amber); box-shadow: 0 0 18px rgba(231, 166, 106, .38); }
.star-node.current .star-label { color: var(--text); }
.star-node.current .star-dot::before { border-color: rgba(231, 166, 106, .4); width: 27px; height: 27px; }
.star-node.visited .star-label { color: #a4b9ad; }
.star-node.visited .star-label::before { content: "· "; color: var(--sage); }
.star-node.unreachable { opacity: .48; }
.star-node.reachable { color: #b5c2b8; }
.star-node.reachable .star-dot { box-shadow: 0 0 12px 2px color-mix(in srgb, var(--star-color, #b3c4b9) 20%, transparent); }
.star-node.anomaly .star-dot { border-radius: 1px; transform: rotate(45deg); }
.star-node.anomaly .star-label { color: #a7a5c4; }
.star-label { font: 9px/1.25 var(--mono); display: block; white-space: nowrap; letter-spacing: .01em; text-shadow: 0 1px 6px #071012, 0 0 4px #071012; }
.star-distance { display: block; color: var(--faint); font: 8px/1.25 var(--mono); margin-top: 4px; white-space: nowrap; }
.ship-marker { position: absolute; left: 50%; top: -5px; transform: translateX(-50%); color: var(--amber); font: 8px var(--mono); white-space: nowrap; letter-spacing: .12em; }
.ship-marker svg { width: 13px; height: 13px; margin: 0 auto; }
.map-controls { position: absolute; z-index: 12; right: 15px; bottom: 17px; display: flex; flex-direction: column; padding: 3px; background: rgba(15, 25, 25, .9); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 2px 12px #0002; }
.map-controls .icon-button { width: 29px; height: 29px; border-radius: 3px; color: #9bac9f; font: 18px var(--mono); }
.map-controls .icon-button + .icon-button { border-top: 1px solid var(--line); }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 17px; color: #73877c; font: 9px var(--mono); }
.map-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #657e70; }
.legend-dot.current { background: var(--amber); box-shadow: 0 0 7px #e7a66a22; }
.legend-dot.visited { background: var(--sage); }
.legend-dot.anomaly { background: #aca5c2; border-radius: 1px; transform: rotate(45deg); }
.legend-line { width: 13px; height: 0; border-top: 1px dashed var(--amber); display: inline-block; }
.map-caption { position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 20px; align-items: center; min-height: 49px; padding: 13px 19px; border-top: 1px solid var(--line); background: #0e1718; }
.map-caption > small, .map-caption > .map-scale { color: var(--faint); font: 9px var(--mono); white-space: nowrap; }
.map-status { position: absolute; z-index: 5; left: 19px; bottom: 20px; color: var(--faint); font: 9px var(--mono); display: flex; gap: 10px; align-items: center; }
.map-status span { width: 26px; height: 5px; border: 1px solid var(--faint); border-top: 0; display: inline-block; }

/* Selected system dossier */
.side-panel { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.panel-head { padding: 22px 22px 0; }
.panel-head .eyebrow { color: var(--faint); font-size: 8px; margin-bottom: 10px; }
.panel-head .eyebrow::before { width: 8px; }
.panel-title-row { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.system-name { font-size: 28px; line-height: 1.1; font-weight: 400; letter-spacing: -.035em; margin: 0 0 7px; }
.system-type { color: var(--muted); font: 10px var(--mono); line-height: 1.7; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; font: 8px var(--mono); letter-spacing: .045em; text-transform: uppercase; padding: 5px 7px; color: var(--sage); border: 1px solid rgba(145, 183, 165, .21); border-radius: 3px; background: rgba(145, 183, 165, .04); white-space: nowrap; }
.status-badge.current, .status-badge.amber { color: var(--amber); border-color: rgba(231, 166, 106, .25); background: var(--amber-dim); }
.status-badge.locked, .status-badge.muted { color: var(--faint); border-color: var(--line); background: transparent; }
.status-badge.danger { color: var(--red); border-color: rgba(223, 137, 122, .25); background: #df897a0a; }
.system-art { position: relative; height: 160px; margin: 8px 0 2px; display: grid; place-items: center; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 50% 48%, rgba(231, 166, 106, .07), transparent 63%); }
.system-art::before { content: ""; position: absolute; width: 83px; height: 83px; border-radius: 50%; background: radial-gradient(circle at 33% 28%, #f6ddb1, var(--star-color, #e7a66a) 38%, #936b42 72%, #4b412b 93%); box-shadow: 0 0 20px 1px rgba(231, 166, 106, .13), 0 0 65px 18px rgba(231, 166, 106, .045); z-index: -1; }
.system-art::after { content: ""; position: absolute; width: 190px; height: 57px; border: 1px solid rgba(145, 183, 165, .15); border-radius: 50%; transform: rotate(-23deg); z-index: -2; }
.system-art pre { position: relative; font: 9px/1.15 var(--mono); margin: 0; color: rgba(242, 207, 153, .9); text-shadow: 0 0 12px #e7a66a33; background: transparent; }
.system-art.ascii::before, .system-art.ascii::after { display: none; }
.system-art > svg { width: 100%; height: 100%; }
.system-art .art-coord { position: absolute; left: 22px; bottom: 10px; font: 8px var(--mono); letter-spacing: .08em; color: var(--faint); }
.system-art .art-orbit { position: absolute; width: 246px; height: 88px; border: 1px solid rgba(145, 183, 165, .055); border-radius: 50%; transform: rotate(-23deg); }
.system-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 22px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { min-width: 0; }
.stat + .stat { padding-left: 12px; border-left: 1px solid var(--line); }
.stat-value { display: block; font: 15px/1.25 var(--mono); white-space: nowrap; color: var(--text); }
.stat-value small { font-size: 9px; color: var(--muted); }
.stat-label { display: block; color: var(--muted); font-size: 9px; line-height: 1.4; margin-top: 6px; }
.system-description { padding: 17px 22px 0; color: #9aa99f; font-size: 12px; line-height: 1.75; margin: 0; }
.side-panel .tags { padding: 12px 22px 0; }
.action-stack { display: flex; flex-direction: column; gap: 8px; padding: 21px 22px; margin-top: auto; }
.action-stack .button { width: 100%; }
.action-stack .action-row { display: flex; gap: 7px; }
.action-stack .action-row .button { flex: 1; padding-inline: 8px; }
.action-hint { font-size: 10px; line-height: 1.6; color: var(--faint); text-align: center; margin: 1px 0 0; }
.action-hint.amber { color: var(--amber); }
.panel-footer { border-top: 1px solid var(--line); padding: 13px 22px; color: var(--faint); font: 9px var(--mono); }
.objective-card { padding: 18px 22px; border-top: 1px solid var(--line); background: linear-gradient(115deg, rgba(145, 183, 165, .055), transparent); }
.objective-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 9px var(--mono); color: var(--sage); letter-spacing: .03em; margin-bottom: 8px; }
.objective-header svg { width: 13px; height: 13px; }
.objective-card h3 { margin: 0 0 6px; font-size: 12px; line-height: 1.5; font-weight: 500; }
.objective-card p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 0; }
.progress-track { height: 3px; background: #91b7a512; overflow: hidden; margin-top: 13px; border-radius: 3px; }
.progress-fill { height: 100%; background: var(--sage); transition: width .4s; max-width: 100%; }
.progress-fill.amber { background: var(--amber); }
.mission-strip { margin-top: 18px; padding: 16px 20px; background: rgba(145, 183, 165, .035); border: 1px solid var(--line); border-radius: 5px; display: flex; align-items: center; gap: 20px; }
.mission-strip .mission-icon { color: var(--sage); flex-shrink: 0; }
.mission-strip .mission-copy { flex: 1; min-width: 0; }
.mission-strip h3 { font-size: 12px; margin: 0 0 4px; font-weight: 500; }
.mission-strip p { font-size: 11px; color: var(--muted); margin: 0; }
.mission-strip .progress-track { width: 120px; margin: 0; flex-shrink: 0; }
.mission-strip .button { flex-shrink: 0; }
.eventbar { min-height: 40px; display: flex; align-items: center; gap: 14px; padding: 10px 30px; border-top: 1px solid var(--line); font: 9px/1.5 var(--mono); color: var(--muted); background: #0a1213; }
.event-label { flex-shrink: 0; color: var(--faint); letter-spacing: .09em; display: flex; align-items: center; gap: 7px; }
.event-label::before { content: ""; width: 4px; height: 4px; background: var(--sage); border-radius: 50%; }
.event-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #91a399; }
.event-time { white-space: nowrap; color: var(--faint); margin-left: auto; }

/* System survey and sample cabinet */
.content-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.content-panel + .content-panel { margin-top: 18px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-heading h2, .section-heading h3 { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: -.02em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.section-heading .eyebrow { font-size: 8px; margin-bottom: 7px; }
.section-heading > span, .section-heading > small { color: var(--faint); font: 10px var(--mono); }
.planet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.planet-card { border: 1px solid var(--line); border-radius: 6px; background: #0d1718; padding: 22px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.planet-card::before { content: ""; position: absolute; right: -45px; top: -55px; width: 190px; height: 190px; border: 1px solid rgba(145, 183, 165, .035); border-radius: 50%; pointer-events: none; }
.planet-orb { position: relative; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 31% 27%, color-mix(in srgb, var(--planet-color, #91b7a5) 85%, white), var(--planet-color, #91b7a5) 30%, #20392f 66%, #0a1213 94%); margin-bottom: 23px; box-shadow: inset -12px -11px 20px rgba(0, 0, 0, .5), 0 0 30px rgba(145, 183, 165, .04); isolation: isolate; }
.planet-orb::after { content: ""; position: absolute; inset: 8px 3px; border-radius: 50%; background: repeating-linear-gradient(163deg, transparent 0 9px, rgba(0, 0, 0, .16) 9px 14px, transparent 14px 19px); mix-blend-mode: multiply; }
.planet-orb.ice { --planet-color: #9bbdca; }
.planet-orb.desert { --planet-color: #bf9569; }
.planet-orb.lava { --planet-color: #bc7854; }
.planet-orb.ocean { --planet-color: #6d9dad; }
.planet-orb.gas { --planet-color: #a99076; }
.planet-info h3 { font-size: 20px; font-weight: 400; letter-spacing: -.03em; margin: 0 0 7px; }
.planet-info p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 12px 0 18px; }
.planet-info .eyebrow { font-size: 8px; margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font: 9px/1.4 var(--mono); padding: 4px 6px; border-radius: 3px; background: rgba(145, 183, 165, .055); border: 1px solid rgba(145, 183, 165, .08); color: #91aa9c; white-space: nowrap; }
.tag.amber, .tag.life { color: var(--amber-soft); background: #e7a66a0a; border-color: #e7a66a14; }
.tag.danger, .tag.warning { color: var(--red); background: #df897a08; border-color: #df897a14; }
.tag.blue { color: var(--blue); background: #85b4c00a; border-color: #85b4c014; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; align-items: baseline; padding: 8px 0; color: var(--muted); font-size: 11px; border-bottom: 1px solid rgba(145, 183, 165, .055); }
.detail-row:last-child { border-bottom: 0; }
.detail-row > :last-child { color: var(--text); font: 11px/1.5 var(--mono); text-align: right; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 20px; }
.card-actions .button { flex: 1; }
.catalog-list { display: flex; flex-direction: column; }
.sample-card { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 17px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.sample-card:first-child { padding-top: 0; }
.sample-card:last-child { padding-bottom: 0; border-bottom: 0; }
.sample-symbol { display: grid; place-items: center; width: 43px; height: 47px; border: 1px solid var(--line-strong); background: var(--sage-dim); border-radius: 4px; color: var(--sage); font: 23px var(--mono); }
.sample-card h3 { font-size: 13px; margin: 0 0 5px; font-weight: 500; }
.sample-card p { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 0 0 7px; }
.sample-card .sample-meta { font: 9px/1.5 var(--mono); color: var(--faint); }
.sample-card .sample-value { font: 15px var(--mono); color: var(--sage); text-align: right; white-space: nowrap; }
.sample-card .sample-value small { font: 9px var(--mono); color: var(--faint); display: block; margin-top: 4px; }
.sample-card .button { white-space: nowrap; }
.notice { border-left: 2px solid var(--sage); padding: 12px 15px; margin: 18px 0; background: var(--sage-dim); color: #b1c1b6; font-size: 12px; line-height: 1.75; border-radius: 0 4px 4px 0; }
.notice.warning { border-color: var(--amber); background: var(--amber-dim); color: #d7bd9f; }
.notice.danger { border-color: var(--red); background: #df897a0a; color: #c9a69c; }

/* Consciousness, automation, science */
.crew-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.crew-card { padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: #0e1819; position: relative; display: flex; flex-direction: column; }
.crew-card.active, .crew-card.selected { border-color: rgba(231, 166, 106, .35); background: linear-gradient(145deg, #e7a66a07, transparent 55%), #101a1a; }
.crew-card.lost { opacity: .55; }
.crew-card .crew-id { color: var(--faint); font: 8px var(--mono); letter-spacing: .1em; }
.crew-card .crew-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.avatar-ascii { font: 12px/1.15 var(--mono); color: var(--sage); margin: 0 0 20px; min-height: 86px; display: flex; align-items: center; justify-content: center; text-shadow: 0 0 18px #91b7a51a; background: radial-gradient(ellipse at center, #91b7a509, transparent 70%); white-space: pre; }
.crew-card:nth-child(2n) .avatar-ascii { color: #b2a2c3; }
.crew-card:nth-child(3n) .avatar-ascii { color: var(--amber); }
.crew-card h3 { font-size: 22px; letter-spacing: -.03em; margin: 0 0 7px; font-weight: 400; }
.crew-role { color: var(--sage); font: 10px var(--mono); margin-bottom: 15px; }
.crew-card p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.health-bar { height: 3px; background: var(--sage-dim); border-radius: 3px; margin: 5px 0 17px; overflow: hidden; }
.health-bar > span { display: block; height: 100%; background: var(--sage); max-width: 100%; transition: width .4s; }
.health-bar.low > span { background: var(--red); }
.role-select, select { min-height: 38px; width: 100%; border: 1px solid var(--line-strong); background: #0c1515; color: var(--text); padding: 8px 12px; border-radius: 4px; font-size: 11px; }
.role-select { margin: 13px 0 0; }
.automation-row { display: flex; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.automation-row:first-child { padding-top: 0; border-top: 0; }
.automation-row:last-child { padding-bottom: 0; }
.automation-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--sage); background: var(--sage-dim); border: 1px solid var(--line); border-radius: 5px; flex-shrink: 0; }
.automation-icon svg { width: 19px; height: 19px; }
.automation-copy { flex: 1; }
.automation-copy h3 { font-size: 12px; margin: 0 0 5px; }
.automation-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.stepper { display: flex; align-items: center; gap: 10px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; }
.stepper .icon-button { width: 28px; height: 28px; font: 17px var(--mono); }
.stepper > span { font: 14px var(--mono); min-width: 18px; text-align: center; }
.tech-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tech-card { display: flex; flex-direction: column; min-height: 240px; padding: 22px; background: #0e1819; border: 1px solid var(--line); border-radius: 6px; position: relative; overflow: hidden; }
.tech-card::before { content: ""; position: absolute; height: 1px; left: 22px; right: 22px; top: 0; background: var(--sage); opacity: 0; }
.tech-card.available { border-color: rgba(145, 183, 165, .25); }
.tech-card.available::before { opacity: .65; }
.tech-card.unlocked { background: linear-gradient(145deg, #91b7a507, transparent), #0d1818; }
.tech-card.unlocked::before { opacity: .9; background: var(--amber); }
.tech-card.locked { background: #0c1516; }
.tech-card.locked h3, .tech-card.locked .tech-index { color: #809188; }
.tech-card.locked .button { margin-top: auto; }
.tech-index { font: 9px var(--mono); letter-spacing: .1em; color: var(--sage); margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.tech-index svg { width: 22px; height: 22px; opacity: .9; }
.tech-card h3 { font-size: 17px; font-weight: 400; letter-spacing: -.02em; margin: 0 0 12px; }
.tech-card p { color: var(--muted); font-size: 11px; line-height: 1.75; margin: 0 0 17px; }
.tech-prerequisite { color: var(--faint); font: 9px/1.6 var(--mono); margin: 0 0 15px; }
.cost-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font: 10px var(--mono); color: var(--sage); margin-top: auto; padding: 15px 0 14px; border-top: 1px solid var(--line); }
.cost-row > span { display: inline-flex; align-items: center; gap: 5px; }
.cost-row svg { width: 12px; height: 12px; }
.cost-row .insufficient { color: var(--red); }
.tech-card > .button { width: 100%; }
.research-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 25px; padding: 18px 0 23px; border-bottom: 1px solid var(--line); }
.research-summary .stat-value { font-size: 23px; }
.research-summary .stat { padding-left: 22px; }
.research-summary .stat:first-child { padding-left: 0; }
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr); gap: 18px; }
.two-column > .content-panel { margin-top: 0; }

/* Flight recorder and requests */
.journal-list { display: flex; flex-direction: column; }
.journal-entry { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; position: relative; padding: 0 0 24px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.journal-entry:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.journal-entry .log-time { color: var(--faint); font: 9px/1.9 var(--mono); padding-top: 2px; }
.journal-entry h3 { margin: 0 0 7px; font-size: 13px; line-height: 1.5; font-weight: 500; }
.journal-entry p { color: var(--muted); font-size: 12px; line-height: 1.75; margin: 0; }
.log-kind { display: inline-flex; align-items: center; gap: 5px; font: 8px var(--mono); letter-spacing: .08em; color: var(--sage); margin-bottom: 8px; text-transform: uppercase; }
.log-kind.warning, .log-kind.danger { color: var(--red); }
.log-kind.discovery, .log-kind.success { color: var(--amber); }
.contract-card { padding: 20px 0; border-top: 1px solid var(--line); }
.contract-card:first-child { padding-top: 0; border-top: 0; }
.contract-card:last-child { padding-bottom: 0; }
.contract-card h3 { font-size: 14px; margin: 0 0 7px; }
.contract-card p { color: var(--muted); font-size: 11px; line-height: 1.75; margin-bottom: 13px; }
.contract-card .contract-meta { display: flex; justify-content: space-between; gap: 14px; color: var(--faint); font: 9px var(--mono); margin-top: 10px; }
.contract-card.completed h3 { color: var(--sage); }
.contract-card.claimed { opacity: .5; }
.contract-card .card-actions { padding-top: 12px; }
.empty-state { padding: 55px 25px; color: var(--muted); text-align: center; max-width: 550px; margin: 0 auto; }
.empty-state > svg { width: 36px; height: 36px; color: var(--faint); margin: 0 auto 21px; }
.empty-state > pre { font-size: 14px; color: var(--sage); margin: 0 0 23px; }
.empty-state h2, .empty-state h3 { font-size: 20px; color: #c2cfc4; margin: 0 0 12px; font-weight: 400; }
.empty-state p { font-size: 12px; line-height: 1.8; margin-bottom: 20px; }
.empty-state .button { margin-top: 5px; }

/* Surface terminal */
.surface-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.surface-terminal { border: 1px solid var(--line); border-radius: 7px; background: #091314; overflow: hidden; }
.surface-terminal .map-toolbar { min-height: 49px; }
.surface-map { display: grid; grid-template-columns: repeat(var(--cols, 13), minmax(0, 1fr)); gap: 2px; width: min(100%, 640px); padding: 30px; margin: 0 auto; background: radial-gradient(ellipse at 50% 45%, #91b7a505, transparent 70%); user-select: none; touch-action: manipulation; }
.surface-cell { display: flex; justify-content: center; align-items: center; min-width: 0; width: 100%; aspect-ratio: 1; font: clamp(14px, 1.8vw, 24px)/1 var(--mono); color: #30473d; border-radius: 2px; border: 1px solid transparent; background: transparent; padding: 0; }
button.surface-cell:hover { background: #91b7a50c; border-color: #91b7a52b; }
.surface-cell.wall { color: #4a6457; background: #30483a1c; }
.surface-cell.sample { color: var(--amber); text-shadow: 0 0 11px #e7a66a52; background: #e7a66a05; }
.surface-cell.hazard { color: #bb7664; background: #df897a06; }
.surface-cell.shuttle { color: var(--blue); border: 1px solid #85b4c02b; background: #85b4c00b; }
.surface-cell.player { color: #d8efdc; background: #91b7a526; border: 1px solid #91b7a570; box-shadow: 0 0 16px #91b7a517; font-weight: 700; }
.surface-cell.unknown { color: #1a2b24; background: #091313; }
.surface-cell.ruin { color: #b8a4cf; background: #b8a4cf08; }
.surface-cell.path { color: #51715d; }
.surface-legend { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 17px; color: var(--muted); font: 10px var(--mono); }
.surface-legend b { margin-right: 5px; font-size: 13px; }
.surface-info { padding: 22px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.surface-info h3 { font-size: 18px; font-weight: 400; margin-bottom: 8px; }
.surface-info .eyebrow { font-size: 8px; }
.surface-info p { font-size: 11px; line-height: 1.75; color: var(--muted); }
.surface-info .action-stack { padding: 20px 0 0; }
.surface-info .tags { margin: 12px 0 18px; }
.surface-controls { margin: 20px 0 8px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; }
.dpad { display: grid; grid-template-columns: repeat(3, 39px); grid-template-rows: repeat(3, 36px); gap: 5px; }
.dpad .button, .dpad button { margin: 0; padding: 0; min-height: 0; border: 1px solid var(--line-strong); background: rgba(145, 183, 165, .055); border-radius: 4px; color: var(--sage); font: 16px var(--mono); display: grid; place-items: center; }
.dpad button:hover { background: rgba(145, 183, 165, .14); border-color: var(--sage); }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .center { grid-column: 2; grid-row: 2; color: var(--faint); font-size: 12px; border-color: transparent; background: transparent; cursor: default; }
.dpad .right { grid-column: 3; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 3; }
.surface-controls p { text-align: center; font: 9px/1.7 var(--mono); color: var(--faint); margin: 0; }
.oxygen-gauge { display: flex; align-items: flex-end; justify-content: space-between; margin: 20px 0 7px; }
.oxygen-gauge strong { color: var(--sage); font: 28px/1 var(--mono); }
.oxygen-gauge span { color: var(--muted); font: 9px var(--mono); }
.oxygen-gauge.low strong { color: var(--red); }
.surface-info .inventory { margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); }
.surface-info .inventory h4 { font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.surface-info .inventory > div { color: var(--sage); font-size: 11px; padding: 4px 0; }

/* Dialogs, onboarding and save tools */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3, 9, 10, .82); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade-in .2s ease; overflow-y: auto; }
.modal { width: min(100%, 610px); max-height: min(88svh, 900px); overflow-y: auto; background: #111c1d; border: 1px solid rgba(145, 183, 165, .22); border-radius: 10px; box-shadow: var(--shadow); position: relative; animation: modal-in .25s ease; }
.modal.wide { width: min(100%, 820px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 27px 28px 22px; gap: 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-weight: 400; font-size: 25px; letter-spacing: -.035em; margin: 0; }
.modal-header p { color: var(--muted); font-size: 12px; margin: 9px 0 0; }
.modal-header .eyebrow { font-size: 8px; }
.modal-header .icon-button { margin: -5px -5px 0 0; }
.modal-body { padding: 25px 28px; }
.modal-body > p { font-size: 13px; line-height: 1.8; color: #acbbb0; margin: 0 0 18px; }
.modal-body ul, .modal-body ol { padding-left: 20px; color: #a7b6ab; font-size: 12px; line-height: 1.9; }
.modal-body li + li { margin-top: 9px; }
.modal-body strong { color: var(--text); font-weight: 500; }
.modal-body .notice { margin: 20px 0 0; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; align-items: center; }
.modal-footer > small { margin-right: auto; font-size: 10px; color: var(--faint); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px; }
.help-grid > div { padding: 17px; border: 1px solid var(--line); border-radius: 5px; background: #0b1516; }
.help-grid h3 { color: var(--text); font-size: 13px; margin: 0 0 9px; font-weight: 500; }
.help-grid p { color: var(--muted); font-size: 11px; line-height: 1.75; margin: 0; }
.help-grid .help-number { color: var(--amber); font: 9px var(--mono); margin-bottom: 17px; }
.keycap { display: inline-flex; min-width: 20px; min-height: 20px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; background: #0d1718; color: #b5c6ba; font: 10px var(--mono); padding: 1px 5px; vertical-align: middle; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.settings-row:first-child { padding-top: 0; }
.settings-row:last-child { padding-bottom: 0; border-bottom: 0; }
.settings-row h3 { font-size: 12px; font-weight: 500; margin: 0 0 5px; }
.settings-row p { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0; }
.settings-row .button { flex-shrink: 0; }
.settings-row input[type="checkbox"] { accent-color: var(--sage); width: 16px; height: 16px; flex-shrink: 0; }
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.form-field input, .form-field textarea { width: 100%; min-height: 41px; padding: 10px 12px; background: #0a1415; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--text); font-size: 12px; }
.form-field textarea { min-height: 130px; resize: vertical; font-family: var(--mono); line-height: 1.6; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--faint); }
.form-field small { display: block; font-size: 10px; color: var(--faint); margin-top: 7px; line-height: 1.6; }
.intro-banner { padding: 17px 20px; margin: 0 0 20px; border: 1px solid rgba(231, 166, 106, .2); background: linear-gradient(105deg, rgba(231, 166, 106, .075), transparent); border-radius: 6px; display: flex; gap: 16px; align-items: center; }
.intro-banner h3 { font-size: 13px; margin: 0 0 4px; font-weight: 500; }
.intro-banner p { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 0; }
.intro-banner .intro-symbol { color: var(--amber); font: 25px var(--mono); flex-shrink: 0; }
.intro-banner .button { margin-left: auto; flex-shrink: 0; }
.victory-emblem { color: var(--amber); font: 15px/1.4 var(--mono); text-align: center; margin: 5px 0 25px; white-space: pre; text-shadow: 0 0 25px rgba(231, 166, 106, .1); }
.victory-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-block: 1px solid var(--line); padding: 20px 0; margin: 20px 0; }
.victory-stats strong { display: block; font: 25px var(--mono); color: var(--amber); }
.victory-stats span { font-size: 10px; color: var(--muted); display: block; margin-top: 8px; }
.toast-stack { position: fixed; bottom: 62px; right: 25px; z-index: 150; width: min(380px, calc(100vw - 40px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { position: relative; border: 1px solid rgba(145, 183, 165, .28); border-left: 2px solid var(--sage); border-radius: 5px; background: #182423; color: #c4d4c8; padding: 14px 17px; font-size: 12px; line-height: 1.65; box-shadow: 0 5px 30px #0004; animation: toast-in .25s ease; pointer-events: auto; }
.toast.error { border-left-color: var(--red); border-color: rgba(223, 137, 122, .3); background: #271e1b; color: #e2bcb2; }
.toast.success { border-left-color: var(--amber); color: #e6d2b8; }
.toast button { float: right; margin: -5px -5px 0 10px; }

/* Tablet and compact desktop */
@media (min-width: 1600px) {
  .workspace { padding: 32px 40px; }
  .topbar, .eventbar { padding-inline: 40px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; }
  .panel-head { padding: 25px 26px 0; }
  .system-stats { margin-inline: 26px; }
  .system-description { padding-inline: 26px; }
  .action-stack { padding: 24px 26px; }
  .objective-card { padding-inline: 26px; }
  .system-art { height: 185px; }
  .star-map { height: clamp(500px, 58vh, 800px); }
  .star-label { font-size: 10px; }
}
@media (max-width: 1250px) {
  .topbar { padding-inline: 23px; gap: 17px; }
  .resource-strip { gap: 17px; }
  .resource { min-width: 62px; column-gap: 7px; }
  .resource-number { font-size: 13px; }
  .resource-label { font-size: 8px; }
  .topbar-actions { padding-left: 15px; gap: 8px; }
  .save-indicator { font-size: 8px; }
  .expedition-id > strong { font-size: 11px; }
  .expedition-id > small, .expedition-id > span { font-size: 8px; }
  .workspace { padding: 24px 23px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 15px; }
  .panel-head { padding: 20px 19px 0; }
  .system-stats { margin-inline: 19px; }
  .system-description { padding-inline: 19px; font-size: 11px; }
  .action-stack { padding: 19px; }
  .objective-card { padding-inline: 19px; }
  .system-name { font-size: 25px; }
  .map-caption { padding: 13px 16px; }
  .map-caption > small { display: none; }
  .map-legend { gap: 11px; font-size: 8px; }
  .star-label { font-size: 8px; }
  .star-distance { font-size: 7px; }
  .planet-grid, .tech-grid { gap: 13px; }
  .planet-card, .tech-card, .crew-card { padding: 19px; }
  .crew-grid { gap: 13px; }
  .eventbar { padding-inline: 23px; }
}
@media (max-width: 1050px) {
  .save-indicator { display: none; }
  .topbar-actions { padding-left: 12px; }
  .resource-strip { gap: 13px; }
  .resource { grid-template-columns: 1fr; min-width: 56px; }
  .resource-icon { display: none; }
  .resource-meter { grid-column: 1; width: 53px; }
  .resource-number { font-size: 13px; }
  .expedition-id { max-width: 165px; }
  .expedition-id > strong { font-size: 10px; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 276px; gap: 13px; }
  .map-toolbar { gap: 10px; padding-inline: 15px; }
  .map-meta { font-size: 8px; gap: 6px; }
  .page-heading { margin-bottom: 20px; }
  .page-title { font-size: 28px; }
  .heading-actions { gap: 6px; }
  .heading-actions .button { padding-inline: 10px; font-size: 10px; }
  .map-legend { gap: 10px; }
  .map-caption { flex-wrap: wrap; }
  .star-node { padding-inline: 7px; }
  .planet-grid, .crew-grid, .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .surface-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 13px; }
  .surface-map { padding: 20px; }
  .surface-info { padding: 18px; }
  .two-column { grid-template-columns: minmax(0, 1fr); }
  .mission-strip { gap: 13px; padding: 14px 17px; }
  .mission-strip .progress-track { display: none; }
}
@media (max-width: 880px) and (min-width: 761px) {
  .topbar { gap: 12px; padding-inline: 20px; }
  .expedition-id { max-width: 120px; }
  .expedition-id > strong { font-size: 9px; line-height: 1.6; }
  .resource-strip { gap: 12px; }
  .resource { min-width: 44px; }
  .resource-number { font-size: 12px; }
  .resource-meter { width: 43px; }
  .topbar-actions { border: 0; padding-left: 0; gap: 2px; margin-left: 0; }
  .topbar-actions .icon-button { width: 27px; }
  .workspace { padding-inline: 20px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .map-panel { min-height: 500px; }
  .star-map { min-height: 390px; height: 440px; }
  .star-label { font-size: 9px; }
  .side-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .side-panel .panel-head { grid-column: 1; }
  .side-panel .system-art { grid-column: 1; grid-row: 2 / 4; height: 130px; }
  .side-panel .system-stats { grid-column: 2; grid-row: 1; align-self: center; border-top: 0; }
  .side-panel .system-description { grid-column: 2; grid-row: 2; }
  .side-panel .action-stack { grid-column: 2; grid-row: 3 / 5; }
  .side-panel .objective-card { grid-column: 1 / 3; }
  .side-panel .tags { grid-column: 1; grid-row: 4; padding-bottom: 18px; }
}

/* A real hand-held control panel */
@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: calc(67px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 0 0; width: 100%; height: calc(67px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid rgba(145, 183, 165, .22); background: rgba(8, 14, 15, .97); backdrop-filter: blur(18px); flex-direction: row; align-items: center; z-index: 50; }
  .brand-mark, .sidebar-foot { display: none; }
  .nav-list { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; padding: 0 5px; }
  .nav-item { width: auto; flex: 1; min-width: 0; min-height: 60px; gap: 6px; padding: 9px 2px; border-radius: 0; }
  .nav-item.active { background: transparent; }
  .nav-item.active::before { top: -3px; left: 25%; right: 25%; bottom: auto; width: auto; height: 2px; }
  .nav-icon, .nav-icon svg { width: 20px; height: 20px; }
  .nav-label { font-size: 9px; }
  .main-shell { min-height: calc(100svh - 67px); }
  .topbar { min-height: 116px; padding: 14px 19px 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .expedition-id { max-width: none; display: flex; align-items: center; gap: 11px; }
  .expedition-id > strong { font-size: 10px; letter-spacing: .13em; }
  .expedition-id > span, .expedition-id > small { font-size: 8px; margin: 0; }
  .expedition-id::before { content: "✧"; color: var(--amber); font: 21px/1 var(--mono); }
  .topbar-actions { grid-column: 2; grid-row: 1; padding-left: 0; margin: 0; border: 0; gap: 4px; }
  .topbar-actions .icon-button { width: 26px; height: 26px; }
  .topbar-actions .icon-button svg { width: 16px; height: 16px; }
  .resource-strip { grid-column: 1 / 3; grid-row: 2; display: flex; justify-content: space-between; width: 100%; gap: 10px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); }
  .resource { min-width: 48px; grid-template-columns: 13px auto; column-gap: 6px; }
  .resource-icon { display: block; grid-row: 1; align-self: center; }
  .resource-icon svg { width: 12px; height: 12px; }
  .resource-number { font-size: 12px; }
  .resource-number small { font-size: 8px; }
  .resource-label { font-size: 8px; grid-column: 1 / 3; margin-top: 3px; }
  .resource-meter { display: none; }
  .workspace { padding: 24px 18px 22px; }
  .page-heading { gap: 14px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-start; }
  .page-title { font-size: 28px; letter-spacing: -.045em; }
  .page-subtitle { font-size: 11px; line-height: 1.7; margin-top: 8px; }
  .eyebrow { font-size: 8px; letter-spacing: .15em; margin-bottom: 7px; }
  .heading-actions { align-self: center; flex-wrap: wrap; gap: 7px; }
  .heading-actions .button { min-height: 32px; font-size: 10px; padding: 7px 10px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .map-panel { min-height: 470px; border-radius: 6px; }
  .map-toolbar { min-height: 45px; padding: 10px 13px; gap: 10px; }
  .map-toolbar h2, .map-toolbar h3 { font-size: 10px; }
  .map-meta { font-size: 8px; gap: 6px; }
  .star-map { min-height: 390px; height: 420px; aspect-ratio: auto; }
  .star-node { padding: 13px 5px 9px; min-width: 34px; min-height: 38px; }
  .star-label { font-size: 8px; }
  .star-distance { font-size: 7px; margin-top: 3px; }
  .star-dot { width: 5px; height: 5px; margin-bottom: 7px; }
  .star-node.selected .star-dot { width: 7px; height: 7px; }
  .star-node.selected .star-dot::before { width: 27px; height: 27px; }
  .star-node.selected .star-dot::after { inset: -14px; }
  .star-node.current .star-dot { width: 7px; height: 7px; }
  .star-node.current .star-dot::before { width: 23px; height: 23px; }
  .coordinate-label { font-size: 6px; }
  .coordinate-label.top-left, .coordinate-label.bottom-left { left: 13px; }
  .coordinate-label.top-right, .coordinate-label.bottom-right { right: 13px; }
  .map-caption { min-height: 45px; padding: 12px 13px; }
  .map-legend { gap: 12px; row-gap: 9px; font-size: 7px; }
  .map-legend > span { gap: 5px; }
  .map-controls { right: 11px; bottom: 12px; }
  .map-controls .icon-button { width: 28px; height: 28px; }
  .map-status { left: 13px; bottom: 16px; font-size: 7px; }
  .ship-marker { font-size: 7px; }
  .side-panel { border-radius: 6px; }
  .panel-head { padding: 22px 22px 0; }
  .system-name { font-size: 28px; }
  .system-art { height: 145px; }
  .system-stats { margin-inline: 22px; padding-block: 17px; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 10px; }
  .system-description { padding: 18px 22px 0; font-size: 12px; line-height: 1.8; }
  .action-stack { padding: 20px 22px; }
  .action-stack .button { min-height: 43px; }
  .action-hint { font-size: 10px; }
  .objective-card { padding: 18px 22px; }
  .objective-card h3 { font-size: 13px; }
  .objective-card p { font-size: 11px; }
  .mission-strip { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .mission-strip .mission-copy { min-width: 200px; }
  .mission-strip .button { margin-left: 34px; }
  .mission-strip h3 { font-size: 12px; }
  .mission-strip p { font-size: 10px; }
  .eventbar { padding: 13px 18px; min-height: 42px; gap: 11px; font-size: 8px; align-items: flex-start; }
  .event-text { white-space: normal; line-height: 1.7; }
  .event-label { padding-top: 2px; }
  .event-time { display: none; }
  .content-panel { padding: 20px; border-radius: 6px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; margin-bottom: 19px; gap: 12px; }
  .section-heading h2, .section-heading h3 { font-size: 19px; }
  .section-heading p { line-height: 1.7; }
  .planet-grid, .crew-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .planet-card { padding: 22px; }
  .planet-orb { width: 76px; height: 76px; }
  .planet-info h3 { font-size: 22px; }
  .planet-info p { font-size: 12px; }
  .planet-card .button { min-height: 42px; }
  .crew-card { padding: 22px; }
  .crew-card .avatar-ascii { font-size: 13px; min-height: 90px; }
  .crew-card h3 { font-size: 24px; }
  .crew-card p { font-size: 12px; }
  .crew-card .card-actions .button { min-height: 41px; }
  .detail-row { font-size: 12px; }
  .detail-row > :last-child { font-size: 11px; }
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tech-card { padding: 18px; min-height: 260px; }
  .tech-card h3 { font-size: 16px; }
  .tech-card p { font-size: 11px; }
  .tech-index { margin-bottom: 21px; font-size: 8px; }
  .tech-card .button { font-size: 11px; padding-inline: 9px; }
  .cost-row { gap: 9px; font-size: 9px; }
  .research-summary { gap: 12px; margin-bottom: 20px; }
  .research-summary .stat { padding-left: 12px; }
  .research-summary .stat-value { font-size: 22px; }
  .research-summary .stat-label { font-size: 9px; }
  .tab-row { gap: 22px; overflow-x: auto; margin-bottom: 20px; }
  .tab-button { font-size: 11px; padding-bottom: 13px; }
  .sample-card { grid-template-columns: 35px minmax(0, 1fr); gap: 12px; padding-block: 19px; }
  .sample-symbol { width: 35px; height: 39px; font-size: 19px; }
  .sample-card .button, .sample-card > .sample-value { grid-column: 2; justify-self: start; }
  .sample-card .sample-value { font-size: 14px; text-align: left; }
  .sample-card .sample-value small { display: inline-block; margin: 0 0 0 5px; }
  .sample-card h3 { font-size: 13px; }
  .sample-card p { font-size: 11px; }
  .journal-entry { grid-template-columns: 53px minmax(0, 1fr); gap: 12px; }
  .journal-entry .log-time { font-size: 8px; }
  .journal-entry p { font-size: 11px; }
  .journal-entry h3 { font-size: 12px; }
  .automation-row { gap: 12px; flex-wrap: wrap; }
  .automation-icon { width: 35px; height: 35px; }
  .automation-copy { min-width: 170px; }
  .automation-row .stepper { margin-left: 47px; }
  .surface-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .surface-map { width: 100%; gap: 1px; padding: 18px 12px; }
  .surface-cell { font-size: clamp(13px, 4.2vw, 24px); }
  .surface-legend { gap: 12px; row-gap: 9px; padding: 13px; font-size: 9px; }
  .surface-info { padding: 22px; }
  .surface-info h3 { font-size: 21px; }
  .surface-info p { font-size: 12px; }
  .surface-controls { margin-block: 23px 10px; }
  .dpad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 45px); gap: 6px; }
  .dpad .button, .dpad button { font-size: 20px; }
  .surface-controls p { font-size: 10px; }
  .surface-info .action-stack .button { min-height: 44px; }
  .modal-backdrop { padding: 16px; }
  .modal { max-height: 90svh; border-radius: 8px; }
  .modal-header { padding: 23px 22px 19px; }
  .modal-header h2 { font-size: 23px; }
  .modal-body { padding: 21px 22px; }
  .modal-body > p { font-size: 12px; }
  .modal-footer { padding: 18px 22px; }
  .modal-footer .button { min-height: 42px; }
  .help-grid { gap: 12px; }
  .help-grid > div { padding: 14px; }
  .help-grid h3 { font-size: 12px; }
  .help-grid p { font-size: 10px; }
  .settings-row { gap: 15px; flex-wrap: wrap; }
  .settings-row > div { min-width: 150px; flex: 1; }
  .settings-row .button { font-size: 10px; }
  .intro-banner { padding: 15px; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .intro-banner > div:not(.intro-symbol) { flex: 1; min-width: 200px; }
  .intro-banner .button { margin-left: 35px; }
  .intro-banner h3 { font-size: 12px; }
  .intro-banner p { font-size: 11px; }
  .toast-stack { bottom: calc(85px + env(safe-area-inset-bottom)); right: 15px; width: calc(100vw - 30px); }
  .toast { padding: 13px 15px; font-size: 12px; }
}
@media (max-width: 420px) {
  .workspace { padding-inline: 14px; }
  .topbar { padding-inline: 15px; }
  .expedition-id > strong { font-size: 9px; }
  .expedition-id > span, .expedition-id > small { font-size: 7px; }
  .expedition-id { gap: 8px; }
  .resource-strip { gap: 7px; }
  .resource { min-width: 45px; column-gap: 4px; }
  .resource-number { font-size: 11px; }
  .resource-label { font-size: 7px; }
  .resource-icon svg { width: 11px; height: 11px; }
  .page-title { font-size: 26px; }
  .page-heading { margin-bottom: 18px; }
  .map-meta { font-size: 7px; }
  .star-map { height: 400px; min-height: 375px; }
  .map-legend { gap: 10px; }
  .star-label { font-size: 7px; }
  .star-distance { font-size: 6px; }
  .star-node { padding-inline: 3px; }
  .tech-grid { grid-template-columns: minmax(0, 1fr); }
  .tech-card { min-height: 0; padding: 21px; }
  .tech-card h3 { font-size: 19px; }
  .tech-card p { font-size: 12px; }
  .tech-index { margin-bottom: 17px; }
  .cost-row { font-size: 10px; gap: 15px; }
  .tech-card .button { min-height: 41px; }
  .help-grid { grid-template-columns: minmax(0, 1fr); }
  .help-grid .help-number { margin-bottom: 9px; }
  .help-grid p { font-size: 11px; }
  .eventbar { padding-inline: 15px; }
  .event-label { font-size: 7px; gap: 5px; }
  .modal-header, .modal-body, .modal-footer { padding-inline: 19px; }
  .modal-footer > small { width: 100%; margin-bottom: 3px; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes route-flow { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
