/* The map is fixed to the viewport. Only HUD contents participate in this grid. */
body.playing { overflow: hidden; }
.playing main { max-width: none; padding: 0; }
.playing footer { display: none; }

#game {
  position: fixed;
  inset: 0;
  isolation: isolate;
  --gap: clamp(8px, 1.3vw, 20px);
  --dock-clearance: calc(55px + var(--gap) + env(safe-area-inset-bottom));
  --glass: rgba(17, 27, 30, .93);
  --edge: #dae6de32;
  --ink-subtle: #c2d1cd;
  --phase: #f2cb83;
  --civic: #d7bd88;
}
#game[data-phase="voting"] { --phase: #9ed4ff; }

#map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #29463a, #0b1519);
  touch-action: none;
}
#map-stage { position: absolute; inset: 0; }
#valley-map { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#valley-map.dragging { cursor: grabbing; }
#valley-map.placing { cursor: crosshair; }
.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 32px;
  text-align: center;
  color: #dbe6df;
}

.hud-layout {
  position: absolute;
  inset: var(--gap) var(--gap) max(var(--gap), env(safe-area-inset-bottom));
  display: grid;
  grid-template: "header header header" auto
                 "council . situation" minmax(0, 1fr)
                 "council . inspector" minmax(0, 1fr)
                 "dock dock dock" auto
                 / minmax(238px, 1fr) minmax(120px, 2.8fr) minmax(255px, 1.18fr);
  gap: var(--gap);
  pointer-events: none;
}
.hud-glass {
  color: #f4f6f3;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 15px;
  box-shadow: 0 6px 24px #0a181b4f;
  backdrop-filter: blur(12px);
}

.hud-header {
  grid-area: header;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 7px 14px;
  pointer-events: auto;
}
.hud-header .brand { white-space: nowrap; font-size: 14px; }
.hud-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.hud-header .clock, .hud-header .status {
  margin: 0;
  border-color: var(--edge);
  background: #0b1316;
  padding: 8px 9px;
  white-space: nowrap;
}
.hud-header .clock { min-width: 122px; text-align: center; letter-spacing: .02em; }
.hud-header .status { color: var(--ink-subtle); }
.menu-toggle, .pause-toggle {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: #0b1316;
  color: #e8f0eb;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.menu-toggle:hover, .pause-toggle:hover:not(:disabled):hover:not(:disabled) { background: #ffffff24; }
.pause-toggle:disabled:disabled { opacity: .5; cursor: default; }
.wait-toggle { color: var(--ink-subtle); }
.wait-toggle[aria-pressed="true"] { color: #f0b43c; border-color: #f0b43c80; }
.pause-toggle[aria-pressed="true"] { background: #f0b43c; border-color: #f0b43c; color: #15232a; font-weight: 600; }
#game[data-paused] .hud-header .clock,
#game[data-awaiting] .hud-header .clock,
#game[data-awaiting] #round-clock { color: #f0b43c; }
.hud-header .status[data-state="down"] { color: #ffb1a2; }
.stat-strip { display: flex; justify-content: center; min-width: 0; }
.stat-chip {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 4px;
  padding: 4px clamp(5px, .65vw, 12px);
  border-inline-start: 1px solid #ffffff21;
  white-space: nowrap;
}
.stat-chip:first-child { border-inline-start: 0; }
.stat-label {
  grid-column: 1 / -1;
  color: var(--ink-subtle);
  font: 650 10px/1.25 var(--sans);
}
.stat-value { font: 650 15px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.stat-delta { font: 600 10px/1.2 var(--mono); color: #aebeba; }
.stat-delta.up { color: #a0e4b3; }
.stat-delta.down { color: #ffc2ad; }

.council-hud, .situation-hud { min-width: 0; min-height: 0; align-self: start; max-block-size: 100%; }
.council-hud {
  grid-area: council;
  width: min(100%, 370px);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  border-block-start: 3px solid var(--phase);
}
.council-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: inherit;
  border: 0;
  text-align: left;
  padding: 13px 15px 10px;
  border-radius: 12px 12px 0 0;
}
.council-heading { display: grid; gap: 3px; flex: 1; min-width: 0; }
.hud-eyebrow, .phase-track {
  color: var(--ink-subtle);
  font: 650 10px/1.35 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}
#phase-title { font-size: clamp(19px, 1.65vw, 26px); line-height: 1.15; letter-spacing: -.035em; }
.phase-time, #event-clock { font: 650 19px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.phase-time { color: var(--phase); white-space: normal; text-align: end; max-width: 9em; }
.disclosure-arrow { width: 8px; height: 8px; border: solid #c2cecb; border-width: 0 2px 2px 0; transform: rotate(225deg); }
[aria-expanded="false"] .disclosure-arrow { transform: rotate(45deg); }
.phase-track { display: flex; gap: 7px; margin: 0; padding: 0 15px 10px; list-style: none; }
.phase-track li { flex: 1; padding-top: 4px; border-top: 2px solid #ffffff40; }
.phase-track [aria-current="step"] { color: var(--phase); border-color: var(--phase); }

#council-body, .activity-preview-body, .drawer-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #74847e #182427;
}
#council-body { padding: 12px 14px 15px; border-top: 1px solid var(--edge); }
#council-body .hint, .hud-action { color: #e8f0eb; border-color: #ffffff43; }
#game .flash:empty, #ballot:empty { display: none; }
#game .empty, #game .tally, #game .deadline, #game .cost { color: var(--ink-subtle); }
#ballot:not(:empty) { padding-top: 5px; }
#ballot .proposal { background: #ffffff09; border-color: var(--edge); border-inline-start: 3px solid var(--phase); }
#game .phase-result { color: var(--phase); margin: 4px 0; overflow-wrap: anywhere; }
.ballot-guide { margin: 0 0 10px; color: var(--ink-subtle); font-size: 13px; }
#ballot .score-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
#game .score { height: 40px; width: 100%; border-color: #ffffff43; color: #f1f6f4; }
#game .score.chosen { background: var(--phase); color: #15232a; border-color: var(--phase); }
.proposal h4 { overflow-wrap: anywhere; }
.locate-plot { flex-shrink: 0; }

.filing-menus { display: flex; gap: 6px; margin-bottom: 10px; }
.filing-menus button[aria-pressed="true"] { border-color: var(--phase); background: #ffffff23; }
.catalogue-guide { margin: 0 0 9px; color: var(--ink-subtle); font-size: 13px; }
.catalogue { display: grid; gap: 11px; }
.catalogue-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.catalogue-group h4 {
  grid-column: 1 / -1;
  margin: 0;
  font: 650 11px/1.3 var(--sans);
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.catalogue-item, .hire-option {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  text-align: left;
  border: 1px solid var(--edge);
  background: #ffffff0d;
  color: #eef3ed;
  border-radius: 9px;
}
.catalogue-item:hover:not(:disabled), .hire-option:hover:not(:disabled) { border-color: #ffffff73; background: #ffffff1c; }
.catalogue-item:disabled, .hire-option:disabled { opacity: .55; cursor: not-allowed; }
.catalogue-head { display: grid; gap: 2px; }
.catalogue-name { font-weight: 650; font-size: 13px; overflow-wrap: anywhere; }
.catalogue-level, .catalogue-cost, .hire-option small { font: 11px/1.35 var(--sans); color: var(--ink-subtle); }
.hire-picker { margin-top: 12px; padding: 10px; border: 1px solid var(--civic); background: #302a20; border-radius: 11px; }
.hire-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hire-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.hire-option b { font-size: 13px; overflow-wrap: anywhere; }

/* The ballot reads as a single-column list: one full-width row per proposal. */
#council-body { display: flex; flex-direction: column; gap: 10px; }
#council-body > * { min-width: 0; }
/* While voting, put the scores first and keep filing available underneath. */
#council-body[data-phase="voting"] > #ballot { order: -1; }
.ballot-list { display: grid; gap: 9px; }
#ballot .proposal { display: grid; gap: 7px; padding: 12px 13px; border-radius: 11px; }
#ballot .proposal.unaffordable { border-inline-start-color: #f4ab93; }
.proposal-note { margin: 0; color: var(--ink-subtle); font: italic 12px/1.5 var(--sans); overflow-wrap: anywhere; }
.proposal-shortfall { margin: 0; color: #ffc3aa; font: 650 11px/1.45 var(--mono); }
#ballot .score-row { gap: 6px; margin-top: 2px; }
#game .score { min-height: 44px; }

/* Catalogue rows stay compact; longer text lives behind the info button. */
.catalogue { gap: 7px; }
.catalogue-group { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.catalogue .catalogue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2px 6px;
  padding: 5px 6px 5px 9px;
  border-radius: 8px;
}
.catalogue .catalogue-item.showing-detail { background: #ffffff0a; }
.catalogue-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 5px 4px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  border-radius: 6px;
}
.catalogue-file:hover:not(:disabled), .catalogue-file:focus-visible { background: #ffffff12; }
.catalogue-file:disabled { opacity: .55; cursor: not-allowed; }
.catalogue-info {
  align-self: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #ffffff43;
  background: #ffffff0d;
  color: #e8f0eb;
  font: 700 12px/1 var(--mono);
}
.catalogue-info:hover, .catalogue-info[aria-expanded="true"] { border-color: var(--phase); color: var(--phase); }
.catalogue-detail {
  grid-column: 1 / -1;
  margin: 0 4px 4px;
  padding: 7px 0 2px;
  border-top: 1px dashed var(--edge);
  color: var(--ink-subtle);
  font: 12px/1.5 var(--sans);
  overflow-wrap: anywhere;
}
@media (max-width: 430px) {
  .catalogue-file { grid-template-columns: minmax(0, 1fr); }
  .catalogue-cost { justify-self: start; }
}

.situation-hud { grid-area: situation; display: flex; flex-direction: column; gap: var(--gap); }
.forecast, .event-panel { pointer-events: auto; }
.forecast { --event-accent: #a6d9b3; flex: none; padding: 12px 15px; border-top: 3px solid var(--event-accent); }
.forecast[data-category="attack"], .forecast[data-category="hazard"] { --event-accent: #f4ab93; }
.forecast[data-category="weather"] { --event-accent: #afd6fb; }
.forecast-head, .placement-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.forecast h2 { margin: 1px 0 0; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
#event-clock { color: var(--event-accent); }
#event-hint, #event-threat, .aftermath p, .placement-hud p, .panel-header p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-subtle);
  overflow-wrap: anywhere;
}
#event-threat { color: #ffc3aa; font-weight: 650; }
#event-threat[data-ready="true"] { color: #ace9b6; }

.event-panel { display: flex; flex-direction: column; min-height: 0; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  padding: 12px 14px;
  border-bottom: 1px solid var(--edge);
}
.panel-header h2 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.025em; }
.hud-action {
  flex: none;
  padding: 7px 10px;
  background: #ffffff09;
  border: 1px solid var(--edge);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.25;
}
.activity-preview-body, .activity-history-body { overflow-anchor: none; }
.activity-preview-body { padding: 0 14px; }
.activity-list { padding: 0; margin: 0; list-style: none; }
.activity-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 10px 12px;
  padding: 11px 0;
}
.activity-item + .activity-item { border-block-start: 1px solid var(--edge); }
.activity-day { color: var(--ink-subtle); font: 600 11px/1.35 var(--mono); white-space: nowrap; }
.activity-entry {
  color: #f0f4f1;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.activity-entry strong { color: #f2d9a6; font-size: 14px; }
.activity-text { margin: 0; }
.activity-empty { padding: 12px 0; color: var(--ink-subtle); font-size: 14px; }
.activity-item.tone-passed .activity-entry strong { color: #a8e4b7; }
.activity-item.tone-rejected .activity-entry strong { color: #ffc2ad; }

.hud-dock {
  grid-area: dock;
  z-index: 7;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 6px;
}
.hud-dock > div { display: flex; align-items: center; padding: 3px; border-radius: 12px; pointer-events: auto; }
.hud-dock button, .hud-close {
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: #eef3ed;
  border-radius: 8px;
  font: 650 13px var(--sans);
}
.hud-dock button:hover, .hud-dock button[aria-expanded="true"], .hud-action:hover, .hud-close:hover { background: #ffffff24; }
.map-tools label { display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; border-inline-start: 1px solid var(--edge); }
.map-tools input { width: 64px; margin: 0; accent-color: var(--civic); }
.hud-dock .compact-events { display: none; }

.hud-drawer, .placement-hud, .aftermath {
  position: absolute;
  bottom: var(--dock-clearance);
  right: var(--gap);
  min-width: 0;
}
.hud-drawer {
  z-index: 8;
  display: flex;
  flex-direction: column;
  width: min(455px, calc(100% - 2 * var(--gap)));
  max-height: min(74dvh, calc(100% - var(--dock-clearance) - var(--gap)));
}
.history-drawer { width: min(570px, calc(100% - 2 * var(--gap))); }
.drawer-body { padding: 0 15px 12px; }
.history-drawer .activity-entry, .history-drawer .activity-entry strong { font-size: 15px; }
.drawer-body h3 { margin: 14px 0 8px; font-size: 14px; }
.drawer-body .town { margin-top: 12px; }
.storage-table { width: 100%; border-collapse: collapse; margin-block: 4px 14px; font-size: 13px; }
.storage-table caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.storage-table :is(th, td) { padding: 6px 3px; border-bottom: 1px solid var(--edge); }
.storage-table thead th { color: var(--ink-subtle); font-size: 11px; font-weight: 650; }
.storage-table :is(th, td) { text-align: right; }
.storage-table th:first-child { text-align: left; }
.storage-table tbody th { color: var(--resource); font-weight: 650; }
.storage-table td { font-variant-numeric: tabular-nums; }
.storage-table small { color: var(--ink-subtle); font-size: 11px; }
.storage-table .storage-overflow { color: #ffc2ad; }
.hud-close { flex: none; min-width: 38px; padding: 0; background: #ffffff13; font-size: 23px; }
.selection-hud {
  grid-area: inspector;
  align-self: end;
  position: relative;
  z-index: 4;
  width: min(100%, 350px);
  margin-inline-start: auto;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  padding: 12px 53px 13px 14px;
}
.selection-hud .hud-close { position: absolute; right: 6px; top: 6px; }
.selection-hud .inspect-head { display: grid; gap: 2px; }
.selection-hud .inspect-head b { font-size: 18px; line-height: 1.3; }
.selection-hud .inspect-line { color: var(--ink-subtle); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.selection-hud .inspect-health { display: grid; gap: 3px; margin-top: 6px; padding: 7px 9px; border-radius: 8px; border-left: 3px solid var(--health-tone); background: #ffffff0d; --health-tone: #8fc79a; }
.selection-hud .inspect-health.tone-hurt { --health-tone: #e8c46a; }
.selection-hud .inspect-health.tone-serious { --health-tone: #ec8a5e; }
.selection-hud .inspect-health.tone-down { --health-tone: #ef6461; background: #ef64611a; }
.selection-hud .inspect-health-status { font-size: 13px; color: var(--health-tone); }
.selection-hud .inspect-health-stats { font-size: 12px; color: var(--ink-subtle); }
.selection-hud .inspect-wounds { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 1px; font-size: 12px; line-height: 1.4; }
.selection-hud .inspect-wounds li::before { content: "•"; margin-right: 6px; color: #8fc79a; }
.selection-hud .inspect-wounds li.tone-hurt::before { color: #e8c46a; }
.selection-hud .inspect-wounds li.tone-serious::before { color: #ec8a5e; }
.care-report { display: grid; gap: 2px; margin-bottom: 10px; font-size: 13px; color: var(--ink-subtle); }
.care-report p { margin: 0; }
.dev-panel { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border: 1px dashed #ef646180; border-radius: 8px; font-size: 12px; }
.dev-panel > b { color: #ef8f8d; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.dev-panel .dev-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dev-panel select, .dev-panel input { font: inherit; background: #0006; color: inherit; border: 1px solid var(--edge); border-radius: 5px; padding: 2px 4px; }
.dev-panel input { width: 4em; }
.dev-panel button { font: inherit; padding: 3px 8px; }
.placement-hud, .aftermath {
  z-index: 6;
  width: min(400px, calc(100% - 2 * var(--gap)));
  padding: 12px 15px;
  max-height: 46dvh;
  overflow: auto;
}
.aftermath { left: 50%; right: auto; transform: translateX(-50%); }
.placement-hud { z-index: 7; }
.placement-controls { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 10px; }
.placement-controls label { display: grid; gap: 2px; color: var(--ink-subtle); font-size: 12px; }
.placement-controls input { width: 63px; min-height: 38px; background: #172326; border: 1px solid #788984; border-radius: 6px; padding: 5px; }
.placement-controls .btn { min-height: 38px; padding: 5px 10px; }
#game.placing-farm #council-body { display: none; }
#game :focus-visible { outline: 2px solid #fff2c6; outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 940px) {
  .hud-layout {
    grid-template: "header" auto
                   "situation" auto
                   "council" minmax(0, 1fr)
                   "dock" auto
                   / minmax(0, 1fr);
  }
  .hud-header {
    grid-template: "brand meta" auto "stats stats" auto / minmax(0, 1fr) auto;
    gap: 5px 8px;
    padding: 7px 9px;
  }
  .hud-header .brand { grid-area: brand; font-size: 12px; }
  .hud-meta { grid-area: meta; gap: 5px; }
  .hud-header .clock { min-width: 0; font-size: 11px; padding: 5px 7px; }
  .menu-toggle, .pause-toggle { font-size: 11px; padding: 5px 8px; }
  .hud-header .status { font-size: 0; padding: 6px; gap: 0; }
  .stat-strip { grid-area: stats; justify-content: space-between; border-top: 1px solid var(--edge); padding-top: 4px; }
  .stat-chip { flex: 1; justify-content: center; padding: 2px 4px; }
  .event-panel { display: none; }
  .forecast { padding: 8px 12px; }
  .forecast h2 { font-size: 16px; }
  #event-hint, #event-threat { font-size: 12px; margin-top: 3px; }
  .council-hud { max-block-size: min(100%, 56dvh); }
  .hud-dock .compact-events { display: block; }
}
@media (max-width: 560px) {
  .stat-chip:not([data-resource="gold"], [data-resource="food"], [data-resource="wood"], [data-resource="people"]) { display: none; }
  .hud-dock button { padding-inline: 6px; font-size: 12px; }
  .map-tools label { font-size: 0; padding-inline: 5px; gap: 0; }
  .map-tools input { width: 38px; }
  .hud-drawer { max-height: min(70dvh, calc(100% - var(--dock-clearance) - var(--gap))); }
  .activity-item { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .forecast h2 { font-size: 15px; }
}
@media (max-height: 470px) and (min-width: 600px) {
  .hud-layout {
    grid-template: "header header" auto
                   "council situation" minmax(0, 1fr)
                   "dock dock" auto
                   / minmax(0, 1fr) minmax(0, 1fr);
  }
  .council-hud { max-block-size: 100%; }
  .event-panel { display: none; }
  .hud-dock .compact-events { display: block; }
  .hud-drawer { max-height: calc(100% - var(--dock-clearance) - var(--gap)); }
}
@media (max-width: 940px), (max-height: 470px) {
  .selection-hud {
    position: absolute;
    inset-inline-end: 0;
    bottom: var(--dock-clearance);
    width: min(100%, 350px);
    max-height: 43%;
  }
  .hud-layout:has(.selection-hud:not([hidden])) #council-body { display: none; }
}
.score[aria-disabled="true"] { opacity: .65; cursor: progress; }
#ballot [hidden] { display: none; }
#map-viewport::after { content:""; position:absolute; inset:0; pointer-events:none; opacity:0; transition:opacity .5s; }
#game:is([data-encounter=storm],[data-encounter=flood],[data-encounter=bountiful_rain]) #map-viewport::after {
  opacity:.48; background:repeating-linear-gradient(112deg,transparent 0 22px,#c3e5ff2e 24px 25px,transparent 27px 45px),#335b8260;
  background-size:120px 160px; animation:rain .65s linear infinite;
}
#game:is([data-encounter=wildfire],[data-encounter=dragon]) #map-viewport::after { opacity:.65; background:radial-gradient(ellipse at 70% 55%, transparent 35%,#551b1650 67%,#c2502562); }
#game:is([data-encounter=frost],[data-encounter=blight],[data-encounter=drought]) #map-viewport::after { opacity:.65; background:radial-gradient(ellipse,transparent 48%,#ccb88c55); }
@keyframes rain { to { background-position:-120px 160px; } }
@media(prefers-reduced-motion:reduce) { #game #map-viewport::after { animation:none; } }

/* Main menu */
.main-menu { z-index: 70; }
.main-menu[data-mode="title"] { background: rgba(5, 8, 13, .55); }
.menu-card { text-align: left; }
.menu-card p { margin-left: 0; margin-right: 0; max-width: none; }
.menu-card .kicker { display: inline-block; }
#menu-title { font-size: 34px; letter-spacing: .02em; }
#menu-title span { color: var(--accent); }
.menu-status { color: var(--ink2); margin: 0 0 18px; }
.menu-choices { display: grid; gap: 9px; }
.menu-choices .btn { width: 100%; padding: 12px 14px; font-size: 15px; text-align: center; }
.menu-view > .btn { margin-top: 12px; }
.menu-save-form label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 6px; }
.menu-save-row { display: flex; gap: 8px; }
.menu-save-row input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #ffffff2e; background: #0b1316; color: #f1f6f4; font: inherit;
}
.menu-save-row input:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.menu-hint { font-size: 12px; color: var(--ink-subtle, #9aa7a2); margin: 8px 0; }
.save-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.save-entry {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 11px; border: 1px solid #ffffff1f; border-radius: 10px; background: #ffffff08;
}
.save-entry strong { display: block; overflow-wrap: anywhere; }
.save-entry span { font-size: 12px; color: var(--ink2); }
.save-tools { display: flex; gap: 6px; flex: none; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.save-empty { color: var(--ink2); font-size: 13px; padding: 6px 2px; }
.menu-confirm { margin: 4px 0 16px; }
.menu-message { min-height: 1.2em; margin: 12px 0 0; font-size: 13px; color: var(--ink2); }
.menu-message.good { color: #9fe0b0; }
.menu-message.bad { color: #ffb1a2; }
.main-menu[aria-busy] .menu-card { cursor: progress; }

/* Host controls */
.menu-choices .btn.quiet { background: transparent; border-color: #ffffff1f; color: var(--ink2); font-size: 13px; padding: 9px 14px; }
.mode-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.mode-choice { display: grid; gap: 4px; text-align: left; padding: 10px 12px; }
.mode-choice span { font-size: 12px; color: var(--ink2); font-weight: 400; }
.mode-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.chat-feed { min-height: min(160px, 26dvh); padding-block: 8px; list-style: none; margin: 0; }
.chat-feed li { padding-block: 5px; overflow-wrap: anywhere; }
.chat-feed strong { color: var(--ink-subtle); font-size: 12px; }
.chat-feed p { margin: 0; white-space: pre-wrap; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 10px 14px; }
.chat-form input { min-width: 0; padding: 8px; }
.chat-form [role="status"] { grid-column: 1 / -1; font-size: 12px; }
@media (max-width: 620px) {
  .hud-dock { flex-wrap: wrap; gap: 4px; }
  .hud-dock > div { flex-wrap: wrap; }
}
