@font-face {
  font-family: 'Press Start 2P';
  src: url('/fonts/press-start-2p.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'VT323';
  src: url('/fonts/vt323.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #14170f;
  --bg-2: #1b2015;
  --panel: #1c2417;
  --panel-2: #222c1b;
  --panel-3: #161d11;
  --line: #38472a;
  --line-soft: #2a3620;
  --ink: #d9e7b8;
  --ink-2: #b7c99a;
  --dim: #84956d;
  --dim-2: #66754f;
  --lime: #9bbc0f;
  --lime-2: #c3d94a;
  --magenta: #b3306a;
  --magenta-2: #e0508a;
  --amber: #d9a441;
  --red: #d25050;
  --green: #7ec850;

  --plastic: #d8d5c6;
  --plastic-2: #c2bfb0;
  --plastic-3: #a5a294;
  --plastic-ink: #3a3a33;

  --screen: #0f380f;
  --screen-2: #306230;
  --screen-3: #8bac0f;
  --screen-4: #9bbc0f;

  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --body: 'VT323', ui-monospace, 'Courier New', monospace;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -15%, #2b3a1f 0%, #1a2113 45%, #0e1209 100%);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.35;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(155, 188, 15, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 188, 15, 0.028) 1px, transparent 1px);
  background-size: 22px 22px;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.42) 100%);
  z-index: 0;
}

.hidden { display: none !important; }
button { font-family: inherit; }
a { color: var(--lime-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #10150c; }
::-webkit-scrollbar-thumb { background: #3c4a2c; border: 2px solid #10150c; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #52663a; }

::selection { background: var(--lime); color: #0f380f; }

/* ── Boot ────────────────────────────────────────────────────────────────── */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, #17310f 0%, #0a1507 70%, #050a03 100%);
  transition: opacity 380ms ease;
}
.boot.off { opacity: 0; pointer-events: none; }

.boot-screen {
  width: min(460px, 82vw);
  text-align: center;
  padding: 34px 20px;
  border: 3px solid #2f4a1d;
  border-radius: 6px;
  background: #0b1808;
  box-shadow: 0 0 0 6px #101d0a, 0 0 70px rgba(155, 188, 15, 0.18);
  position: relative;
  overflow: hidden;
}
.boot-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.boot-logo {
  font-family: var(--pixel);
  font-size: clamp(20px, 5vw, 32px);
  letter-spacing: 0.04em;
  color: var(--lime-2);
  text-shadow: 3px 3px 0 #0f380f, 6px 6px 0 rgba(0, 0, 0, 0.4);
  line-height: 1.3;
}
.boot-logo span { display: block; color: #e8f4c4; }

.boot-sub {
  margin-top: 18px;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.18em;
  color: #6f8a4d;
}

.boot-cart {
  width: 46px;
  height: 54px;
  margin: 26px auto 18px;
  position: relative;
  background: linear-gradient(180deg, #dedbcb, #bcb9a8);
  border: 3px solid #0b1808;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--lime), 0 8px 18px rgba(0, 0, 0, 0.4);
}
.boot-cart::before {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 6px;
  height: 18px;
  background: var(--lime);
  border: 2px solid #0f380f;
  box-shadow: inset 0 0 0 2px rgba(15, 56, 15, 0.18);
}
.boot-cart::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 6px;
  height: 9px;
  background: repeating-linear-gradient(90deg, #3a3a33 0 3px, #cfccbc 3px 6px);
}
.boot-cart i {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 12px;
  height: 2px;
  margin-left: -6px;
  background: #0f380f;
  box-shadow: 0 -4px 0 #0f380f, 0 4px 0 #0f380f;
}

.boot-press {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: var(--lime);
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 12px 18px;
  cursor: pointer;
}
.boot-press:hover { color: #e8ff9a; }
.boot-press .blink {
  width: 46px;
  height: 3px;
  background: currentColor;
  animation: blink 1.1s steps(2, start) infinite;
}

.boot-demo {
  margin-top: 18px;
  font-family: var(--pixel);
  font-size: 6px;
  color: #6b7d52;
  letter-spacing: 0.1em;
}

.boot-hint {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--pixel);
  font-size: 6px;
  color: #3f5133;
  letter-spacing: 0.18em;
}

/* ── Login ───────────────────────────────────────────────────────────────── */

.login {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #16220f, #080c05 75%);
  padding: 20px;
}
.login-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.login-logo { font-family: var(--pixel); font-size: 16px; color: var(--lime); margin-bottom: 20px; }
.login-logo span { color: var(--ink); }
.login-card h1 { font-family: var(--pixel); font-size: 10px; margin: 0 0 8px; color: var(--ink); }
.login-card p { margin: 0 0 18px; color: var(--dim); font-size: 17px; }
.login-error { color: var(--magenta-2); min-height: 20px; font-size: 16px; margin: 10px 0 0; }
.login-card input { height: 44px; font-size: 19px; letter-spacing: 0.05em; border: 2px solid #4f6338; background: #131c0d; }
.login-card .btn { margin-top: 6px; }

/* ── App shell ───────────────────────────────────────────────────────────── */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 64px;
  padding: 0 22px;
  background: rgba(17, 22, 13, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-glyph {
  display: grid;
  grid-template-columns: 8px 8px;
  grid-template-rows: 8px 8px;
  gap: 2px;
  transform: rotate(0deg);
}
.brand-glyph i { background: var(--lime); display: block; }
.brand-glyph i:nth-child(2) { background: var(--magenta-2); }
.brand-glyph i:nth-child(3) { background: var(--dim-2); }
.brand-glyph i:nth-child(4) { background: var(--lime-2); }

.brand-text { font-family: var(--pixel); font-size: 12px; letter-spacing: 0.04em; color: var(--ink); white-space: nowrap; }
.brand-text b { color: var(--lime); }
.brand-sub {
  font-family: var(--pixel);
  font-size: 5px;
  color: var(--dim-2);
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 30px;
  border-left: 1px solid var(--line);
  padding-left: 6px;
}

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-btn {
  position: relative;
  background: none;
  border: 0;
  color: var(--dim);
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 12px 14px;
  cursor: pointer;
  transition: color 120ms;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.active { color: var(--lime); }
.nav-btn.active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--lime);
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.chip {
  white-space: nowrap;
  background: #121809;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.06em;
  padding: 9px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.chip:hover { border-color: var(--lime); color: var(--lime-2); }
.chip-icon { font-family: var(--body); font-size: 16px; padding: 5px 9px; line-height: 1; }
.badge {
  font-family: var(--pixel);
  font-size: 6px;
  letter-spacing: 0.1em;
  padding: 6px 7px;
  border-radius: 3px;
  border: 1px solid;
}
.badge-demo { color: #0f1a06; background: var(--amber); border-color: #efbe63; }
.badge-live { color: #0b1a08; background: var(--green); border-color: #a4e37c; }

/* ── Layout ──────────────────────────────────────────────────────────────── */

.layout {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 20px 22px 26px;
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr) 404px;
  gap: 18px;
  align-items: start;
  flex: 1;
}

.col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-left { position: sticky; top: 84px; max-height: calc(100vh - 150px); overflow-y: auto; padding-right: 2px; }
.col-right { position: sticky; top: 84px; }

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.tick { width: 6px; height: 12px; background: var(--lime); display: inline-block; }
.count {
  margin-left: auto;
  font-family: var(--pixel);
  font-size: 7px;
  color: var(--dim);
  background: #121809;
  border: 1px solid var(--line);
  padding: 4px 6px;
  border-radius: 3px;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span {
  font-family: var(--pixel);
  font-size: 6px;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}
input, textarea, select {
  width: 100%;
  background: #0f1409;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  padding: 7px 9px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
textarea { resize: vertical; min-height: 82px; line-height: 1.25; }
input:focus, textarea:focus, select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(155, 188, 15, 0.18);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--lime) 50%), linear-gradient(135deg, var(--lime) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 24px; }
input[type='number'] { font-family: var(--pixel); font-size: 9px; height: 36px; }
.row2 { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #26321c;
  border: 1px solid #465834;
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 80ms, filter 120ms, border-color 120ms;
}
.btn:hover { border-color: var(--lime); color: var(--lime-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--magenta);
  border-color: #d94a84;
  color: #fff4f8;
  box-shadow: 0 3px 0 #6f1a3f, inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 12px;
}
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #6f1a3f; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--dim); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink-2); }
.btn.danger { background: #3a1b22; border-color: #7d3146; color: #f2b6c6; }
.btn.wide { width: 100%; }
.btn.small { padding: 8px 9px; font-size: 6px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Queue ───────────────────────────────────────────────────────────────── */

.queue { display: flex; flex-direction: column; gap: 8px; }
.queue-empty { color: var(--dim-2); font-size: 16px; padding: 8px 2px 12px; }

.mission-card {
  text-align: left;
  width: 100%;
  background: #151c0f;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--line);
  border-radius: 4px;
  padding: 9px 10px;
  cursor: pointer;
  color: inherit;
  transition: border-color 120ms, background 120ms;
}
.mission-card:hover, .mission-card.selected { background: #1b2413; border-color: var(--line); }
.mission-card.selected { border-left-color: var(--lime); }
.mission-card .mc-top { display: flex; align-items: center; gap: 7px; }
.mission-card .mc-title {
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.5;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mission-card .mc-meta {
  display: flex;
  gap: 8px;
  margin-top: 5px;
  font-size: 14px;
  color: var(--dim);
  align-items: center;
}
.mission-card .mc-meta b { color: var(--ink-2); font-weight: 400; }
.mc-bar { height: 3px; background: #0d1208; margin-top: 7px; border-radius: 2px; overflow: hidden; }
.mc-bar i { display: block; height: 100%; background: var(--lime); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim-2); flex: 0 0 auto; }
.dot.running { background: var(--lime); animation: pulse 1.4s infinite; }
.dot.queued { background: var(--amber); }
.dot.done { background: var(--green); }
.dot.failed, .dot.blocked { background: var(--magenta-2); }
.dot.stopped, .dot.paused { background: var(--dim-2); }

/* ── Supervisors ─────────────────────────────────────────────────────────── */

.supervisors { display: flex; flex-direction: column; gap: 10px; }
.sup-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; }
.sup-row canvas { width: 30px; height: 30px; image-rendering: pixelated; }
.sup-name { font-family: var(--pixel); font-size: 6px; color: var(--ink-2); letter-spacing: 0.08em; }
.sup-sub { font-size: 14px; color: var(--dim); line-height: 1.1; }
.sup-val { font-family: var(--pixel); font-size: 7px; color: var(--lime); text-align: right; }
.sup-val.warn { color: var(--amber); }
.sup-val.bad { color: var(--magenta-2); }

/* ── Console ─────────────────────────────────────────────────────────────── */

.col-center { align-items: center; }

.console {
  width: 100%;
  max-width: 760px;
  padding: 16px 18px 20px;
  border-radius: 18px 18px 52px 18px;
  background:
    linear-gradient(155deg, #e3e0d2 0%, #d3d0c1 38%, #c3c0b1 78%, #b7b4a5 100%);
  border: 1px solid #a8a596;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -8px 0 rgba(120, 117, 105, 0.45),
    inset 8px 0 14px rgba(255, 255, 255, 0.15),
    0 30px 60px rgba(0, 0, 0, 0.55);
  position: relative;
}
.console::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 5px);
  pointer-events: none;
  opacity: 0.5;
}

.console-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 10px;
}
.console-label {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--plastic-ink);
  letter-spacing: 0.04em;
}
.console-label b { color: #7a1a45; }
.console-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b1a1a;
  box-shadow: inset 0 0 0 1px #4a1010;
}
.console-led.on { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d, inset 0 0 0 1px #8a1f1f; }
.console-micro {
  margin-left: auto;
  font-family: var(--pixel);
  font-size: 4px;
  color: #85826f;
  letter-spacing: 0.12em;
}

.screen-bezel {
  background: linear-gradient(180deg, #31312b, #24241f 60%, #1c1c18);
  border-radius: 8px 8px 26px 8px;
  padding: 12px 12px 16px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.8),
    inset 0 -2px 0 rgba(255, 255, 255, 0.06),
    0 2px 0 rgba(255, 255, 255, 0.5);
}

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  background: var(--screen);
  border-radius: 4px 4px 14px 4px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px #0a1a0a,
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(155, 188, 15, 0.1);
  isolation: isolate;
}
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px 0;
  pointer-events: none;
  z-index: 3;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
}
.hud-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hud-mission {
  font-family: var(--pixel);
  font-size: 7px;
  color: #dff0a8;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}
.hud-sub {
  font-family: var(--pixel);
  font-size: 5px;
  color: #9fbb6c;
  letter-spacing: 0.1em;
}
.hud-right { display: flex; align-items: center; gap: 6px; }
.hud-credits {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--screen-4);
}
.hud-coin {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--screen-4);
  box-shadow: inset 0 0 0 2px var(--screen-2), inset 0 0 0 3px var(--screen-3);
}

.phasebar {
  position: absolute;
  bottom: 118px;
  right: 12px;
  left: auto;
  display: flex;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 70%;
}
.phase-chip {
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: 0.06em;
  padding: 3px 5px;
  border: 1px solid rgba(155, 188, 15, 0.35);
  color: #93b35e;
  background: rgba(15, 56, 15, 0.6);
  border-radius: 2px;
}
.phase-chip.done { color: #cfe69a; border-color: rgba(195, 217, 74, 0.6); background: rgba(48, 98, 48, 0.55); }
.phase-chip.active { color: #0f380f; background: var(--screen-4); border-color: var(--screen-4); }

.dialog {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  z-index: 4;
  min-height: 88px;
  background: var(--screen-4);
  border: 3px solid var(--screen);
  border-radius: 5px;
  padding: 12px 12px 8px;
  color: var(--screen);
  box-shadow:
    0 0 0 1px rgba(15, 56, 15, 0.4),
    0 6px 0 rgba(0, 0, 0, 0.22);
}
.dialog-name {
  position: absolute;
  top: -13px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--screen);
  color: var(--screen-4);
  font-family: var(--pixel);
  font-size: 6px;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  border-radius: 2px;
}
.dialog-name i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--screen-3);
  display: inline-block;
}
.dialog-name i.live { background: #e8ff9a; animation: blink 1s steps(2) infinite; }
.dialog-text {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
  min-height: 42px;
  max-height: 63px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.dialog-text .caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--screen);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 0.9s steps(2) infinite;
}
.dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
  font-family: var(--pixel);
  font-size: 5px;
  color: #2c542c;
  letter-spacing: 0.06em;
}
.dialog-hint { color: #2c542c; }

.screen-fx {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: repeating-linear-gradient(rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
.screen-glare {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 45%);
}
.screen.glitch { animation: glitch 240ms steps(2); }

/* Console controls */
.console-body {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 8px 6px;
}
.controls { display: flex; align-items: center; gap: 18px; flex: 1; }

.dpad {
  position: relative;
  width: 74px;
  height: 74px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}
.dp {
  background: linear-gradient(180deg, #3b3b35, #26261f);
  border: 0;
  color: #8c8c80;
  font-size: 8px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.dp:hover { color: var(--lime-2); }
.dp:active { background: #1c1c17; }
.dp.up { grid-area: 1 / 2; border-radius: 4px 4px 0 0; }
.dp.left { grid-area: 2 / 1; border-radius: 4px 0 0 4px; }
.dp.right { grid-area: 2 / 3; border-radius: 0 4px 4px 0; }
.dp.down { grid-area: 3 / 2; border-radius: 0 0 4px 4px; }
.dp-center {
  grid-area: 2 / 2;
  background: linear-gradient(180deg, #33332d, #26261f);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ab { display: flex; align-items: center; gap: 12px; transform: rotate(-12deg); margin-top: 6px; }
.round {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, #d75a90, #a52a61 55%, #7c1a45);
  color: #ffe9f2;
  font-family: var(--pixel);
  font-size: 9px;
  cursor: pointer;
  box-shadow: 0 4px 0 #5c1232, 0 7px 12px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.25);
  transition: transform 70ms, box-shadow 70ms;
}
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 #5c1232, inset 0 2px 4px rgba(0, 0, 0, 0.3); }
.round.a { width: 50px; height: 50px; margin-bottom: 8px; }
.round.b { width: 38px; height: 38px; }

.startsel { display: flex; flex-direction: column; gap: 8px; margin-left: auto; margin-right: 12px; }
.pill {
  background: linear-gradient(180deg, #55554c, #3a3a33);
  border: 0;
  border-radius: 12px;
  color: #c9c9bd;
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: 0.1em;
  padding: 7px 12px;
  transform: rotate(-24deg);
  cursor: pointer;
  box-shadow: 0 2px 0 #22221d;
}
.pill:hover { color: #fff; }
.pill:active { transform: rotate(-24deg) translateY(2px); box-shadow: none; }

.speaker { display: flex; gap: 3px; transform: rotate(-18deg); padding-right: 8px; }
.speaker i { display: block; width: 3px; height: 34px; border-radius: 2px; background: #8f8c7d; box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.35), 1px 0 1px rgba(0, 0, 0, 0.25); }

.console-foot {
  text-align: center;
  font-family: var(--pixel);
  font-size: 4.5px;
  color: #8a8778;
  letter-spacing: 0.18em;
  padding-top: 4px;
}

.console-note {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
  font-family: var(--pixel);
  font-size: 5.5px;
  color: var(--dim-2);
  letter-spacing: 0.1em;
}
.note-dot { color: var(--line); }

/* ── Right panel ─────────────────────────────────────────────────────────── */

.panel-tabs { padding: 0; overflow: hidden; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.tabbar { display: flex; border-bottom: 1px solid var(--line); background: #151b10; }
.tab {
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-family: var(--pixel);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  padding: 13px 4px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--lime); border-bottom-color: var(--lime); background: rgba(155, 188, 15, 0.05); }
.tab-body { padding: 13px; overflow-y: auto; flex: 1; }

.crew-list { display: flex; flex-direction: column; }
.crew-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 6px;
  border-bottom: 1px dashed var(--line-soft);
  cursor: pointer;
  border-radius: 4px;
  transition: background 120ms;
}
.crew-row:hover { background: #1e2817; }
.crew-row:last-child { border-bottom: 0; }
.crew-row canvas { width: 40px; height: 40px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4)); }
.crew-name { display: flex; align-items: baseline; gap: 6px; }
.crew-name b { font-family: var(--pixel); font-size: 7px; font-weight: 400; color: var(--ink); }
.crew-species { font-family: var(--pixel); font-size: 5px; color: var(--lime); letter-spacing: 0.06em; }
.crew-role { font-size: 14px; color: var(--dim); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.crew-role .state { color: var(--lime-2); }
.crew-bars { margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.bar { height: 4px; background: #0d1208; border-radius: 2px; flex: 1; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--lime); }
.bar i.low { background: var(--magenta-2); }
.bar i.mid { background: var(--amber); }
.crew-hp { font-family: var(--pixel); font-size: 5px; color: var(--dim); width: 52px; text-align: right; }
.crew-spend { text-align: right; font-family: var(--pixel); font-size: 6px; color: var(--dim); }
.crew-lv { color: var(--ink-2); font-size: 5px; }

.section-title {
  font-family: var(--pixel);
  font-size: 6.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin: 18px 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.section-title:first-child { margin-top: 0; }
.section-title::after { content: ''; height: 1px; background: var(--line-soft); flex: 1; }

/* Budget */
.budget-hero { padding: 12px; background: #141b0e; border: 1px solid var(--line-soft); border-radius: 6px; }
.budget-big { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.budget-amount { font-family: var(--pixel); font-size: 20px; color: var(--lime-2); letter-spacing: 0.02em; }
.budget-of { font-family: var(--pixel); font-size: 6px; color: var(--dim); }
.budget-track {
  margin: 11px 0 7px;
  height: 16px;
  background: #0b1007;
  border: 1px solid #2b3820;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.budget-fill {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--lime) 0 8px, #7a9610 8px 10px);
  transition: width 400ms ease;
}
.budget-fill.warn { background: repeating-linear-gradient(90deg, var(--amber) 0 8px, #b07f28 8px 10px); }
.budget-fill.crit { background: repeating-linear-gradient(90deg, var(--magenta-2) 0 8px, #a8285c 8px 10px); }
.budget-reserve { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(45deg, rgba(0,0,0,0.5) 0 4px, rgba(0,0,0,0.2) 4px 8px); border-left: 1px dashed #4a5a36; }
.budget-rows { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
.budget-row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; color: var(--dim); }
.budget-row b { color: var(--ink-2); font-weight: 400; }
.budget-row b.warn { color: var(--amber); }

.agent-bar-row { display: grid; grid-template-columns: 62px 1fr 56px; gap: 8px; align-items: center; margin-bottom: 7px; }
.agent-bar-name { font-family: var(--pixel); font-size: 5.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.agent-bar-row .bar { height: 6px; }
.agent-bar-val { font-family: var(--pixel); font-size: 5px; color: var(--dim); text-align: right; }

.spark { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; height: 44px; margin-top: 4px; }
.spark i { flex: 0 0 12px; background: var(--line); min-height: 2px; border-radius: 1px 1px 0 0; }
.spark i.on { background: var(--lime); }
.spark-labels { display: flex; justify-content: space-between; gap: 4px; font-family: var(--pixel); font-size: 5px; color: var(--dim-2); margin-top: 3px; }
.spark-labels span { flex: 0 0 12px; text-align: center; }

.price-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.price-table th { text-align: left; font-family: var(--pixel); font-size: 4.5px; color: var(--dim); font-weight: 400; padding: 4px 3px; border-bottom: 1px solid var(--line-soft); }
.price-table th:nth-child(2), .price-table th:nth-child(3) { width: 62px; }
.price-table td:nth-child(2), .price-table td:nth-child(3) { white-space: nowrap; }
.price-table td { padding: 5px 3px; border-bottom: 1px dashed var(--line-soft); color: var(--ink-2); }
.price-table td:first-child { font-family: var(--pixel); font-size: 5px; color: var(--ink); }
.price-table small { color: var(--dim-2); display: block; font-size: 10px; margin-top: 2px; }
.peak-pill { font-family: var(--pixel); font-size: 5px; padding: 2px 4px; border-radius: 2px; border: 1px solid currentColor; }
.peak-pill.peak { color: var(--amber); }
.peak-pill.off { color: var(--green); }

.demo-tag { font-family: var(--pixel); font-size: 4.5px; color: var(--amber); border: 1px solid #5e4a1e; padding: 1px 3px; border-radius: 2px; vertical-align: 1px; }
.bar i.demo { background: repeating-linear-gradient(90deg, var(--amber) 0 3px, #7a5c1e 3px 5px); }
.spark i.demo { background: var(--amber); opacity: 0.75; }
.agent-bar-val em { color: var(--amber); font-style: normal; font-size: 4px; }

.price-cards { display: flex; flex-direction: column; gap: 8px; }
.price-card { background: #141b0e; border: 1px solid var(--line-soft); border-radius: 5px; padding: 9px 10px; }
.price-card-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.price-card-head b { font-family: var(--pixel); font-size: 5.5px; color: var(--ink); font-weight: 400; }
.price-card-head span { font-size: 12px; color: var(--dim-2); flex: 1; min-width: 80px; }
.price-card-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 7px; }
.price-card-cols > div { display: grid; grid-template-columns: 1fr; gap: 2px; border-left: 2px solid var(--line); padding-left: 7px; }
.price-card-cols span { font-family: var(--pixel); font-size: 4.5px; color: var(--dim); letter-spacing: 0.08em; }
.price-card-cols b { font-family: var(--pixel); font-size: 5px; color: var(--ink-2); font-weight: 400; }

/* Github */
.repo-card { background: #141b0e; border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px; }
.repo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.repo-name { font-family: var(--pixel); font-size: 7px; color: var(--ink); word-break: break-all; }
.repo-meta { font-size: 14px; color: var(--dim); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.repo-actions { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.pr-list { display: flex; flex-direction: column; gap: 7px; }
.pr-row { display: flex; gap: 8px; align-items: center; padding: 8px; background: #141b0e; border: 1px solid var(--line-soft); border-radius: 4px; }
.pr-num { font-family: var(--pixel); font-size: 6px; color: var(--lime); }
.pr-title { font-size: 15px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.hint { font-size: 14px; color: var(--dim-2); line-height: 1.3; }

/* Log */
.log-list { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.log-row { display: grid; grid-template-columns: 42px 1fr; gap: 7px; padding: 4px 2px; border-bottom: 1px dotted #232e1a; color: var(--dim); }
.log-row time { font-family: var(--pixel); font-size: 4.5px; color: var(--dim-2); padding-top: 3px; }
.log-row .log-text { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.log-row.agent .log-text { color: var(--lime-2); }
.log-row.warden .log-text { color: #e6b3c8; }
.log-row.coin .log-text { color: #e8d79a; }
.log-row.error .log-text { color: var(--red); }

/* ── Status bar ──────────────────────────────────────────────────────────── */

.statusbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 22px;
  background: rgba(14, 18, 10, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-soft);
  font-family: var(--pixel);
  font-size: 5.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
  flex-wrap: wrap;
}
.status-left, .status-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.statusbar .sep { width: 1px; height: 9px; background: var(--line); }
.led { width: 6px; height: 6px; border-radius: 50%; background: var(--dim-2); }
.led.on { background: var(--lime); box-shadow: 0 0 6px rgba(155, 188, 15, 0.7); }
.led.off { background: var(--red); }
.pending {
  color: #1a1305;
  background: var(--amber);
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  animation: pulse 1.6s infinite;
}
.brand-mini { color: var(--dim-2); }

/* ── Modals ──────────────────────────────────────────────────────────────── */

.modal {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #1f2918, #171e12);
  color: var(--ink);
  padding: 0;
  max-width: min(940px, 94vw);
  width: 100%;
  max-height: 90vh;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}
.modal.modal-approval { max-width: min(660px, 94vw); }
.modal::backdrop { background: rgba(5, 8, 3, 0.72); backdrop-filter: blur(3px); }
.modal-inner { padding: 18px 20px 20px; overflow-y: auto; max-height: 90vh; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #10150c;
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--pixel);
  font-size: 7px;
  padding: 7px 8px;
  border-radius: 3px;
  cursor: pointer;
  z-index: 2;
}
.modal-close:hover { color: var(--ink); border-color: var(--lime); }
.modal-head { padding-right: 60px; margin-bottom: 14px; }
.modal-eyebrow { font-family: var(--pixel); font-size: 5.5px; color: var(--lime); letter-spacing: 0.14em; margin-bottom: 7px; }
.modal-title { font-family: var(--pixel); font-size: 12px; line-height: 1.5; margin: 0 0 6px; color: var(--ink); }
.modal-sub { font-size: 16px; color: var(--dim); }

.pdx { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.pdx-left { display: flex; flex-direction: column; gap: 12px; }
.pdx-portrait {
  background: radial-gradient(circle at 50% 42%, #2b421c, #101a0c 75%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.pdx-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}
.pdx-portrait canvas { width: 128px; height: 128px; image-rendering: pixelated; }
.pdx-id { font-family: var(--pixel); font-size: 5px; color: var(--dim); position: absolute; top: 8px; left: 10px; }
.pdx-stats { display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: grid; grid-template-columns: 30px 1fr 24px; gap: 6px; align-items: center; font-family: var(--pixel); font-size: 5px; color: var(--dim); }
.stat-row .bar { height: 5px; }
.stat-row b { color: var(--ink-2); font-weight: 400; text-align: right; }
.pdx-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--pixel); font-size: 5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--dim); }
.tag.hi { color: var(--lime); border-color: #4c6428; }
.pdx-bio { font-size: 17px; color: var(--ink-2); line-height: 1.3; }
.pdx-section { font-family: var(--pixel); font-size: 5.5px; color: var(--dim); letter-spacing: 0.1em; margin: 12px 0 6px; }
.chat-box { display: flex; flex-direction: column; gap: 7px; max-height: 210px; overflow-y: auto; padding-right: 4px; }
.chat-msg { max-width: 88%; padding: 7px 9px; border-radius: 6px; font-size: 16px; line-height: 1.2; }
.chat-msg.user { align-self: flex-end; background: #2c3b1e; border: 1px solid #46592f; color: var(--ink); }
.chat-msg.agent { align-self: flex-start; background: #131a0d; border: 1px solid var(--line-soft); color: var(--ink-2); }
.chat-form { display: flex; gap: 7px; margin-top: 10px; }
.chat-form input { flex: 1; }
.chat-hint { font-size: 13px; color: var(--dim-2); margin-top: 5px; }

.mission-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.mission-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font-family: var(--pixel); font-size: 6px; padding: 9px 10px; cursor: pointer; }
.mission-tab.active { color: var(--lime); border-bottom-color: var(--lime); }
.mission-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin-bottom: 14px; }
.meta-box { background: #131a0d; border: 1px solid var(--line-soft); border-radius: 4px; padding: 8px 9px; }
.meta-box span { display: block; font-family: var(--pixel); font-size: 4.5px; color: var(--dim); letter-spacing: 0.08em; margin-bottom: 4px; }
.meta-box b { font-family: var(--pixel); font-size: 7px; color: var(--ink); font-weight: 400; }
.meta-box b.ok { color: var(--green); }
.meta-box b.bad { color: var(--magenta-2); }

.transcript { display: flex; flex-direction: column; gap: 9px; }
.tr-row { display: grid; grid-template-columns: 74px 1fr; gap: 9px; }
.tr-who { font-family: var(--pixel); font-size: 5px; color: var(--dim); padding-top: 4px; text-align: right; }
.tr-who b { display: block; color: var(--lime); font-weight: 400; margin-bottom: 3px; }
.tr-text { background: #131a0d; border: 1px solid var(--line-soft); border-left: 2px solid var(--line); border-radius: 4px; padding: 7px 9px; font-size: 16px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.tr-row.supervisor .tr-text { border-left-color: #6d5a2a; color: #d8cfa8; }
.tr-row.handoff .tr-text { border-left-color: #4e6b8a; color: #b8cfe2; }
.tr-row.system .tr-text, .tr-row.tool .tr-text { font-family: var(--body); font-size: 13px; line-height: 1.45; color: var(--dim); }
.tr-row.human .tr-text { border-left-color: var(--magenta); }
.tr-phase { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; font-family: var(--pixel); font-size: 5px; color: var(--lime); letter-spacing: 0.12em; }
.tr-phase::before, .tr-phase::after { content: ''; height: 1px; background: var(--line); flex: 1; }

.file-list { display: flex; flex-direction: column; gap: 5px; }
.file-row { display: flex; align-items: center; gap: 8px; background: #131a0d; border: 1px solid var(--line-soft); border-radius: 4px; padding: 7px 9px; cursor: pointer; }
.file-row:hover { border-color: var(--lime); }
.file-path { font-family: var(--pixel); font-size: 5.5px; color: var(--ink-2); flex: 1; word-break: break-all; }
.file-size { font-size: 13px; color: var(--dim); }
.file-preview { margin-top: 10px; }
.file-preview pre {
  background: #0d1309;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.3;
  max-height: 340px;
  overflow: auto;
  color: #cfe2a4;
  white-space: pre-wrap;
  word-break: break-word;
}
.decision-row { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 15px; color: var(--ink-2); }
.decision-row time { font-family: var(--pixel); font-size: 4.5px; color: var(--dim-2); padding-top: 2px; white-space: nowrap; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-grid .field.full { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.check-row input { width: auto; accent-color: var(--lime); }
.check-row span { font-size: 16px; color: var(--ink-2); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.approval-risk { display: inline-block; font-family: var(--pixel); font-size: 6px; padding: 4px 7px; border-radius: 3px; margin-bottom: 10px; }
.risk-low { color: var(--green); border: 1px solid #4f7a37; }
.risk-medium { color: var(--amber); border: 1px solid #7a5f24; }
.risk-high { color: var(--magenta-2); border: 1px solid #7c2c46; }
.approval-detail {
  background: #0f150a;
  font-size: 17px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  padding: 10px;
  font-size: 16px;
  color: var(--ink-2);
  white-space: pre-wrap;
  margin: 10px 0 4px;
}

.toasts { position: fixed; right: 18px; bottom: 54px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #1d2817;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lime);
  color: var(--ink);
  font-size: 15px;
  padding: 9px 12px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 180ms ease;
  max-width: 340px;
}
.toast.bad { border-left-color: var(--magenta-2); }
.toast.ok { border-left-color: var(--green); }

/* ── Animations ──────────────────────────────────────────────────────────── */

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes toastIn { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glitch {
  0% { transform: translate(0); filter: none; }
  25% { transform: translate(-2px, 1px); filter: hue-rotate(20deg); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 0); filter: saturate(1.4); }
  100% { transform: none; }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1500px) {
  .layout { grid-template-columns: 306px minmax(0, 1fr) 372px; gap: 14px; }
  .brand-sub { display: none; }
}

@media (max-width: 1240px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; position: static; }
  .panel-tabs { max-height: none; }
  .tab-body { max-height: 460px; }
  .col-left { position: static; max-height: none; }
  .console { max-width: 720px; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .col-center { order: 1; }
  .col-left { order: 2; }
  .col-right { order: 3; }
  .topbar { height: auto; min-height: 58px; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .nav-btn { padding: 8px 10px; font-size: 7px; }
  .top-actions { margin-left: auto; }
  .brand-text { font-size: 10px; }
  .console { padding: 12px 12px 16px; border-radius: 14px 14px 40px 14px; }
  .screen-bezel { padding: 9px 9px 12px; }
  .dialog-text { font-size: 17px; max-height: 56px; }
  .console-body { gap: 10px; }
  .controls { gap: 12px; }
  .speaker { display: none; }
  .statusbar { position: static; padding: 10px 14px; }
}

@media (max-width: 560px) {
  .layout { padding: 10px; }
  .brand-glyph { display: none; }
  .brand-text { font-size: 9px; }
  .top-actions .chip { font-size: 6px; padding: 7px; }
  .console { padding: 10px 10px 14px; }
  .hud-mission { font-size: 6px; max-width: 190px; }
  .hud-credits { font-size: 7px; }
  .dialog { min-height: 80px; }
  .dialog-text { font-size: 16px; line-height: 1.1; max-height: 52px; }
  .dialog-name { font-size: 5px; }
  .phasebar { display: none; }
  #soundBtn span { display: none; }
  .phase-chip { font-size: 4px; padding: 2px 4px; }
  .console-body { justify-content: center; padding-bottom: 0; }
  .startsel { margin-right: 0; }
  .pdx { grid-template-columns: 1fr; }
  .pdx-portrait canvas { width: 100px; height: 100px; }
  .settings-grid { grid-template-columns: 1fr; }
  .tr-row { grid-template-columns: 1fr; gap: 3px; }
  .tr-who { text-align: left; }
  .modal-inner { padding: 14px; }
  .toasts { left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

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