:root {
  --ink: #25190f;
  --muted: #705b42;
  --paper: #f4dfb8;
  --paper-light: #fff2d1;
  --paper-deep: #d8b982;
  --line: #684328;
  --shadow-dark: rgba(16, 8, 3, 0.55);
  --blue: #3f75df;
  --green: #2da763;
  --teal: #2b9baa;
  --amber: #e3a13a;
  --red: #c94a37;
  --purple: #765dda;
  --pink: #d94d8a;
  --brown: #9a6338;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  /* Global UI scale. 1 = original size, 0.8 = compact (everything 80%). */
  --ui-scale: 0.8;
}

* {
  box-sizing: border-box;
}

/* `hidden` always wins: any author `display` (flex/grid) beats the UA rule —
   that is how the empty "Run in progress" card showed on a first visit. */
[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #080604;
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
}

.stage {
  position: relative;
  /* Sized up by 1/scale so that, once zoomed back down, it still fills the
     whole viewport with no empty gaps at the right/bottom edges. */
  width: calc(100vw / var(--ui-scale));
  height: calc(100vh / var(--ui-scale));
  zoom: var(--ui-scale);
  overflow: hidden;
  /* The scene backdrop is set by main.js updateSceneImage() once a run starts
     (Phase 3: nothing heavy loads while the setup screen covers the desk). */
  background-color: #17120f;
  background-size: cover;
  background-position: center;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.22), transparent 18%, transparent 67%, rgba(5, 3, 2, 0.34)),
    radial-gradient(circle at 50% 50%, transparent 0 52%, rgba(0, 0, 0, 0.28) 100%);
  pointer-events: none;
}

.top-hud,
.side-panel,
.scene-status,
.selected-card,
.hand-area {
  position: absolute;
  z-index: 2;
}

/* Brand | Week·Cash·Runway·Stress | tools & settings. Three grid columns: the
   middle one stays centred while both sides have room and slides aside — never
   under — when they don't (the old absolutely-centred group covered the tool
   strip at ≤1536px, e.g. a 1920 screen at 125% scaling). */
.top-hud {
  top: 14px;
  left: 18px;
  right: 18px;
  height: 66px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.hud-papers {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-card {
  height: 58px;
  min-width: 166px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffe5bd;
  text-shadow: 0 2px 0 #000;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid #b4522a;
  border-radius: 6px;
  background: #17120f;
  color: #ff8245;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.75);
}

.brand-card strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 0.95;
  text-transform: uppercase;
}

.brand-card small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 229, 189, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud-paper,
.side-panel,
.selected-card {
  border: 2px solid rgba(55, 33, 18, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 242, 211, 0.96), rgba(222, 190, 139, 0.96)),
    var(--paper);
  box-shadow:
    0 4px 0 rgba(28, 13, 5, 0.7),
    0 10px 26px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.hud-paper {
  /* Positioned so its paper-grid ::after stays on the pill (it used to borrow
     the absolutely-placed group as its box; once the group joined the grid
     flow, four grids spread across the whole header). */
  position: relative;
  height: 64px;
  min-width: 128px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border-radius: 7px;
}

.week-paper {
  min-width: 174px;
}

.stress-paper {
  min-width: 198px;
}

.hud-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(42, 25, 13, 0.85);
  border-radius: 5px;
  background: #d8b378;
  color: #21150d;
  font-family: var(--font-mono);
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.hud-icon.cash {
  background: #69b85a;
}

.hud-icon.runway {
  background: #e5ad43;
}

.hud-icon.stress {
  background: var(--red);
  color: #fff5de;
}

.hud-paper small,
.side-panel h2,
.note-card h3,
.planner-title h2,
.pinned-box small {
  color: #61492f;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.hud-paper strong {
  display: block;
  color: #1f150d;
  font-size: 20px;
  line-height: 1;
}

.hud-paper em {
  color: #735c43;
  font-style: normal;
  font-weight: 700;
}

.hud-paper b {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(71, 45, 25, 0.34);
  border-radius: 4px;
  background: rgba(255, 248, 231, 0.55);
  color: #2f2014;
  font-size: 10px;
}

.hud-bar {
  display: block;
  width: 118px;
  height: 7px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(87, 58, 34, 0.22);
  overflow: hidden;
}

.hud-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c84a37, #edae47);
}

.tool-strip {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-radius: 8px;
  background: rgba(4, 4, 4, 0.44);
  box-shadow: inset 0 0 0 1px rgba(255, 229, 185, 0.08);
  color: #ffe1ad;
  font-family: var(--font-mono);
  font-weight: 900;
  text-shadow: 0 2px 0 #000;
}

.tool-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.settings-button {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(23, 14, 8, 0.95);
  border-radius: 7px;
  background: #261f18;
  color: #f4d8a8;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.72);
}

.side-panel {
  top: 96px;
  bottom: auto;
  width: 292px;
  max-height: calc(100vh - 126px);
  border-radius: 7px;
  padding: 16px;
  overflow: visible;
}

.side-panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(91, 58, 31, 0.2);
  border-radius: 5px;
  pointer-events: none;
}

.side-panel::after,
.selected-card::after,
.hud-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(69, 43, 23, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(69, 43, 23, 0.03) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: multiply;
}

.left-panel {
  left: 18px;
}

.right-panel {
  right: 18px;
  width: 326px;
}

.panel-pin {
  position: absolute;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb477, #c44334 65%);
  box-shadow: 0 2px 0 #79231b;
  z-index: 2;
}

.pin-left {
  left: 13px;
}

.pin-right {
  right: 13px;
}

.side-panel h2 {
  position: relative;
  margin: 4px 0 14px;
  padding-left: 20px;
  font-size: 12px;
}

.founder-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(106, 70, 38, 0.34);
  border-radius: 7px;
  background: rgba(255, 248, 227, 0.62);
}

.founder-portrait {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #20150e;
  border-radius: 7px;
  background: linear-gradient(150deg, #4d83b8, #2c557f 60%, #233f5d);
  color: #f4faff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 -4px rgba(0, 0, 0, 0.2);
}

.founder-strip strong,
.milestone strong {
  display: block;
  font-size: 13px;
}

.founder-strip small,
.milestone small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric-stack {
  display: grid;
  gap: 9px;
}

.metric-row {
  position: relative;
  display: grid;
  grid-template-columns: 25px 72px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.metric-row b {
  color: #392719;
  font-size: 12px;
  text-transform: uppercase;
}

.metric-row strong {
  color: #1d6c74;
  font-size: 12px;
  text-align: right;
}

.metric-glyph {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #3b2717;
  border-radius: 4px;
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.18);
}

.product {
  background: var(--blue);
}

.quality {
  background: var(--teal);
}

.debt {
  background: var(--brown);
}

.users {
  background: #2e98a1;
}

.mrr {
  background: var(--green);
}

.trust {
  background: #356dd0;
}

.meter {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(94, 65, 39, 0.22);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.meter.green span {
  background: var(--green);
}

.meter.brown span {
  background: var(--brown);
}

.meter.teal span {
  background: var(--teal);
}

.meter.money span {
  background: #268f55;
}

.meter.trust span {
  background: #356dd0;
}

.note-card,
.market-stamp,
.pinned-box,
.risk-box {
  position: relative;
  border: 2px solid rgba(109, 72, 39, 0.34);
  border-radius: 6px;
  background: rgba(255, 226, 156, 0.92);
  box-shadow: 0 4px 0 rgba(65, 38, 17, 0.18);
}

.note-card {
  margin-top: 13px;
  padding: 12px;
}

.note-card h3 {
  margin: 0 0 7px;
  color: #3a2819;
  font-size: 12px;
}

.note-card p {
  margin: 0 0 9px;
  color: #4d3724;
  font-size: 12px;
  line-height: 1.32;
}

.note-card button {
  border: 0;
  background: transparent;
  color: #4c2d14;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
}

.warning-note::before,
.milestone-note::before,
.market-stamp::before {
  content: "";
  position: absolute;
  right: 12px;
  top: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cf4a3a;
  box-shadow: 0 2px 0 #7b241b;
}

.milestone-note {
  background: rgba(244, 219, 160, 0.92);
}

.milestone {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.milestone span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--amber);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
}

.milestone.locked {
  opacity: 0.58;
}

.market-stamp {
  width: 75%;
  margin-top: 13px;
  padding: 12px;
  background: rgba(222, 187, 196, 0.94);
}

.market-stamp small,
.pinned-box small {
  display: block;
}

.market-stamp strong {
  display: block;
  margin-top: 8px;
  font-size: 12px;
}

.market-stamp span {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
}

.scene-status {
  top: 96px;
  right: 368px;
  display: grid;
  gap: 8px;
  width: 218px;
  pointer-events: none;
}

.terminal-card,
.assistant-card {
  border: 2px solid rgba(0, 0, 0, 0.72);
  border-radius: 6px;
  background: rgba(7, 14, 13, 0.86);
  color: #67e889;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.42);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px;
}

.terminal-card small,
.assistant-card small {
  display: block;
  margin-bottom: 5px;
  color: #a2f8b6;
  font-weight: 900;
}

.terminal-card span {
  display: block;
  line-height: 1.25;
}

.assistant-card {
  margin-left: 28px;
  background: rgba(229, 237, 232, 0.9);
  color: #25342e;
}

.assistant-card small {
  color: #335b77;
}

.assistant-card p {
  margin: 0;
  line-height: 1.32;
}

.selected-card {
  left: 50%;
  bottom: 286px;
  width: min(476px, calc(100vw - 720px));
  min-width: 410px;
  min-height: 178px;
  transform: translateX(-50%);
  padding: 18px 22px 16px;
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 247, 226, 0.98), rgba(232, 207, 167, 0.98)),
    var(--paper-light);
}

.selected-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(86, 55, 31, 0.2);
  border-radius: 6px;
  pointer-events: none;
}

.selected-pin {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translateX(-50%);
  border: 2px solid #692918;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffbd72, #c14b36 68%);
  box-shadow: 0 4px 0 rgba(55, 24, 11, 0.5);
  z-index: 2;
}

.selected-topline,
.selected-effects,
.selected-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.selected-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.18);
}

.selected-topline b {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-cost {
  margin-left: auto;
  border: 2px solid #ddbc78;
  border-radius: 5px;
  background: #ffe4a8;
  color: #69430e;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}

.selected-card h1 {
  position: relative;
  margin: 11px 0 10px;
  font-size: 24px;
  line-height: 1.05;
}

.selected-effects {
  flex-wrap: wrap;
  margin-bottom: 10px;
  /* keep effect chips in the left column so they never slide under the rotated
     risk stamp pinned to the card's right edge */
  max-width: 326px;
}

.selected-effects span {
  border-radius: 5px;
  background: rgba(222, 248, 225, 0.9);
  color: #137448;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
}

.selected-effects .bad {
  background: rgba(255, 234, 217, 0.94);
  color: #bb3f2d;
}

.risk-stamp {
  position: absolute;
  top: 86px;
  right: 24px;
  transform: rotate(9deg);
  border: 3px solid currentColor;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  text-transform: uppercase;
}

.risk-high .risk-stamp {
  color: #c24132;
}

.risk-medium .risk-stamp {
  color: #b76417;
}

.risk-low .risk-stamp {
  color: #1c7b4f;
}

.focus-line,
.flavor-line {
  position: relative;
  margin: 0 0 7px;
  max-width: 330px;
  font-size: 12px;
  line-height: 1.3;
}

.focus-line {
  color: #5d4ed4;
  font-weight: 900;
}

.flavor-line {
  color: #725a43;
  font-style: italic;
}

.selected-actions {
  margin-top: 10px;
}

.selected-actions button {
  border: 2px solid rgba(91, 61, 35, 0.28);
  border-radius: 6px;
  background: #fff2d4;
  color: #3a2819;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
  box-shadow: 0 3px 0 rgba(76, 45, 22, 0.22);
}

.selected-actions button:first-child {
  border-color: #146341;
  background: var(--green);
  color: #fff;
  box-shadow: 0 3px 0 #0d4a2f;
}

.hand-area {
  left: 322px;
  right: 366px;
  bottom: 26px;
}

.hand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #f4d4a5;
  text-shadow: 0 2px 0 #000;
}

.hand-header strong {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hand-header span {
  color: rgba(244, 212, 165, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.hand-strip {
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 10px;
}

.desk-card {
  position: relative;
  z-index: calc(2 + var(--card-index));
  flex: 0 0 150px;
  height: 174px;
  display: flex;
  flex-direction: column;
  border: 3px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 229, 0.98), rgba(230, 207, 171, 0.98));
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  padding: 11px 11px 10px;
  text-align: left;
  box-shadow:
    0 7px 0 rgba(31, 15, 6, 0.62),
    0 11px 18px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

/* The fan overlaps just enough to fit between the side panels: 18px on wide
   screens, tighter on narrow ones (≈1200px windows used to push the outer cards
   under the panels). --cards is set by render.js; 100% = the strip's width.
   A hovered/selected card lifts above its neighbours, so it stays readable. */
.desk-card + .desk-card {
  margin-left: min(-18px, calc((100% - 150px) / (var(--cards, 7) - 1) - 150px));
}

.desk-card:hover,
.desk-card:focus-visible,
.desk-card.selected {
  z-index: 40;
  transform: translateY(-18px);
  filter: brightness(1.05);
  outline: none;
  box-shadow:
    0 10px 0 rgba(31, 15, 6, 0.62),
    0 16px 22px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.desk-card.planned::after {
  content: "Planned";
  position: absolute;
  top: 12px;
  right: -28px;
  width: 96px;
  transform: rotate(35deg);
  background: #2aa763;
  color: white;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  text-transform: uppercase;
}

.desk-card-top {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.desk-card-top span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
}

.desk-card-top b {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.desk-card-top em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  border-radius: 4px;
  background: #ffe3a2;
  color: #764b0e;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  padding: 4px 6px;
}

.desk-card h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 12px 0 9px;
  min-height: 36px;
  max-height: 36px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.1;
}

.desk-card p {
  min-height: 18px;
  max-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0;
  color: #157248;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  position: relative;
  z-index: 2;
}

.desk-card p.bad {
  color: #be4230;
}

.desk-card strong {
  position: static;
  display: inline-flex;
  align-self: flex-start;
  margin-top: auto;
  border-radius: 4px;
  background: #218f58;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
  text-transform: uppercase;
}

.planner-title {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.planner-title h2 {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 12px;
}

.planner-title strong {
  font-size: 16px;
}

.planner-tokens {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 16px 0 14px;
  padding: 12px;
  border: 1px solid rgba(91, 58, 31, 0.24);
  border-radius: 7px;
  background: rgba(255, 248, 227, 0.6);
}

.planner-tokens div {
  display: grid;
  grid-template-columns: 58px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.planner-tokens b {
  text-transform: uppercase;
}

.energy-tokens,
.focus-tokens {
  display: flex;
  gap: 5px;
}

.energy-tokens i {
  width: 13px;
  height: 23px;
  border-radius: 4px;
  background: #e9a43b;
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.15);
}

.energy-tokens .empty {
  background: rgba(94, 65, 39, 0.2);
}

.focus-tokens i {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  background: var(--purple);
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.15);
}

.focus-tokens .empty {
  background: rgba(94, 65, 39, 0.18);
}

.plan-slots {
  display: grid;
  gap: 10px;
}

.plan-slot {
  position: relative;
  display: grid;
  grid-template-columns: 28px 32px 1fr 36px 26px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px;
  border: 2px solid rgba(108, 71, 38, 0.28);
  border-radius: 7px;
  background: rgba(255, 241, 211, 0.76);
  box-shadow: 0 3px 0 rgba(82, 49, 23, 0.14);
}

.plan-slot.empty {
  grid-template-columns: 28px 1fr;
  border-style: dashed;
  color: rgba(76, 52, 34, 0.55);
}

.slot-number,
.plan-slot.empty span {
  color: rgba(76, 52, 34, 0.38);
  font-size: 22px;
  font-weight: 900;
}

.plan-slot i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.plan-slot b {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.12;
}

.plan-slot em {
  color: #7a4b0f;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.plan-slot button {
  width: 25px;
  height: 25px;
  border: 2px solid #c6a276;
  border-radius: 5px;
  background: #fff0cf;
  color: #764a2b;
  cursor: pointer;
  font-weight: 900;
}

.pinned-box {
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 226, 216, 0.86);
}

.pinned-box div {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.pinned-box span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--amber);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
}

.pinned-box strong {
  font-size: 12px;
}

.pinned-box b {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.risk-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 248, 227, 0.66);
}

.risk-box span {
  font-size: 12px;
}

.risk-box strong {
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 11px;
  padding: 5px 9px;
  text-transform: uppercase;
}

.commit-button {
  width: 100%;
  margin-top: 18px;
  border: 3px solid #0d5234;
  border-radius: 7px;
  background: linear-gradient(180deg, #27aa6a, #16884f);
  color: #fff5db;
  cursor: pointer;
  font-size: 17px;
  font-weight: 950;
  padding: 14px 16px;
  text-transform: uppercase;
  text-shadow: 0 2px rgba(0, 0, 0, 0.34);
  box-shadow: 0 5px 0 #07371f;
}

.commit-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 1350px) {
  /* The assistant is the game's only narrator (income/expenses, coaching,
     "applies next week") — on ~1280px screens it used to vanish entirely
     (studio review T1). Compact: the build.exe flavour card goes, the
     assistant stays, a little narrower. */
  .scene-status {
    width: 204px;
  }

  .scene-status .terminal-card {
    display: none;
  }

  .scene-status .assistant-card {
    margin-left: 0;
  }

  .week-recap {
    right: 588px;
  }

  /* Centred in the free space between the left panel and the assistant (not
     the stage): a tall inspector used to slide under the assistant's corner
     at ~1200px. */
  .selected-card {
    left: calc(50% - 125px);
    width: min(450px, calc(100vw - 680px));
  }

  .desk-card {
    height: 152px;
  }
}

/* Compact header for ~1200-1300px windows (the author's floor: the game must
   read fine at 1200px): the brand keeps its mark, the run tools go icon-only
   (each keeps its title tooltip + aria-label). */
@media (max-width: 1300px) {
  .brand-card {
    min-width: 0;
  }

  .brand-card > div {
    display: none;
  }

  .hud-right {
    gap: 8px;
  }

  .hud-right .journey-button span,
  .hud-right .upgrades-button span {
    display: none;
  }

  .hud-right .journey-button,
  .hud-right .upgrades-button {
    padding: 0 9px;
  }

  .tool-strip {
    gap: 12px;
    padding: 0 12px;
  }
}

@media (max-width: 1150px) {
  .side-panel {
    width: 260px;
  }

  .right-panel {
    width: 288px;
  }

  .hand-area {
    left: 286px;
    right: 326px;
  }

  .selected-card {
    min-width: 360px;
  }
}

/* === v4 polish: icon system, typography & interactions === */

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hud-icon .ic {
  width: 20px;
  height: 20px;
}

.tool-strip .ic {
  width: 19px;
  height: 19px;
}

.settings-button .ic {
  width: 22px;
  height: 22px;
}

.founder-portrait .ic {
  width: 24px;
  height: 24px;
}

.metric-glyph .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.milestone span .ic,
.pinned-box span .ic {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.selected-icon .ic {
  width: 19px;
  height: 19px;
}

.desk-card-top span .ic {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.plan-slot i .ic {
  width: 18px;
  height: 18px;
}

/* Typography refinement */
.selected-card h1 {
  font-weight: 800;
  letter-spacing: -0.012em;
}

.desk-card h3 {
  font-weight: 700;
  letter-spacing: -0.004em;
}

.founder-strip strong,
.milestone strong,
.plan-slot b,
.pinned-box strong {
  font-weight: 700;
  letter-spacing: -0.003em;
}

.brand-card strong {
  letter-spacing: 0.015em;
}

/* Interaction states */
.commit-button,
.settings-button,
.note-card button,
.selected-actions button,
.plan-slot button {
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
}

.commit-button:hover {
  filter: brightness(1.06);
}

.commit-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #07371f;
}

.settings-button:hover {
  background: #322820;
  color: #ffe8be;
}

.settings-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.72);
}

.selected-actions button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.selected-actions button:active {
  transform: translateY(1px);
}

.note-card button:hover {
  color: #7a3f15;
}

.plan-slot button:hover {
  background: #ffe6bd;
  color: #5a2f12;
  border-color: #b78a5b;
}

.plan-slot button:active {
  transform: translateY(1px);
}

.commit-button:focus-visible,
.settings-button:focus-visible,
.selected-actions button:focus-visible,
.note-card button:focus-visible,
.plan-slot button:focus-visible,
.desk-card:focus-visible {
  outline: 2px solid #3f75df;
  outline-offset: 2px;
}

.meter span,
.hud-bar span {
  transition: width 240ms ease;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
