/* Decisions occupy the right rail; the selected place or tree occupies the board. */
.game-header {
  height: 68px;
  padding: 10px 22px;
}
.brand {
  font-size: var(--text-section);
  letter-spacing: 2px;
}
.headline-metrics {
  gap: 26px;
}
.headline-metrics button {
  display: flex;
  gap: 7px;
  align-items: baseline;
}
.headline-metrics span {
  font-size: var(--text-meta);
  letter-spacing: 0;
  text-transform: none;
}
.headline-metrics b {
  font-size: var(--text-value);
}
.headline-metrics small {
  font-size: var(--text-meta);
}
.main-nav {
  height: 46px;
  padding: 0 22px;
}
.main-nav button {
  font-size: var(--text-compact);
  padding: 7px 14px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  height: calc(100dvh - 114px);
}
#board {
  height: auto;
  min-height: 0;
  padding: 22px;
  overflow: auto;
}
.command-rail {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-subtle);
  background: var(--surface);
  min-height: 0;
}
.rail-inbox {
  overflow: auto;
  min-height: 130px;
  flex: 1;
  padding: 20px;
  scrollbar-width: thin;
}
.turn-inbox h2 {
  font-size: var(--text-section);
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.turn-inbox h2 span {
  color: var(--fg-muted);
}
.turn-inbox h3 {
  font-size: var(--text-meta);
  font-weight: 500;
  color: var(--fg-muted);
  margin: 18px 0 5px;
}
.inbox-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 11px 0;
  background: none;
  text-align: left;
}
.inbox-item > span,
.inbox-item > small {
  display: block;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin: 2px 0;
}
.inbox-item strong {
  font-size: var(--text-compact);
  font-weight: 500;
}
.inbox-item.needs-action strong {
  color: var(--accent);
}
.inbox-item .bar {
  margin: 7px 0 0;
  height: 3px;
}
.inbox-item.urgent strong {
  color: var(--danger-fg);
}
.inbox-news {
  margin-top: 18px;
}
.news-item strong {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.turn-dock {
  height: 68px;
  flex: none;
  padding: 12px 18px;
  gap: 8px;
}
.next-turn {
  font-size: var(--text-body);
  min-width: 0;
  flex: 1;
  justify-content: center;
}
.turn-dock .subtle {
  padding: 8px 11px;
  font-size: var(--text-value);
}
.context-panel {
  flex: none;
  max-height: 52%;
  overflow: auto;
  padding: 20px;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--surface);
  scrollbar-width: thin;
}
.context-panel h2 {
  font-size: var(--text-value);
}
.context-panel .inspector-empty {
  font-size: var(--text-compact);
  margin: 0;
  color: var(--fg-muted);
}
/* Map labels show the selected measure once, without repeated instructions. */
.map-toolbar {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
}
.world-view .map-key {
  bottom: 10px;
}
.world-view .earth {
  padding: 70px 18px 45px;
}
.world-view .world-canvas {
  background: var(--canvas);
}
.world-canvas:after {
  display: none;
}
.city-name {
  font-size: var(--text-compact);
}
.city-value {
  font-size: var(--text-meta);
}
.map-toolbar .segmented button {
  background: var(--surface);
}
.map-toolbar .segmented [aria-pressed='true'] {
  background: var(--accent);
}
/* The city is a floor plan populated only by actual facilities. */
.city-view {
  display: block;
  height: 100%;
}
.city-landscape {
  height: 100%;
  background: var(--canvas);
}
.city-heading {
  top: 18px;
  left: 22px;
  pointer-events: none;
}
.city-heading button {
  pointer-events: auto;
}
.city-heading h1 {
  font-size: var(--text-heading);
  margin: 4px 0;
}
.plot-city {
  position: absolute;
  inset: 0;
  background: var(--canvas) !important;
}
.city-plot-map {
  width: 100%;
  height: 100%;
  padding: 95px 20px 25px;
}
.city-plot {
  cursor: pointer;
}
.city-plot:hover .vector-structure {
  filter: brightness(1.35);
}
.city-plot:focus-visible {
  outline: 2px solid var(--accent);
}
.city-plot.foreign .vector-structure {
  opacity: 0.55;
}
.plot-city.blackout .city-plot.owned .vector-structure {
  opacity: 0.55;
}
.empty-city-label {
  position: absolute;
  left: 50%;
  top: 55%;
  translate: -50% -50%;
  color: var(--fg-subtle);
  font-size: var(--text-compact);
  pointer-events: none;
}
.city-facts {
  margin: 0;
}
.city-stat-grid {
  margin-top: 18px;
  gap: 10px 18px;
}
.city-stat-grid > div {
  display: block;
}
.city-stat-grid b {
  font-size: var(--text-value);
  display: block;
}
.citizen-share {
  margin-top: 14px;
}
.citizen-share > span {
  font-size: var(--text-compact);
}
.citizen-share .bar {
  margin: 5px 0 9px;
}
.copy-status {
  font-size: var(--text-compact);
}
.work-options {
  margin-top: 20px;
}
.work-options h3 {
  margin: 24px 0 8px;
}
.choice-row {
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}
.choice-row summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.choice-row summary:after {
  content: '＋';
  color: var(--fg-subtle);
}
.choice-row[open] summary:after {
  content: '−';
}
.choice-row summary b {
  font-size: var(--text-compact);
  font-weight: 500;
}
.choice-row summary span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin-left: auto;
}
.choice-row p {
  font-size: var(--text-compact);
}
.choice-row button {
  margin-top: 12px;
  font-size: var(--text-compact);
}
.choice-row.complete summary b {
  color: var(--ok-fg);
}
/* A directed graph: all prerequisites connect from the left. Selection is click only. */
.research-view {
  height: 100%;
  min-height: 0;
}
.research-view .view-title {
  margin-bottom: 16px;
}
.view-title h1 {
  font-size: var(--text-heading);
}
.tree-key {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.tree-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px;
  background: none;
  border: 0;
}
.tech-hex {
  height: 94px;
}
.tech-hex path {
  stroke: var(--border-strong) !important;
  fill: var(--surface) !important;
}
.tech-hex:hover path,
.tech-hex:focus-visible path {
  stroke: var(--fg) !important;
  fill: var(--surface-raised) !important;
  stroke-width: 1.5 !important;
}
.tech-hex.selected path {
  stroke: var(--accent) !important;
  fill: var(--accent-soft) !important;
  stroke-width: 2.5 !important;
}
.tech-hex.complete path {
  stroke: var(--ok-dot) !important;
}
.tech-hex.researching path {
  stroke: var(--info-fg) !important;
}
.tech-hex.selected.complete path,
.tech-hex.selected.researching path {
  stroke: var(--accent) !important;
}
.tech-hex strong {
  font-size: var(--text-compact);
}
.hex-board .tech-edge {
  fill: none;
  stroke: var(--fg-subtle);
  stroke-width: 1.4;
  opacity: 0.75;
}
.hex-board .tech-edge.complete {
  stroke: var(--ok-dot);
}
.hex-board .tech-edge.highlighted {
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 1;
}
.hex-board .tech-edge.any {
  stroke-dasharray: 4 4;
}
#tech-arrow path {
  fill: var(--fg-muted);
  stroke: none;
}
.tree-gate {
  position: absolute;
  width: 132px;
  height: 94px;
  border: 1px dashed var(--fg-subtle);
  padding: 12px;
  background: var(--surface);
  font-size: var(--text-compact);
}
.tree-gate small {
  display: block;
  font-size: var(--text-meta);
  margin-top: 6px;
  color: var(--fg-muted);
}
.tech-tooltip {
  position: fixed;
  z-index: 40;
  max-width: 250px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 30px #0008;
  padding: 13px;
  pointer-events: none;
  border-radius: 6px;
  font-size: var(--text-compact);
}
.tech-tooltip[hidden] {
  display: none;
}
.tech-tooltip p {
  font-size: var(--text-compact);
  margin: 5px 0;
}
.tech-tooltip small {
  color: var(--fg-muted);
}
.tech-detail {
  border-width: 1px 0 0;
}
.tech-detail .tech-unlock {
  font-size: var(--text-compact);
  line-height: 1.5;
}
.tech-detail .tech-risk {
  font-size: var(--text-meta);
  color: var(--warn-fg);
  line-height: 1.5;
  margin-top: 10px;
}
.tech-cost {
  margin-top: 12px;
}
.tech-cost b {
  font-size: var(--text-section);
}
.tech-detail button {
  margin-top: 10px;
}
.mechanic-details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.mechanic-details summary {
  cursor: pointer;
  color: var(--fg-muted);
  font-size: var(--text-compact);
}
.mechanic-details h3 {
  font-size: var(--text-meta);
  margin-top: 15px;
}
.mechanic-details p {
  font-size: var(--text-compact);
  line-height: 1.5;
}
.tech-detail .allocation {
  margin-top: 12px;
}
.policy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.policy-branch > h2 {
  font-size: var(--text-body);
  margin: 12px 0;
}
.policy-grid .choice-row summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.policy-grid .choice-row summary b {
  flex-basis: 85%;
}
.policy-grid .choice-row summary span {
  margin: 0;
}
.policy-grid .choice-row summary:after {
  margin-left: auto;
}
.victory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.victory-card {
  padding: 18px;
  background: none;
}
.victory-card h2 {
  font-size: var(--text-section);
  margin: 0;
}
.victory-card button {
  font-size: var(--text-compact);
}
.view-title p {
  font-size: var(--text-compact);
}
.opposition-tabs {
  margin-bottom: 18px;
}
.opposition-summary p {
  font-size: var(--text-compact);
}
.opposition-summary {
  padding: 10px 0;
}
.research-view:has(+ .opposition-summary) {
  height: calc(100% - 95px);
}
@media (max-width: 1050px) {
  .headline-metrics {
    gap: 14px;
  }
  .headline-metrics button {
    flex-wrap: wrap;
    gap: 2px 7px;
  }
  .headline-metrics small {
    flex-basis: 100%;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 275px;
  }
  .rail-inbox,
  .context-panel {
    padding: 15px;
  }
  .policy-grid {
    grid-template-columns: 1fr;
  }
  .game-header {
    padding: 8px 14px;
  }
  .headline-metrics b {
    font-size: var(--text-section);
  }
}
@media (max-width: 700px) {
  .game-header {
    height: 94px;
    flex-wrap: wrap;
  }
  .headline-metrics {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .headline-metrics button {
    display: grid;
    grid-template-columns: auto auto;
  }
  .headline-metrics span {
    font-size: var(--text-meta);
  }
  .headline-metrics small {
    display: none;
  }
  .main-nav {
    height: 42px;
    padding: 0 8px;
  }
  .main-nav button {
    font-size: var(--text-meta);
    padding: 7px 10px;
  }
  .workspace {
    height: calc(100dvh - 136px);
    grid-template-columns: minmax(0, 1fr) 190px;
  }
  .rail-inbox,
  .context-panel {
    padding: 12px;
  }
  .context-panel {
    max-height: 48%;
  }
  .turn-inbox h2 {
    font-size: var(--text-body);
  }
  .inbox-item strong {
    font-size: var(--text-meta);
  }
  .inbox-item > span,
  .inbox-item > small {
    font-size: var(--text-meta);
  }
  .turn-dock {
    padding: 8px;
    height: 56px;
    gap: 4px;
  }
  .next-turn {
    font-size: var(--text-compact);
    padding: 8px 5px;
  }
  .turn-dock .subtle {
    padding: 5px;
  }
  .turn-inbox h3 {
    margin-top: 12px;
  }
  #board {
    padding: 12px;
  }
  .view-title {
    display: block;
  }
  .view-title h1 {
    font-size: var(--text-value);
  }
  .city-view {
    height: 100%;
  }
  .city-heading h1 {
    font-size: var(--text-value);
  }
  .city-heading {
    left: 12px;
  }
  .city-plot-map {
    min-width: 470px;
    padding: 85px 8px 20px;
  }
  .city-landscape {
    overflow: auto;
  }
  .city-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .city-stat-grid span {
    font-size: var(--text-meta);
  }
  .city-stat-grid b {
    font-size: var(--text-section);
  }
  .context-panel h2 {
    font-size: var(--text-section);
  }
  .world-view .earth {
    min-width: 580px;
  }
  .world-view .world-canvas {
    overflow: auto;
  }
  .world-view .map-key {
    display: none;
  }
  .map-toolbar {
    top: 10px;
    left: 10px;
  }
  .map-toolbar .segmented {
    gap: 3px;
  }
  .map-toolbar button {
    font-size: var(--text-meta);
    padding: 5px 7px;
  }
  .victory-grid {
    grid-template-columns: 1fr;
  }
  .tree-key {
    display: block;
    margin-top: 5px;
  }
}
.workspace > #board {
  width: 100%;
  height: 100%;
  margin: 0;
  max-width: none;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  overflow: hidden;
}
.workspace > #board:not(:has(.research-view)):not(.city-board):not(:has(.world-view)) {
  overflow: auto;
}
.world-view {
  width: 100%;
  height: 100%;
}
.research-view {
  min-width: 0;
}
.tree-scroll {
  width: 100%;
  min-width: 0;
  position: relative;
}
.research-view {
  --tree-color: var(--accent);
}
.research-view[data-tree-owner='humans'] {
  --tree-color: var(--warn-fg);
}
.research-view[data-tree-owner='meridian'],
.research-view[data-tree-owner='helios'] {
  --tree-color: var(--busy-fg);
}
.research-view[data-tree-owner='policies'] {
  --tree-color: var(--info-fg);
}
.tech-hex {
  width: 116px;
  height: 100px;
  padding: 17px 14px;
  gap: 5px;
}
.tech-hex strong {
  font-size: var(--text-meta);
  font-weight: 500;
  line-height: 1.3;
}
.hex-board .honey-path {
  stroke: var(--border-strong);
  stroke-width: 1;
  fill: color-mix(in srgb, var(--tree-color) 5%, var(--canvas));
}
.hex-board .honey-path.highlighted {
  stroke: var(--tree-color);
  fill: color-mix(in srgb, var(--tree-color) 18%, var(--canvas));
}
.tech-hex.selected path,
.tech-hex.selected.complete path,
.tech-hex.selected.researching path {
  stroke: var(--tree-color) !important;
  fill: color-mix(in srgb, var(--tree-color) 18%, var(--canvas)) !important;
}
.tree-gate {
  border: 0;
  background: none !important;
}
.tree-gate strong {
  font-size: var(--text-meta);
}
.tree-gate small {
  font-size: var(--text-meta);
  margin: 0;
  line-height: 1.3;
}
.tree-gate path {
  stroke-dasharray: 3 3;
}
.command-rail {
  position: relative;
  z-index: 2;
}
.tech-tooltip {
  z-index: 50;
}
.choice-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
}
.choice-title b {
  font-size: var(--text-body);
  font-weight: 500;
}
.choice-title span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.work-options .choice-row p {
  margin-top: 6px;
}
.work-options .choice-row button {
  padding: 7px 14px;
}
.work-options .choice-row:has(button:not(:disabled)) {
  border-color: var(--border-strong);
}
.tech-hex.prerequisite path {
  stroke: var(--tree-color) !important;
  stroke-width: 2 !important;
}
.tech-hex.prerequisite strong {
  color: var(--fg);
}
.hex-board .honey-path {
  fill: color-mix(in srgb, var(--tree-color) 3%, var(--canvas));
  stroke: color-mix(in srgb, var(--border-strong) 65%, var(--canvas));
}
.hex-board .honey-path.highlighted {
  stroke: var(--tree-color);
  fill: color-mix(in srgb, var(--tree-color) 12%, var(--canvas));
}
.news-summary {
  font-size: var(--text-compact);
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0 0 12px;
  text-align: left;
}
.inbox-item.urgent {
  border-left: 2px solid var(--danger-fg);
  padding-left: 10px;
}
.victory-grid:has(> .victory-card:only-child) {
  grid-template-columns: minmax(0, 620px);
}
.city-art.plot-city .city-plot-map {
  transform: none;
  background: none;
}
.research-view[data-tree-owner='helios'] {
  --tree-color: var(--ok-fg);
}
.research-view:not([data-tree-owner='you']) .tech-hex.complete path {
  stroke: var(--tree-color) !important;
}
.research-view:not([data-tree-owner='you']) .hex-dot.complete {
  background: var(--tree-color);
}
.inbox-item {
  padding: 8px 0;
}
.inbox-city {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}
.inbox-city > .inbox-item {
  border: 0;
}
.policy-ready {
  display: block;
  background: none;
  border: 0;
  padding: 3px 0 8px;
  font-size: var(--text-meta);
  color: var(--info-fg);
  text-align: left;
}
.inbox-headline {
  display: block;
  width: 100%;
  padding: 0 0 10px;
  border: 0;
  background: none;
  text-align: left;
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.turn-inbox h3 {
  margin: 12px 0 4px;
}
.news-summary {
  padding-bottom: 8px;
}
.context-panel {
  max-height: 48%;
}
.context-panel:has(.city-facts) {
  padding: 16px 20px;
  max-height: 46%;
}
.city-facts .city-stat-grid {
  margin-top: 0;
  gap: 7px 20px;
}
.city-facts .city-stat-grid span {
  font-size: var(--text-meta);
}
.city-facts .city-stat-grid b {
  font-size: var(--text-section);
  line-height: 1.4;
}
.city-facts .citizen-share {
  margin-top: 12px;
}
.city-facts .citizen-share .bar {
  margin: 3px 0 7px;
  height: 3px;
}
.city-fact-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin-top: 10px;
}
.city-fact-footer button {
  font-size: var(--text-meta);
  white-space: nowrap;
}
@media (min-width: 1051px) {
  .rail-inbox {
    padding: 16px 20px;
  }
  .turn-inbox h2 {
    margin-bottom: 8px;
  }
  .turn-inbox h3 {
    margin-top: 8px;
  }
  .inbox-headline {
    padding-bottom: 6px;
  }
  .inbox-item {
    padding: 6px 0;
  }
}
.opposition-tabs button[aria-pressed='true'] {
  color: var(--fg);
  background: var(--surface-raised);
}
.tech-hex.working path {
  stroke: var(--info-fg) !important;
}
.hex-dot.working {
  background: var(--info-fg);
}
/* Every visible hex is a discovery; adjacent shared edges are the prerequisite path. */
.branch-tree .view-title {
  margin-bottom: 6px;
}
.branch-note {
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin: 0 0 8px;
}
.branch-tree .tree-scroll {
  scrollbar-width: auto;
  scrollbar-color: var(--border-strong) var(--canvas);
  padding: 8px 0;
  min-height: 0;
}
.branch-tree .tech-hex {
  /* Three reserved bands keep the name above the tapered lower edge. */
  display: grid;
  grid-template-rows: 18px 45px 14px;
  justify-items: center;
  align-items: center;
  padding: 4px 11px 8px;
  gap: 3px;
  width: 116px;
  height: 100px;
  color: var(--fg);
}
.branch-tree .tech-hex .hex-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.branch-tree .tech-hex .tech-glyph {
  position: static;
  inset: auto;
  width: 28px;
  height: 20px;
  flex: none;
  z-index: auto;
  color: var(--tree-color);
  overflow: visible;
}
.branch-tree .tech-hex .tech-glyph path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.6 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.branch-tree .tech-hex strong {
  line-height: 15px;
  width: 90px;
  max-width: 90px;
  text-align: center;
  text-wrap: balance;
  letter-spacing: 0;
  font-weight: 600;
}
.branch-tree .hex-caption {
  max-width: 80px;
  white-space: nowrap;
  line-height: 14px;
  color: var(--fg-muted);
}
.branch-tree .tech-hex .hex-shape path {
  fill: color-mix(in srgb, var(--tree-color) 9%, var(--surface)) !important;
  stroke: color-mix(in srgb, var(--tree-color) 45%, var(--border-strong)) !important;
  stroke-width: 1.3 !important;
}
.branch-tree .tech-hex.available .hex-shape path {
  fill: color-mix(in srgb, var(--tree-color) 23%, var(--surface)) !important;
  stroke: var(--tree-color) !important;
  stroke-width: 2 !important;
}
.branch-tree .tech-hex.complete .hex-shape path {
  fill: var(--ok-soft) !important;
  stroke: var(--ok-dot) !important;
}
.branch-tree .tech-hex.complete .tech-glyph,
.branch-tree .tech-hex.complete .hex-caption {
  color: var(--ok-fg);
}
.branch-tree .tech-hex.researching .hex-shape path,
.branch-tree .tech-hex.working .hex-shape path {
  fill: var(--info-soft) !important;
  stroke: var(--info-fg) !important;
}
.branch-tree .tech-hex.locked .tech-glyph {
  opacity: 0.6;
}
.branch-tree .tech-hex.locked strong {
  color: var(--fg-muted);
}
.branch-tree .tech-hex:hover .hex-shape path,
.branch-tree .tech-hex:focus-visible .hex-shape path {
  stroke: var(--fg) !important;
  stroke-width: 2 !important;
}
.branch-tree .tech-hex.selected .hex-shape path {
  fill: color-mix(in srgb, var(--tree-color) 32%, var(--surface)) !important;
  stroke: var(--fg) !important;
  stroke-width: 2.5 !important;
}
.branch-tree .tech-hex.prerequisite .hex-shape path {
  stroke: var(--tree-color) !important;
  stroke-width: 2.5 !important;
}
.branch-tree:not([data-tree-owner='you']) .tech-hex.complete .hex-shape path {
  stroke: var(--tree-color) !important;
  fill: color-mix(in srgb, var(--tree-color) 14%, var(--surface)) !important;
}
.branch-tree:not([data-tree-owner='you']) .tech-hex.complete .tech-glyph {
  color: var(--tree-color);
}
.strategy-game .opposition-tabs button[aria-pressed='true'] {
  color: var(--fg) !important;
}
