/* ---- 00-base.css ---- */
/* Hegemony — design tokens, reset, typography, background.
   Visual language: the main board's dark city-map, thin gold frames and uppercase gold captions,
   class colours (WC red, MC yellow, CC blue, State grey), resource colours, policy colours 1-7. */

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/montserrat.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* surfaces */
  --bg: #111a21;
  --bg-2: #16222b;
  --panel: rgba(21, 31, 39, 0.94);
  --panel-2: rgba(30, 43, 53, 0.96);
  --panel-3: #22323e;
  --line: rgba(227, 163, 59, 0.34);
  --line-soft: rgba(255, 255, 255, 0.09);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);

  /* text */
  --text: #eef2f4;
  --text-2: #c9d3da;
  --muted: #92a2ad;
  --gold: #e3a33b;
  --gold-2: #f3c26a;
  --pos: #63c46b;
  --neg: #ff6b5e;
  --warn: #f5b13d;

  /* classes */
  --wc: #e3262b;
  --mc: #f5c518;
  --cc: #1d9bd7;
  --st: #a7b0b5;
  --wc-ink: #ff5a5e;
  --mc-ink: #ffd84a;
  --cc-ink: #43b5ee;
  --st-ink: #c7cfd4;

  /* resources / industries */
  --food: #6db33f;
  --luxury: #1fa5de;
  --health: #e5322e;
  --education: #f28f1c;
  --influence: #a457a8;
  --media: #a457a8;
  --i-food: var(--food);
  --i-luxury: var(--luxury);
  --i-health: var(--health);
  --i-education: var(--education);
  --i-media: var(--media);

  /* worker skill fills (meeple colours) */
  --sk-unskilled: #a7afb4;
  --sk-food: #72c23f;
  --sk-luxury: #33b6ec;
  --sk-health: #f5f5f5;
  --sk-education: #f7d028;
  --sk-media: #ef8fd2;

  /* policies (colours of the politics table) */
  --p1: #1a8fd0;
  --p2: #7d5aa8;
  --p3: #c64fa3;
  --p4: #e3262b;
  --p5: #f28f1c;
  --p6: #a5774b;
  --p7: #8a9095;

  /* wages (company cards: L3 red, L2 yellow, L1 blue) */
  --l1: #1d9bd7;
  --l2: #f5c518;
  --l3: #e3262b;

  --r: 12px;
  --r-s: 8px;
  --gap: 12px;
  --topbar-h: 92px;
  --bnav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #e9edf0;
  --bg-2: #f4f6f8;
  --panel: rgba(255, 255, 255, 0.97);
  --panel-2: #f3f5f7;
  --panel-3: #e6ebef;
  --line: rgba(178, 120, 22, 0.45);
  --line-soft: rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 16px rgba(20, 30, 40, 0.12);
  --text: #121a20;
  --text-2: #2c3a44;
  --muted: #5d6c76;
  --gold: #a96d0c;
  --gold-2: #8a5806;
  --pos: #1f8a2c;
  --neg: #c62a1f;
  --warn: #a96d0c;
  --wc-ink: #c9161c;
  --mc-ink: #9a7600;
  --cc-ink: #0a6fa6;
  --st-ink: #56636b;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.38;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(10, 16, 21, 0.35), rgba(10, 16, 21, 0.62)),
    url('/assets/bg/board-texture.webp'),
    url('/bg-city.svg');
  background-size: auto, 640px, 480px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  min-height: 100dvh;
}

:root[data-theme='light'] body {
  background-image: linear-gradient(180deg, rgba(240, 243, 246, 0.88), rgba(240, 243, 246, 0.94)), url('/bg-city.svg');
  background-size: auto, 480px;
}

body.sheet-open { overflow: hidden; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }

a { color: var(--gold-2); }

:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }

img { max-width: 100%; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; }

p { margin: 0.4em 0; }

small { font-size: 0.82em; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }

.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.note { color: var(--muted); font-size: 0.84em; margin: 8px 2px 0; }
.empty { color: var(--muted); padding: 18px 12px; text-align: center; font-size: 0.92em; }
.empty.small { padding: 8px; font-size: 0.85em; }

/* class / industry / resource colour helpers */
.c-WC { --cc-color: var(--wc); --ink: var(--wc-ink); }
.c-MC { --cc-color: var(--mc); --ink: var(--mc-ink); }
.c-CC { --cc-color: var(--cc); --ink: var(--cc-ink); }
.c-ST { --cc-color: var(--st); --ink: var(--st-ink); }
.i-food, .r-food { --ind: var(--food); }
.i-luxury, .r-luxury { --ind: var(--luxury); }
.i-health, .r-health { --ind: var(--health); }
.i-education, .r-education { --ind: var(--education); }
.i-media, .r-influence { --ind: var(--media); }
.p1 { --pc: var(--p1); } .p2 { --pc: var(--p2); } .p3 { --pc: var(--p3); } .p4 { --pc: var(--p4); }
.p5 { --pc: var(--p5); } .p6 { --pc: var(--p6); } .p7 { --pc: var(--p7); }

.ic { display: inline-block; vertical-align: middle; flex: none; }
.ic.inline { vertical-align: -3px; margin: 0 1px; }

/* boot screen */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.boot-logo { font-size: 30px; letter-spacing: 0.32em; font-weight: 300; color: var(--text); padding-left: 0.32em; }
.boot-logo::after { content: ''; display: block; height: 2px; margin: 10px auto 0; width: 70%; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.boot-sub { color: var(--muted); }
.boot-note { color: var(--muted); max-width: 420px; font-size: 0.9em; }

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

/* ---- 10-chrome.css ---- */
/* App chrome: top status bar, bottom navigation, prompt dock, sheets, toasts. */

.app { min-height: 100vh; min-height: 100dvh; }
.screen { padding: 10px 10px calc(var(--bnav-h) + var(--safe-b) + 76px); max-width: 760px; margin: 0 auto; animation: screen-in 0.18s var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(13, 20, 26, 0.97), rgba(17, 26, 33, 0.95));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  padding: max(6px, env(safe-area-inset-top, 0px)) 10px 6px;
  backdrop-filter: blur(6px);
}
:root[data-theme='light'] .topbar { background: rgba(255, 255, 255, 0.96); }
.topbar::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--cc-color, var(--gold)); opacity: 0.9; }
.topbar.me-WC { --cc-color: var(--wc); } .topbar.me-MC { --cc-color: var(--mc); } .topbar.me-CC { --cc-color: var(--cc); } .topbar.me-ST { --cc-color: var(--st); }
.tb-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-round { display: flex; gap: 3px; flex: none; }
.tb-round i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: #1b1405; transition: all 0.2s; }
.tb-round i.past { background: rgba(227, 163, 59, 0.55); }
.tb-round i.cur { width: 24px; height: 24px; background: radial-gradient(circle at 35% 30%, #ffe2a3, var(--gold) 60%, #a86f12); box-shadow: 0 0 0 2px rgba(227, 163, 59, 0.3); }
.tb-phase { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.tb-phase b { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-phase span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 400px) {
  /* only the current round coin; the phase name may take two short lines ("Подготовка к игре") */
  .tb-phase b { font-size: 12px; letter-spacing: 0.03em; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.1; overflow-wrap: normal; }
  .tb-round i:not(.cur) { display: none; }
  .tb-round i.cur { width: 22px; height: 22px; }
  .tb-counters { gap: 6px; padding: 3px 7px; }
}
.tb-spacer { flex: 0 1 4px; }
.tb-counters { display: flex; align-items: center; gap: 7px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-soft); min-height: 36px; flex: none; }
.tb-counters .amt b { font-size: 14px; }
.tb-me { flex: none; }
.tb-me { position: relative; }
.conn { position: absolute; z-index: 2; margin: 26px 0 0 -12px; width: 10px; height: 10px; border-radius: 50%; background: var(--pos); flex: none; border: 2px solid #10181e; }
.conn.connecting { background: var(--warn); animation: blink 1.2s infinite; }
.conn.offline { background: var(--neg); }
@keyframes blink { 50% { opacity: 0.3; } }
.tb-status { margin-top: 5px; font-size: 13px; min-height: 22px; display: flex; align-items: center; overflow: hidden; }
.tb-status > span { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; white-space: nowrap; overflow: hidden; }
.tb-status .st-mine { display: block; text-overflow: ellipsis; }
.tb-status .st-mine .ic { vertical-align: -3px; margin-right: 4px; }
.st-mine { color: var(--gold-2); font-weight: 700; }
.topbar.my-turn .tb-status { animation: pulse-gold 2.4s infinite; border-radius: 6px; }
@keyframes pulse-gold { 0%, 100% { background: transparent; } 50% { background: rgba(227, 163, 59, 0.12); } }
.st-wait { color: var(--text-2); }
.st-wait .cname .ic:last-child:not(:first-child) { color: var(--gold-2); }
.st-bot > .ic { color: var(--gold-2); animation: blink 1.6s infinite; }
.st-over { color: var(--gold-2); font-weight: 700; }
.cname { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--ink); }

/* ---------------- class badge & tag */
.cbadge { display: inline-grid; place-items: center; border-radius: 50%; background: var(--cc-color); color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 0 0 2px rgba(255, 255, 255, 0.12); }
.cbadge.c-MC { color: #3a2c00; }
.cbadge.c-ST { color: #1f272c; }
.cbadge.spect { width: 32px; height: 32px; background: var(--panel-3); color: var(--text-2); }
.ctag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 999px; font-weight: 700; font-size: 0.86em; color: var(--ink); background: color-mix(in srgb, var(--cc-color) 16%, transparent); border: 1px solid color-mix(in srgb, var(--cc-color) 45%, transparent); white-space: nowrap; line-height: 1.5; vertical-align: middle; }
.ctag-name { font-weight: 500; color: var(--text-2); }

/* ---------------- bottom navigation */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bnav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(12, 18, 23, 0.97); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
:root[data-theme='light'] .bnav { background: rgba(255, 255, 255, 0.97); }
.bnav-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0; position: relative; min-width: 0; }
.bnav-b.on { color: var(--gold-2); }
.bnav-b.on::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold); }
.bnav-i { position: relative; }
.bnav-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 1px; font-size: min(10.5px, 2.6vw); letter-spacing: -0.01em; }
.badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--panel-3); color: var(--text); font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; border: 1px solid var(--line-soft); }
.badge.hot { background: var(--gold); color: #2a1a00; border-color: transparent; }

/* ---------------- prompt dock */
.dock {
  position: fixed; left: 8px; right: 8px; bottom: calc(var(--bnav-h) + var(--safe-b) + 8px); z-index: 29;
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(90deg, #e7a83f, #f4c46b); color: #2a1a00; font-weight: 700;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  animation: dock-in 0.25s var(--ease);
}
@keyframes dock-in { from { transform: translateY(20px); opacity: 0; } }
.dock-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-t .ctag, .dock-t .mnum { color: inherit; }
.dock-go { display: flex; align-items: center; gap: 2px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.is-wide .dock { left: auto; right: 20px; bottom: 20px; width: 420px; }

/* ---------------- sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 12, 0.6); animation: fade-in 0.18s; }
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column;
  /* opaque (the translucent --panel tokens let the text of the screen below shine through the form) */
  background: linear-gradient(180deg, #1e2b35, #151f27);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  animation: sheet-up 0.24s var(--ease);
  padding-bottom: var(--safe-b);
}
:root[data-theme='light'] .sheet { background: #fff; }
.sheet.tall { height: 88vh; height: 88dvh; }
.sheet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 18px 18px 0 0; background: var(--accent, var(--gold)); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
.sheet-grip { display: flex; justify-content: center; padding: 8px 0 2px; touch-action: none; cursor: grab; }
.sheet-grip i { width: 42px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
:root[data-theme='light'] .sheet-grip i { background: rgba(0, 0, 0, 0.2); }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 2px 10px 8px 16px; border-bottom: 1px solid var(--line-soft); }
.sheet-t { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.sheet-t > span:not(.ptitle) { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 16px; outline: none; }
.sheet-f { border-top: 1px solid var(--line-soft); padding: 10px 12px; background: rgba(0, 0, 0, 0.12); }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.icon-btn:hover, .icon-btn.on { background: rgba(255, 255, 255, 0.08); color: var(--gold-2); }
@media (min-width: 900px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 18px; border-bottom: 1px solid var(--line); max-height: 86vh; }
  .sheet.tall { height: auto; min-height: 60vh; }
  .sheet::before { border-radius: 18px 18px 0 0; }
}

/* ---------------- toasts & banners */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--topbar-h) + 8px); z-index: 60; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 10px 14px; border-radius: 12px; background: #23323d; color: #fff; box-shadow: var(--shadow); font-size: 14px; border-left: 4px solid var(--gold); animation: dock-in 0.2s; }
.toast.ok { border-left-color: var(--pos); }
.toast.bad { border-left-color: var(--neg); }
.update-banner { display: block; width: 100%; padding: 8px; background: var(--gold); color: #2a1a00; font-weight: 700; text-align: center; }

/* ---- 20-bits.css ---- */
/* Shared components: panels, buttons, chips, segmented controls, steppers, amounts, stats, meeples. */

/* ---------------- panel: thin gold frame + gold uppercase caption (like the board) */
.panel {
  position: relative; margin: 0 0 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--topbar-h) + 8px);
}
.panel::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent); opacity: 0.85; }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 0; min-height: 46px; }
.panel-t { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 46px; color: var(--gold-2); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; font-size: 13px; min-width: 0; }
.panel-t > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-t .ic:first-child { color: var(--accent, var(--gold)); }
.panel-x { display: flex; align-items: center; gap: 6px; }
.panel-b { padding: 0 12px 12px; }
.panel.closed .panel-b { display: none; }
.chev { transition: transform 0.2s; opacity: 0.7; }
.chev.open { transform: rotate(90deg); }
.subhead { display: flex; align-items: center; gap: 6px; margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--text-2); flex-wrap: wrap; }
.subhead small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.subhead .hint-btn { margin-left: auto; }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 14px 2px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-2); flex-wrap: wrap; }
.sec-h small { color: var(--muted); font-weight: 600; }
.sec-sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 12px; font-weight: 700; font-size: 14.5px; border: 1px solid var(--line-soft); background: var(--panel-3); color: var(--text); transition: transform 0.08s, background 0.15s, opacity 0.15s; text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 9px; }
.btn.full { flex: 1; }
.btn-primary { background: linear-gradient(180deg, #f2bd59, #d9922a); color: #2a1a00; border-color: rgba(255, 255, 255, 0.25); box-shadow: 0 3px 10px rgba(227, 163, 59, 0.25); }
.btn-gold { background: transparent; color: var(--gold-2); border-color: var(--gold); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line-soft); }
.btn-danger { background: #8f1d1a; color: #fff; }
.linklike { color: var(--muted); text-decoration: underline; font-size: 13px; padding: 6px 0; }
.pf-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-btns .btn.full { min-width: 46%; }
.hint-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--gold-2); flex: none; }
.hint-btn:hover { background: rgba(227, 163, 59, 0.15); }

/* chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.04); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--gold); color: #2a1a00; border-color: transparent; }
.chip.gold { border-color: var(--gold); color: var(--gold-2); }
.chip.c-WC.on, .chip.c-MC.on, .chip.c-CC.on, .chip.c-ST.on { background: var(--cc-color); color: #fff; }
.chip.c-MC.on { color: #2c2200; }
.chip-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold-2); font-weight: 800; font-size: 14px; min-height: 32px; }

/* segmented */
.seg { display: inline-flex; border: 1px solid var(--line-soft); border-radius: 11px; padding: 2px; background: rgba(0, 0, 0, 0.2); gap: 2px; max-width: 100%; flex-wrap: wrap; }
.seg-b { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg-b.on { background: var(--panel-3); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme='light'] .seg { background: #eef1f4; }
:root[data-theme='light'] .seg-b.on { background: #fff; }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper-l { margin-right: 6px; font-size: 13px; color: var(--text-2); }
.stepper-b { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); border: 1px solid var(--line-soft); color: var(--text); }
.stepper-b:disabled { opacity: 0.3; }
.stepper-v { min-width: 40px; text-align: center; font-weight: 800; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; }

/* checkbox row */
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; border: 1px solid var(--line-soft); margin: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; margin: 1px 0 0; }
.check span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check small { color: var(--muted); }
.check.dis { opacity: 0.5; }

/* amounts with icons */
.amt { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; vertical-align: middle; }
.amt b { font-weight: 800; }
.amt.money b { color: var(--gold-2); }
.won { color: var(--gold); font-weight: 700; font-size: 0.92em; }
.amt.dim { opacity: 0.5; }
.amt.vp b { color: #f0f3f5; }
.mnum { font-weight: 800; }

/* section letters, wages */
.sec { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 4px; border-radius: 5px; background: var(--pc, var(--panel-3)); color: #fff; font-weight: 800; font-size: 12px; }
.wage { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; font-weight: 800; font-size: 11.5px; line-height: 1.5; color: #fff; }
.wage em { font-style: normal; font-weight: 700; opacity: 0.95; }
.wage.L1 { background: var(--l1); }
.wage.L2 { background: var(--l2); color: #2b2200; }
.wage.L3 { background: var(--l3); }
.wage.none { background: var(--panel-3); color: var(--muted); }

/* stat tiles (class boards) */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 8px; }
.stat { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 10px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft); min-width: 0; text-align: left; }
:root[data-theme='light'] .stat { background: #f6f8fa; }
.stat.tappable:active { transform: scale(0.98); }
.stat-v { font-size: 21px; font-weight: 800; line-height: 1.15; }
.stat-v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-l { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.02em; font-weight: 600; line-height: 1.2; hyphens: manual; -webkit-hyphens: manual; max-width: 100%; }
.stat-s { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.stat-q { position: absolute; top: 6px; right: 8px; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; display: grid; place-items: center; color: var(--gold-2); border: 1px solid var(--line); font-weight: 800; }
.stat.bad { border-color: rgba(255, 107, 94, 0.5); }
.stat.bad .stat-v { color: var(--neg); }
.stat.good .stat-v { color: var(--pos); }

/* pips track */
.pips { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.pip { width: 14px; height: 14px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); font-style: normal; }
.pip.cur { box-shadow: 0 0 0 2px #fff; }

/* meeples */
.meeple { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.meeple.dim { opacity: 0.45; }
.meeple.empty { opacity: 0.85; }
.skill-dot { display: inline-block; border-radius: 3px; vertical-align: middle; }

/* messages */
.mp { display: inline; }
.msg-missing { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.msg-missing code { color: var(--warn); background: rgba(245, 177, 61, 0.1); padding: 0 4px; border-radius: 4px; }
.mm-p { font-size: 0.86em; color: var(--muted); }
.mm-p i { font-style: normal; color: var(--text-2); }
.mjson { color: var(--muted); }
.mlist { display: inline; }
.mbundle { display: inline-flex; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.clink { display: inline; font-weight: 700; color: var(--text); border-bottom: 2px solid var(--ind, var(--gold)); padding: 0 1px; line-height: 1.2; }
.mcard { font-weight: 700; font-style: italic; color: var(--ink, var(--text)); }
.mcard.ev { color: #f1b65c; }
.ind { font-weight: 700; color: var(--ind); }
.skillname { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.pname { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.pname i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--pc); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: rgba(227, 163, 59, 0.18); color: var(--gold-2); font-size: 11px; font-weight: 700; margin-left: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cc-color); }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.formula { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); border: 1px dashed var(--line); font-size: 15px; line-height: 1.8; margin: 4px 0 10px; }
.formula sub { font-size: 10px; color: var(--muted); margin-left: 2px; }
.formula .big { font-size: 22px; color: var(--gold-2); }
:root[data-theme='light'] .formula { background: #f6f3ec; }

/* ---- 30-board.css ---- */
/* Board screen: scoreboard, section jumps, politics, workers, state areas, foreign market, events. */

.board { display: flex; flex-direction: column; }

/* ---------------- scoreboard */
.scoreboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.score { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 7px 6px 6px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line-soft); border-top: 3px solid var(--cc-color); min-width: 0; box-shadow: var(--shadow); }
.score.me { border-color: var(--cc-color); background: linear-gradient(180deg, color-mix(in srgb, var(--cc-color) 18%, var(--panel)), var(--panel)); }
.score.acting::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(227, 163, 59, 0.25); animation: blink 1.4s infinite; }
.score-h { display: flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 700; font-size: 12px; min-width: 0; }
.score-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.online { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; opacity: 0.6; }
.online.on { background: var(--pos); opacity: 1; }
/* presence dot sits on the class icon (like an avatar badge) so the player name keeps the room */
.score.acting .score-h { padding-right: 9px; }
.score-ic { position: relative; display: inline-flex; flex: none; }
.score-ic .online { position: absolute; right: -3px; bottom: -2px; width: 7px; height: 7px; box-shadow: 0 0 0 1.5px var(--panel); opacity: 1; }
.score-ic .online:not(.on) { background: #5d6870; }
/* a seat played by the server's bot: small robot badge on the class icon */
.bot-badge { position: absolute; right: -6px; bottom: -5px; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--panel-3); color: var(--gold-2); box-shadow: 0 0 0 1.5px var(--panel); }
.score-vp { display: flex; align-items: center; gap: 3px; font-size: 22px; font-weight: 800; line-height: 1.1; }
.score-vp .lead { font-style: normal; font-size: 11px; color: var(--gold); }
.score-c { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- section jumps */
.jumps { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.jumps::-webkit-scrollbar { display: none; }
.jump { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; min-height: 36px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }

/* ---------------- politics */
.pol-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin: -2px 0 8px; }
.pol-legend span { display: inline-flex; align-items: center; gap: 4px; }
.policies { display: flex; flex-direction: column; gap: 6px; }
.policy { border-radius: 10px; background: rgba(0, 0, 0, 0.18); border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); overflow: hidden; }
:root[data-theme='light'] .policy { background: #f7f8fa; }
.policy.has-bill { box-shadow: 0 0 0 1px var(--gold) inset; }
.pol-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px 4px 0; min-height: 34px; background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 55%, transparent), transparent 70%); }
.pol-n { width: 30px; align-self: stretch; display: grid; place-items: center; background: var(--pc); color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.pol-t { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 3px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff; background: color-mix(in srgb, var(--cc-color) 85%, #000); flex: none; }
.bill-tag.c-MC { color: #2b2200; }
.pol-secs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.psec { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 6px 7px 7px; min-height: 52px; border-left: 1px solid var(--line-soft); opacity: 0.55; min-width: 0; }
.psec:first-child { border-left: 0; }
.psec.cur { opacity: 1; background: color-mix(in srgb, var(--pc) 28%, transparent); box-shadow: inset 0 -3px 0 var(--pc); }
.psec.proposed { opacity: 1; outline: 2px dashed var(--cc-color, var(--gold)); outline-offset: -3px; border-radius: 6px; }
.psec.by-WC { --cc-color: var(--wc); } .psec.by-MC { --cc-color: var(--mc); } .psec.by-CC { --cc-color: var(--cc); } .psec.by-ST { --cc-color: var(--st); }
.psec-l { font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.psec-e { display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: center; font-size: 12px; font-weight: 700; }
.ef { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.ef.sm { font-size: 10.5px; font-weight: 600; color: var(--text-2); white-space: normal; }
.fan { width: 7px; height: 7px; border-radius: 50%; background: var(--cc-color); display: inline-block; opacity: 0.85; }
.agenda-mark { color: var(--gold); font-size: 12px; margin-left: 1px; }
.marker { position: absolute; top: 5px; right: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--cc-color); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.6); }
.pol-derived { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 38px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-soft); font-size: 12.5px; }
.dchip b { font-size: 16px; color: var(--gold-2); }
.bag-row { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.bag { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.04); width: 100%; flex-wrap: wrap; }
.bag-t { display: flex; flex-direction: column; font-weight: 700; font-size: 13px; flex: 1; min-width: 90px; }
.bag-t small { color: var(--muted); font-weight: 500; }
.bag-c { display: flex; gap: 10px; }
.cubes { display: inline-flex; align-items: center; gap: 3px; }
.cubes small { color: var(--muted); font-size: 10.5px; }
.cubes-row { display: inline-flex; gap: 10px; }
.bill-markers { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.bm { display: inline-flex; gap: 2px; }
.bmk { width: 11px; height: 11px; border-radius: 50%; background: var(--cc-color); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25); }
.bmk.used { opacity: 0.2; }
.refill-note { font-size: 11.5px; color: var(--muted); }

/* ---------------- workers */
.unemp { display: flex; flex-direction: column; gap: 8px; }
.unemp-row { border-radius: 10px; padding: 8px 10px; background: color-mix(in srgb, var(--cc-color) 9%, transparent); border: 1px solid color-mix(in srgb, var(--cc-color) 30%, transparent); }
.unemp-h { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.unemp-h b { flex: 1; }
.pop-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text); background: rgba(0, 0, 0, 0.25); min-height: 28px; }
.unemp-b { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 10px; margin-top: 6px; min-height: 34px; }
.mgroup { display: inline-flex; align-items: flex-end; gap: 1px; }
.mgroup b { font-size: 13px; }
.unemp-n { margin-left: auto; font-size: 12px; color: var(--muted); }
.unions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.union { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 10px; background: color-mix(in srgb, var(--ind) 22%, transparent); border: 1px solid color-mix(in srgb, var(--ind) 45%, transparent); min-width: 0; }
.union.on { background: color-mix(in srgb, var(--ind) 60%, #000); box-shadow: 0 0 0 2px var(--ind); }
.union.possible { border-style: dashed; border-color: var(--gold); }
.union-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.02em; font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.union-s { font-size: 11px; color: var(--muted); font-weight: 700; }
.union-s.ok { color: var(--pos); }
.demo-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.demo, .immig { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.04); width: 100%; }
.demo.on { border-color: var(--wc); background: rgba(227, 38, 43, 0.14); }
.demo.possible { border-color: var(--gold); border-style: dashed; }
.demo-t, .immig-t { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.demo-t small, .immig-t small { color: var(--muted); }
.demo-state { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.demo-state.ok { color: var(--warn); }
.demo.on .demo-state { color: var(--wc-ink); }
.deck-n { min-width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--panel-3); font-weight: 800; font-size: 13px; }
.supply { margin-top: 10px; font-size: 12.5px; }
.supply summary { cursor: pointer; color: var(--text-2); padding: 6px 0; }
.supply-grid { display: flex; flex-direction: column; gap: 6px; }
.supply-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.supply-row .cname { width: 64px; }
.sup { display: inline-flex; align-items: center; gap: 2px; }

/* ---------------- state areas */
.treasury { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(90deg, rgba(227, 163, 59, 0.16), transparent); border: 1px solid var(--line); flex-wrap: wrap; }
.treasury-v { display: flex; flex-direction: column; flex: 1; }
.treasury-v b { font-size: 26px; color: var(--gold-2); line-height: 1.1; }
.treasury-v small { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.loans { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.loans.bad { color: var(--neg); font-weight: 700; }
.svcs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.svcs.goods { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.svc { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 9px 9px 12px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--ind) 50%, transparent); background: color-mix(in srgb, var(--ind) 10%, transparent); text-align: left; overflow: hidden; }
.svc .ic { grid-row: span 2; }
.svc-n b { font-size: 20px; font-weight: 800; }
.svc-n small { color: var(--muted); font-weight: 600; }
.svc-p { font-size: 12.5px; font-weight: 800; color: var(--gold-2); }
.svc-p.free { color: var(--pos); }
.svc-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.08); }
.svc-bar i { display: block; height: 100%; background: var(--ind); }
.benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.benefit { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--cc-color) 35%, transparent); min-height: 62px; min-width: 0; }
.benefit.full { background: color-mix(in srgb, var(--cc-color) 14%, transparent); border-color: var(--cc-color); }
.benefit-h { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; color: var(--ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.benefit-b { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }

/* ---------------- foreign market */
.market { display: grid; grid-template-columns: 1fr; gap: 6px; }
.imp { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ind) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ind) 40%, transparent); margin-bottom: 6px; }
.imp-total b { font-size: 20px; font-weight: 800; }
.imp-split { font-size: 12px; color: var(--text-2); }
.imp-split em { font-style: normal; color: var(--warn); font-weight: 700; }
.imp-split em.muted { color: var(--muted); }
.exp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.exp-r { display: flex; flex-direction: column; gap: 4px; padding: 7px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); border-left: 3px solid var(--ind); }
.exp-tx { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.exp-tx .m { color: var(--gold-2); }
.deals { display: flex; flex-wrap: wrap; gap: 8px; }
.deal { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 11px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.04); flex: 1 1 260px; min-width: 0; }
.deal-img { width: 64px; border-radius: 6px; flex: none; }
.deal-art { width: 64px; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 8px; background: color-mix(in srgb, var(--ind) 30%, #1a2630); font-size: 22px; flex: none; }
.deal-b { display: flex; flex-direction: column; gap: 3px; font-size: 13px; min-width: 0; }
.deal-b em { font-style: normal; color: var(--muted); }

/* ---------------- events & agenda */
.events { display: grid; grid-template-columns: 1fr; gap: 8px; }
.event { display: flex; gap: 10px; padding: 9px; border-radius: 12px; background: linear-gradient(135deg, rgba(232, 163, 59, 0.12), rgba(0, 0, 0, 0.18)); border: 1px solid rgba(232, 163, 59, 0.45); width: 100%; text-align: left; min-width: 0; }
.event.empty { align-items: center; justify-content: center; color: var(--muted); border-style: dashed; min-height: 70px; background: none; }
.event-art { flex: none; width: 58px; }
.event-art .art { width: 58px; height: 58px; object-fit: cover; border-radius: 50%; }
.event-globe { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #4b3a1d, #1c1a14); border: 2px solid #e8a33b; }
.event-b { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.event-n { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; color: #f3c26a; }
:root[data-theme='light'] .event-n { color: #9a5c00; }
.event-task { font-size: 12.5px; color: var(--text-2); }
.event-rows { display: flex; flex-direction: column; gap: 3px; }
.event-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; }
.event-row em { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); width: 100%; }
.event-row .opt { display: inline-flex; gap: 2px; }
.rew { display: inline-flex; align-items: center; gap: 1px; font-size: 12px; font-weight: 800; color: var(--ink, var(--text)); }
.rew.token { outline: 1.5px solid currentColor; border-radius: 6px; padding: 0 3px; }
.rew small { display: inline-flex; align-items: center; font-weight: 600; }
.event-row.bad .rew b { color: var(--neg); }
.agenda { margin-top: 6px; }
.agenda-b { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.agenda-p { display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px; border-radius: 8px; font-weight: 800; font-size: 14px; background: color-mix(in srgb, var(--pc) 25%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 60%, transparent); opacity: 0.6; }
.agenda-p.ok { opacity: 1; background: var(--pc); color: #fff; }
.agenda-vp { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 18px; }
.agenda-vp small { font-size: 11px; color: var(--muted); margin-left: 4px; }

@media (min-width: 600px) {
  /* by the width of the panel, not of the viewport: in the two-column board (720-1099 px) and in the dashboard the panel is ~330 px */
  .events { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .demo-row { grid-template-columns: 1fr 1fr; }
  .market { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ---------------- results (game over) */
.results { padding: 10px 12px 12px; border-color: var(--gold); background: linear-gradient(160deg, rgba(227, 163, 59, 0.22), var(--panel) 60%); }
.res-h { display: flex; align-items: center; gap: 8px; color: var(--gold-2); text-transform: uppercase; letter-spacing: 0.08em; font-size: 15px; margin-bottom: 8px; }
.res-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.res { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border-left: 4px solid var(--cc-color); color: var(--ink); }
.res.win { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.res-pos { width: 22px; font-weight: 800; color: var(--muted); }
.res-n { flex: 1; display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.res-n small { color: var(--muted); }
.res-vp { display: flex; align-items: center; gap: 3px; font-size: 20px; color: var(--text); }
.res-crown { color: var(--gold); }

/* ---- 40-companies.css ---- */
/* Companies: overview grid, compact strip, long list, markets, company sheet. */

.co-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.co-toolbar .seg { flex: 1; }
.co-toolbar .seg-b { flex: 1; justify-content: center; }
.co-group { margin-bottom: 14px; }
.co-gh { display: flex; align-items: center; gap: 7px; padding: 6px 4px; margin-bottom: 6px; color: var(--ink); border-bottom: 2px solid color-mix(in srgb, var(--cc-color) 70%, transparent); font-size: 14px; }
.co-gh b { text-transform: uppercase; letter-spacing: 0.06em; font-size: 13px; }
.co-gm { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.co-gops { display: inline-flex; align-items: center; gap: 2px; color: var(--pos); font-size: 12px; font-weight: 800; }

/* ---------------- (a) overview grid */
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; }
.co-tile {
  position: relative; display: flex; flex-direction: column; min-width: 0; text-align: left;
  border-radius: 10px; overflow: hidden; background: var(--panel); border: 1px solid color-mix(in srgb, var(--ind) 55%, transparent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); transition: transform 0.1s;
}
.co-tile:active { transform: scale(0.98); }
.co-art { position: relative; height: 54px; background: color-mix(in srgb, var(--ind) 35%, #18242d); overflow: hidden; }
.co-art .art { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-art-fb { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.co-top { position: absolute; top: 4px; left: 4px; right: 4px; display: flex; justify-content: space-between; align-items: flex-start; }
.prod { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 6px; border-radius: 999px; background: rgba(10, 15, 19, 0.82); color: #fff; font-weight: 800; font-size: 13px; }
.prod.off { opacity: 0.7; }
.prod .mach { margin-left: 1px; }
.co-name { padding: 4px 6px 0; font-size: 11.5px; font-weight: 700; line-height: 1.2; min-height: 30px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; border-top: 3px solid var(--ind); }
.co-body { padding: 2px 5px 6px; }
.slots { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1px; min-height: 24px; }
.slot.emp { padding-left: 3px; margin-left: 2px; border-left: 1px dashed var(--line-soft); }
.auto { color: var(--text-2); }
.co-flags { position: absolute; left: 4px; top: 32px; display: flex; gap: 3px; align-items: center; }
.flag { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; background: var(--panel-3); color: var(--text-2); }
.flag.strike { background: rgba(227, 38, 43, 0.25); color: var(--wc-ink); }
.flag.strike.on { background: var(--wc); color: #fff; }
.flag.idle { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.flag.half { background: rgba(245, 197, 24, 0.2); color: var(--mc-ink); }
.co-tile.off { border-style: dashed; }
.co-tile.off .co-art .art { filter: grayscale(0.85) brightness(0.65); }
.co-tile.striking::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(-45deg, transparent 0 12px, rgba(227, 38, 43, 0.12) 12px 18px); }
.co-tile.committed .co-name::after { content: ' 🔒'; font-size: 9px; }

/* ---------------- (b) compact strip */
.co-strip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 10px; scrollbar-width: none; background: rgba(10, 16, 21, 0.6); border-radius: 10px; margin-bottom: 10px; }
.co-strip::-webkit-scrollbar { display: none; }
.co-strip.pinned { position: sticky; top: var(--topbar-h); z-index: 25; border-radius: 0; margin: 0; border-bottom: 1px solid var(--line); background: rgba(12, 18, 23, 0.94); backdrop-filter: blur(6px); }
:root[data-theme='light'] .co-strip { background: rgba(255, 255, 255, 0.9); }
.cs-g { display: flex; gap: 3px; align-items: stretch; padding-left: 6px; border-left: 3px solid var(--cc-color); flex: none; }
.cs-o { display: grid; place-items: center; color: var(--ink); padding-right: 2px; }
.co-micro { position: relative; width: 38px; min-height: 42px; border-radius: 6px; background: color-mix(in srgb, var(--ind) 30%, #16212a); border-bottom: 3px solid var(--ind); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3px 2px; flex: none; }
:root[data-theme='light'] .co-micro { background: color-mix(in srgb, var(--ind) 22%, #fff); }
.co-micro.off { opacity: 0.45; border-bottom-style: dashed; }
.cm-p { display: inline-flex; align-items: center; gap: 1px; font-weight: 800; font-size: 12px; color: #fff; }
:root[data-theme='light'] .cm-p { color: var(--text); }
.cm-w { display: flex; gap: 1px; flex-wrap: wrap; justify-content: center; }
.wd { width: 7px; height: 9px; border-radius: 3px 3px 1px 1px; background: rgba(255, 255, 255, 0.15); border: 1px dashed rgba(255, 255, 255, 0.35); }
.wd.c-WC, .wd.c-MC { border: 0; box-shadow: inset 0 -2px 0 var(--cc-color); }
.wd.com { transform: rotate(-90deg) scale(0.9); }
.cm-strike { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--wc); border: 2px solid #fff; }
.cm-wage { position: absolute; top: 2px; left: 2px; width: 5px; height: 5px; border-radius: 50%; }
.cm-wage.L1 { background: var(--l1); } .cm-wage.L2 { background: var(--l2); } .cm-wage.L3 { background: var(--l3); }

/* ---------------- (c) long list */
.co-list { display: flex; flex-direction: column; gap: 6px; }
.co-row { display: grid; grid-template-columns: 5px 1fr auto; grid-template-areas: 'band main slots' 'band main stor'; column-gap: 10px; align-items: center; padding: 8px 10px 8px 0; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); text-align: left; min-width: 0; overflow: hidden; }
.co-row.off { opacity: 0.75; border-style: dashed; }
.cr-band { grid-area: band; align-self: stretch; background: var(--ind); }
.cr-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cr-name { font-weight: 700; font-size: 14px; }
.cr-sub { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.cr-slots { grid-area: slots; justify-self: end; }
.cr-stor { grid-area: stor; justify-self: end; font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }

/* ---------------- markets */
.markets .panel-b { display: flex; flex-direction: column; gap: 4px; }
.mkt-cards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.mkt-cards.pick { flex-wrap: wrap; overflow: visible; }
.mcard-co { position: relative; width: 122px; flex: none; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--ind) 60%, transparent); text-align: left; }
.mcard-co.dim { opacity: 0.55; }
.mcard-co.sel { box-shadow: 0 0 0 3px var(--gold); }
.mc-art { height: 58px; background: color-mix(in srgb, var(--ind) 35%, #18242d); }
.mc-art .art { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-name { padding: 4px 7px 0; font-size: 11.5px; font-weight: 800; line-height: 1.2; min-height: 30px; border-top: 3px solid var(--ind); overflow-wrap: anywhere; }
.mc-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 7px; }
.mc-cost { font-weight: 800; color: var(--gold-2); font-size: 13px; }
.mcard-co .prod { background: rgba(0, 0, 0, 0.35); font-size: 12px; }
.mc-slots { display: flex; align-items: flex-end; gap: 1px; padding: 0 6px 4px; min-height: 22px; flex-wrap: wrap; }
.emp-plus { display: inline-flex; align-items: flex-end; margin-left: 3px; padding-left: 3px; border-left: 1px dashed var(--line-soft); font-size: 10px; color: var(--muted); }
.mc-wages { display: flex; }
.wl { flex: 1; text-align: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; padding: 1px 0; }
.wl.L1 { background: var(--l1); } .wl.L2 { background: var(--l2); color: #2b2200; } .wl.L3 { background: var(--l3); }

/* ---------------- company sheet */
.co-sheet-t { border-bottom: 3px solid var(--ind); padding-bottom: 1px; }
.co-detail { display: grid; grid-template-columns: 1fr; gap: 12px; }
.co-scan .scan { width: 100%; max-width: 260px; display: block; margin: 0 auto; border-radius: 12px; box-shadow: var(--shadow); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; align-self: center; }
.kv dd { margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bonus { color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.bonus.on { color: var(--pos); }
.eq { color: var(--gold-2); margin-left: 4px; }
.wages-row { gap: 6px !important; }
.wl-box { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; color: #fff; opacity: 0.55; }
.wl-box b { font-size: 14px; }
.wl-box.L1 { background: var(--l1); } .wl-box.L2 { background: var(--l2); color: #2b2200; } .wl-box.L3 { background: var(--l3); }
.wl-box.cur { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.wl-box.forbidden { text-decoration: line-through; opacity: 0.3; }
.slot-list { display: flex; flex-direction: column; gap: 6px; }
.slot-li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); }
.slot-li span { display: flex; flex-direction: column; min-width: 0; }
.slot-li small { color: var(--muted); }
.facts { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.facts .good { color: var(--pos); } .facts .bad { color: var(--neg); } .facts .muted { color: var(--muted); }
.co-card { width: 220px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #fff; color: #1d2328; box-shadow: var(--shadow); }
.cc-art { position: relative; height: 120px; background: color-mix(in srgb, var(--ind) 40%, #ddd); display: grid; place-items: center; }
.cc-art .art { width: 100%; height: 100%; object-fit: cover; }
.cc-cost { position: absolute; top: 6px; right: 6px; background: var(--ind); color: #fff; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.cc-name { background: var(--ind); color: #fff; text-align: center; font-weight: 800; text-transform: uppercase; font-size: 13px; padding: 5px; }
.cc-body { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: var(--ind); }
.cc-prod { display: flex; align-items: center; gap: 4px; font-size: 30px; font-weight: 800; color: #fff; }
.cc-wages { display: flex; }
.cc-wages .wl { padding: 4px 0; font-size: 13px; }
@media (min-width: 560px) {
  .co-detail { grid-template-columns: 220px 1fr; align-items: start; }
  .co-detail .subhead, .co-detail .slot-list, .co-detail .facts { grid-column: 1 / -1; }
}

/* ---- 50-classes.css ---- */
/* Class boards (counters) and the production/scoring forecast. */

.classes { display: flex; flex-direction: column; gap: 10px; }
.cboard { border-radius: var(--r); background: var(--panel); border: 1px solid color-mix(in srgb, var(--cc-color) 45%, transparent); overflow: hidden; box-shadow: var(--shadow); scroll-margin-top: calc(var(--topbar-h) + 8px); }
.cboard.mine { border-color: var(--cc-color); }
.cb-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--cc-color) 30%, transparent), transparent 75%); }
.cb-t { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.cb-t b { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); }
.cb-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-sum { display: flex; gap: 9px; align-items: center; font-size: 14px; }
.cb-sum .vp b { font-size: 17px; }
.cb-b { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.track { display: flex; }
.goods-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gtile { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ind) 40%, transparent); background: color-mix(in srgb, var(--ind) 9%, transparent); min-width: 0; }
.gtile b { font-size: 18px; }
.gtile small { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.15; }
.gtile.ready { border-color: var(--pos); box-shadow: 0 0 0 1px var(--pos) inset; }
.gtile.ready small { color: var(--pos); font-weight: 700; }
.stor-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.stor { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'ic n' 'bar bar' 'p p'; gap: 3px 6px; align-items: center; padding: 7px 8px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ind) 40%, transparent); background: color-mix(in srgb, var(--ind) 8%, transparent); min-width: 0; }
.stor > .ic { grid-area: ic; }
.stor-n { grid-area: n; }
.stor-n b { font-size: 17px; }
.stor-n small { color: var(--muted); }
.stor-bar { grid-area: bar; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.stor-bar i { display: block; height: 100%; background: var(--ind); }
.stor-p { grid-area: p; display: flex; gap: 3px; }
.stor-p i { flex: 1; text-align: center; font-style: normal; font-size: 11px; padding: 1px 0; border-radius: 4px; color: var(--muted); border: 1px solid var(--line-soft); }
.stor-p i.cur { background: var(--ind); color: #fff; border-color: transparent; font-weight: 800; }
.tile-note { position: absolute; top: 6px; right: 8px; color: var(--gold-2); font-size: 10px; font-weight: 700; }
.ftz { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); font-size: 13px; }
.ftz span:first-of-type { display: flex; flex-direction: column; flex: 1; min-width: 140px; }
.ftz small { color: var(--muted); }
.ws-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legit { display: flex; flex-direction: column; gap: 6px; }
.legit-row { display: flex; align-items: center; gap: 8px; }
.legit-n b { font-size: 18px; min-width: 24px; display: inline-block; text-align: center; }
.legit-track { flex: 1; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; }
.legit-track i { height: 12px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.legit-track i.on { background: var(--cc-color); }
.legit-tok { display: inline-flex; align-items: center; gap: 1px; font-size: 12px; font-weight: 800; color: var(--ink); }

/* ---------------- forecast */
.forecast { border-radius: 11px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.18); }
:root[data-theme='light'] .forecast { background: #faf7f0; }
.fc-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; font-weight: 700; font-size: 13px; color: var(--gold-2); }
.fc-h span { flex: 1; }
.fc-h b.pos { color: var(--pos); } .fc-h b.neg { color: var(--neg); }
.fc-b { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.fblock { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.fb-h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); font-weight: 700; margin-bottom: 3px; }
.fb-t { margin-left: auto; color: var(--text); }
.fl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fl { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.fl.sub { padding-left: 12px; font-size: 12.5px; color: var(--text-2); }
.fl.bad .fl-k { color: var(--neg); }
.fl.muted { color: var(--muted); }
.fl.good .fl-k { color: var(--pos); }
.fl-k { flex: 1; min-width: 0; }
.fl-v { font-weight: 800; white-space: nowrap; }
.fl-v.pos { color: var(--pos); } .fl-v.neg { color: var(--neg); }
.prodv { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fc-money { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(227, 163, 59, 0.1); font-size: 13.5px; flex-wrap: wrap; }
.fc-money span { flex: 1; }
.fc-money b { font-size: 16px; color: var(--gold-2); }
.fc-money b.neg { color: var(--neg); }
.fc-money em { font-style: normal; font-weight: 700; }
.fc-note { font-size: 11px; color: var(--muted); margin: 0; }

@media (min-width: 560px) {
  .stor-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- 60-hand.css ---- */
/* Hand: turn header, action cards (styled like the printed cards), basic/free action lists. */

.turn-head { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: linear-gradient(135deg, rgba(227, 163, 59, 0.22), rgba(227, 163, 59, 0.06)); border: 1px solid var(--gold); margin-bottom: 4px; }
.turn-head.idle { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--panel); border-color: var(--line-soft); font-size: 13.5px; }
.th-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.th-t { display: flex; align-items: center; gap: 6px; font-size: 16px; color: var(--gold-2); flex: 1 1 100%; }
.th-step { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.th-step i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; border: 2px solid var(--gold); color: var(--gold-2); }
.th-step.done i { background: var(--pos); border-color: var(--pos); color: #0b2410; }
.th-hint { font-size: 12.5px; color: var(--text-2); margin: 0; }
.pass-box { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.to { display: inline-block; padding: 0 5px; margin: 0 1px; border-radius: 5px; color: var(--ink); font-weight: 700; }
.to.cur { background: var(--cc-color); color: #fff; }
.to.c-MC.cur { color: #2b2200; }
.to.me { text-decoration: underline; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.cards.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.acard {
  position: relative; display: flex; flex-direction: column; text-align: center; min-width: 0;
  border-radius: 11px; overflow: hidden; background: #f3f1ec; color: #20262b;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s, box-shadow 0.15s;
}
.acard:active { transform: scale(0.98); }
.acard.sel { box-shadow: 0 0 0 3px var(--gold), 0 3px 10px rgba(0, 0, 0, 0.4); }
.acard.unknown { display: grid; place-items: center; min-height: 160px; background: var(--panel-3); color: var(--muted); }
.ac-art { height: 82px; background: color-mix(in srgb, var(--cc-color) 45%, #222); border-bottom: 3px solid var(--cc-color); overflow: hidden; }
.ac-art .art { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-art-fb { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc-color) 60%, #fff), var(--cc-color)); }
.ac-name { padding: 6px 6px 2px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15; }
.ac-text { padding: 0 7px; font-size: 11.5px; line-height: 1.28; color: #39434a; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ac-foot { margin-top: auto; padding: 6px 6px 7px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.req { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; background: #4a545b; color: #fff; font-size: 11px; font-weight: 800; }
.req.ok { background: #2e7d3a; }
.req.no { background: #8f2b24; }
.lbadges { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.lb { display: inline-flex; align-items: center; gap: 1px; font-size: 11px; font-weight: 800; color: #20262b; }
.lb.token { outline: 1.5px solid #20262b; border-radius: 5px; padding: 0 2px; }
.lb small { font-weight: 600; }
.ac-ribbon { position: absolute; top: 6px; left: 6px; right: 6px; padding: 2px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 800; text-align: left; line-height: 1.25; }
.ac-ribbon.ok { left: auto; background: var(--pos); color: #0b2410; text-transform: uppercase; }
.ac-ribbon.no { background: rgba(15, 20, 24, 0.82); color: #ffd9d5; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard.s-req, .acard.s-no { filter: saturate(0.6); }
.acard.s-req .ac-art, .acard.s-no .ac-art { opacity: 0.7; }
:root[data-theme='light'] .acard { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.12); }

.actions { margin-top: 4px; }
.actions.done .act.ok { opacity: 0.55; }
.act-list { display: flex; flex-direction: column; gap: 6px; }
.act { display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-height: 54px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line-soft); text-align: left; width: 100%; }
.act.ok { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.act.no { opacity: 0.62; }
.act.on { box-shadow: 0 0 0 2px var(--gold); }
.act-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); flex: none; }
.act.ok .act-ic { background: rgba(227, 163, 59, 0.16); }
.act-b { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.act-b b { font-size: 14px; }
.act-b small { color: var(--muted); font-size: 12px; line-height: 1.25; }
.act.no .act-b small { color: #e79a91; }
.act-go { opacity: 0.5; }
.ref-grid { display: grid; grid-template-columns: 1fr; gap: 10px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; }
.ref-grid h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-2); margin-bottom: 6px; }
.ref-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ref-grid li { display: flex; gap: 8px; align-items: flex-start; }
.ref-grid li span { display: flex; flex-direction: column; font-size: 13px; }
.ref-grid li small { color: var(--muted); }
@media (min-width: 600px) { .ref-grid { grid-template-columns: 1fr 1fr; } }
.spect-hands { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.sh { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 13px; }

/* card sheet */
.card-detail { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cd-scan { display: flex; justify-content: center; }
.cd-scan .scan { width: min(260px, 70vw); border-radius: 14px; box-shadow: var(--shadow); }
.cd-scan .acard { width: 220px; }
.cd-scan .acard .ac-text { -webkit-line-clamp: unset; }
.cd-text { font-size: 15px; line-height: 1.45; }
.cd-alt { font-style: italic; }
.cd-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cd-meta .lb { color: var(--text); }
.cd-meta .lb.token { outline-color: var(--text); }
.cd-why { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: rgba(255, 107, 94, 0.1); color: #ffb3aa; font-size: 13px; margin-top: 8px; }
:root[data-theme='light'] .cd-why { color: #a3261c; }
.pick-basic { margin-top: 10px; }
.act-help { font-size: 14.5px; }
.cs-t, .as-t { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 560px) { .card-detail { grid-template-columns: 260px 1fr; align-items: start; } }

/* ---- 70-history.css ---- */
/* History log tree (also used for dryRun previews) and hint sheets. */

.history { display: flex; flex-direction: column; gap: 10px; }
.hist-filters { position: sticky; top: calc(var(--topbar-h) + 2px); z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--r); background: rgba(16, 24, 30, 0.95); border: 1px solid var(--line-soft); backdrop-filter: blur(6px); }
:root[data-theme='light'] .hist-filters { background: rgba(255, 255, 255, 0.95); }
.hist-filters .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.hist-round { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 6px 4px 8px; }
.hist-rh { display: flex; align-items: center; gap: 8px; padding: 4px 8px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gold-2); }
.rnum { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ffe2a3, var(--gold) 60%, #a86f12); color: #2a1a00; font-size: 13px; }

.log { list-style: none; margin: 0; padding: 0; }
.log .log { margin-left: 13px; padding-left: 9px; border-left: 1.5px solid var(--line-soft); }
.le { position: relative; }
.le-row { display: flex; align-items: flex-start; gap: 7px; padding: 4px 6px; border-radius: 7px; font-size: 13px; line-height: 1.35; min-width: 0; }
.le.has-ch > .le-row { cursor: pointer; }
.le.has-ch > .le-row:hover { background: rgba(255, 255, 255, 0.04); }
.le-ic { flex: none; width: 20px; height: 20px; display: grid; place-items: center; margin-top: -1px; opacity: 0.9; color: var(--text-2); }
.le-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.le-flag { color: var(--muted); flex: none; }
.le-n { flex: none; display: inline-flex; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); font-weight: 700; }
.le.phase > .le-row { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 12px; color: var(--gold-2); background: rgba(227, 163, 59, 0.08); }
.le.turn > .le-row { font-weight: 700; border-left: 3px solid var(--cc-color, var(--line)); }
.le.turn.a-WC { --cc-color: var(--wc); } .le.turn.a-MC { --cc-color: var(--mc); } .le.turn.a-CC { --cc-color: var(--cc); } .le.turn.a-ST { --cc-color: var(--st); }
.le.d1 > .le-row, .le.d2 > .le-row { font-size: 12.8px; }
.le.d3 > .le-row, .le.d4 > .le-row { font-size: 12.3px; color: var(--text-2); }
.hist-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* hint sheet */
.hint { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.hint-t { display: inline-flex; align-items: center; gap: 6px; }
.hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-size: 13.5px; }
.hrow b { white-space: nowrap; }
.hrow.good { box-shadow: inset 3px 0 0 var(--pos); }
.hrow.warn { box-shadow: inset 3px 0 0 var(--warn); }
.htable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0; }
.htable th, .htable td { padding: 5px 6px; text-align: center; border-bottom: 1px solid var(--line-soft); }
.htable th:first-child, .htable td:first-child { text-align: left; color: var(--muted); }
.htable .cur { background: rgba(227, 163, 59, 0.14); font-weight: 800; }
.htable .hit { background: var(--gold); color: #2a1a00; font-weight: 800; border-radius: 4px; }
.hsecs { display: flex; flex-direction: column; gap: 6px; }
.hsec { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-soft); flex-wrap: wrap; }
.hsec > b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--panel-3); }
.hsec.cur { border-color: var(--gold); background: rgba(227, 163, 59, 0.1); }
.hsec.cur > b { background: var(--gold); color: #2a1a00; }
.hsec.bill { outline: 2px dashed var(--gold); }
.hsec span { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-weight: 700; }
.hsec small { margin-left: auto; color: var(--muted); }
.popsteps, .ptrack { display: flex; flex-wrap: wrap; gap: 4px; }
.ps, .pt { display: flex; flex-direction: column; align-items: center; min-width: 42px; padding: 4px 4px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-soft); }
.ps small, .pt small { color: var(--muted); font-size: 10.5px; }
.ps.cur, .pt.cur { border-color: var(--gold); background: rgba(227, 163, 59, 0.18); }
.pt.past { opacity: 0.55; }
.ptrack.wealth .pt { min-width: 48px; }
/* lighter class tags inside the log */
.le-t .ctag { background: none; border: 0; padding: 0 2px 0 0; font-size: 1em; }
.le-t .clink { border-bottom-width: 1.5px; }

/* ---- 80-forms.css ---- */
/* Prompt forms, preview box, settings, legend, host tools. */

.ptitle { display: block; color: var(--gold-2); line-height: 1.32; }
.ptitle .ic { vertical-align: -3px; }
.ptabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.secret-note { display: flex; align-items: center; gap: 6px; padding: 7px 10px; margin-bottom: 10px; border-radius: 9px; background: rgba(164, 87, 168, 0.18); color: #e2b7e5; font-size: 13px; }
:root[data-theme='light'] .secret-note { color: #6e2a73; }
.form-note { font-size: 13px; color: var(--text-2); margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.form-note.small { font-size: 12px; color: var(--muted); }
.form-note .count { color: var(--gold-2); }
.form-sum { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(227, 163, 59, 0.1); border: 1px solid var(--line); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.form-sum.ok { border-color: var(--pos); background: rgba(99, 196, 107, 0.1); }
.form-sum.bad { border-color: var(--neg); background: rgba(255, 107, 94, 0.08); }
.quick { display: flex; gap: 6px; margin-top: 10px; }
.pf { display: flex; flex-direction: column; gap: 8px; }
.pf-err { display: flex; align-items: flex-start; gap: 6px; padding: 7px 10px; border-radius: 9px; background: rgba(255, 107, 94, 0.14); color: #ffc2bb; font-size: 13px; }
:root[data-theme='light'] .pf-err { color: #a3261c; }

/* preview */
.preview { margin-top: 14px; border-radius: 11px; border: 1px dashed var(--line); padding: 8px 8px 6px; background: rgba(0, 0, 0, 0.15); transition: opacity 0.15s; }
:root[data-theme='light'] .preview { background: #fbfaf6; }
.preview.loading { opacity: 0.6; }
.preview.bad { border-color: rgba(255, 107, 94, 0.6); border-style: solid; }
.preview.good { border-color: rgba(99, 196, 107, 0.5); }
.pv-h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.preview.bad .pv-h { color: var(--neg); }
.pv-err { font-size: 13.5px; color: #ffc2bb; padding: 2px 4px 4px; }
:root[data-theme='light'] .pv-err { color: #a3261c; }
.pv-note, .pv-next { font-size: 12px; color: var(--muted); padding: 4px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pv-next b { color: var(--gold-2); }

/* choose */
.opts { display: flex; flex-direction: column; gap: 6px; }
.opts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.opt { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-height: 52px; border-radius: 11px; background: var(--panel-3); border: 1px solid var(--line-soft); text-align: left; flex-wrap: wrap; min-width: 0; }
.opt.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--panel-3)); box-shadow: 0 0 0 1px var(--gold) inset; }
.opt.dis { opacity: 0.5; }
.opt-tick { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: #2a1a00; }
.opt.on .opt-tick { background: var(--gold); border-color: var(--gold); }
.opt-body { flex: 1; min-width: 0; display: flex; }
.opt-why { width: 100%; font-size: 12px; color: #e79a91; padding-left: 30px; }
.o-skill, .o-res { display: flex; align-items: center; gap: 8px; }
.o-skill small { color: var(--muted); }
.o-class { display: flex; align-items: center; gap: 8px; }
.o-class small { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; }
.o-deal { display: flex; flex-direction: column; gap: 2px; }
.o-deal-g { display: flex; gap: 10px; font-size: 16px; }
.o-deal-c small { color: var(--muted); }
.o-worker { display: flex; align-items: center; gap: 8px; }
.o-worker span { display: flex; flex-direction: column; }
.o-worker small { color: var(--muted); }
.o-co { display: flex; flex-direction: column; gap: 3px; min-width: 0; width: 100%; }
.o-extra { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--text-2); font-size: 12px; align-items: center; }
.co-line { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.co-line .band { width: 5px; align-self: stretch; min-height: 18px; border-radius: 3px; background: var(--ind); }
.co-line b { font-size: 13.5px; }
.cl-slots { display: inline-flex; gap: 1px; align-items: flex-end; }
.opt .event { padding: 0; border: 0; background: none; }

/* yes / no */
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.yn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border-radius: 14px; font-weight: 800; font-size: 16px; border: 2px solid var(--line-soft); background: var(--panel-3); }
.yesno.big .yn { min-height: 72px; font-size: 18px; }
.yn.yes.on { background: rgba(99, 196, 107, 0.2); border-color: var(--pos); color: var(--pos); }
.yn.no.on { background: rgba(255, 107, 94, 0.16); border-color: var(--neg); color: var(--neg); }

/* bills / votes */
.bill-list { display: flex; flex-direction: column; gap: 8px; }
.bill-pol { border-radius: 11px; border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent); overflow: hidden; }
.bill-pol.on { box-shadow: 0 0 0 2px var(--gold); }
.bp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 40%, transparent), transparent); }
.bp-cur { font-size: 12px; color: var(--muted); }
.bp-secs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; padding: 8px; }
.bp-sec { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 9px; background: var(--panel-3); border: 1px solid var(--line-soft); text-align: left; min-height: 56px; }
.bp-sec.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, var(--panel-3)); }
.bp-eff { display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 12px; font-weight: 700; }
.bp-sec .fan { position: absolute; top: 9px; right: 9px; }
.billctx { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--pc) 55%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 22%, transparent), transparent); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bc-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bc-b { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.bc-sec { display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; border-radius: 9px; background: rgba(0, 0, 0, 0.2); font-size: 12px; font-weight: 700; min-width: 0; }
.bc-sec > b { font-size: 18px; }
.bc-sec > span { display: flex; flex-wrap: wrap; gap: 3px 8px; }
.bc-sec.to { box-shadow: 0 0 0 2px var(--gold) inset; }
.bc-by { font-size: 12.5px; color: var(--text-2); }
.prefs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.pref { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); font-size: 12.5px; color: var(--ink); }
.tally { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.side { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border-radius: 12px; border: 2px solid var(--line-soft); min-width: 110px; }
.side b { font-size: 30px; line-height: 1.1; }
.side small { color: var(--muted); }
.side.pos { color: var(--pos); } .side.neg { color: var(--neg); }
.side.mine { border-color: currentColor; }
.vs { font-size: 24px; color: var(--muted); }
.bidform .stepper, .numform .stepper { margin: 8px 0; }
.numform { display: flex; flex-direction: column; align-items: flex-start; }

/* wages & prices & distribute */
.wrow, .prow, .drow { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 11px; border: 1px solid var(--line-soft); margin-bottom: 6px; flex-wrap: wrap; }
.wrow.changed, .prow.changed { border-color: var(--gold); background: rgba(227, 163, 59, 0.08); }
.wrow-n { flex: 1 1 180px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wrow-n small { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.wrow-seg { display: flex; gap: 4px; }
.wl-btn { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 4px 6px; border-radius: 9px; font-size: 11px; font-weight: 800; color: #fff; opacity: 0.45; border: 2px solid transparent; }
.wl-btn b { font-size: 14px; }
.wl-btn.L1 { background: var(--l1); } .wl-btn.L2 { background: var(--l2); color: #2b2200; } .wl-btn.L3 { background: var(--l3); }
.wl-btn.on { opacity: 1; border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); }
.wl-btn.dis { opacity: 0.15; text-decoration: line-through; }
.prow-n { flex: 1 1 140px; display: flex; flex-direction: column; min-width: 0; }
.prow-n small { color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.drow { justify-content: space-between; }
.drow small { color: var(--muted); flex: 1 1 100%; order: 2; }

/* market forms */
.res-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px; margin-bottom: 10px; }
.res-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 11px; border: 2px solid var(--line-soft); font-size: 11px; font-weight: 700; color: var(--text-2); background: color-mix(in srgb, var(--ind) 8%, transparent); }
.res-tab.on { border-color: var(--ind); background: color-mix(in srgb, var(--ind) 22%, transparent); color: var(--text); }
.src-list { display: flex; flex-direction: column; gap: 6px; }
.src-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'n s' 'p s'; align-items: center; gap: 2px 10px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line-soft); background: var(--panel-3); }
.src-row.on { border-color: var(--gold); }
.src-row.dis { opacity: 0.5; }
.src-n { grid-area: n; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.src-n small { color: var(--muted); }
.src-p { grid-area: p; display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.src-p small { color: var(--muted); font-size: 11.5px; }
.src-row .stepper { grid-area: s; }
.src { font-weight: 700; }
.needs-head { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: rgba(109, 179, 63, 0.12); border: 1px solid rgba(109, 179, 63, 0.4); }
.needs-head span { display: flex; flex-direction: column; }
.needs-head small { color: var(--muted); }
.sell-res, .prov-res { border-radius: 11px; border: 1px solid color-mix(in srgb, var(--ind) 40%, transparent); padding: 8px; margin-bottom: 8px; }
.sr-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.sr-stock { margin-left: auto; font-size: 12px; color: var(--muted); }
.sr-txs { display: flex; flex-wrap: wrap; gap: 6px; }
.tx { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line-soft); background: var(--panel-3); min-height: 46px; flex-wrap: wrap; }
.tx.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, var(--panel-3)); }
.tx.dis { opacity: 0.4; }
.tx-t { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.tx small { color: var(--muted); }
.tx.extra { width: 100%; justify-content: space-between; }

/* staffing forms */
.moves { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.move { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 10%, var(--panel-3)); border: 1px solid var(--line); }
.mv-t { flex: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; min-width: 0; }
.mv-t small { color: var(--muted); }
.pickers { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-l { width: 100%; font-size: 12px; color: var(--muted); margin-top: 4px; }
.wpick { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 8px; min-width: 64px; min-height: 64px; border-radius: 11px; border: 1px solid var(--line-soft); background: var(--panel-3); font-size: 11px; position: relative; justify-content: center; }
.wpick b { position: absolute; top: 3px; right: 5px; font-size: 11px; color: var(--gold-2); }
.wpick.emp { min-width: 0; max-width: 160px; flex-direction: row; gap: 6px; min-height: 48px; text-align: left; }
.wpick.small { min-width: 56px; min-height: 52px; }
.wpick.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--panel-3)); }
.dests { display: flex; flex-direction: column; gap: 6px; }
.dest-picked { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(227, 163, 59, 0.12); font-size: 13px; }
.dest-picked span { flex: 1; }
.dest { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line-soft); background: var(--panel-3); flex-wrap: wrap; text-align: left; }
.dest.union { border-color: var(--gold); }
.dest.union span { display: flex; flex-direction: column; }
.dest.union small { color: var(--muted); }
.dest .co-line { flex: 1 1 160px; }
.dest-slots { display: flex; gap: 4px; }
.slot-btn { display: flex; flex-direction: column; align-items: center; min-width: 40px; min-height: 44px; justify-content: center; border-radius: 9px; border: 1px dashed var(--gold); background: rgba(227, 163, 59, 0.08); font-size: 9.5px; color: var(--gold-2); }
.swap-row { border-radius: 11px; border: 1px solid var(--line-soft); padding: 8px; margin-bottom: 8px; }
.swap-row.on { border-color: var(--gold); }
.sw-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sw-h span { flex: 1; display: flex; flex-direction: column; font-size: 13px; }
.sw-h small { color: var(--muted); }
.sw-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cand { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.cand.dis { opacity: 0.6; }
.cand-price { font-size: 12.5px; }
.cand-price s { color: var(--muted); }
.cand .opt-why { padding: 0; width: 100%; max-width: 150px; text-align: center; font-size: 11px; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.build-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line-soft); }
.build-row.col { flex-direction: column; align-items: flex-start; }
.br-l { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--text-2); }
.br-team { display: flex; gap: 4px; align-items: flex-end; flex-wrap: wrap; }
.tm { display: inline-flex; flex-direction: column; align-items: center; font-size: 9.5px; color: var(--muted); }
.rawform textarea { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); padding: 8px; }
.raw-data { max-height: 200px; overflow: auto; font-size: 11px; background: rgba(0, 0, 0, 0.25); padding: 8px; border-radius: 8px; }

/* settings / legend / host */
.settings { display: flex; flex-direction: column; gap: 10px; }
.me-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); }
.me-card small { color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.set-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend h4 { margin-top: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-2); }
.lg-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.lg-i { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.host { display: flex; flex-direction: column; gap: 16px; }
.host h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-2); margin-bottom: 4px; }
.hi { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.hi.rev { box-shadow: inset 3px 0 0 var(--muted); }
.hi-seq { font-weight: 800; color: var(--muted); min-width: 36px; }
.hi-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.hi-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hi-h small { color: var(--muted); }
.hi-log { color: var(--muted); display: flex; flex-direction: column; }
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; font-size: 12.5px; color: var(--text-2); }
.field input { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); padding: 6px 10px; font-size: 15px; }
:root[data-theme='light'] .field input { background: #fff; }
.link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
/* host: Telegram */
.tg { display: flex; flex-direction: column; gap: 8px; }
.tg h4 { display: flex; align-items: center; gap: 6px; }
.tg .note { margin: 0 2px; }
.tg .check { margin: 0; }
.tg > .btn { align-self: flex-start; }
.tg-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft); font-size: 14px; }
.tg-box p { margin: 0; }
.tg-warn { border-color: var(--line); background: rgba(227, 163, 59, 0.08); }
.tg-warn b { display: flex; align-items: center; gap: 6px; color: var(--gold-2); }
.tg-warn p { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.tg-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tg-line > span { color: var(--muted); flex: none; }
.tg-line > b { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.tg-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--pos); }
.tg-bind { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(227, 163, 59, 0.06); }
.tg-bind ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.tg-bind .btn { align-self: flex-start; }
.tg-cmd { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px dashed var(--gold); }
:root[data-theme='light'] .tg-cmd { background: #fff; }
.tg-cmd code { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; color: var(--gold-2); letter-spacing: 0.02em; user-select: all; overflow-wrap: anywhere; }
.tg-wait { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin: 0; }
.tg-quiet { display: flex; align-items: flex-end; gap: 8px; }
.tg-quiet .field { flex: 1; margin-bottom: 0; }
.tg-quiet .btn { min-height: 42px; }
.tg .set-btns { margin-top: 2px; }
.tg-actions .btn { white-space: nowrap; }
/* host: bots */
.bot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.bot-row.on { box-shadow: inset 3px 0 0 var(--gold); }
.bot-row .ctag { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bot-row .seg { flex: none; }
.link { font-size: 11px; word-break: break-all; flex: 1 1 200px; }
.preview.todo { border-style: dashed; border-color: var(--line); }
.preview.todo .pv-h { color: var(--gold-2); }
.preview.todo .pv-err { color: var(--text-2); }
.o-skill b, .o-res b { font-size: 14.5px; }
/* one column on phones (long skill names), two in the wide sheet */
.opts-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.opt { min-height: 48px; }
/* single choice: round radio tick */
.choose.single .opt-tick { border-radius: 50%; }
.calc { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 8px; }
.hrow.total { background: rgba(227, 163, 59, 0.16); font-weight: 800; }
.hrow.total b { font-size: 20px; color: var(--gold-2); }
.prefill-note { display: flex; align-items: flex-start; gap: 6px; padding: 6px 10px; margin-bottom: 8px; border-radius: 9px; background: rgba(227, 163, 59, 0.1); border: 1px dashed rgba(227, 163, 59, 0.45); color: var(--text-2); font-size: 12.5px; line-height: 1.3; }
.prefill-note svg { flex: none; margin-top: 1px; color: var(--gold-2); }

/* ---- 90-layout.css ---- */
/* Tablet & desktop layouts, dev bar. */

/* tablet: board panels in two columns */
@media (min-width: 720px) {
  .screen { max-width: 980px; padding-left: 16px; padding-right: 16px; }
  .board { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: start; }
  .board > .scoreboard, .board > .jumps, .board > #p-politics { grid-column: 1 / -1; }
  .policies { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .classes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
  .classes .cboard.mine { grid-column: 1 / -1; }
}

/* desktop: 3-column dashboard (board | hand or companies | classes or history) */
.app.is-wide { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.dash { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(400px, 1.15fr) minmax(340px, 0.9fr); gap: 14px; padding: 12px 14px 0; }
.dash-col { padding-bottom: 20px; }
.dash-col { overflow-y: auto; overscroll-behavior: contain; min-width: 0; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(227, 163, 59, 0.35) transparent; }
.dash-col .board { display: flex; flex-direction: column; }
.dash-col .policies { display: flex; flex-direction: column; }
.dash-col .classes { display: flex; flex-direction: column; }
.dash-tabs { position: sticky; top: 0; z-index: 6; padding-bottom: 8px; background: linear-gradient(180deg, var(--bg) 70%, transparent); }
:root:not([data-theme='light']) .dash-tabs { background: linear-gradient(180deg, rgba(15, 23, 29, 0.98) 70%, transparent); }
.dash-seg { width: 100%; }
.dash-seg .seg-b { flex: 1; justify-content: center; }
.is-wide .co-strip.pinned { position: static; flex: none; }
.is-wide .toasts { top: calc(var(--topbar-h) + 50px); }
.is-wide .hist-filters { top: 46px; }
@media (min-width: 1500px) {
  .dash { grid-template-columns: minmax(420px, 1fr) minmax(480px, 1.2fr) minmax(380px, 0.95fr); }
}

/* dev bar (mock mode) */
.devbar { position: fixed; left: 6px; bottom: calc(var(--bnav-h) + var(--safe-b) + 70px); z-index: 70; font-size: 12px; }
.is-wide .devbar { bottom: 10px; }
.devbar-t { width: 38px; height: 26px; border-radius: 8px; background: #6a2c91; color: #fff; font-weight: 800; font-size: 11px; opacity: 0.85; }
.devbar-b { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; padding: 10px; width: min(92vw, 380px); border-radius: 12px; background: #1c1330; border: 1px solid #6a2c91; box-shadow: var(--shadow); color: #eee; }
.devbar-b label { display: flex; flex-direction: column; gap: 2px; }
.devbar-b select { min-height: 32px; border-radius: 8px; background: #2b2045; border: 1px solid #6a2c91; color: #fff; max-width: 100%; }
.devbar-b small { color: #b9a9d6; }
