/* Quota Week UI: stencilled signage, clipboards and enamel safety signs over the game canvas. */

:root {
  --bg: rgba(22, 27, 33, 0.86);
  --bg-strong: rgba(18, 22, 27, 0.94);
  --plate: #232b34;
  --plate-2: #2b343e;
  --line: #3b4651;
  --line-2: #4c5966;
  --text: #ece6d8;
  --muted: #98a2ac;
  --yellow: #e6c229;
  --yellow-dim: #a68b1c;
  --copper: #c8783f;
  --copper-hi: #e0915a;
  --red: #d8503d;
  --red-bg: rgba(200, 64, 46, 0.14);
  --green: #6fbf5f;
  --green-bg: rgba(95, 174, 90, 0.14);
  --blue: #6b93dd;
  --ink: #15191e;
  --display: 'Fredoka', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, 'Courier New', monospace;
  --r: 4px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --hazard: repeating-linear-gradient(-45deg, var(--yellow) 0 9px, #1b1b1b 9px 18px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #101317; color: var(--text); font-family: var(--body); font-size: 14px; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
#ui { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ------------------------------------------------------------------ primitives */
.layer { position: absolute; inset: 0; pointer-events: none; }
.layer-hud { z-index: 1; } .layer-panels { z-index: 2; } .layer-join { z-index: 3; }
.layer-modals { z-index: 4; } .layer-toasts { z-index: 5; } .layer-top { z-index: 6; }
.hidden { display: none !important; }
.panel {
  pointer-events: auto;
  background: var(--bg);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-top-color: var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.display { font-family: var(--display); letter-spacing: 0.02em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; } .tiny { font-size: 11px; } .big { font-size: 18px; }
.center { text-align: center; }
.good { color: var(--green); } .bad { color: var(--red); } .warn { color: var(--yellow); }
.warn-text { color: #f0b85a; }
.yellow { color: var(--yellow); }
.grow { flex: 1 1 auto; }
.risk { color: #f08b78; }
p { margin: 6px 0; line-height: 1.4; }
h2, h3, h4 { margin: 0; font-weight: 600; }

.panel-label {
  font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--yellow); margin-bottom: 6px; display: flex; align-items: center; gap: 4px;
}
.sect {
  font-family: var(--display); font-size: 15px; color: var(--yellow); text-transform: uppercase;
  letter-spacing: 0.06em; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--line-2);
}
.cat-head {
  font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  margin: 14px 0 6px; padding-left: 8px; border-left: 4px solid var(--bc, var(--copper)); color: var(--text);
}
.ico { display: inline-block; vertical-align: middle; flex: none; }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.2) inset; flex: none; }
.pill {
  display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; line-height: 16px;
  background: var(--plate-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill.mode-manual { color: #9fd18b; border-color: #3f5a37; }
.pill.mode-auto { color: #8fb3f0; border-color: #36486a; }
.pill.mode-belt { color: #d8c27a; border-color: #5a4f2b; }
.tag { font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 2px; text-transform: uppercase; letter-spacing: 0.06em; }
.yellow-tag { background: var(--yellow); color: var(--ink); }

/* buttons */
.btn {
  pointer-events: auto; font: 600 13px var(--body); color: var(--text); cursor: pointer;
  background: linear-gradient(#36414c, #2a333c); border: 1px solid #4f5d6a; border-bottom-color: #1c2228;
  border-radius: var(--r); padding: 7px 14px; box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 2px 0 rgba(0,0,0,.35);
  transition: filter .1s, transform .05s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .tab:focus-visible, .swatch:focus-visible, .tt-node:focus-visible, .build-item:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.btn-primary { background: linear-gradient(#f0cd3a, #d3ae1c); color: var(--ink); border-color: #f5dc6a; border-bottom-color: #8a7212; }
.btn-danger, .btn-danger.on { background: linear-gradient(#d4523f, #a83a2b); border-color: #e2705e; border-bottom-color: #5e1f17; color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn-small { padding: 4px 9px; font-size: 12px; }
.btn-big { padding: 11px 18px; font-size: 16px; width: 100%; font-family: var(--display); letter-spacing: .04em; }
.btn-x {
  pointer-events: auto; cursor: pointer; width: 30px; height: 30px; flex: none; font-size: 20px; line-height: 1;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--plate); color: var(--muted);
}
.btn-x:hover { color: var(--text); border-color: var(--line-2); }
.input, .select {
  font: 14px var(--body); color: var(--text); background: #12161b; border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 7px 9px; outline: none; min-width: 0;
}
.input:focus, .select:focus { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(230,194,41,.2); }
.select { padding: 4px 6px; font-size: 12.5px; max-width: 170px; }
.kbd {
  display: inline-block; min-width: 26px; padding: 3px 7px; margin: 1px; text-align: center;
  font: 600 12px var(--mono); color: #22272d; background: linear-gradient(#f2eee4, #d4cdbd);
  border-radius: 4px; border: 1px solid #8f877a; box-shadow: 0 2px 0 #6f685d, 0 3px 4px rgba(0,0,0,.35);
}
.kbd.wide { min-width: 64px; }
.kc-group { display: inline-flex; gap: 1px; }
.or { color: var(--muted); font-size: 11px; margin: 0 6px; }

/* meters & bars */
.meter { display: inline-block; position: relative; width: 64px; height: 8px; background: #11151a; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; vertical-align: middle; }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--copper-hi); transition: width .25s; }
.meter.rep .meter-fill { background: linear-gradient(90deg, var(--copper), var(--yellow)); }
.meter.rep.low .meter-fill { background: var(--red); }
.meter.fatigue { width: 120px; }
.meter.fatigue .meter-fill { background: linear-gradient(90deg, #6fbf5f, #e6c229 70%, #d8503d); background-size: 120px 100%; }
.meter.fatigue.tired { box-shadow: 0 0 0 1px var(--red); }
.bar { height: 10px; background: #11151a; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; margin: 6px 0; }
.bar.big { height: 16px; }
.bar-fill { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--copper) 0 6px, var(--copper-hi) 6px 12px); transition: width .3s; }
.bar-fill.good { background: repeating-linear-gradient(-45deg, #4f9a46 0 6px, #6fbf5f 6px 12px); }
.bar-fill.bad { background: repeating-linear-gradient(-45deg, #a83a2b 0 6px, #d8503d 6px 12px); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.kv.total { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 6px; font-size: 15px; }

/* tabs */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--yellow-dim); }
.tab {
  pointer-events: auto; cursor: pointer; font: 600 13px var(--body); color: var(--muted);
  background: var(--plate); border: 1px solid var(--line); border-bottom: none; border-radius: var(--r) var(--r) 0 0;
  padding: 7px 12px; display: inline-flex; gap: 6px; align-items: center;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.tab-badge:empty { display: none; }
.tab-badge { font: 700 10.5px var(--mono); background: var(--red); color: #fff; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.tab.active .tab-badge { background: var(--ink); color: var(--yellow); }

/* ------------------------------------------------------------------ help button + banner + toasts */
.help-btn {
  pointer-events: auto; position: absolute; top: 10px; right: 10px; height: 42px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 4px; cursor: pointer; color: var(--text); font: 600 13px var(--body);
  background: var(--bg-strong); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow);
}
.help-btn:hover { border-color: var(--yellow); }
.help-q {
  width: 32px; height: 32px; display: grid; place-items: center; font-size: 22px; color: var(--ink);
  background: var(--yellow); border-radius: 3px; box-shadow: 0 0 0 2px #1b1b1b inset, 0 0 0 3px var(--yellow) inset;
}
.disconnect {
  pointer-events: auto; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  padding: 8px 18px 8px 26px; background: var(--red); color: #fff; border-radius: 0 0 var(--r) var(--r);
  box-shadow: var(--shadow); font-size: 14px; border-left: 10px solid #1b1b1b;
  background-image: linear-gradient(var(--red), #b23f2f);
}
.toasts { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); width: min(380px, 60vw); display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.toast {
  pointer-events: auto; display: flex; align-items: stretch; gap: 10px; padding: 0 12px 0 0; font-size: 13.5px; overflow: hidden;
  background: var(--bg-strong); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  animation: toast-in .2s ease-out; transition: opacity .4s, transform .4s;
}
.toast-bar { width: 5px; flex: none; background: var(--blue); }
.toast-bar + span { padding: 8px 0; }
.toast.good .toast-bar { background: var(--green); } .toast.bad .toast-bar { background: var(--red); } .toast.warn .toast-bar { background: var(--yellow); }
.toast.bad { border-color: #6b2d25; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ------------------------------------------------------------------ join screen */
.join-screen {
  pointer-events: auto; position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(200,120,63,.18), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 2px, transparent 2px 4px),
    #12161b;
}
.join-card { width: min(440px, 100%); overflow: hidden; background: var(--bg-strong); }
.hazard { height: 12px; background: var(--hazard); }
.title-plate { padding: 22px 24px 14px; text-align: center; border-bottom: 1px dashed var(--line-2); }
.title-kicker { font: 600 11px var(--mono); color: var(--muted); letter-spacing: .25em; text-transform: uppercase; }
.title {
  font-size: 56px; line-height: 1; margin: 6px 0 4px; color: var(--yellow); font-weight: 700;
  text-shadow: 3px 3px 0 #1b1b1b, 0 0 24px rgba(230,194,41,.15); letter-spacing: .04em;
}
.title-sub {
  display: inline-block; font: 600 15px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--copper-hi);
  padding: 3px 10px; border: 2px solid var(--copper); border-radius: 3px; margin-top: 4px;
}
.title-tag { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.join-form { padding: 16px 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.join-note { font-size: 12.5px; color: var(--muted); min-height: 16px; }
.code-inline { background: var(--ink); color: var(--yellow); padding: 1px 6px; border-radius: 3px; margin-left: 4px; }

/* swatches */
.swatch-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch {
  pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px;
  background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font: 12px var(--body);
}
.swatch:hover:not(:disabled) { border-color: var(--line-2); background: var(--plate-2); }
.swatch-fill { width: 100%; height: 30px; border-radius: 3px; box-shadow: 0 -4px 0 rgba(0,0,0,.25) inset, 0 1px 0 rgba(255,255,255,.25) inset; }
.swatch.mini .swatch-fill { height: 26px; }
.swatch-name { font-weight: 600; }
.swatch-owner { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.swatch.sel { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.swatch.taken { opacity: .5; cursor: not-allowed; }
.swatch.taken .swatch-fill { background-image: repeating-linear-gradient(-45deg, rgba(0,0,0,.45) 0 4px, transparent 4px 8px) !important; }

/* ------------------------------------------------------------------ modals */
.modal-back { pointer-events: auto; position: absolute; inset: 0; display: grid; place-items: center; padding: 60px 16px 16px; background: rgba(8, 10, 13, 0.55); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { display: flex; flex-direction: column; max-height: calc(100vh - 76px); width: min(560px, 100%); background: var(--bg-strong); border-top: 4px solid var(--yellow); }
.modal-sm { width: min(480px, 100%); } .modal-md { width: min(620px, 100%); }
.modal-xl { width: min(1200px, 100%); height: min(880px, calc(100vh - 76px)); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-titles { flex: 1; }
.modal-head h2 { font-size: 24px; color: var(--text); }
.modal-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-body { padding: 14px 18px 18px; overflow: auto; flex: 1; min-height: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.mandate-total { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; margin-bottom: 10px; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); }
.mandate-total b { color: var(--yellow); font-size: 22px; }
.mandate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mandate-card {
  pointer-events: auto; cursor: pointer; text-align: left; display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 8px; align-items: center;
  padding: 10px; color: var(--text); font: 13px var(--body); background: #f4f1ea08; border: 1px solid var(--line); border-radius: var(--r);
}
.mandate-card:hover:not(:disabled) { border-color: var(--line-2); }
.mandate-card.on { border-color: var(--red); background: var(--red-bg); }
.mandate-check { width: 18px; height: 18px; border: 2px solid var(--line-2); border-radius: 3px; display: grid; place-items: center; color: var(--red); font-weight: 700; }
.mandate-card.on .mandate-check { border-color: var(--red); }
.mandate-name { font-weight: 700; }
.mandate-score { color: var(--yellow); }
.mandate-desc { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }

/* ledger + endings */
.ledger-grid { display: grid; grid-template-columns: 1fr 150px; gap: 18px; align-items: start; }
.ledger-rows .kv b { font-size: 15px; }
.grade-box { text-align: center; padding: 10px; border: 3px solid var(--line-2); border-radius: 6px; background: var(--plate); }
.grade-label { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.grade-letter { font-size: 92px; line-height: 1; font-weight: 700; }
.grade-A .grade-letter { color: var(--green); } .grade-B .grade-letter { color: #a9cf6a; } .grade-C .grade-letter { color: var(--yellow); }
.grade-D .grade-letter { color: #f08b3a; } .grade-F .grade-letter { color: var(--red); }
.grade-F { border-color: var(--red); }
.stamp {
  display: block; width: max-content; margin: 18px auto 6px; padding: 6px 18px; font: 700 26px var(--display); letter-spacing: .12em;
  border: 4px double currentColor; border-radius: 6px; transform: rotate(-3deg); opacity: .92;
}
.stamp.good { color: var(--green); } .stamp.warn { color: var(--yellow); } .stamp.bad { color: var(--red); }
.letter {
  position: relative; margin: 14px auto; max-width: 440px; padding: 22px 22px 18px; color: #2b2620;
  background: linear-gradient(#f4ecd8, #e7dcc0); border-radius: 3px; box-shadow: 0 8px 22px rgba(0,0,0,.5);
  font-family: Georgia, 'Times New Roman', serif;
}
.letter-seal {
  position: absolute; top: -16px; right: 22px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 35%, #c2453a, #7d1f18); color: #f4d6c8; font: 700 15px Georgia, serif; box-shadow: 0 3px 6px rgba(0,0,0,.4);
}
.letter-from { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #6e604c; margin-bottom: 8px; }
.letter-text { font-size: 18px; font-style: italic; line-height: 1.5; }
.chapter { text-align: center; margin-top: 18px; }
.chapter .display { font-size: 20px; color: var(--copper-hi); }

/* ------------------------------------------------------------------ HUD: lobby */
.hud, .hud-lobby, .hud-game { position: absolute; inset: 0; pointer-events: none; }
.hud-lobby-left { position: absolute; top: 10px; left: 10px; width: 300px; display: flex; flex-direction: column; gap: 8px; }
.invite { padding: 12px; }
.invite-code { font-size: 44px; line-height: 1; color: var(--yellow); letter-spacing: .14em; text-shadow: 2px 2px 0 #1b1b1b; margin: 2px 0 8px; }
.invite-row { display: flex; gap: 6px; }
.invite-link { flex: 1; font-size: 12px; padding: 5px 7px; }
.players-card { padding: 10px 12px; }
.player-list { display: flex; flex-direction: column; gap: 4px; }
.player-row { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.player-row.off { opacity: .5; }
.player-row.me .pname { font-weight: 700; }
.host-star { color: var(--yellow); }
.hud-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 9px 16px; font-size: 14px;
  white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  border-left: 6px solid var(--yellow); display: flex; align-items: center; gap: 6px;
}
.zone-status { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); padding: 6px 14px; font-size: 13px; color: var(--yellow); }
.clockin { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.clockin-label { font: 700 20px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text); text-shadow: 2px 2px 0 #000; }
.clockin-num { font-size: 120px; line-height: 1; color: var(--yellow); text-shadow: 5px 5px 0 #1b1b1b; animation: pulse 1s infinite; }
.clockin-sub { font: 600 13px var(--mono); color: var(--text); text-shadow: 1px 1px 0 #000; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ------------------------------------------------------------------ HUD: shift */
.topbar { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; width: max-content; max-width: calc(100vw - 190px); }
.plate { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--plate); border: 1px solid var(--line); border-radius: 3px; font-size: 14px; white-space: nowrap; }
.plate b { font-size: 15px; }
.plate-k { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.plate-day { background: var(--ink); border-color: var(--yellow-dim); gap: 10px; }
.tb-day { color: var(--yellow); font-size: 15px; }
.tb-day.friday { color: #fff; background: var(--red); padding: 0 6px; border-radius: 2px; }
.tb-clock { font-size: 16px; font-weight: 600; color: #f6efe0; background: #0b0d10; padding: 1px 6px; border-radius: 2px; border: 1px solid #333; }
.tb-clock.late { color: var(--red); }
.strikes { letter-spacing: 2px; }

.quota { position: absolute; top: 62px; left: 10px; width: 250px; padding: 10px 12px; }
.q-line { font-size: 17px; }
.q-clauses { display: flex; gap: 5px; flex-wrap: wrap; }
.clause { font: 600 11.5px var(--mono); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line); background: var(--plate); }
.clause.ok { color: var(--green); border-color: #3f6a39; background: var(--green-bg); }
.clause.no { color: #f08b78; border-color: #6b2d25; background: var(--red-bg); }
.clause.off { color: var(--muted); }
.clause.trend { color: #9cc0f5; border-color: #34507a; background: rgba(107,147,221,.12); cursor: help; }
.q-days { margin-top: 6px; font-size: 12px; color: var(--muted); }
.q-days.friday { color: var(--yellow); font-weight: 700; font-family: var(--display); letter-spacing: .05em; }

.hud-right { position: absolute; top: 62px; right: 10px; width: 240px; display: flex; flex-direction: column; gap: 8px; }
.power, .contract, .ticker { padding: 9px 12px; }
.power.tripped { border-color: var(--red); animation: trip .5s steps(2) infinite; }
.power.tripped .small { color: var(--red); font-weight: 700; }
@keyframes trip { 50% { background: rgba(200, 64, 46, .45); } }
.ct-line { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.ev { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 2px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
.ev.good .dot, .li.good .dot { background: var(--green); }
.ev.bad .dot, .li.bad .dot { background: var(--red); }
.players-mini { position: absolute; left: 10px; bottom: 10px; padding: 7px 10px; min-width: 150px; }
.zoom-ctl { position: absolute; left: 10px; bottom: 58px; display: flex; align-items: center; gap: 2px; padding: 3px; pointer-events: auto; }
.zoom-ctl button { background: var(--plate-2); color: var(--text, #eee); border: 0; border-radius: 6px; height: 24px; min-width: 26px; font: 700 15px var(--body); cursor: pointer; }
.zoom-ctl button:hover { background: var(--line); }
.zoom-ctl .zoom-val { min-width: 48px; font: 600 11.5px var(--mono, monospace); color: var(--muted); }
.phase-test .zoom-ctl { display: none; }
.player-list.compact .player-row { font-size: 12.5px; }
.first-hint { bottom: 14px; border-left-color: var(--copper); }
.build-chip { position: absolute; bottom: 14px; left: calc((100vw - var(--pp-w, 520px)) / 2); transform: translateX(-50%); padding: 7px 14px; display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.rot-arrow { display: inline-block; color: var(--yellow); margin: 0 4px; transition: transform .12s; }

/* ------------------------------------------------------------------ planning panel */
.planning {
  position: absolute; top: 62px; right: 0; bottom: 0; width: 620px; display: flex; flex-direction: column; /* wide enough for every tab on one row */
  background: var(--bg-strong); border-top: 4px solid var(--yellow); border-left: 1px solid var(--line-2); border-radius: 0; transition: width .15s;
}
.planning.resizing { transition: none; user-select: none; }
/* left-edge drag handle: the planning panel is a sheet docked to the right of the screen */
.pp-resize { position: absolute; left: -6px; top: 0; bottom: 0; width: 12px; cursor: ew-resize; z-index: 2; }
/* the visible grip: a dotted tab sticking out of the sheet's left edge */
.pp-grip {
  position: absolute; left: -6px; top: 50%; width: 16px; height: 56px; margin-top: -28px; border-radius: 6px 0 0 6px;
  background: var(--plate-2) radial-gradient(circle, var(--muted) 1.4px, transparent 1.6px) 3px 7px / 5px 6px repeat-y;
  background-clip: padding-box; border: 1px solid var(--line-2); border-right: none; box-shadow: -2px 2px 6px rgba(0,0,0,.35);
  transition: background-color .12s, border-color .12s;
}
.pp-grip::after { content: ''; position: absolute; left: 8px; top: 7px; bottom: 7px; width: 5px;
  background: radial-gradient(circle, var(--muted) 1.4px, transparent 1.6px) 0 0 / 5px 6px repeat-y; }
.pp-resize:hover .pp-grip, .planning.resizing .pp-grip { background-color: #3a3520; border-color: var(--yellow); }
.pp-resize:hover .pp-grip::after, .planning.resizing .pp-grip::after { filter: brightness(1.6); }
.planning.shift-mode .pp-resize { display: none; }
.planning.wide { width: min(1100px, calc(100vw - 20px)); }
.planning.shift-mode { right: 10px; border-left: none; }
.planning.collapsed { bottom: auto; }
.planning.collapsed .tabs, .planning.collapsed .pp-body { display: none; }
.planning.shift-mode { width: 460px; bottom: auto; max-height: calc(100vh - 72px); }
.pp-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px 14px; }
.pp-title { font-size: 17px; color: var(--yellow); }
.planning .tabs { padding: 0 10px; flex-wrap: wrap; row-gap: 2px; } /* wraps to a 2nd row when narrow, so no tab is ever off-screen */
.planning .tab { padding: 6px 8px; font-size: 12.5px; gap: 4px; }
.pp-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 14px 14px; }
.pp-sec.sec-research { height: 100%; display: flex; flex-direction: column; }
.pp-intro { margin: 8px 0; }
.build-tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.build-grid { display: flex; flex-direction: column; gap: 4px; }
.build-item {
  pointer-events: auto; cursor: pointer; display: flex; gap: 10px; text-align: left; align-items: flex-start; padding: 7px 8px;
  color: var(--text); font: 13px var(--body); background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: var(--r);
}
.build-item:hover:not(:disabled) { border-color: var(--line-2); background: rgba(255,255,255,.05); }
.build-item.sel { border-color: var(--yellow); background: rgba(230,194,41,.1); box-shadow: 0 0 0 1px var(--yellow); }
.build-item.poor { opacity: .7; }
.build-item.built { opacity: .45; cursor: default; }
.bi-icon { width: 44px; height: 44px; display: grid; place-items: center; background: #11151a; border: 1px solid var(--line); border-radius: 3px; flex: none; }
.bi-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bi-top { display: flex; justify-content: space-between; gap: 8px; }
.bi-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.bi-desc { color: #c9c3b6; }
.bi-risk { color: #f2a090; background: var(--red-bg); border-left: 3px solid var(--red); padding: 2px 6px; border-radius: 0 3px 3px 0; }

.draft-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.draft-card {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 10px; min-height: 250px; border-radius: 6px;
  background: linear-gradient(#2c3640, #222a32); border: 2px solid #4a6b8a; box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.draft-card.deal { border-color: var(--copper); background: linear-gradient(#3a2f28, #261f1b); }
.draft-card.r-rare { box-shadow: 0 0 0 1px var(--yellow), 0 4px 0 rgba(0,0,0,.35); }
.draft-card.picked { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow), 0 0 18px rgba(230,194,41,.3); }
.draft-card.dim { opacity: .45; }
.dc-type { display: flex; justify-content: space-between; font: 700 11px var(--mono); letter-spacing: .14em; color: #8fb3f0; }
.deal .dc-type { color: var(--copper-hi); }
.rarity { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.r-uncommon .rarity { color: #8fd18b; } .r-rare .rarity { color: var(--yellow); }
.dc-name { font-size: 19px; line-height: 1.1; }
.dc-up { color: #b9e4ae; font-size: 13.5px; }
.dc-down { color: #f2a090; font-size: 13px; background: var(--red-bg); border-left: 3px solid var(--red); padding: 4px 6px; }
.dc-picked { text-align: center; font: 700 16px var(--display); color: var(--yellow); letter-spacing: .14em; border: 2px solid var(--yellow); border-radius: 3px; padding: 4px; transform: rotate(-2deg); }

.worker, .applicant, .contract-card { padding: 8px 10px; margin-bottom: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--r); }
.w-top, .applicant { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.w-fat { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.w-job { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.job-picker { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; flex: 1; }
.traits { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.trait { font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); cursor: help; }
.trait.good { color: #9fd18b; border-color: #3f5a37; background: var(--green-bg); }
.trait.bad { color: #f2a090; border-color: #6b2d25; background: var(--red-bg); }
.applicant > .grow { display: flex; flex-direction: column; gap: 3px; }
.contract-card.accepted { border-color: var(--yellow); background: rgba(230,194,41,.07); }
.cc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cc-body { display: flex; align-items: center; gap: 10px; }
.cc-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.pnl { padding: 8px 12px; background: #f4f1ea0a; border: 1px solid var(--line); border-radius: var(--r); }
.repay { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.repay .input { width: 100px; padding: 4px 7px; }
.sku-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.owned-cards, .mini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.mini-card { padding: 7px 9px; border-radius: 4px; border: 1px solid #4a6b8a; background: rgba(61,111,209,.08); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.mini-card.deal { border-color: #7a4f33; background: rgba(200,120,63,.08); }
.mc-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.mc-up { color: #b9e4ae; } .mc-down { color: #f2a090; }

.ready-bar { display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); }
.ready-list { flex: 1; display: flex; gap: 5px; flex-wrap: wrap; }
.ready-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 3px; font-size: 12.5px; background: var(--plate); border: 1px solid var(--line); }
.ready-chip.on { border-color: #3f6a39; background: var(--green-bg); }
.ready-chip.off { opacity: .45; }
.ready-chip .rd { font-weight: 700; color: var(--muted); }
.ready-chip.on .rd { color: var(--green); }
.btn-ready { min-width: 140px; padding: 10px 14px; font: 700 15px var(--display); letter-spacing: .06em; background: linear-gradient(#f0cd3a, #d3ae1c); color: var(--ink); border-color: #f5dc6a; }
.btn-ready.on { background: linear-gradient(#6fbf5f, #4f9a46); border-color: #8fd18b; color: #0e1a0c; }
.btn-ready.blocked { background: linear-gradient(#3a4652, #2b343e); border-color: var(--yellow); color: var(--yellow); font-size: 13px; }

/* ------------------------------------------------------------------ tech tree */
.techtree { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pp-sec.sec-research .techtree { flex: 1; }
.tt-main { display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; flex: 1; }
.tt-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tt-tools .tt-hint { margin-right: auto; }
.tt-tools .btn.on { background: var(--yellow); color: var(--ink); }
.tt-legend { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.tt-legend-stub { width: 14px; height: 8px; border-bottom: 2px solid #9aa3ad; border-left: 2px solid transparent; border-radius: 0 0 0 10px; }
.tt-zoom { display: inline-flex; align-items: center; gap: 2px; }
.tt-zoom-val { font-size: 11px; color: var(--muted); min-width: 38px; text-align: center; }
.tt-scroll { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: rgba(10, 13, 16, .55) radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 18px 18px; flex: 1; min-height: 240px; cursor: grab; touch-action: none; user-select: none; }
.tt-scroll.panning, .tt-scroll.panning .tt-node { cursor: grabbing; }
.howto .tt-scroll { height: 480px; flex: none; }
.tt-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tt-band { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(255,255,255,.04); background: linear-gradient(90deg, color-mix(in srgb, var(--bc) 16%, transparent), transparent 60%); }
.tt-band-label { position: absolute; left: 0; top: 0; bottom: 0; width: 112px; padding: 8px 8px 8px 10px; border-left: 5px solid var(--bc); display: flex; flex-direction: column; gap: 3px; }
.tt-band-label b { font: 700 13px var(--display); text-transform: uppercase; letter-spacing: .06em; }
.tt-band-label span { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.tt-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.tt-edge { fill: none; stroke-width: 2; opacity: .5; transition: opacity .12s; }
.tt-edge:not(.shown) { display: none; }
.tt-edge.cross { stroke-dasharray: 5 4; opacity: .45; stroke-width: 1.5; }
.tt-edge.met { opacity: .8; }
.tt-edge.hl { opacity: 1 !important; stroke-width: 3; }
.tt-edge.cross.hl { stroke-width: 2.2; }
.tt-stub { fill: none; stroke-width: 2.5; stroke-linecap: round; opacity: .9; pointer-events: stroke; }
.tt-stub.gone { display: none; }
.techtree.focusing .tt-edge:not(.hl) { opacity: .12; }
.techtree.focusing .tt-node:not(.rel) { opacity: .28; filter: saturate(.3); }
.techtree.focusing .tt-stub { opacity: .25; }
.tt-node {
  pointer-events: auto; position: absolute; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px;
  padding: 6px 8px 5px; color: var(--text); font: 12px var(--body); overflow: hidden; justify-content: space-between; transition: opacity .12s;
  background: #1d242b; border: 1px solid var(--line-2); border-left: 4px solid var(--bc); border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.tt-node:hover, .tt-node.sel { border-color: var(--yellow); border-left-color: var(--bc); box-shadow: 0 0 0 1px var(--yellow); z-index: 2; }
.tt-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; }
.tt-cost { display: flex; gap: 6px; font-size: 11px; }
.cost-rp { color: #c9b6f2; } .cost-cash { color: var(--yellow); } .cost-rep { color: #f0a96a; }
.tt-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 18px; }
.tt-new { font-style: normal; color: var(--yellow); margin-right: 3px; }
.tt-unlocks { display: flex; gap: 2px; }
.tt-fx { font-size: 10.5px; color: var(--muted); }
.tt-badge { position: absolute; top: 5px; right: 6px; font: 700 10px var(--mono); }
.tt-node.s-owned { background: #1f2e22; border-color: #3f6a39; }
.tt-node.s-owned .tt-badge { color: var(--green); font-size: 14px; }
/* yellow = ready to research; green is reserved for researched */
.tt-node.s-avail { background: #2d2a17; border-color: var(--yellow-dim); }
.tt-node.s-avail .tt-badge { color: var(--ink); background: var(--yellow); padding: 0 4px; border-radius: 2px; }
.tt-node.s-short { opacity: .85; }
.tt-node.s-locked { opacity: .62; filter: saturate(.45); }
.tt-detail { min-height: 92px; max-height: 170px; overflow: auto; flex: none; padding: 9px 12px; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); }
.tt-detail-in { border-left: 4px solid var(--bc); padding-left: 10px; display: flex; flex-direction: column; gap: 3px; }
.tt-detail-in .btn { align-self: flex-start; margin-top: 6px; }
.tt-detail-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tt-detail-head b { font-size: 17px; }
.tt-branch { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tt-state { font: 700 10.5px var(--mono); text-transform: uppercase; padding: 1px 6px; border-radius: 2px; background: var(--plate-2); }
.tt-state.s-owned { color: #0e1a0c; background: var(--green); } .tt-state.s-avail { color: var(--yellow); background: transparent; box-shadow: inset 0 0 0 1.5px var(--yellow); } /* outline, so it differs from the solid Research button */
.tt-state.s-short { color: #f0b85a; } .tt-state.s-locked { color: var(--muted); }
.tt-unl-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.tt-unl { display: inline-flex; align-items: center; gap: 3px; }

/* ------------------------------------------------------------------ how to play */
.howto { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.howto-modal .modal-body { display: flex; flex-direction: column; overflow: hidden; }
.howto-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 4px 8px; }
.ht-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.goal-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.goal-list li { padding-left: 18px; position: relative; line-height: 1.4; }
.goal-list li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px; background: var(--yellow); transform: rotate(45deg); }
.quota-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quota-pill { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--plate); font-size: 12px; }
.quota-pill b { font-size: 16px; color: var(--yellow); }
.quota-pill em { font-size: 10px; color: var(--copper-hi); font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.loop { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }
.loop li::marker { color: var(--yellow); font-family: var(--display); }
.grade-list, .tool-list { display: flex; flex-direction: column; gap: 5px; }
.grade-row, .tool-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tool-row b { min-width: 86px; }
.grade-chip { width: 26px; height: 26px; display: grid; place-items: center; font: 700 15px var(--display); border-radius: 3px; flex: none; color: var(--ink); }
.grade-chip.g-S { background: linear-gradient(#f5dc6a, #d3ae1c); } .grade-chip.g-A { background: #8fd18b; }
.grade-chip.g-B { background: #a8b2bc; } .grade-chip.g-D { background: var(--red); color: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); padding: 6px 8px; border-bottom: 2px solid var(--yellow-dim); position: sticky; top: 0; background: var(--bg-strong); }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.35; }
.tbl tbody tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.tbl.controls td { vertical-align: middle; padding: 8px; }
.tbl.controls td.keys { white-space: nowrap; width: 1%; }
.job-name { font-weight: 700; white-space: nowrap; }
.lede { font-size: 15px; margin: 4px 0 12px; }
.wj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wj { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); }
.ht-tech { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }
.ht-tech-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-item i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend-item i.dash { height: 0; width: 18px; border-top: 2px dashed #9aa3ad; border-radius: 0; }
.tips { padding: 10px 12px; background: var(--plate); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: var(--r); font-size: 12.5px; }
.tips .sect { margin-top: 0; }
.tips ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; line-height: 1.4; }
.list { display: flex; flex-direction: column; gap: 4px; }
.list.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.li { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.li .dot { align-self: center; }
.li .small { flex-basis: 100%; color: #c9c3b6; padding-left: 15px; }
.hidden-tag { color: #f0b85a; border-color: #6a5121; }
.tbl.machines td:first-child { width: 36px; }

/* ------------------------------------------------------------------ small screens (1280x720 is the floor) */
@media (max-width: 1360px) {
  .planning { width: 590px; }
  .draft-card { min-height: 220px; }
  .dc-name { font-size: 17px; }
}
@media (max-height: 760px) {
  .invite-code { font-size: 36px; }
  .modal-xl { height: calc(100vh - 66px); }
  .modal-back { padding: 56px 10px 10px; }
  .howto .tt-scroll { max-height: 380px; }
  .clockin-num { font-size: 96px; }
}
@media (max-width: 1000px) {
  .ht-cols, .ht-tech, .list.cols2 { grid-template-columns: 1fr; }
  .wj-grid { grid-template-columns: 1fr 1fr; }
  .help-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ settings button + menu */
.gear-btn { right: 152px; padding: 0 4px; }
.gear-btn .help-q { font-size: 20px; background: var(--plate-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.modal-settings { width: min(1040px, 96vw); }
.settings .set-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 6px; align-items: start; }
@media (max-width: 900px) { .settings .set-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .settings .set-cols { grid-template-columns: 1fr; } }
.settings section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.set-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 8px; border-radius: var(--r); background: var(--plate); border: 1px solid var(--line); }
.set-row:hover { border-color: var(--line-2); }
.set-row input { margin-top: 3px; accent-color: var(--yellow); width: 16px; height: 16px; flex: none; }
.set-text { display: flex; flex-direction: column; gap: 2px; }
.set-row-btn { display: flex; justify-content: flex-start; margin: -2px 0 4px 34px; }
.set-slider { align-items: center; }
.set-slider b { width: 74px; flex: none; }
.set-row.set-slider input[type=range] { flex: 1; width: auto; height: 16px; margin: 0; }
.set-val { width: 38px; text-align: right; flex: none; }
.set-test { margin-left: 0; gap: 6px; }
.set-test-pick { flex: 1; padding: 4px 6px; text-transform: capitalize; }
.set-credits summary { cursor: pointer; padding: 2px 0; }
.set-credits ul { margin: 4px 0 0; padding-left: 16px; max-height: 140px; overflow: auto; }
.set-credits a { color: inherit; }
.set-keys { border-collapse: collapse; }
.set-keys td { padding: 3px 8px 3px 0; vertical-align: middle; }
.set-foot { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.invite-row { display: flex; gap: 6px; }
.invite-row .input { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ tutorial carousel */
.tut-ring {
  position: fixed; left: 0; top: 0; pointer-events: none; border-radius: 50%; z-index: 30;
  border: 3px solid var(--yellow); box-shadow: 0 0 0 4px rgba(230,194,41,.25), 0 0 26px 6px rgba(230,194,41,.45), inset 0 0 18px rgba(230,194,41,.35);
  animation: tut-pulse 1.4s ease-in-out infinite;
}
@keyframes tut-pulse { 0%,100% { opacity: 1; filter: brightness(1); } 50% { opacity: .7; filter: brightness(1.25); } }
.tut-pop {
  position: fixed; left: 0; top: 0; z-index: 31; pointer-events: auto; width: min(460px, 92vw);
  padding: 14px 16px 12px; border-radius: 14px; border: 2px solid var(--yellow);
  background: linear-gradient(rgba(30,36,44,.97), rgba(22,27,33,.97)); box-shadow: 0 14px 34px rgba(0,0,0,.5);
}
.tut-pop.docked { width: min(560px, 94vw); }
.tut-pop.slide-in .tut-body { animation: tut-slide .28s ease-out; }
@keyframes tut-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.tut-arrow { position: absolute; width: 14px; height: 14px; background: inherit; border: 2px solid var(--yellow); transform: translateX(-50%) rotate(45deg); display: none; }
.tut-pop[data-where="above"] .tut-arrow { display: block; bottom: -9px; border-top: none; border-left: none; background: #161b21; }
.tut-pop[data-where="below"] .tut-arrow { display: block; top: -9px; border-bottom: none; border-right: none; background: #1e242c; }
.tut-body { display: flex; gap: 14px; align-items: flex-start; }
.tut-img { flex: none; width: 92px; height: 92px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #f4efe4, #d8d0c0); display: grid; place-items: center; overflow: hidden; }
.tut-img canvas { width: 92px; height: 92px; }
.tut-copy { min-width: 0; flex: 1; }
.tut-kicker { font: 600 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); }
.tut-title { font-size: 21px; line-height: 1.15; margin: 2px 0 6px; text-wrap: balance; }
.tut-text { font-size: 14px; line-height: 1.5; color: var(--text); }
.tut-text .kbd { padding: 1px 6px; min-width: 20px; font-size: 11px; }
.tut-how { margin-top: 8px; padding: 6px 9px; border-radius: 8px; background: rgba(230,194,41,.1); border: 1px solid rgba(230,194,41,.35); font-size: 13px; }
.tut-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tut-nav { min-width: 34px; font-size: 18px; line-height: 1; padding: 4px 10px; }
.tut-dots { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; max-width: 260px; }
.tut-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: none; background: var(--line-2); cursor: pointer; }
.tut-dot.done { background: var(--green); }
.tut-dot.on { background: var(--yellow); transform: scale(1.35); }
.tut-glow { outline: 3px solid var(--yellow) !important; outline-offset: 3px; box-shadow: 0 0 22px 6px rgba(230,194,41,.5) !important; animation: tut-pulse 1.4s ease-in-out infinite; }

/* ------------------------------------------------------------------ equipment hint */
.eq-hint {
  position: fixed; left: 0; top: 0; z-index: 25; pointer-events: none; max-width: 250px;
  padding: 8px 10px; border-radius: 10px; background: rgba(250,246,236,.96); color: #262b31;
  box-shadow: 0 8px 20px rgba(0,0,0,.35); font-size: 12.5px; line-height: 1.4;
}
.eq-hint::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.eq-name { font: 700 14px var(--display); display: flex; gap: 6px; align-items: center; }
.eq-mode { font: 600 10px var(--body); text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 99px; background: #d9e9d5; color: #2f6b2a; }
.eq-mode.auto { background: #d6e3f5; color: #2c5a9a; }
.eq-desc { color: #4a515a; margin: 2px 0 4px; }
.eq-keys .kbd { padding: 0 5px; min-width: 18px; font-size: 11px; }
.eq-keys .warn-text { color: #c8402e; }
@media (prefers-reduced-motion: reduce) { .tut-ring, .tut-glow { animation: none; } .tut-pop.slide-in .tut-body { animation: none; } }

/* ------------------------------------------------------------------ station inspector (left-click equipment) */
.insp {
  position: fixed; left: 0; top: 0; z-index: 33; pointer-events: auto; width: 300px; padding: 0 12px 10px;
  border-radius: 12px; font-size: 12.5px; line-height: 1.35; display: flex; flex-direction: column; gap: 7px;
}
.insp-head { display: flex; gap: 9px; align-items: center; margin: 0 -12px; padding: 9px 10px 0 12px; border-top: 4px solid; border-radius: 12px 12px 0 0; }
.insp-thumb { flex: none; width: 40px; height: 40px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #f4efe4, #d3cbbb); display: grid; place-items: center; }
.insp-titles { flex: 1; min-width: 0; }
.insp-name { font-size: 16px; line-height: 1.1; }
.insp-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.insp .ichip { font: 600 10px var(--body); text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 99px; background: var(--plate-2); color: var(--muted); border: none; }
.insp .ichip.c-man { background: rgba(111,191,95,.18); color: #9be08c; }
.insp .ichip.c-auto { background: rgba(107,147,221,.2); color: #a9c3f2; }
.insp .ichip.c-grade { background: rgba(230,194,41,.16); color: var(--yellow); }
.insp-head .btn-x { align-self: flex-start; }
.insp-desc { color: var(--muted); font-size: 12px; }
.insp-k { color: var(--muted); font: 600 10.5px var(--body); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.insp-grid, .insp-risk { display: grid; grid-template-columns: 74px 1fr auto; gap: 4px 8px; align-items: center; }
.insp-grid > :nth-child(2n) { grid-column: 2 / 4; }
.insp-sec { font: 700 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); border-top: 1px solid var(--line); padding-top: 6px; }
.insp .pill { display: inline-block; font: 600 11px var(--body); padding: 1px 8px; border-radius: 99px; background: var(--plate-2); }
.insp .pill.good { background: rgba(111,191,95,.2); color: #9be08c; }
.insp .pill.warn { background: rgba(230,160,41,.2); color: #f2c460; }
.insp .pill.bad { background: rgba(216,80,61,.22); color: #ff9a8a; }
.insp .pill.muted { color: var(--muted); }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 9px; height: 9px; border-radius: 3px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.pips i.on { background: var(--green); }
.pips.amber i.on { background: #f2b84b; }
.pips.red i.on { background: #e8674f; }
.pips.blue i.on { background: #5aa9e6; }
.pips.fill i.on { background: var(--copper-hi); }
.insp-barrow { display: flex; gap: 8px; align-items: center; }
.insp-bar { flex: 1; height: 7px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.insp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6cc3a0, #9be08c); border-radius: 99px; }
.insp-recipe { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.insp-arrow { color: var(--yellow); font-weight: 700; margin: 0 2px; }
.insp-flow { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: baseline; }
.insp-v { font-size: 12px; }
.insp-dir { color: var(--yellow); }
.insp-item { position: relative; display: inline-flex; border-radius: 5px; background: rgba(255,255,255,.07); padding: 1px; }
.insp-grade { position: absolute; right: -3px; bottom: -3px; font: 700 8.5px var(--body); min-width: 11px; height: 11px; line-height: 11px; text-align: center; border-radius: 3px; background: #6b7682; color: #fff; }
.insp-grade.g-S { background: #e6b82a; color: #2a2208; } .insp-grade.g-A { background: #4f9a46; } .insp-grade.g-D { background: #d8503d; }
.insp-slots { display: flex; gap: 4px; align-items: center; }
.insp-slots .insp-k { width: 74px; }
.insp-slot { width: 18px; height: 18px; border-radius: 5px; border: 1px dashed rgba(255,255,255,.18); }
.insp-counts { display: flex; gap: 8px; flex-wrap: wrap; padding-left: 82px; }
.insp-count { display: inline-flex; gap: 2px; align-items: center; font: 600 11px var(--mono); }
.insp-warn { font-size: 11.5px; color: #ffb3a6; background: var(--red-bg); border-radius: 7px; padding: 5px 8px; }
.insp-label { display: inline-flex; align-items: center; gap: 4px; }
.insp-pick { display: flex; gap: 4px; flex-wrap: wrap; padding-left: 82px; }
.insp-pickbtn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line-2); background: var(--plate); cursor: pointer; padding: 0; color: var(--muted); }
.insp-pickbtn:hover { border-color: var(--yellow); }
.insp-pickbtn.on { border-color: var(--yellow); background: rgba(230,194,41,.18); box-shadow: 0 0 0 1px var(--yellow) inset; }
.insp-pickbtn.dim { opacity: .45; }
.insp-pickbtn.clear { font-size: 13px; }
.insp-ok { font-size: 11.5px; color: #9be08c; background: var(--green-bg); border-radius: 7px; padding: 4px 8px; }

/* ------------------------------------------------------------------ roles: what each machine / research is FOR */
.role-tag { display: inline-block; font: 700 9.5px var(--body); text-transform: uppercase; letter-spacing: .07em; padding: 1px 6px; border-radius: 99px; background: var(--plate-2); color: var(--muted); white-space: nowrap; }
.role-tag.role-new { background: rgba(111,191,95,.22); color: #9be08c; }
.role-tag.role-faster { background: rgba(107,147,221,.22); color: #a9c3f2; }
.role-tag.role-premium { background: rgba(230,184,42,.2); color: #f2cf5b; }
.role-tag.role-quality { background: rgba(42,157,143,.22); color: #7fd6cb; }
.role-tag.role-logistics { background: rgba(61,111,209,.2); color: #9fb8ee; }
.role-tag.role-core { background: rgba(230,194,41,.18); color: var(--yellow); }
.tt-role { align-self: flex-start; margin: 1px 0 2px; }
.tt-role-line { font-size: 13px; }
.bi-role { font-weight: 600; }
.bi-role.role-new { color: #9be08c; } .bi-role.role-faster { color: #a9c3f2; } .bi-role.role-core { color: var(--yellow); }
.bi-role.role-premium { color: #f2cf5b; } .bi-role.role-quality { color: #7fd6cb; } .bi-role.role-logistics { color: #9fb8ee; } .bi-role.role-facility { color: var(--muted); }
.cat-head .cat-sub { margin-left: 8px; font: 400 11.5px var(--body); text-transform: none; letter-spacing: 0; color: var(--muted); }

/* ------------------------------------------------------------------ production lines */
.lines { display: flex; flex-direction: column; gap: 10px; }
.ln-card { background: var(--plate); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.ln-head { display: flex; align-items: center; gap: 9px; }
.ln-head.ln-toggle { cursor: pointer; user-select: none; }
.ln-head .cat-caret { color: var(--muted); width: 10px; }
.ln-card.collapsed > :not(.ln-head) { display: none; }
.ln-title { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.ln-status { font: 600 11.5px var(--body); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.ln-status.st-have { background: rgba(111,191,95,.18); color: #9be08c; }
.ln-status.st-build { background: rgba(230,194,41,.16); color: var(--yellow); }
.ln-status.st-locked { background: var(--plate-2); color: var(--muted); }
.ln-chain { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; row-gap: 6px; }
/* compact flow chart: small icon nodes, details on hover (.ln-tipbox) */
.ln-node { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; cursor: default; }
.ln-item { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-strong); border: 1px solid var(--line); }
.ln-step { min-width: 46px; padding: 3px 4px 2px; border: 1.5px solid var(--line-2); background: var(--bg-strong); color: var(--text); font: inherit; gap: 1px; }
.ln-node:hover { border-color: var(--yellow); }
button.ln-step { cursor: pointer; }
.ln-step.st-have { border-color: rgba(111,191,95,.7); }
.ln-step.st-build { border-color: var(--yellow); border-style: dashed; }
.ln-step.st-locked { opacity: .55; }
.ln-step.ln-qc { border-style: dashed; } .ln-step.ln-qc.st-static, .ln-step.ln-qc.st-locked { border-color: rgba(42,157,143,.6); }
.ln-does { font: 700 8.5px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); line-height: 1; }
.ln-mark { position: absolute; top: -6px; right: -6px; font-style: normal; font-size: 9.5px; line-height: 14px; min-width: 14px; height: 14px; text-align: center; border-radius: 7px; background: var(--plate-2); border: 1px solid var(--line-2); }
.ln-step.st-have .ln-mark { color: #9be08c; } .ln-step.st-build .ln-mark { color: var(--yellow); }
.ln-bolt { position: absolute; top: -6px; left: -5px; font-style: normal; font-size: 10px; }
.ln-plus { color: var(--muted); font-weight: 700; }
.ln-arrow { color: var(--muted); font-weight: 700; font-size: 13px; }
.ln-tipbox { position: fixed; z-index: 9999; max-width: 280px; padding: 7px 10px; border-radius: 8px; background: var(--bg-strong); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.35; pointer-events: none; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.ln-tipbox.hidden { display: none; }
.ln-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.ln-extra { background: var(--plate); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.ln-extra-title { font-weight: 600; }
.ln-extra-mach { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; }
.tt-node > * { flex-shrink: 0; }  /* fixed-height column: never squash the title */

/* ------------------------------------------------------------------ test run, sandbox, blueprint */
.btn-test { background: linear-gradient(#3fc4d8, #2696aa); color: #071a1f; border-color: #7fe3f0; border-bottom-color: #145a66; font-weight: 700; white-space: nowrap; }
.ready-bar .btn-test { padding: 10px 12px; font: 700 13.5px var(--display); letter-spacing: .03em; }
.btn-test-end { background: #2c3a42; color: #bff1f8; border-color: #3fc4d8; }
.test-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); pointer-events: auto;
  min-width: 420px; max-width: calc(100vw - 220px); padding: 8px 12px 9px; display: flex; flex-direction: column; gap: 6px;
  border-top: 4px solid #3fc4d8; background: rgba(12, 30, 38, 0.92);
}
.tr-top { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tr-top b { font-size: 16px; color: #dff8fc; }
.tr-title { color: #5fd8ff; font-size: 17px; letter-spacing: .08em; }
.tr-dot { width: 10px; height: 10px; border-radius: 50%; background: #5fd8ff; box-shadow: 0 0 8px #5fd8ff; animation: trblink 1.2s infinite; }
@keyframes trblink { 50% { opacity: .25; } }
.tr-bar { height: 4px; border-radius: 2px; background: rgba(95, 216, 255, .15); overflow: hidden; }
.tr-fill { display: block; height: 100%; background: #5fd8ff; transition: width .3s linear; }
.tr-made { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 26px; }
.tr-item { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 3px; border-radius: 99px; background: var(--plate); border: 1px solid var(--line); font-size: 12.5px; }
.tr-item.sku { border-color: var(--yellow); background: rgba(230, 194, 41, .14); }
.tr-item.sku b { color: var(--yellow); }
.tr-item.big { font-size: 14px; padding: 2px 9px 2px 4px; }
.test-report .tr-made.wrap { gap: 8px; }
.tr-verdict { text-align: center; padding: 10px; border-radius: 8px; border: 2px solid var(--line); margin-bottom: 4px; }
.tr-verdict.good { border-color: #4f9a46; background: var(--green-bg); }
.tr-verdict.bad { border-color: #a03a2c; background: var(--red-bg); }
.tr-verdict-big { font-size: 30px; line-height: 1.1; }
.tr-verdict.good .tr-verdict-big { color: #9be08c; }
.tr-verdict.bad .tr-verdict-big { color: #f08b78; }
.tr-issues { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow: auto; }
.tr-issue { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 9px; text-align: left; cursor: pointer;
  background: var(--plate); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; }
.tr-issue:hover { border-color: var(--yellow); background: var(--plate-2); }
.tr-issue-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-issue-top { display: flex; align-items: center; gap: 7px; }
.tr-pill.bad { color: #f6a090; border-color: #7a3328; background: var(--red-bg); }
.tr-pill.warn { color: #f2c46b; border-color: #6a5121; background: rgba(242, 184, 75, .12); }
.tr-pill.info { color: #9cc4f2; border-color: #36486a; }
.pips.tr-share.major i.on { background: #e8674f; }
.pips.tr-share.minor i.on { background: #f2b84b; }

/* test phase: minimal HUD */
.phase-test .players-mini { opacity: .85; }

/* sandbox */
.sandbox-plate { background: linear-gradient(#7a5ce0, #5a3fc0); border-color: #a895f5; color: #fff; font: 700 12px var(--display); letter-spacing: .12em; }
.sandbox-chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #6a4fd8; color: #fff; font: 700 10.5px var(--display); letter-spacing: .1em; }
.sandbox-unlock { display: flex; align-items: center; gap: 8px; padding: 7px 9px; margin: 6px 0; border: 1px dashed #8a76e8; border-radius: 8px; background: rgba(106, 79, 216, .12); }
.mode-card { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.mode-card.sb { border-color: #8a76e8; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 99px; overflow: hidden; background: var(--plate); align-self: flex-start; }
.seg-btn { pointer-events: auto; cursor: pointer; padding: 6px 16px; border: 0; background: transparent; color: var(--muted); font: 600 13.5px var(--display); letter-spacing: .03em; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--yellow); color: var(--ink); }
.seg-btn:last-child.on { background: #7a5ce0; color: #fff; }
.mode-read { font: 700 16px var(--display); color: var(--yellow); }
.mode-read.sb { color: #b9a9ff; }
.mode-note { color: #cfc4ff; }

/* sandbox: Build/Lines tabs during a shift dock full height */
.planning.shift-mode.shift-build { width: 520px; bottom: 10px; max-height: none; }
.build-item { user-select: none; }

/* ------------------------------------------------------------------ research: details beside the tree (no scrolling to read or buy) */
.pp-sec.sec-research .techtree.mode-research { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; min-height: 0; flex: 1; }
.pp-sec.sec-research .techtree.mode-research .tt-scroll { min-height: 0; }
.pp-sec.sec-research .techtree.mode-research .tt-detail { max-height: none; min-height: 0; height: 100%; overflow: auto; }
.tt-buy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.tt-detail-in .tt-buy-row .btn { align-self: center; margin-top: 0; }
.tt-detail-in p { margin: 2px 0; }
@media (max-width: 900px) { .pp-sec.sec-research .techtree.mode-research { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Build tab: search, collapsible sections, expandable cards */
.build-search-row { position: sticky; top: 0; z-index: 3; padding: 0 0 8px; background: linear-gradient(var(--bg-strong) 75%, transparent); }
.build-search { width: 100%; box-sizing: border-box; padding: 8px 12px 8px 32px; border-radius: 9px; font-size: 14px;
  background: var(--plate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a2ac' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center; }
.build-search:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }
.cat-toggle { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; color: inherit; font: inherit; padding: 6px 0; }
.cat-toggle:hover { color: var(--yellow); }
.cat-caret { width: 12px; color: var(--muted); }
.cat-count { font: 600 10.5px var(--mono); padding: 0 6px; border-radius: 99px; background: var(--plate-2); color: var(--muted); }
.cat-toggle.collapsed { opacity: .8; }
.build-card { display: flex; flex-direction: column; border-radius: 6px; min-width: 0; }
.build-card .build-item { width: 100%; }
.build-card.open .build-item { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.build-card.flash { animation: bc-flash 1.5s ease-out; border-radius: 6px; }
@keyframes bc-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--yellow), 0 0 18px 4px rgba(230,194,41,.45); } 100% { box-shadow: none; } }
.bi-expand { align-self: flex-start; margin: 3px 0 0 6px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--plate); color: var(--muted); font: 600 11px var(--body); cursor: pointer; }
.bi-expand:hover, .build-card.open .bi-expand { color: var(--yellow); border-color: var(--yellow-dim); }
.bi-upgrades { display: flex; flex-direction: column; gap: 4px; margin: 5px 0 2px 14px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.bi-up-line { font-size: 12px; }
.bi-up { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--plate); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bi-up:hover { border-color: var(--yellow); }
.bi-up.locked { opacity: .8; }
.bi-up-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.bi-up-st { font-size: 11.5px; white-space: nowrap; }
.bi-up-st.ok { color: #9be08c; }
.bi-up-st.lock { color: var(--muted); }
.pill.pill-range { background: rgba(255,210,58,.14); color: var(--yellow); }
.build-empty { padding: 14px 4px; font-size: 13px; }
/* the upgrades pill lives inside its card (bottom-right), so it's obvious which machine it belongs to */
.bi-head { position: relative; }
.build-card.has-ups .bi-head > .build-item { padding-bottom: 26px; }
.bi-head > .bi-expand { position: absolute; right: 8px; bottom: 6px; margin: 0; z-index: 1; }
.cat-toggle { flex-wrap: wrap; }
.cat-toggle .cat-sub { flex: 1 1 200px; text-align: left; }
.insp-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 82px; }
/* Lines */
/* machine tiers */
.insp-tier { display: grid; grid-template-columns: 74px auto 1fr; gap: 8px; align-items: center; }
.tier-pips { display: inline-flex; gap: 3px; }
.tier-pips i { width: 14px; height: 8px; border-radius: 3px; background: rgba(255,255,255,.12); }
.tier-pips i.on { background: #9aa4ae; } .tier-pips i.on.t2 { background: #dde3e8; } .tier-pips i.on.t3 { background: #f2c230; }
.insp .ichip.c-tier.t2 { background: rgba(221,227,232,.18); color: #e8edf1; }
.insp .ichip.c-tier.t3 { background: rgba(242,194,48,.22); color: #f2cf5b; }
.insp-actions { align-items: center; }

/* ---- power cables / on-off / battery / arms / workforce gear ---- */
.good-text { color: #8fd07f; }
.insp-power { display: flex; flex-direction: column; gap: 5px; }
.insp-power .insp-actions { padding-left: 0; }
.insp-nowire { font-size: 11.5px; color: #ffb3a6; background: var(--red-bg); border: 1px solid rgba(216,80,61,.45); border-radius: 7px; padding: 5px 8px; }
.insp-onoff { display: inline-flex; align-items: center; gap: 6px; }
.insp-onoff .onoff-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.insp-onoff.is-off .onoff-dot { background: #59626b; box-shadow: none; }
.insp-onoff.is-off { opacity: .85; }
.insp-bar.bat i { background: linear-gradient(90deg, #4fb0d8, #8fe0ff); }
.insp-bar.bat.low i { background: linear-gradient(90deg, #d8503d, #f0b85a); }
.insp-pick.items { max-height: 96px; overflow-y: auto; }
.insp-pickbtn.wide { width: auto; padding: 0 9px; font-size: 12px; font-weight: 600; color: var(--text); }
.insp-pickbtn.grade { font-family: var(--display); font-weight: 700; font-size: 13px; }
.insp-pickbtn.grade.g-S { color: #f2c230; }
.insp-pickbtn.grade.g-A { color: #8fd07f; }
.insp-pickbtn.grade.g-B { color: #9fb4d6; }
.pips.fill.amber i.on { background: #f0b85a; }
.panel.power .p-split { margin-top: -2px; }
.panel.power .p-bat { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; }
.panel.power .p-bat .bar.mini { height: 6px; margin: 0; }
.bar-fill.bat { background: repeating-linear-gradient(-45deg, #3f97c0 0 6px, #63b8e0 6px 12px); }
.bar-fill.bat.drain { background: repeating-linear-gradient(-45deg, #c98a2b 0 6px, #f0b85a 6px 12px); }
.link { color: var(--yellow); text-decoration: underline; cursor: pointer; }
.wf-card { margin-top: 14px; padding: 9px 10px; background: var(--plate); border: 1px solid var(--line); border-top: 3px solid var(--bc, var(--copper)); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.wf-head { display: flex; align-items: baseline; gap: 8px; }
.wf-head .display { font-size: 15px; }
.wf-rp { margin-left: auto; color: #b9a6ff; }
.wf-node { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 7px; border-radius: 7px; background: var(--plate-2); border: 1px solid transparent; }
.wf-node.s-avail { border-color: var(--yellow-dim); }
.wf-node.s-owned { border-color: rgba(111,191,95,.45); }
.wf-node.s-locked { opacity: .6; }
.wf-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wf-txt .tt-cost { font-size: 11px; }
.wf-state.owned { color: var(--green); font-size: 12px; font-weight: 600; white-space: nowrap; }
.wf-icons { display: flex; gap: 2px; }
.wf-hint { margin-top: 2px; }
.ht-wf .wf-node { grid-template-columns: auto 1fr; }
.tips .wf-card { font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: var(--plate); color: var(--muted); font: 600 12px var(--body); padding: 4px 10px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: rgba(230,194,41,.2); color: var(--text); box-shadow: 0 0 0 1px var(--yellow) inset; }
.insp-bat-hint { line-height: 1.35; }

/* ---- Market tab: Board Meeting, weekly trend, products (docs/MARKET.md) ---- */
.board { padding: 10px; margin-bottom: 10px; border: 2px solid var(--yellow); border-radius: 6px; background: rgba(230,194,41,.06); }
.board-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.board-row { margin-top: 8px; }
.board-opt { min-height: 0; }
.board-opt .select { width: 100%; }
.mk-trend { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r); border: 1px solid #34507a; background: rgba(107,147,221,.1); }
.mk-trend.steady { border-color: var(--line); background: rgba(255,255,255,.03); }
.mk-row { padding: 7px 10px; margin-bottom: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--r); }
.mk-row.unlisted { opacity: .8; border-style: dashed; }
.mk-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mk-buyer { color: #c9c3b6; margin: 3px 0; }
.mk-stats { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.mk-stats span { cursor: help; }
.mk-tag { border: 1px solid var(--line); }
.mk-tag.on { color: var(--green); border-color: #3f6a39; background: var(--green-bg); }
.mk-tag.off { color: var(--muted); }
.mk-tag.grace { color: var(--yellow); border-color: var(--yellow-dim); background: rgba(230,194,41,.1); }
.mk-tag.deep { color: var(--copper-hi); border-color: var(--copper); }
.mk-tag.trend { color: #9cc0f5; border-color: #34507a; cursor: help; }
.insp-pickbtn.wide { width: auto; padding: 2px 8px; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.insp-meter { flex: 1; height: 7px; border-radius: 4px; background: var(--plate-2); overflow: hidden; min-width: 60px; }
.insp-meter i { display: block; height: 100%; background: #9aa1a8; }
.insp-meter.bad i { background: var(--red); }
.insp-tool { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.insp-tool.on b { color: var(--yellow); }
.insp-tool .tag { margin-left: 6px; }
.mk-ore-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-finish { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.ln-warn { color: #f2a090; background: var(--red-bg); border-left: 3px solid var(--red); padding: 3px 7px; margin: 4px 0; border-radius: 0 3px 3px 0; }

/* ---- Operate priority list (Staff tab) ---- */
.task-list { display: flex; flex-direction: column; gap: 3px; margin: 5px 0 2px; padding-left: 8px; border-left: 2px solid var(--line-2); }
.task-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--plate); }
.task-row[draggable="true"] { cursor: grab; }
.task-row.dragging { opacity: .45; }
.task-row.drop { border-color: var(--yellow); box-shadow: 0 -2px 0 var(--yellow); }
.task-grip { color: var(--muted); letter-spacing: -2px; font-size: 12px; }
.task-n { color: var(--yellow); min-width: 12px; }
.task-btn { border: 1px solid var(--line-2); background: var(--plate-2); color: var(--muted); border-radius: 5px; padding: 0 6px; line-height: 18px; cursor: pointer; font: 600 12px var(--body); }
.task-btn:hover { color: var(--text); border-color: var(--yellow-dim); }
.task-add { align-self: flex-start; font-size: 12px; }
.worker.focus { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow), 0 0 14px rgba(230,194,41,.3); transition: box-shadow .3s; }

/* lockers: outfit preview + pickers */
.locker { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: start; }
.locker-preview { position: sticky; top: 0; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); display: grid; place-items: center; }
.locker-preview canvas { width: 160px; height: 160px; display: block; }
.locker-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.locker-label { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.locker-row { display: flex; flex-wrap: wrap; gap: 6px; }
.locker-opt {
  pointer-events: auto; cursor: pointer; padding: 5px 10px; background: var(--plate); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--text); font: 600 12px var(--body);
}
.locker-opt:hover { border-color: var(--line-2); background: var(--plate-2); }
.locker-opt.sel { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.locker-opt:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 560px) { .locker { grid-template-columns: 1fr; } .locker-preview { position: static; } }
