/* World, city and research share one stable header and right-hand work area. */
.game-header {
  height: 82px;
  padding: 12px 22px;
  gap: 28px;
  border-bottom: 1px solid var(--border-subtle);
}
.headline-metrics {
  display: flex;
  gap: 26px;
  flex: 1;
  justify-content: center;
}
.headline-metrics .metric {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 8px;
  align-content: center;
}
.metric > span {
  grid-column: 1/-1;
  color: var(--fg-muted);
  font-size: var(--text-meta);
}
.metric > b {
  font-size: var(--text-value);
  font-weight: 600;
  white-space: nowrap;
}
.metric > small {
  align-self: end;
  padding-bottom: 3px;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  white-space: nowrap;
}
.metric.user-metric {
  display: block;
}
.metric.user-metric > * {
  display: block;
}
.metric.user-metric b {
  font-size: var(--text-body);
}
.turn-number {
  font-size: var(--text-compact);
  white-space: nowrap;
}
.header-controls {
  gap: 14px;
}
.header-controls .audio-panel {
  gap: 8px;
}
.brand {
  letter-spacing: 1px;
  white-space: nowrap;
}
.workspace {
  height: calc(100dvh - 82px);
  grid-template-columns: minmax(0, 1fr) 340px;
}
.workspace > #board {
  position: relative;
  padding: 0;
}
.command-rail {
  background: var(--surface);
  overflow: hidden;
}
.rail-content {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 24px;
  scrollbar-width: thin;
}
.rail-content h2 {
  font-size: var(--text-body);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  margin: 0 0 14px;
}
.rail-content h2 > span {
  color: var(--fg-subtle);
  font-weight: 400;
  font-size: var(--text-meta);
}
.rail-content p {
  font-size: var(--text-compact);
  line-height: 1.6;
}
.rail-content .muted {
  color: var(--fg-muted);
}
.research-widget {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  min-width: 220px;
  max-width: 300px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px 18px;
  text-align: left;
  display: block;
  box-shadow: 0 8px 28px #0002;
}
.research-widget > span {
  display: block;
  color: var(--fg-muted);
  font-size: var(--text-meta);
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.research-widget strong {
  font-size: var(--text-body);
  font-weight: 500;
}
.work-meter {
  height: 3px;
  border-radius: 3px;
  background: var(--border-subtle);
  overflow: hidden;
  margin-top: 12px;
}
.work-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.6s;
}
.world-view .earth {
  padding: 100px 24px 65px;
  width: 100%;
  height: 100%;
}
.world-view .world-canvas {
  height: 100%;
  background: radial-gradient(ellipse at 50% 40%, var(--surface), var(--canvas) 75%);
}
.world-view .map-key {
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: var(--text-meta);
  justify-content: center;
  pointer-events: none;
}
.map-key i.lime {
  background: var(--accent);
}
.power-label {
  font-size: var(--text-meta);
  fill: var(--fg-muted);
}
.city-name {
  font-size: var(--text-meta);
  font-weight: 600;
}
.city-value {
  font-size: var(--text-meta);
  fill: var(--fg-muted);
}
.map-city circle {
  transition: stroke-dasharray 0.7s;
}
.world-view .earth .map-city:hover {
  filter: brightness(1.25);
}
.notification-zone {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}
.ready-card {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.ready-card:last-child {
  border: 0;
}
.ready-card > span {
  display: block;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin-bottom: 5px;
}
.ready-card > strong {
  display: block;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--accent);
}
.ready-card > small {
  display: block;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin-top: 5px;
  line-height: 1.5;
}
.news-card {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.news-card:last-child {
  border: 0;
}
.news-place {
  font-size: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-subtle);
}
.news-card h3 {
  font-size: var(--text-body);
  line-height: 1.4;
  font-weight: 500;
  margin: 5px 0 8px;
}
.news-card p {
  color: var(--fg-muted);
  margin: 0;
}
.news-card .event-choice-effect {
  margin-top: 10px;
  color: var(--fg);
}
.news-card.threat h3 {
  color: var(--danger-fg);
}
.news-card.research h3 {
  color: var(--ok-fg);
}
.news-card details {
  font-size: var(--text-meta);
  margin-top: 10px;
  color: var(--fg-subtle);
}
.news-card a {
  font-size: var(--text-meta);
  line-height: 1.5;
}
.news-card small {
  display: block;
  margin-top: 10px;
  color: var(--ok-fg);
}
.event-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.event-buttons button {
  font-size: var(--text-meta);
  padding: 8px 10px;
}
.event-buttons button:first-child {
  color: var(--accent);
}
.turn-dock {
  height: auto;
  min-height: 92px;
  border-top: 1px solid var(--border-subtle);
  padding: 14px 22px;
  align-items: flex-start;
}
.advance-controls {
  flex: 1;
  display: grid;
  gap: 8px;
}
.next-turn {
  width: 100%;
  font-size: var(--text-compact);
  text-align: center;
  padding: 10px 14px;
  display: block;
}
.wait-turn {
  font-size: var(--text-meta);
  padding: 0;
  background: none;
  border: 0;
  color: var(--fg-muted);
}
.turn-dock > .subtle {
  padding: 6px;
  margin-top: 1px;
}
.next-turn:disabled {
  opacity: 0.4;
  cursor: default;
}
.city-landscape {
  overflow: hidden;
  border-radius: 0;
}
.city-heading {
  top: 24px;
  left: 28px;
}
.city-plot-map {
  padding: 50px 20px 160px;
}
.city-bottom-stats {
  position: absolute;
  bottom: 24px;
  left: 28px;
  max-width: 510px;
  width: calc(100% - 56px);
  padding: 20px 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  pointer-events: auto;
}
.city-population {
  display: grid;
  gap: 4px;
}
.city-population strong {
  font-size: var(--text-compact);
  font-weight: 500;
}
.city-population span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.population-bar {
  display: flex;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border-subtle);
  margin: 7px 0 17px;
}
.local-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.local-metrics > div {
  display: grid;
  gap: 4px;
}
.local-metrics span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.local-metrics b {
  font-size: var(--text-value);
  font-weight: 500;
}
.city-bottom-stats > p {
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin: 14px 0 0;
}
.city-work .active-work {
  padding: 16px;
  background: var(--canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 20px;
}
.active-work > span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.active-work h3 {
  font-size: var(--text-section);
  font-weight: 500;
  margin: 6px 0 0;
}
.active-work p {
  color: var(--fg-muted);
  font-size: var(--text-meta);
  margin: 8px 0 12px;
}
.slot-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.slot-buttons button {
  font-size: var(--text-meta);
  padding: 6px 8px;
}
.work-categories {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  gap: 6px;
  margin: 20px 0 0;
}
.work-categories button {
  font-size: var(--text-meta);
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--fg-muted);
}
.work-categories button[aria-pressed='true'] {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}
.city-work .work-options {
  margin: 0;
}
.work-choice {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.work-choice strong {
  font-size: var(--text-compact);
  font-weight: 500;
  display: block;
}
.work-choice small {
  display: block;
  margin-top: 5px;
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.work-choice p {
  margin: 9px 0;
  color: var(--fg-muted);
  font-size: var(--text-meta);
}
.work-choice button {
  font-size: var(--text-meta);
  padding: 7px 12px;
  white-space: normal;
  text-align: left;
}
.work-choice button:disabled {
  opacity: 0.45;
}
.city-installed {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.shutdown-notice {
  border-left: 2px solid var(--danger-fg);
  padding: 12px;
  margin-top: 18px;
  font-size: var(--text-compact);
}
.city-workspace .turn-dock,
.research-workspace .turn-dock {
  min-height: 68px;
}
.back-world {
  margin: 24px 24px 10px;
  border: 0;
  background: none;
  font-size: var(--text-compact);
  color: var(--fg-muted);
  padding: 0;
}
.research-workspace .research-view {
  height: calc(100% - 62px);
  padding: 8px 24px 24px;
}
.research-workspace .tech-detail {
  border: 0;
}
.research-workspace .rail-content {
  padding-top: 30px;
}
.research-workspace .tech-detail h2 {
  font-size: var(--text-value);
}
.workspace #board:has(.victory-grid) {
  padding-bottom: 24px;
}
.workspace .victory-grid,
.workspace #board > section:has(.victory-grid) {
  padding: 24px;
}
@media (max-width: 1150px) {
  .game-header {
    gap: 15px;
    padding: 12px 16px;
  }
  .headline-metrics {
    gap: 17px;
  }
  .metric > small {
    grid-column: 1/-1;
    padding: 0;
  }
  .header-controls {
    gap: 8px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .rail-content {
    padding: 20px;
  }
  .header-controls .volume-slider {
    width: 65px;
  }
  .brand b {
    display: none;
  }
  .world-view .earth {
    padding: 80px 12px 40px;
  }
  .city-bottom-stats {
    left: 20px;
    bottom: 20px;
    width: calc(100% - 40px);
  }
}
@media (max-width: 760px) {
  .game-header {
    height: 110px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .brand b {
    display: inline;
  }
  .header-controls {
    margin-left: auto;
  }
  .headline-metrics {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .headline-metrics .metric > b {
    font-size: var(--text-body);
  }
  .metric > span {
    font-size: var(--text-meta);
  }
  .metric > small {
    font-size: var(--text-meta);
  }
  .metric.user-metric > b {
    font-size: var(--text-compact);
  }
  .workspace {
    height: calc(100dvh - 110px);
    grid-template-columns: minmax(0, 1fr) 230px;
  }
  .rail-content {
    padding: 14px;
  }
  .research-widget {
    top: 16px;
    left: 16px;
    min-width: 180px;
    padding: 10px 12px;
  }
  .world-view .earth {
    min-width: 570px;
  }
  .world-view .world-canvas {
    overflow: auto;
  }
  .world-view .map-key {
    display: none;
  }
  .city-bottom-stats {
    left: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    padding: 12px;
  }
  .local-metrics {
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
  }
  .city-population strong {
    font-size: var(--text-meta);
  }
  .city-population span {
    font-size: var(--text-meta);
  }
  .local-metrics b {
    font-size: var(--text-body);
  }
  .city-plot-map {
    min-width: 0;
    padding: 50px 5px 180px;
  }
  .city-heading {
    left: 14px;
  }
  .city-heading h1 {
    font-size: var(--text-value);
  }
  .turn-dock {
    padding: 12px;
  }
  .research-workspace .research-view {
    padding: 8px 12px 12px;
  }
  .notification-zone h2,
  .news-feed h2 {
    font-size: var(--text-compact);
  }
  .work-categories {
    gap: 0;
  }
  .work-categories button {
    padding: 7px 5px;
    font-size: var(--text-meta);
  }
}
/* Information lives on the canvas. Cards are reserved for choosing work. */
.headline-metrics {
  align-items: start;
}
.headline-metrics .metric {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 16px 27px 15px;
  gap: 1px;
  align-content: start;
}
.headline-metrics .metric > span {
  grid-column: 1;
  font-size: var(--text-meta);
  line-height: 16px;
}
.headline-metrics .metric > b {
  font-size: var(--text-value);
  line-height: 27px;
}
.headline-metrics .metric > small {
  grid-column: 1;
  padding: 0;
  align-self: start;
  line-height: 15px;
  font-size: var(--text-meta);
}
.workspace.world-workspace,
.workspace.city-workspace {
  display: block;
  position: relative;
}
.world-workspace #board,
.city-workspace #board {
  width: 100%;
  height: 100%;
}
.world-workspace .world-view .earth {
  padding: 100px 340px 60px 18px;
}
.world-workspace .map-key {
  right: 330px;
}
.world-notifications {
  position: absolute;
  right: 22px;
  top: 30px;
  bottom: 14px;
  width: 290px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  background: none;
  border: 0;
  box-shadow: none;
}
.world-notifications .rail-content {
  padding: 18px 4px 0;
  display: block;
  overflow: auto;
  mask-image: linear-gradient(transparent, #000 22px);
  pointer-events: auto;
}
.world-notifications .turn-dock {
  pointer-events: auto;
  border: 0;
  padding: 22px 0 0;
  background: none;
  min-height: 76px;
}
.world-notifications .news-feed {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.world-notifications .news-card {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  flex-shrink: 0;
}
.news-card.past-news {
  opacity: 0.5;
}
.world-notifications h3 {
  font-size: var(--text-body);
  margin: 5px 0;
  font-weight: 600;
}
.world-notifications p {
  font-size: var(--text-compact);
  line-height: 1.55;
}
.world-notifications .notification-zone {
  padding: 0;
  margin: 24px 0 0;
  border: 0;
}
.ready-prompt {
  margin: 12px 0;
}
.ready-prompt .text-link {
  font-size: var(--text-body);
  font-weight: 600;
  padding: 0;
}
.available-prompt {
  color: var(--fg-muted);
  font-size: var(--text-meta) !important;
}
.available-prompt .text-link {
  display: inline;
  font-size: inherit;
  padding: 0;
  white-space: normal;
  text-align: left;
}
.world-notifications .text-link {
  background: none;
  border: 0;
  color: var(--accent);
  border-radius: 0;
}
.world-notifications .wait-turn:disabled {
  opacity: 0.3;
}
.research-widget {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  min-width: 180px;
}
.research-widget:hover {
  background: none;
  color: var(--accent);
}
.research-widget .work-meter {
  max-width: 180px;
}
.research-widget strong {
  font-size: var(--text-section);
}
.city-bottom-stats {
  background: none;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  padding: 0;
  box-shadow: none;
  max-width: 460px;
  bottom: 35px;
  left: 32px;
}
.city-population strong {
  font-size: var(--text-body);
}
.city-population span,
.city-bottom-stats > p {
  font-size: var(--text-meta);
}
.local-metrics span {
  font-size: var(--text-meta);
}
.local-metrics b {
  font-size: var(--text-value);
}
.city-slots {
  position: absolute;
  right: 32px;
  bottom: 36px;
  width: 300px;
  max-height: 70%;
  overflow: auto;
}
.work-slot {
  display: block;
  width: 100%;
  padding: 20px;
  text-align: left;
  background: color-mix(in srgb, var(--canvas) 90%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--fg);
}
.work-slot > span,
.work-slot > small {
  display: block;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  line-height: 1.5;
}
.work-slot > strong {
  display: block;
  font-size: var(--text-section);
  font-weight: 500;
  margin: 8px 0;
}
.work-slot > small {
  margin: 12px 0;
}
.work-slot .slot-action,
.work-slot.empty strong {
  color: var(--accent);
}
.work-slot:hover {
  border-color: var(--accent);
}
.rush-work {
  margin-top: 12px;
  font-size: var(--text-meta);
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
}
.rush-work:disabled {
  display: none;
}
.slot-unavailable {
  color: var(--fg-muted);
  font-size: var(--text-compact);
}
.city-installed {
  border: 0;
  padding: 12px 0;
}
.city-plot-map {
  padding: 60px 250px 210px 20px;
}
.city-plot.owned {
  --info-dot: var(--accent);
  --info-fg: var(--accent);
  --ok-dot: var(--accent);
  --ok-fg: var(--accent);
}
.city-plot.foreign {
  --info-dot: var(--busy-fg);
  --info-fg: var(--busy-fg);
  --ok-dot: var(--busy-fg);
  --ok-fg: var(--busy-fg);
}
.research-workspace .command-rail {
  background: none;
  border: 0;
  box-shadow: none;
}
.research-workspace .turn-dock {
  border: 0;
  background: none;
}
.research-workspace .tech-detail {
  background: none;
  box-shadow: none;
  border-radius: 0;
}
.tech-hex {
  --hex-fill: var(--surface);
  --hex-line: var(--border-strong);
  --hex-ink: var(--fg-muted);
}
.branch-tree .tech-hex .hex-shape path {
  fill: var(--hex-fill) !important;
  stroke: var(--hex-line) !important;
}
.branch-tree .tech-hex .tech-glyph {
  color: var(--hex-ink) !important;
}
.branch-tree .tech-hex.researching,
.branch-tree .tech-hex.working {
  --hex-fill: var(--accent);
  --hex-line: var(--accent);
  --hex-ink: var(--canvas);
  color: var(--canvas) !important;
}
.branch-tree .tech-hex.available {
  --hex-fill: color-mix(in srgb, var(--accent) 30%, var(--surface));
  --hex-line: color-mix(in srgb, var(--accent) 70%, var(--fg));
  --hex-ink: color-mix(in srgb, var(--accent) 55%, var(--fg));
  color: var(--fg);
}
.branch-tree .tech-hex.locked {
  --hex-fill: var(--canvas);
  --hex-line: var(--border-subtle);
  --hex-ink: var(--fg-subtle);
  color: var(--fg-subtle);
  cursor: default;
  opacity: 0.75;
}
.branch-tree .tech-hex.complete {
  --hex-fill: var(--surface);
  --hex-line: var(--border-strong);
  --hex-ink: var(--fg-muted);
  color: var(--fg-muted);
}
.branch-tree .tech-hex.selected .hex-shape path {
  stroke-width: 3;
}
.branch-tree .tech-hex.researching .hex-caption,
.branch-tree .tech-hex.working .hex-caption {
  color: var(--canvas);
}
.tech-requirement {
  color: var(--fg-muted);
  font-size: var(--text-meta);
}
.map-city[aria-disabled='true'] {
  cursor: default !important;
}
.map-city[aria-disabled='true']:hover {
  filter: none !important;
}
.world-notifications .next-turn {
  border: 0;
  background: var(--accent);
  color: var(--canvas);
}
@media (max-width: 1150px) {
  .world-workspace .world-view .earth {
    padding-right: 300px;
  }
  .world-notifications {
    width: 260px;
    right: 20px;
  }
  .world-workspace .map-key {
    right: 290px;
  }
  .city-slots {
    width: 260px;
    right: 24px;
  }
  .city-bottom-stats {
    max-width: 420px;
  }
  .headline-metrics .metric > b {
    font-size: var(--text-value);
  }
  .city-plot-map {
    padding-right: 180px;
  }
}
@media (max-width: 760px) {
  .headline-metrics .metric {
    grid-template-rows: 13px 21px 12px;
  }
  .headline-metrics .metric > span {
    font-size: var(--text-meta);
    line-height: 13px;
  }
  .headline-metrics .metric > b {
    font-size: var(--text-body);
    line-height: 21px;
  }
  .headline-metrics .metric > small {
    font-size: var(--text-meta);
    line-height: 12px;
  }
  .world-notifications {
    width: 220px;
    right: 12px;
    top: 90px;
  }
  .world-workspace .world-view .earth {
    padding-right: 230px;
    min-width: 740px;
  }
  .city-bottom-stats {
    left: 16px;
    bottom: 20px;
    width: 45%;
  }
  .city-slots {
    right: 16px;
    bottom: 20px;
    width: 44%;
  }
  .city-plot-map {
    padding: 70px 10px 240px;
  }
  .local-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-slot {
    padding: 14px;
  }
  .city-population strong {
    font-size: var(--text-compact);
  }
  .city-population span {
    font-size: var(--text-meta);
  }
  .research-widget {
    left: 16px;
    top: 18px;
    padding: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .work-meter i,
  .map-city circle {
    transition: none;
  }
}
.header-controls {
  position: relative;
}
.game-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 16px);
  z-index: 50;
  width: 205px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 12px 30px #0004;
}
.game-menu[hidden] {
  display: none;
}
.game-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  background: none;
  text-align: left;
  padding: 12px;
  font-size: var(--text-compact);
}
.game-menu button:hover,
.game-menu button:focus-visible {
  background: var(--surface-raised);
  color: var(--accent);
}
.news-card {
  position: relative;
}
.world-notifications .news-card {
  padding-right: 20px;
}
.dismiss-news {
  position: absolute;
  right: -3px;
  top: -5px;
  padding: 4px;
  background: none;
  border: 0;
  color: var(--fg-muted);
  font-size: var(--text-value);
  line-height: 1;
}
.dismiss-news:hover {
  color: var(--fg);
}
.run-hint {
  display: block;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  text-align: center;
  margin-bottom: 2px;
}
.world-notifications .advance-controls {
  gap: 6px;
}
.world-notifications .rail-content {
  display: flex;
  flex-direction: column;
}
.world-notifications .news-feed {
  margin-top: auto;
  flex-shrink: 0;
}
.world-notifications .notification-zone {
  flex-shrink: 0;
}
.city-basis {
  display: block;
  font-size: var(--text-meta);
  color: var(--fg-muted);
  margin-top: 10px;
}
.research-workspace .back-world {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 4;
  margin: 0;
}
.research-workspace .research-view {
  height: 100%;
  padding: 66px 22px 18px;
}
.research-workspace .view-title {
  position: absolute;
  top: 18px;
  left: 112px;
  margin: 0;
}
.research-workspace .view-title h1 {
  font-size: var(--text-value);
}
.research-workspace .tree-scroll {
  overflow: auto;
  padding: 0;
}
.branch-tree .tech-hex.researching .hex-shape path,
.branch-tree .tech-hex.working .hex-shape path {
  fill: var(--accent) !important;
  stroke: var(--accent) !important;
}
.branch-tree .tech-hex.available .hex-shape path {
  fill: color-mix(in srgb, var(--accent) 38%, var(--surface)) !important;
  stroke: color-mix(in srgb, var(--accent) 65%, var(--fg)) !important;
}
.branch-tree .tech-hex.locked .hex-shape path,
.branch-tree .tech-hex.complete .hex-shape path {
  fill: var(--surface) !important;
  stroke: var(--border-strong) !important;
}
.branch-tree .tech-hex.locked .tech-glyph,
.branch-tree .tech-hex.complete .tech-glyph,
.branch-tree .tech-hex.complete .hex-caption {
  color: var(--fg-muted) !important;
}
.metric {
  position: relative;
  cursor: help;
}
.metric-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  width: 340px;
  max-height: 460px;
  overflow: auto;
  padding: 18px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 10px 30px #0005;
  text-align: left;
  cursor: auto;
  white-space: normal;
}
.metric:hover .metric-tooltip,
.metric:focus-within .metric-tooltip {
  display: block;
}
.metric-tooltip h3 {
  margin: 0 0 8px;
  font-size: var(--text-body);
}
.metric-tooltip > p {
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0 0 14px;
}
.metric-tooltip section {
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}
.metric-tooltip h4 {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-compact);
  margin: 0 0 8px;
  font-weight: 600;
  gap: 12px;
}
.metric-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-meta);
  margin: 5px 0;
}
.metric-source span,
.metric-tooltip section p {
  color: var(--fg-muted);
  font-size: var(--text-meta);
  line-height: 1.4;
}
.metric-source b {
  font-weight: 500;
  white-space: nowrap;
}
.metric-tooltip section p {
  margin: 4px 0;
}
.game-header {
  overflow: visible;
  position: relative;
  z-index: 10;
}
.headline-metrics .metric:nth-last-child(-n + 2) .metric-tooltip {
  left: auto;
  right: 0;
}
@media (max-width: 760px) {
  .metric-tooltip {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    top: 110px;
    width: auto;
    max-height: 65vh;
  }
}

#sim-dialog:has(.policy-work-tree) {
  width: min(1160px, 96vw);
  max-height: 94dvh;
  padding: 24px;
}
.policy-work-tree {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 22px;
  height: min(520px, 60vh);
}
.policy-work-tree .research-view {
  padding: 42px 0 0 !important;
  height: 100%;
  min-height: 0;
}
.policy-work-tree .view-title {
  top: 0;
  left: 0;
}
.policy-work-tree .view-title h1 {
  font-size: var(--text-section) !important;
}
.policy-work-tree .tree-scroll {
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.policy-work-tree .tech-detail {
  padding: 12px 0;
  overflow: auto;
  background: none;
  border: 0;
}
.policy-work-tree .tech-detail h2 {
  font-size: var(--text-value);
}
.policy-work-tree .tech-detail p {
  font-size: var(--text-compact);
}
.policy-work-tree .hex-board {
  position: relative;
}
.policy-work-tree .tech-hex.available .hex-shape path {
  fill: var(--accent-soft) !important;
  stroke: var(--accent) !important;
}
.policy-work-tree .tech-hex.working .hex-shape path {
  fill: var(--accent) !important;
  stroke: var(--accent) !important;
}
.policy-work-tree .tech-hex.locked .hex-shape path {
  fill: var(--surface) !important;
  stroke: var(--border-subtle) !important;
}
@media (max-width: 700px) {
  .policy-work-tree {
    grid-template-columns: 1fr;
    height: 65vh;
    grid-template-rows: minmax(0, 1fr) 160px;
  }
  .policy-work-tree .tech-detail {
    padding: 0;
  }
  .policy-work-tree .tech-detail h2 {
    margin: 0;
  }
}
#sim-dialog.wide:has(.policy-work-tree) {
  max-width: min(1160px, 96vw);
  width: min(1160px, 96vw);
}

/* Notifications launch from the Run control into the same vertical stream. */
.world-notifications {
  top: 14px;
  bottom: 16px;
  overflow: hidden;
}
.world-notifications .rail-content {
  display: block;
  position: relative;
  padding: 0 0 110px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.world-notifications .news-feed {
  margin-top: 0;
}
.world-notifications .notification-zone {
  display: block;
}
.world-notifications .turn-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 82px;
  z-index: 3;
  padding: 18px 0 0;
  background: linear-gradient(transparent, var(--canvas) 22%);
}
.world-notifications .advance-controls {
  width: 100%;
}
.world-notifications .next-turn {
  width: 100%;
  height: 50px;
}
.world-notifications [data-news-key] {
  transform-origin: center bottom;
}
.news-card.past-news {
  opacity: 0.68;
}
.news-card h3 {
  font-size: var(--text-body);
}
.news-card p {
  font-size: var(--text-compact);
  line-height: 1.45;
}
.notification-zone .ready-prompt {
  margin: 22px 0;
}
.ready-prompt .text-link {
  font-size: var(--text-body);
}
.world-notifications .news-card {
  padding-bottom: 20px;
  margin-bottom: 12px;
}
/* Work is physically on a city grid point, alongside completed buildings. */
.city-plot-map {
  padding: 115px 24px 150px !important;
  width: 100%;
  height: 100%;
  min-width: 0;
}
.grid-work-slot {
  overflow: visible;
}
.grid-work-slot .city-slots {
  position: static !important;
  width: 100% !important;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
}
.grid-work-slot .work-slot {
  width: 100%;
  height: auto;
  min-height: 128px;
  padding: 14px;
  background: var(--canvas);
  border: 1px dashed var(--accent);
  border-radius: 5px;
  text-align: center;
}
.grid-work-slot .work-slot > span {
  font-size: var(--text-body);
}
.grid-work-slot .work-slot > strong {
  font-size: var(--text-value);
  line-height: 1.2;
  margin: 8px 0;
}
.grid-work-slot .work-slot > small {
  font-size: var(--text-body);
}
.grid-work-slot .work-meter {
  height: 4px;
  margin: 10px 0 6px;
}
.city-plot.offline {
  --info-dot: var(--fg-subtle);
  --ok-dot: var(--fg-subtle);
  --ok-fg: var(--fg-subtle);
  --accent: var(--fg-subtle);
  --structure-color: var(--fg-subtle);
}
.city-plot {
  cursor: default;
}
.city-grid-dots {
  opacity: 0.8;
}
.city-plot.offline .vector-structure {
  filter: grayscale(1);
}
.map-power.uncharged {
  opacity: 0.65;
}
.map-city.unoccupied {
  opacity: 0.5;
}
.map-city.unoccupied .city-value {
  font-size: var(--text-meta);
}
/* Compact accounting retains source amounts rather than full prose paragraphs. */
.metric-tooltip {
  width: 270px;
  max-height: 300px;
  padding: 12px;
  font-size: var(--text-meta);
  line-height: 1.35;
}
.metric-tooltip h3 {
  font-size: var(--text-compact);
  margin: 0 0 4px;
}
.metric-tooltip > p {
  font-size: var(--text-meta);
  margin: 0 0 8px;
}
.metric-tooltip section {
  padding: 6px 0 !important;
  margin: 0 !important;
}
.metric-tooltip h4 {
  font-size: var(--text-meta);
  margin: 0 0 2px !important;
}
.metric-tooltip .metric-source {
  font-size: var(--text-meta);
  line-height: 1.35;
  margin: 0 !important;
  padding: 0 !important;
  gap: 8px;
}
.metric-tooltip section p {
  display: inline;
  font-size: var(--text-meta);
  margin: 0 5px 0 0;
}
.metric-tooltip .metric-source b {
  font-size: var(--text-meta);
}
.research-estimate {
  display: grid;
  gap: 5px;
  margin: 16px 0;
}
.research-estimate > strong {
  font-size: var(--text-value);
  color: var(--accent);
}
.research-estimate > span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.research-estimate > small {
  font-size: var(--text-meta);
  line-height: 1.4;
  color: var(--fg-subtle);
}
.branch-tree .tech-hex:disabled {
  cursor: default;
  pointer-events: auto;
}
.branch-tree .tech-hex.locked:hover .hex-shape path {
  stroke: var(--border-subtle) !important;
  fill: var(--canvas) !important;
}

/* A single teleprompter stream: uniform white text, no informational cards. */
.world-notifications {
  top: 30px;
  bottom: 16px;
}
.world-notifications .rail-content {
  padding: 4px 0 100px;
  display: block;
  overflow-y: auto;
  mask-image: none;
  scrollbar-width: none;
}
.notification-stream {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 0 8px;
}
.stream-notification {
  position: relative;
  flex: none;
  padding: 0 22px 0 0;
  margin: 0;
  transform-origin: center top;
  color: var(--fg);
}
.world-notifications .notification-text {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--fg);
  font-family: inherit;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  text-transform: none;
  text-decoration: none;
}
.world-notifications button.notification-text {
  width: 100%;
  cursor: pointer;
}
.world-notifications button.notification-text:hover,
.world-notifications button.notification-text:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  color: var(--fg);
}
.world-notifications button.notification-text:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 6px;
}
.world-notifications .notification-dismiss {
  position: absolute;
  right: 0;
  top: 0;
  border: 0;
  background: none;
  padding: 0;
  width: 18px;
  height: 23px;
  color: var(--fg);
  font-size: var(--text-section);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: none;
}
.stream-notification:hover .notification-dismiss,
.stream-notification:focus-within .notification-dismiss {
  opacity: 1;
}
.world-notifications .turn-dock {
  background: var(--canvas);
  box-shadow: 0 -14px 18px var(--canvas);
}
@media (hover: none) {
  .world-notifications .notification-dismiss {
    opacity: 1;
  }
}
@media (max-width: 760px) {
  .world-notifications {
    top: 80px;
  }
  .world-notifications .notification-text {
    font-size: var(--text-compact);
  }
  .notification-stream {
    gap: 20px;
  }
}

.map-key > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.world-notifications button.notification-text {
  display: block;
}
.notification-arrow {
  display: inline;
  color: inherit;
}
/* Work unfolds beside its grid slot; the city and local accounting stay visible. */
.world-tree-controls {
  position: absolute;
  left: 24px;
  top: 26px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}
.world-tree-controls .research-widget {
  position: static;
  min-width: 180px;
  padding: 0;
}
.city-grid-lines {
  display: none;
}
.city-plot-map {
  position: relative;
  width: 58% !important;
  padding: 115px 24px 230px !important;
}
.city-backdrop-grid {
  position: absolute;
  inset: 0 41% 0 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    linear-gradient(to right, var(--border-strong) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-strong) 1px, transparent 1px);
  background-size: 140px 105px;
}
.work-expansion {
  position: absolute;
  right: 28px;
  top: 85px;
  bottom: 28px;
  width: 34%;
  max-width: 470px;
  display: flex;
  flex-direction: column;
  z-index: 5;
  padding: 18px 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
}
.work-expansion header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 14px;
}
.work-expansion header span {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.work-expansion h2 {
  font-size: var(--text-value);
  margin: 5px 0 0;
  font-weight: 500;
}
.work-expansion header button {
  border: 0;
  background: none;
  padding: 0 4px;
  color: var(--fg-muted);
  font-size: var(--text-value);
}
.work-current-effect {
  display: block;
  color: var(--fg);
  margin: 5px 0;
}
.work-current small {
  font-size: inherit;
}
.work-current {
  font-size: var(--text-meta);
  line-height: 1.5;
  margin: 0 0 12px;
  color: var(--fg-muted);
}
.available-work {
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.available-work-choice {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 8px;
  text-align: left;
  white-space: normal;
  background: none;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--fg);
  flex-shrink: 0;
}
.available-work-choice:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.work-choice-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.work-choice-heading strong {
  font-size: var(--text-compact);
  font-weight: 600;
}
.work-choice-heading small {
  font-size: var(--text-meta);
  color: var(--fg-muted);
}
.work-choice-effect {
  font-size: var(--text-meta);
  line-height: 1.45;
  color: var(--fg-muted);
}
.work-choice-cost {
  font-size: var(--text-meta);
  color: var(--fg);
}
.work-choice-cost > span {
  float: right;
  color: var(--accent);
}
@media (max-width: 760px) {
  .world-tree-controls {
    left: 16px;
    gap: 18px;
  }
  .world-tree-controls .research-widget {
    min-width: 140px;
  }
  .work-expansion {
    right: 12px;
    width: 43%;
    padding: 12px;
    top: 100px;
    bottom: 16px;
  }
  .city-plot-map {
    width: 52% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .work-choice-heading {
    flex-wrap: wrap;
    gap: 3px;
  }
  .work-expansion h2 {
    font-size: var(--text-section);
  }
  .city-bottom-stats {
    width: 47%;
  }
}

.work-expansion {
  bottom: auto;
  max-height: calc(100% - 113px);
}
.work-expansion header {
  position: static;
  flex: none;
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  min-height: 0;
}
.work-connector {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}
.work-connector path {
  fill: none;
  stroke: var(--border-strong);
  stroke-opacity: 0.8;
  stroke-width: 1;
}
.city-grid-lines {
  opacity: 1;
  stroke: var(--border-strong);
  stroke-width: 1;
}
.branch-tree .tech-hex.complete {
  --hex-fill: var(--accent);
  --hex-line: var(--accent);
  --hex-ink: var(--canvas);
  color: var(--canvas) !important;
  opacity: 1;
  cursor: default;
}
.branch-tree .tech-hex.complete .hex-shape path {
  fill: var(--accent) !important;
  stroke: var(--accent) !important;
}
.branch-tree .tech-hex.complete .tech-glyph {
  color: var(--canvas) !important;
}
.tech-complete-check {
  position: absolute;
  left: 24px;
  top: 8px;
  font-size: var(--text-body);
  line-height: 16px;
  color: var(--canvas);
  z-index: 2;
}
.branch-tree .tech-hex:disabled {
  opacity: 1;
}
.branch-tree .tech-hex.locked {
  opacity: 0.65;
}
.locked-work-heading {
  font-size: var(--text-meta);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 18px 8px 8px;
}
.locked-work-choice,
.locked-work-choice:disabled {
  display: flex;
  gap: 14px;
  padding: 16px 8px;
  align-items: flex-start;
  flex-shrink: 0;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: none;
  color: var(--fg-muted);
  opacity: 1;
  text-align: left;
  white-space: normal;
  cursor: not-allowed;
}
.locked-work-choice:hover {
  background: none;
}
.locked-work-content {
  display: grid;
  gap: 7px;
}
.locked-work-choice strong {
  display: block;
  font-size: var(--text-compact);
  font-weight: 500;
}
.locked-work-choice small {
  display: block;
  font-size: var(--text-meta);
  line-height: 1.45;
  color: var(--fg-muted);
}
.work-lock {
  flex: none;
  padding-top: 1px;
  color: var(--fg-muted);
}
.work-lock svg {
  display: block;
  width: 22px;
  height: 22px;
}
.electricity-icon {
  color: var(--warn-fg);
  vertical-align: middle;
  flex: none;
}
.electricity-label {
  display: flex;
  align-items: center;
  gap: 4px;
}
@media (max-width: 760px) {
  .city-backdrop-grid {
    right: 49%;
  }
}

/* Accounting tooltip layout; interface.css owns its text hierarchy. */
.metric-tooltip {
  width: 290px;
  max-height: 340px;
  font-size: var(--text-meta);
  line-height: 1.45;
}
.metric-tooltip h3 {
  margin-bottom: 8px;
}
.metric-tooltip section {
  padding: 7px 0 !important;
}
.metric-tooltip h4 {
  font-weight: 500;
}
.metric-tooltip .metric-source b {
  font-weight: 500;
}

.available-work-choice {
  position: relative;
  padding-left: 76px;
  min-height: 104px;
}
.work-art {
  position: absolute;
  left: 0;
  top: 10px;
  width: 66px;
  height: 72px;
  --structure-color: var(--player);
}

/* Decision effects belong beside the choice that causes them. */
.response-options button {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 14px 16px;
  white-space: normal;
}
.response-options button strong {
  font-size: var(--text-compact);
  font-weight: 600;
}
.response-options button small {
  font-size: var(--text-meta);
  font-weight: 400;
  line-height: 1.45;
  color: var(--fg-muted);
}

.work-choice-warning {
  font-size: var(--text-meta);
  color: var(--electricity);
}
.locked-work-choice {
  padding-top: 10px;
  padding-bottom: 10px;
}
.locked-work-content {
  gap: 4px;
}

.victory-grid.committed {
  display: block;
  max-width: 560px;
}
.victory-card.active {
  border: 0;
  background: none;
  padding: 0;
}
.terminal-cost {
  display: block;
  margin: 6px 0 16px;
  color: var(--fg-muted);
}
.ending-view .victory-card.active select {
  max-width: 360px;
}
.ending-view .victory-card.active > button:not(.text-link) {
  display: block;
  width: 100%;
}

.ending-workspace {
  grid-template-columns: minmax(0, 1fr);
}
.ending-workspace .ending-view {
  max-width: 1100px;
  margin: 40px auto;
}

.outcome-summary {
  position: fixed;
  right: 30px;
  top: 105px;
  background: none;
  border: 0;
  color: var(--fg);
  font-size: var(--text-compact);
  z-index: 8;
}
.ending-banner [data-dismiss-outcome] {
  display: block;
  margin-top: 20px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--fg-muted);
}

.confidence-face {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  vertical-align: middle;
  margin-right: 7px;
}
.confidence-face.happy {
  color: var(--ok-fg);
}
.confidence-face.neutral {
  color: var(--warn-fg);
}
.confidence-face.alarmed {
  color: var(--accent);
}
.grid-controls {
  border: 1px solid var(--border-subtle);
  padding: 12px;
  margin-top: 16px;
}
.grid-controls label {
  display: block;
  margin: 10px 0;
}
.grid-controls select,
.grid-controls input {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  max-width: 100%;
}
.compute-breakdown {
  max-width: 420px;
  font-size: var(--text-meta);
}
.headline-metrics .metric-value {
  white-space: nowrap;
}

/* Approved art shares ownership and category colors on every surface. */
.city-plot[data-plot-kind^='policy:'] {
  --structure-color: var(--policy-color);
}
.approved-glyph {
  fill: none;
}
.victory-card > .work-art {
  width: 100%;
  height: 170px;
  color: var(--accent);
  --structure-color: var(--accent);
}

.work-slot:disabled {
  cursor: default;
  opacity: 0.55;
}
.work-slot:disabled:hover {
  border-color: var(--border-strong);
}

.game-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-header .brand img {
  flex: none;
}

.film-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
}
.film-wordmark img {
  flex: none;
}

.inline-event-choices {
  margin-top: 10px;
}
.world-notifications .event-choice-description {
  font-size: var(--text-compact);
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 12px;
}
.inline-event-choices .response-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.inline-event-choices .response-options button {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--fg);
  padding: 12px;
  text-align: left;
}
.inline-event-choices .response-options button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.inline-event-choices .response-options button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.inline-event-choices .response-options button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.inline-event-choices .response-options strong {
  color: var(--accent);
}
