:root {
  --ink: #101513;
  --ink-soft: #1a211e;
  --paper: #e9e5d8;
  --paper-dark: #d6d0bf;
  --mint: #a8f6b1;
  --mint-dark: #4ebc78;
  --coral: #ff6c55;
  --blue: #89a9ff;
  --yellow: #f2d45c;
  --muted: #8e978f;
  --line: rgba(233, 229, 216, 0.2);
  --display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
}

.noscript-message {
  position: fixed;
  inset: auto 18px 18px;
  z-index: 100;
  padding: 16px;
  border: 1px solid var(--coral);
  background: var(--ink);
  color: var(--coral);
  font-size: 11px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 82% 12%, rgba(137, 169, 255, 0.1), transparent 29rem),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--ink);
  background-size: auto, 38px 38px, 38px 38px, auto;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.2;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.025) 2px,
    rgba(255, 255, 255, 0.025) 3px
  );
  mix-blend-mode: screen;
}

.masthead {
  height: 76px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
  background: rgba(16, 21, 19, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: none;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: var(--mint);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-stretch: condensed;
  font-size: 24px;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mint);
  font-size: 9px;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 0 rgba(255, 108, 85, 0.6);
  animation: pulse 2.1s infinite;
}

.masthead nav {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.masthead nav button,
.text-action,
.reset-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper-dark);
  padding: 9px 12px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.08em;
  transition: 150ms ease;
}

.masthead nav button:hover,
.text-action:hover,
.reset-button:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.intro-screen,
.ending-screen {
  min-height: calc(100vh - 118px);
  position: relative;
}

.intro-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  padding: clamp(55px, 8vw, 110px) clamp(28px, 6vw, 92px) 160px;
}

.intro-copy {
  max-width: 900px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--mint);
  margin: 0 0 17px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-copy h1,
.ending-main h1 {
  margin: 0;
  max-width: 840px;
  font-family: var(--display);
  font-size: clamp(62px, 8.2vw, 132px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.intro-copy h1 em {
  display: block;
  color: var(--coral);
  font-style: normal;
}

.lede {
  max-width: 720px;
  margin: 34px 0 0;
  color: var(--paper-dark);
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.35;
}

.intro-actions,
.ending-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
}

.primary-action {
  min-height: 53px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 0 20px;
  border: 1px solid var(--mint);
  background: var(--mint);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 7px 7px 0 rgba(168, 246, 177, 0.12);
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.primary-action:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 rgba(168, 246, 177, 0.18);
}

.primary-action span {
  font-size: 20px;
}

.runtime {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.11em;
}

.model-warning {
  max-width: 650px;
  margin-top: 30px;
  padding-left: 13px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.appointment-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 470px;
  justify-self: end;
  padding: 28px;
  border: 1px solid rgba(16, 21, 19, 0.45);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 16px 18px 0 var(--blue);
  transform: rotate(1.2deg);
}

.appointment-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(16, 21, 19, 0.25);
  pointer-events: none;
}

.appointment-stamp {
  width: max-content;
  margin: -8px 0 25px auto;
  border: 3px double var(--coral);
  color: var(--coral);
  padding: 8px 10px;
  font-size: 9px;
  font-weight: 900;
  transform: rotate(3deg);
}

.appointment-card > p {
  margin: 0 0 10px;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.appointment-card h2 {
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 0.98;
}

.appointment-card dl {
  margin: 0;
}

.appointment-card dl div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid rgba(16, 21, 19, 0.2);
}

.appointment-card dt {
  font-size: 8px;
  color: #56605a;
}

.appointment-card dd {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
}

.signature-line {
  margin-top: 28px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border-bottom: 1px solid var(--ink);
}

.signature-line span {
  color: var(--coral);
  font-family: cursive;
  font-size: 40px;
  line-height: 0.8;
}

.signature-line i {
  padding-bottom: 3px;
  font-style: normal;
  font-size: 7px;
}

.case-files {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  padding-top: 17px;
  border-top: 4px solid var(--ink);
}

.case-files strong {
  font-family: var(--display);
  font-size: 36px;
}

.case-files span {
  max-width: 160px;
  font-size: 7px;
  line-height: 1.4;
}

.city-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 125px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  opacity: 0.22;
  border-bottom: 8px solid var(--paper);
  overflow: hidden;
}

.city-strip > span {
  flex: 1;
  min-width: 62px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-auto-rows: 4px;
  justify-content: space-around;
  align-content: space-around;
  padding: 9px;
  background: var(--paper);
}

.city-strip i {
  background: var(--ink);
}

.game-screen {
  max-width: 1700px;
  margin: 0 auto;
  padding: 24px 26px 70px;
}

.run-bar {
  min-height: 66px;
  display: grid;
  grid-template-columns: 210px 1fr 210px;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  background: rgba(26, 33, 30, 0.8);
}

.run-bar > div:first-child {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 18px;
  border-right: 1px solid var(--line);
}

.run-bar span,
.run-bar small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.run-bar strong {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.turn-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.turn-track span {
  height: 6px;
  background: #303834;
}

.turn-track span.current {
  background: var(--coral);
  box-shadow: 0 0 13px rgba(255, 108, 85, 0.45);
}

.turn-track span.complete {
  background: var(--mint-dark);
}

.capital-readout {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr 1fr;
  align-items: end;
  padding: 9px 16px;
  border-left: 1px solid var(--line);
}

.capital-readout strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
}

.capital-readout small {
  align-self: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.metrics-panel,
.brief-panel,
.crisis-card,
.final-audit {
  border: 1px solid var(--line);
  background: rgba(22, 28, 25, 0.94);
}

.panel-heading {
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  color: var(--paper-dark);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.panel-heading small {
  color: var(--coral);
  font-size: 7px;
}

.metrics-panel {
  position: sticky;
  top: 16px;
}

.metric {
  padding: 14px 13px 10px;
  border-bottom: 1px solid rgba(233, 229, 216, 0.08);
}

.metric-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--paper-dark);
  font-size: 8px;
  text-transform: uppercase;
}

.metric-label strong {
  color: var(--paper);
  font-size: 11px;
}

.metric-track {
  height: 5px;
  margin-top: 8px;
  background: #303733;
  overflow: hidden;
}

.metric-fill {
  display: block;
  height: 100%;
  transition: width 550ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

.metric-fill.stable { background: var(--mint); }
.metric-fill.strained { background: var(--yellow); }
.metric-fill.critical { background: var(--coral); }
.metric-fill.failing { background: #ff315e; animation: flash 1s steps(2) infinite; }

.metric > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 7px;
  text-transform: uppercase;
}

.care-index {
  margin: 15px 13px;
  padding: 13px;
  border: 1px dashed var(--blue);
  color: var(--blue);
}

.care-index span,
.care-index small {
  display: block;
  font-size: 7px;
  line-height: 1.5;
}

.care-index strong {
  display: block;
  margin: 5px 0;
  font-family: var(--display);
  font-size: 42px;
  line-height: 1;
}

.crisis-card {
  min-height: 680px;
  padding: clamp(24px, 4vw, 55px);
  position: relative;
  overflow: hidden;
}

.crisis-card::after {
  content: attr(data-docket);
  position: absolute;
  right: -10px;
  bottom: -35px;
  color: rgba(233, 229, 216, 0.025);
  font-family: var(--display);
  font-size: 180px;
  pointer-events: none;
}

.crisis-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--mint);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.crisis-card > h1,
.report-card h1 {
  max-width: 930px;
  margin: 25px 0 18px;
  font-family: var(--display);
  font-size: clamp(44px, 5vw, 82px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.dispatch,
.consequence {
  max-width: 890px;
  margin: 0;
  color: var(--paper-dark);
  font-family: var(--display);
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.42;
}

.crisis-card blockquote {
  max-width: 850px;
  margin: 26px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--coral);
  background: rgba(255, 108, 85, 0.07);
  color: var(--paper);
  font-size: 11px;
  line-height: 1.55;
}

.crisis-card blockquote span {
  display: block;
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.fact-drawer {
  max-width: 850px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact-drawer summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  color: var(--blue);
  cursor: pointer;
  font-size: 9px;
  text-transform: uppercase;
  list-style: none;
}

.fact-drawer summary::-webkit-details-marker { display: none; }
.fact-drawer[open] summary span { transform: rotate(45deg); }
.fact-drawer p { margin: 6px 0 9px; color: var(--paper-dark); font-size: 10px; line-height: 1.55; }
.fact-drawer a { display: inline-block; margin-bottom: 14px; color: var(--mint); font-size: 8px; text-decoration: none; }
.fact-drawer a:hover { text-decoration: underline; }

.decision-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 12px;
  color: var(--paper);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.decision-heading small { color: var(--muted); font-size: 8px; letter-spacing: 0; }

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.choice {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  background: #171d1a;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: 140ms ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--mint);
  background: #202a25;
  transform: translateY(-3px);
}

.choice:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.choice-cost {
  align-self: flex-end;
  color: var(--yellow);
  font-size: 8px;
}

.choice strong {
  margin-top: 9px;
  color: var(--paper);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.choice p {
  margin: 10px 0 18px;
  color: var(--paper-dark);
  font-size: 9px;
  line-height: 1.45;
}

.choice small {
  margin-top: auto;
  color: var(--blue);
  font-size: 7px;
  line-height: 1.5;
}

.choice i {
  display: block;
  margin-top: 8px;
  color: var(--coral);
  font-size: 7px;
  font-style: normal;
}

.brief-panel {
  position: sticky;
  top: 16px;
}

.wire-item,
.assumption-mini,
.decision-log {
  padding: 15px 13px;
  border-bottom: 1px solid rgba(233, 229, 216, 0.08);
  color: var(--paper-dark);
  font-size: 8px;
  line-height: 1.55;
}

.wire-item span,
.assumption-mini > span,
.decision-log > span,
.audit-log > span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.wire-item.alert span { color: var(--coral); }

.assumption-mini dl { margin: 0; }
.assumption-mini dl div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
.assumption-mini dt { color: var(--muted); }
.assumption-mini dd { margin: 0; color: var(--paper); }
.assumption-mini button { padding: 9px 0 0; border: 0; background: none; color: var(--mint); cursor: pointer; font-size: 8px; }

.decision-log > div {
  display: grid;
  grid-template-columns: 45px 1fr;
  padding: 7px 0;
  border-top: 1px solid rgba(233, 229, 216, 0.07);
}

.decision-log small { color: var(--muted); font-size: 7px; }
.decision-log strong { color: var(--paper-dark); font-size: 7px; font-weight: 500; }

.report-card {
  display: flex;
  min-height: 570px;
  flex-direction: column;
  justify-content: center;
  animation: reportIn 360ms ease-out;
}

.report-card .consequence { max-width: 800px; }

.delta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 25px;
}

.delta {
  padding: 8px 10px;
  border: 1px solid currentColor;
  font-size: 8px;
  text-transform: uppercase;
}

.delta.positive { color: var(--mint); }
.delta.negative { color: var(--coral); }

.result-quote {
  margin-top: 35px !important;
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 27px) !important;
}

.result-quote cite {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  text-transform: uppercase;
}

.report-caveat,
.method-note {
  max-width: 850px;
  padding: 13px;
  border: 1px dashed var(--yellow);
  color: var(--yellow);
  font-size: 8px;
  line-height: 1.55;
}

.continue {
  align-self: flex-start;
  margin-top: 28px;
}

.ending-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: clamp(35px, 7vw, 100px);
  padding: clamp(60px, 8vw, 110px) clamp(28px, 7vw, 110px);
  align-items: center;
}

.ending-main h1 { color: var(--coral); }

.ending-main h2 {
  max-width: 800px;
  margin: 28px 0 18px;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
  text-transform: uppercase;
}

.ending-main > p:not(.eyebrow):not(.discovered-note) {
  max-width: 770px;
  color: var(--paper-dark);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.45;
}

.ending-main blockquote {
  max-width: 720px;
  margin: 28px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--mint);
  color: var(--mint);
  font-size: 11px;
  line-height: 1.5;
}

.discovered-note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.final-audit { max-width: 430px; width: 100%; justify-self: end; }

.audit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr 1fr;
  gap: 2px 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(233, 229, 216, 0.08);
}

.audit-row > span { color: var(--paper-dark); font-size: 8px; text-transform: uppercase; }
.audit-row strong { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--yellow); font-size: 23px; }
.audit-row small { color: var(--muted); font-size: 7px; text-transform: uppercase; }

.audit-log { padding: 16px 14px; }
.audit-log p { display: grid; grid-template-columns: 33px 1fr; gap: 8px; margin: 0; padding: 7px 0; border-top: 1px solid rgba(233, 229, 216, 0.06); color: var(--paper-dark); font-size: 8px; }
.audit-log p small { color: var(--muted); }

footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 7, 0.82);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(800px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
  position: relative;
  padding: clamp(27px, 5vw, 55px);
  border: 1px solid var(--mint);
  background: #171e1a;
  box-shadow: 15px 15px 0 rgba(168, 246, 177, 0.12);
  animation: reportIn 200ms ease-out;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: none;
  color: var(--paper-dark);
  cursor: pointer;
  font-size: 8px;
}

.modal h2 {
  max-width: 650px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 6vw, 66px);
  line-height: 0.9;
  text-transform: uppercase;
}

.modal-intro {
  max-width: 670px;
  margin: 20px 0 28px;
  color: var(--paper-dark);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.45;
}

.slider-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(160px, 0.8fr) 48px;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.slider-row strong,
.slider-row small { display: block; }
.slider-row strong { font-family: var(--display); font-size: 17px; text-transform: uppercase; }
.slider-row small { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.slider-row output { color: var(--yellow); font-size: 11px; text-align: right; }
.slider-row input { accent-color: var(--mint); width: 100%; cursor: pointer; }
.reset-button { margin: 12px 0 23px; }

.source-list { border-top: 1px solid var(--line); }
.source-list a { display: grid; grid-template-columns: 35px 1fr 20px; gap: 6px 12px; padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--paper); text-decoration: none; }
.source-list a:hover strong { color: var(--mint); }
.source-list a > span { grid-row: 1 / 3; color: var(--muted); font-size: 8px; }
.source-list strong { font-family: var(--display); font-size: 15px; text-transform: uppercase; transition: color 120ms ease; }
.source-list small { grid-column: 2; color: var(--muted); font-size: 8px; line-height: 1.45; }
.source-list i { grid-row: 1 / 3; grid-column: 3; color: var(--mint); font-style: normal; }

.source-citation {
  display: inline-block;
  margin-left: 2px;
  color: #000080;
  font-family: Arial, sans-serif;
  font-size: 0.66em;
  font-weight: 800;
  line-height: 0;
  text-shadow: none;
  text-transform: none;
  vertical-align: super;
  white-space: nowrap;
}

.source-correlate {
  display: block;
  margin-top: 5px;
  color: #000080;
  font-size: inherit;
  line-height: inherit;
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 28px 0;
}

.briefing-grid > div { min-height: 145px; padding: 18px; border: 1px solid var(--line); }
.briefing-grid strong { color: var(--coral); font-family: var(--display); font-size: 40px; }
.briefing-grid p { color: var(--paper-dark); font-size: 9px; line-height: 1.55; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 108, 85, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(255, 108, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 108, 85, 0); }
}

@keyframes flash { 50% { opacity: 0.35; } }

@keyframes reportIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .masthead { grid-template-columns: 1fr auto; }
  .header-status { display: none; }
  .intro-screen { grid-template-columns: 1fr; align-items: start; }
  .appointment-card { justify-self: start; max-width: 600px; }
  .dashboard-grid { grid-template-columns: 210px minmax(0, 1fr); }
  .brief-panel { grid-column: 1 / 3; position: static; display: grid; grid-template-columns: repeat(3, 1fr); }
  .brief-panel .panel-heading { grid-column: 1 / -1; }
  .decision-log { grid-column: 1 / -1; }
  .ending-screen { grid-template-columns: 1fr; }
  .final-audit { justify-self: start; max-width: 700px; }
}

@media (max-width: 760px) {
  .masthead { height: auto; min-height: 72px; grid-template-columns: 1fr; padding: 13px 18px; gap: 11px; }
  .masthead nav { justify-content: flex-start; flex-wrap: wrap; }
  .masthead nav button { padding: 7px 9px; }
  .intro-screen { min-height: auto; padding: 52px 19px 145px; gap: 50px; }
  .intro-copy h1, .ending-main h1 { font-size: clamp(54px, 17vw, 82px); }
  .appointment-card { padding: 24px 21px; box-shadow: 9px 10px 0 var(--blue); transform: none; }
  .appointment-card dl div { grid-template-columns: 88px 1fr; }
  .game-screen { padding: 13px 12px 55px; }
  .run-bar { grid-template-columns: 1fr 105px; gap: 0; }
  .run-bar > div:first-child { border-right: 0; }
  .turn-track { grid-row: 2; grid-column: 1 / 3; padding: 10px 14px; border-top: 1px solid var(--line); }
  .capital-readout { grid-column: 2; grid-row: 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metrics-panel { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .metrics-panel .panel-heading, .care-index { grid-column: 1 / -1; }
  .metric { padding: 11px 12px; }
  .crisis-card { min-height: 0; padding: 27px 18px; }
  .crisis-card > h1, .report-card h1 { font-size: clamp(41px, 13vw, 62px); }
  .choices { grid-template-columns: 1fr; }
  .choice { min-height: 150px; }
  .brief-panel { grid-column: 1; grid-template-columns: 1fr; }
  .brief-panel .panel-heading, .decision-log { grid-column: 1; }
  .ending-screen { padding: 52px 19px; }
  footer { align-items: flex-start; flex-direction: column; padding: 13px 18px; }
  .modal-backdrop { padding: 9px; }
  .modal { max-height: calc(100vh - 18px); padding: 49px 20px 25px; }
  .slider-row { grid-template-columns: 1fr 48px; }
  .slider-row input { grid-row: 2; grid-column: 1 / 3; }
  .briefing-grid { grid-template-columns: 1fr; }
}

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

/* Compact play surface */
.masthead {
  height: 60px;
  grid-template-columns: 1fr auto;
  padding: 0 max(18px, calc((100vw - 1040px) / 2));
}

.brand-mark {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.brand strong { font-size: 20px; }
.brand small { margin-top: 3px; }
.masthead nav button { padding: 7px 10px; }

.game-screen {
  width: min(100%, 1040px);
  padding: 16px 18px 48px;
}

.run-bar {
  min-height: 56px;
  grid-template-columns: 215px 1fr 210px;
  gap: 18px;
}

.capital-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
}

.capital-readout {
  flex-wrap: wrap;
}

.capital-readout strong { font-size: 24px; }
.capital-readout small { width: 100%; }

.compact-vitals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
  border: 1px solid var(--line);
  background: rgba(22, 28, 25, 0.78);
}

.compact-vitals span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.compact-vitals span:last-child { border-right: 0; }
.compact-vitals strong { color: var(--paper); font-size: 13px; }

.panic-button {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 105px 1fr auto;
  align-items: center;
  gap: 15px;
  margin-top: 8px;
  padding: 8px 14px;
  border: 2px solid #ff6c55;
  background: repeating-linear-gradient(135deg, #ff6c55 0 12px, #e84f3d 12px 24px);
  color: #101513;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 0 3px rgba(255, 108, 85, 0.12);
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.panic-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(255, 108, 85, 0.24);
}

.panic-button span,
.panic-button small {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.panic-button strong {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.panic-button small { text-align: right; }

.dashboard-grid {
  display: block;
  margin-top: 8px;
}

.crisis-card {
  min-height: 0;
  padding: clamp(24px, 4vw, 42px);
}

.crisis-card > h1,
.report-card h1 {
  max-width: 820px;
  margin: 18px 0 12px;
  font-size: clamp(38px, 5vw, 62px);
}

.dispatch,
.consequence {
  max-width: 780px;
  font-size: clamp(16px, 1.8vw, 20px);
}

.crisis-card blockquote {
  margin: 18px 0;
  padding: 12px 15px;
}

.decision-heading { margin: 22px 0 10px; }

.choice {
  min-height: 150px;
  padding: 14px;
}

.choice strong { font-size: 19px; }
.choice p { margin: 8px 0 12px; }

.report-card {
  min-height: 440px;
  justify-content: center;
}

.payroll-cleared {
  max-width: 820px;
  margin-top: 20px;
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  background: rgba(250, 205, 87, 0.06);
  color: var(--yellow);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.choice-cost {
  white-space: nowrap;
  font-size: 7px;
}

.result-quote { margin-top: 24px !important; }
.continue { margin-top: 20px; }

.ending-screen {
  display: block;
  width: min(100%, 920px);
  min-height: calc(100vh - 94px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 78px) 18px;
}

.ending-main h1 { font-size: clamp(54px, 9vw, 92px); }
.ending-main h2 { margin: 20px 0 14px; }
.ending-main blockquote { margin: 20px 0; }

.final-vitals {
  grid-template-columns: repeat(6, 1fr);
  margin: 24px 0 0;
}

.final-vitals span {
  flex-direction: column;
  align-items: flex-start;
}

.compact-audit {
  max-width: 680px;
  margin-top: 24px;
  border: 1px solid var(--line);
  padding: 13px 15px;
}

.compact-audit summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal { width: min(620px, 100%); padding: 46px 28px 28px; }
.modal h2 { font-size: clamp(34px, 6vw, 52px); }
.briefing-grid { grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.briefing-grid > div { min-height: 118px; padding: 14px; }
.briefing-grid strong { font-size: 32px; }
.briefing-grid p { margin-bottom: 0; }
.howto-start { width: 100%; margin-bottom: 18px; }

footer {
  min-height: 34px;
  justify-content: center;
  padding: 0 18px;
  text-align: center;
  font-size: 7px;
}

@media (max-width: 760px) {
  .masthead {
    min-height: 58px;
    grid-template-columns: 1fr auto;
    padding: 10px 12px;
  }

  .brand small { display: none; }
  .masthead nav { justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
  .masthead nav button { padding: 7px 6px; font-size: 7px; }
  .game-screen { padding: 10px 10px 38px; }
  .run-bar { grid-template-columns: 1fr 95px; }
  .capital-readout strong { font-size: 18px; }
  .capital-readout small { font-size: 6px; }
  .compact-vitals { grid-template-columns: repeat(2, 1fr); }
  .compact-vitals span:nth-child(2) { border-right: 0; }
  .compact-vitals span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .panic-button { grid-template-columns: 80px 1fr; gap: 6px 10px; }
  .panic-button strong { font-size: 17px; }
  .panic-button small { grid-column: 1 / 3; text-align: left; }
  .crisis-card { padding: 22px 16px; }
  .crisis-card > h1, .report-card h1 { font-size: clamp(36px, 11vw, 52px); }
  .choices { grid-template-columns: 1fr; }
  .choice { min-height: 128px; }
  .final-vitals { grid-template-columns: repeat(3, 1fr); }
  .briefing-grid { grid-template-columns: 1fr; }
  .briefing-grid > div { min-height: 0; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; }
  .modal { padding: 44px 18px 22px; }
}

@media (max-width: 360px) {
  .masthead {
    height: auto;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px 12px 10px;
  }

  .brand {
    width: 100%;
  }

  .brand strong {
    font-size: 18px;
  }

  .masthead nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .masthead nav button {
    min-height: 40px;
    padding: 6px 4px;
  }

  .ending-main h1 {
    max-width: 100%;
    font-size: 40px;
    line-height: 0.9;
    overflow-wrap: anywhere;
  }

  .ending-main h2 {
    font-size: 25px;
  }
}

/* Continuous six-month simulation */
body.modal-open {
  overflow: hidden;
}

.continuous-game {
  width: min(100%, 1100px);
}

.continuous-runbar {
  grid-template-columns: 220px 1fr 220px;
}

.continuous-track {
  grid-template-columns: repeat(8, 1fr);
}

.ledger-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
  border: 1px solid var(--line);
  background: rgba(22, 28, 25, 0.92);
}

.ledger-strip > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.ledger-strip > div:last-child {
  border-right: 0;
}

.ledger-strip span,
.ledger-strip small {
  display: block;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ledger-strip strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--paper);
  font-family: var(--display);
  font-size: 23px;
  line-height: 1;
}

.good { color: var(--mint) !important; }
.bad { color: var(--coral) !important; }

.continuous-stage {
  margin-top: 8px;
  padding: clamp(25px, 4vw, 45px);
  border: 1px solid var(--line);
  background: rgba(22, 28, 25, 0.96);
  animation: reportIn 260ms ease-out;
}

.period-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  align-items: start;
  gap: 30px;
}

.period-heading h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.price-stamp {
  padding: 13px;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  text-align: center;
  transform: rotate(1.5deg);
}

.price-stamp span,
.price-stamp small {
  display: block;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-stamp strong {
  display: block;
  margin: 5px 0 2px;
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
}

.period-situation {
  max-width: 820px;
  margin: 22px 0 15px;
  color: var(--paper-dark);
  font-family: var(--display);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.42;
}

.pressure-note {
  max-width: 820px;
  margin: 0;
  padding: 12px 15px;
  border-left: 4px solid var(--coral);
  background: rgba(255, 108, 85, 0.07);
  color: var(--paper);
  font-size: 9px;
  line-height: 1.55;
}

.pressure-note span {
  display: block;
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.continuous-choices .choice {
  min-height: 172px;
}

.policy-choice.care:hover {
  border-color: var(--mint);
}

.policy-choice.balance:hover {
  border-color: var(--blue);
}

.policy-choice.extract:hover {
  border-color: var(--coral);
}

.news-ticker {
  min-height: 38px;
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 13px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #0c100e;
  overflow: hidden;
}

.news-ticker span {
  color: var(--coral);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.news-ticker p {
  min-width: 0;
  margin: 0;
  color: var(--paper-dark);
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.halfyear-history {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: rgba(22, 28, 25, 0.7);
}

.halfyear-history summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  color: var(--blue);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.09em;
  list-style: none;
  text-transform: uppercase;
}

.halfyear-history summary::-webkit-details-marker {
  display: none;
}

.halfyear-history summary span {
  color: var(--paper);
}

.timeline-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 15px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  font-size: 8px;
}

.timeline-row span,
.timeline-row small {
  color: var(--muted);
}

.timeline-row strong {
  color: var(--paper-dark);
  text-transform: uppercase;
}

.timeline-empty {
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.modal {
  width: min(720px, 100%);
}

.adviser-report {
  --adviser-color: var(--yellow);
}

.adviser-report.care { --adviser-color: var(--mint); }
.adviser-report.human { --adviser-color: var(--blue); }
.adviser-report.antagonist { --adviser-color: var(--coral); }

.adviser-person {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 17px;
  padding-right: 20px;
}

.adviser-portrait {
  width: 110px;
  height: 124px;
  display: grid;
  place-items: end center;
  position: relative;
  border: 2px solid var(--adviser-color);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 31%, var(--paper-dark) 0 14px, transparent 15px),
    radial-gradient(ellipse at 50% 100%, var(--adviser-color) 0 39px, transparent 40px),
    #0d1210;
}

.adviser-portrait span {
  z-index: 1;
  width: 100%;
  padding: 4px;
  background: rgba(10, 14, 12, 0.82);
  color: var(--adviser-color);
  font-size: 8px;
  text-align: center;
}

.adviser-person p,
.adviser-person small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adviser-person strong {
  display: block;
  margin: 5px 0;
  color: var(--adviser-color);
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 43px);
  line-height: 0.95;
  text-transform: uppercase;
}

.speech-card {
  position: relative;
  margin-top: 21px;
  padding: 18px 20px;
  border: 1px solid var(--adviser-color);
  background: #0f1512;
}

.speech-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 34px;
  width: 15px;
  height: 15px;
  border-top: 1px solid var(--adviser-color);
  border-left: 1px solid var(--adviser-color);
  background: #0f1512;
  transform: rotate(45deg);
}

.speech-card p {
  margin: 7px 0 0;
  color: var(--paper-dark);
  font-size: 9px;
  line-height: 1.55;
}

.speech-card .adviser-quote {
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.25;
}

.popup-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 15px;
  border: 1px solid var(--line);
}

.popup-ledger div {
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.popup-ledger div:last-child {
  border-right: 0;
}

.popup-ledger span,
.popup-impact span {
  display: block;
  color: var(--muted);
  font-size: 7px;
  text-transform: uppercase;
}

.popup-ledger strong {
  display: block;
  margin-top: 5px;
  color: var(--paper);
  font-family: var(--display);
  font-size: 20px;
}

.popup-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
}

.popup-impact strong {
  color: var(--yellow);
}

.adviser-continue {
  width: 100%;
  margin-top: 18px;
}

.continuous-briefing {
  grid-template-columns: repeat(3, 1fr);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 24px 0;
}

.model-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
}

.model-grid span {
  color: var(--blue);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.model-grid strong {
  display: block;
  margin: 6px 0;
  font-family: var(--display);
  font-size: 18px;
  text-transform: uppercase;
}

.model-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.ending-ledger {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 13px;
  background: var(--line);
}

.ending-ledger span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: var(--ink-soft);
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.ending-ledger strong {
  color: var(--paper);
}

@media (max-width: 760px) {
  .continuous-runbar {
    grid-template-columns: 1fr 112px;
  }

  .continuous-track {
    grid-template-columns: repeat(8, 1fr);
  }

  .ledger-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .ledger-strip > div:nth-child(2) {
    border-right: 0;
  }

  .ledger-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .period-heading {
    grid-template-columns: 1fr 94px;
    gap: 13px;
  }

  .price-stamp {
    padding: 9px 6px;
  }

  .price-stamp strong {
    font-size: 30px;
  }

  .continuous-choices {
    grid-template-columns: 1fr;
  }

  .continuous-choices .choice {
    min-height: 135px;
  }

  .timeline-row {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
  }

  .timeline-row strong {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .timeline-row small {
    text-align: right;
  }

  .popup-ledger {
    grid-template-columns: repeat(2, 1fr);
  }

  .popup-ledger div:nth-child(2) {
    border-right: 0;
  }

  .popup-ledger div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .continuous-briefing,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .continuous-briefing > div {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .period-heading {
    grid-template-columns: 1fr;
  }

  .price-stamp {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    text-align: left;
    transform: none;
  }

  .price-stamp strong {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .ledger-strip strong {
    font-size: 19px;
  }

  .adviser-person {
    grid-template-columns: 82px 1fr;
    gap: 12px;
  }

  .adviser-portrait {
    width: 82px;
    height: 94px;
  }

  .popup-impact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .ending-ledger {
    grid-template-columns: 1fr;
  }
}

/* Streamlined hospital view */
.streamlined-game {
  width: min(100%, 1180px);
  padding-top: 14px;
}

.modal h2.plain-modal-title {
  max-width: none;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.1em;
}

.streamlined-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.status-sidebar {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.side-section {
  border: 1px solid rgba(233, 229, 216, 0.12);
  background: rgba(18, 23, 21, 0.76);
}

.side-heading,
.side-history summary {
  padding: 10px 11px;
  border-bottom: 1px solid rgba(233, 229, 216, 0.1);
  color: #7f8982;
  font-size: 7px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.side-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 8px;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(233, 229, 216, 0.07);
}

.side-metric:last-child {
  border-bottom: 0;
}

.side-metric span {
  color: #7f8982;
  font-size: 7px;
}

.side-metric strong {
  color: #b0b5ae;
  font-size: 9px;
  font-weight: 600;
}

.side-metric i {
  grid-column: 1 / 3;
  height: 3px;
  overflow: hidden;
  background: #252c28;
}

.side-metric i b {
  display: block;
  height: 100%;
  opacity: 0.62;
}

.side-metric i b.stable { background: var(--mint-dark); }
.side-metric i b.strained { background: var(--yellow); }
.side-metric i b.critical,
.side-metric i b.failing { background: var(--coral); }

.side-metric.debt {
  padding-block: 11px;
}

.side-ledger > div:not(.side-heading) {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid rgba(233, 229, 216, 0.07);
}

.side-ledger > div:last-child {
  border-bottom: 0;
}

.side-ledger span {
  color: #7f8982;
  font-size: 7px;
}

.side-ledger strong {
  color: #b0b5ae;
  font-size: 8px;
  font-weight: 600;
}

.local-press p {
  margin: 0;
  padding: 11px;
  color: #a7aaa4;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.3;
  text-transform: uppercase;
}

.side-history summary {
  display: flex;
  justify-content: space-between;
  border-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.side-history[open] summary {
  border-bottom: 1px solid rgba(233, 229, 216, 0.1);
}

.side-history summary::-webkit-details-marker {
  display: none;
}

.side-history .timeline-row {
  display: block;
  padding: 9px 11px;
}

.side-history .timeline-row span,
.side-history .timeline-row strong,
.side-history .timeline-row small {
  display: block;
  margin: 0 0 3px;
  text-align: left;
}

.policy-stage {
  min-height: 560px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  background: rgba(22, 28, 25, 0.96);
}

.policy-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.month-label span,
.primary-readouts span,
.primary-readouts small {
  display: block;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.month-label strong {
  display: block;
  margin-top: 7px;
  color: var(--paper-dark);
  font-size: 11px;
}

.primary-readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(135px, 1fr));
  gap: 8px;
}

.primary-readouts > div {
  min-width: 145px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  text-align: right;
}

.primary-readouts strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 31px;
  line-height: 1;
}

.hospital-grade {
  font-family: Arial Black, Arial, "Segoe UI Emoji", sans-serif !important;
  font-weight: 900 !important;
}

.grade-a { color: #007a3d !important; }
.grade-b { color: #168b43 !important; }
.grade-c { color: #8a7700 !important; }
.grade-d { color: #b45c00 !important; }
.grade-f { color: #b10018 !important; }
.grade-skull { color: #111 !important; }

.primary-readouts .hospital-grade {
  font-size: 36px;
  line-height: .9;
}

.compact-vitals .hospital-grade,
.popup-impact .hospital-grade {
  display: inline;
  font-size: inherit;
}

.hospital-update {
  max-width: 820px;
  padding: clamp(27px, 5vw, 52px) 0 15px;
}

.hospital-update p {
  margin: 0 0 15px;
  color: var(--paper-dark);
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.42;
}

.hospital-update p + p {
  color: #9ca39d;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.6;
}

.policy-stage .decision-heading {
  margin-top: 18px;
}

.streamlined-choices .choice {
  min-height: 162px;
}

.streamlined-choices .choice i {
  display: none;
}

.panic-dock {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.panic-dock .panic-button {
  width: min(100%, 430px);
  min-height: 42px;
  grid-template-columns: 82px 1fr;
  margin: 0;
  opacity: 0.78;
}

.panic-dock .panic-button:hover,
.panic-dock .panic-button:focus-visible {
  opacity: 1;
}

.panic-dock .panic-button small {
  grid-column: 1 / 3;
  text-align: right;
}

@media (max-width: 820px) {
  .streamlined-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .policy-topline {
    grid-template-columns: 1fr;
  }

  .primary-readouts {
    width: 100%;
  }

  .primary-readouts > div {
    text-align: left;
  }

  .streamlined-choices {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .streamlined-game {
    padding-inline: 10px;
  }

  .streamlined-layout {
    display: flex;
    flex-direction: column;
  }

  .policy-stage {
    order: 1;
    width: 100%;
    padding: 20px 16px;
  }

  .status-sidebar {
    order: 2;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2px;
  }

  .side-history,
  .local-press {
    grid-column: 1 / 3;
  }

  .primary-readouts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-readouts > div {
    min-width: 0;
    padding: 9px 10px;
  }

  .primary-readouts strong {
    font-size: 26px;
  }

  .hospital-update {
    padding-top: 30px;
  }

  .panic-dock {
    margin-top: 18px;
  }
}

@media (max-width: 360px) {
  .status-sidebar {
    grid-template-columns: 1fr;
  }

  .side-history,
  .local-press {
    grid-column: 1;
  }

  .primary-readouts strong {
    font-size: 22px;
  }
}

/* 1990s city-simulator interface theme */
:root {
  --ink: #1d2728;
  --ink-soft: #a9aaa5;
  --paper: #111111;
  --paper-dark: #202020;
  --mint: #00a878;
  --mint-dark: #087c5a;
  --coral: #bd1f2d;
  --blue: #000080;
  --yellow: #fff36b;
  --muted: #4a4a4a;
  --line: #696969;
  --display: "Arial Narrow", "Franklin Gothic Condensed", Arial, sans-serif;
  --mono: "MS Sans Serif", Tahoma, Geneva, sans-serif;
  --ui-face: #bdbdb8;
  --ui-light: #ffffff;
  --ui-mid: #858681;
  --ui-dark: #3b3c3a;
  --ui-blue: #000080;
  --desktop-teal: #087c82;
  color-scheme: light;
}

html {
  background: var(--desktop-teal);
  scroll-behavior: auto;
}

body {
  background: var(--desktop-teal);
  color: #111;
  font-family: var(--mono);
  font-size: 12px;
}

button,
input,
summary {
  font-family: var(--mono);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px dotted #000;
  outline-offset: -4px;
}

.site-shell {
  min-height: 100vh;
  background:
    linear-gradient(30deg, rgba(255,255,255,.055) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.055) 87.5%, rgba(255,255,255,.055)),
    linear-gradient(150deg, rgba(255,255,255,.055) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.055) 87.5%, rgba(255,255,255,.055)),
    linear-gradient(30deg, rgba(0,0,0,.055) 12%, transparent 12.5%, transparent 87%, rgba(0,0,0,.055) 87.5%, rgba(0,0,0,.055)),
    var(--desktop-teal);
  background-size: 36px 63px;
  overflow: hidden;
}

.noise {
  display: none;
}

.masthead {
  min-height: 44px;
  height: 44px;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 5px 9px;
  border: 2px solid;
  border-color: var(--ui-light) var(--ui-dark) var(--ui-dark) var(--ui-light);
  background: var(--ui-face);
  box-shadow: 0 2px 0 #111;
  color: #111;
  backdrop-filter: none;
}

.brand {
  gap: 8px;
  color: #111;
}

.brand-mark {
  width: 30px;
  height: 30px;
  position: relative;
  border: 2px solid;
  border-color: #fff #3c3c3c #3c3c3c #fff;
  background:
    linear-gradient(90deg, transparent 30%, #fff 30% 42%, transparent 42% 58%, #fff 58% 70%, transparent 70%),
    linear-gradient(#177ec2 0 33%, #e8e8e2 33% 100%);
  color: #d71920;
  font-family: Arial Black, Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  text-shadow: 1px 1px #fff;
}

.brand strong {
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 1px 1px #fff;
}

.brand small {
  margin-top: 2px;
  color: #3f3f3f;
  font-size: 8px;
  letter-spacing: .06em;
}

.masthead nav {
  gap: 5px;
}

.masthead nav button,
.text-action,
.reset-button {
  min-height: 28px;
  padding: 5px 10px;
  border: 2px solid;
  border-color: var(--ui-light) var(--ui-dark) var(--ui-dark) var(--ui-light);
  background: var(--ui-face);
  box-shadow: 1px 1px 0 #111;
  color: #111;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.masthead nav button:hover,
.text-action:hover,
.reset-button:hover {
  border-color: #fff #3b3c3a #3b3c3a #fff;
  background: #d5d5cf;
  color: #000;
}

.masthead nav button:active,
.text-action:active,
.reset-button:active,
.primary-action:active,
.choice:active {
  border-color: var(--ui-dark) var(--ui-light) var(--ui-light) var(--ui-dark);
  box-shadow: none;
  transform: translate(1px, 1px);
}

.streamlined-game {
  width: min(100%, 1220px);
  padding: 12px 12px 34px;
}

.streamlined-layout {
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 9px;
}

.status-sidebar {
  gap: 8px;
  color: #111;
}

.side-section,
.policy-stage,
.compact-audit {
  border: 3px solid;
  border-color: var(--ui-light) var(--ui-dark) var(--ui-dark) var(--ui-light);
  background: var(--ui-face);
  box-shadow: 2px 2px 0 #172224;
  color: #111;
}

.side-heading,
.side-history summary,
.panel-heading {
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid #000;
  background: var(--ui-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-shadow: 1px 1px #000;
  text-transform: none;
}

.side-metric {
  gap: 5px 8px;
  padding: 7px 9px;
  border-bottom: 1px solid #777;
}

.side-metric span,
.side-ledger span {
  color: #222;
  font-size: 10px;
}

.side-metric strong,
.side-ledger strong {
  color: #000;
  font-size: 10px;
  font-weight: 700;
}

.side-metric i {
  height: 7px;
  border: 2px solid;
  border-color: #4c4c4c #fff #fff #4c4c4c;
  background: #7f807c;
}

.side-metric i b {
  opacity: 1;
  border-right: 1px solid #333;
}

.side-metric i b.stable { background: #00bb77; }
.side-metric i b.strained { background: #ffdd31; }
.side-metric i b.critical,
.side-metric i b.failing { background: #f14d3e; }

.side-metric .side-grade {
  font-size: 17px;
  line-height: 1;
}

.side-ledger > div:not(.side-heading) {
  padding: 7px 9px;
  border-bottom: 1px solid #777;
}

.good { color: #006837 !important; }
.bad { color: #a40000 !important; }

.local-press p {
  margin: 5px;
  padding: 10px;
  border: 2px solid;
  border-color: #484848 #fff #fff #484848;
  background: #f7f2d2;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.22;
  text-transform: none;
}

.side-history summary {
  border-bottom: 1px solid #000;
}

.side-history[open] summary {
  border-bottom-color: #000;
}

.side-history .timeline-row,
.timeline-empty {
  padding: 8px;
  border-top: 1px solid #777;
  color: #222;
  font-size: 9px;
}

.side-history .timeline-row strong {
  color: #000;
  font-size: 10px;
}

.policy-stage {
  min-height: 570px;
  padding: 7px;
}

.policy-topline {
  min-height: 70px;
  align-items: stretch;
  padding: 0;
  border: 0;
  gap: 7px;
}

.month-label {
  padding: 8px 10px;
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #dfdfd9;
}

.month-label span,
.primary-readouts span,
.primary-readouts small {
  color: #333;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.month-label strong {
  margin-top: 8px;
  color: #000;
  font-size: 14px;
  font-weight: 800;
}

.primary-readouts {
  gap: 6px;
}

.primary-readouts > div {
  min-width: 150px;
  padding: 7px 9px;
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #e9e7c7;
  color: #111;
}

.primary-readouts strong {
  margin: 5px 0 2px;
  color: #002b88;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 900;
  text-shadow: 1px 1px #fff;
}

.hospital-update {
  max-width: none;
  margin-top: 7px;
  padding: 18px 20px;
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background:
    linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
    repeating-linear-gradient(0deg, #e8e8df 0 1px, #f8f8ef 1px 3px);
  color: #111;
}

.hospital-update p {
  margin: 0 0 12px;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

.hospital-update p + p {
  margin-bottom: 0;
  color: #333;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
}

.policy-stage .decision-heading {
  min-height: 25px;
  align-items: center;
  margin: 7px 0 6px;
  padding: 5px 8px;
  border: 1px solid #000;
  background: var(--ui-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 1px 1px #000;
}

.streamlined-choices {
  gap: 7px;
}

.streamlined-choices .choice,
.choice {
  min-height: 172px;
  padding: 12px 10px 10px;
  border: 3px solid;
  border-color: #fff #464646 #464646 #fff;
  background: #c9c9c3;
  box-shadow: 1px 1px 0 #111;
  color: #111;
  transition: none;
}

.choice:hover:not(:disabled) {
  border-color: #fff #464646 #464646 #fff;
  background: #fff4a8;
  transform: none;
}

.choice-cost {
  position: absolute;
  top: 9px;
  right: 8px;
  color: #272000;
  font-size: 8px;
  font-weight: 700;
}

.choice strong {
  margin-top: 4px;
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: none;
}

.choice p {
  margin: 8px 0 12px;
  color: #111;
  font-size: 10px;
  line-height: 1.35;
}

.choice small {
  color: #000080;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.35;
}

.panic-dock {
  margin-top: 14px;
}

.panic-dock .panic-button,
.panic-button {
  width: min(100%, 430px);
  min-height: 50px;
  padding: 8px 10px;
  border: 3px solid;
  border-color: #ffb1b1 #5a0000 #5a0000 #ffb1b1;
  background: #c62828;
  box-shadow: 2px 2px 0 #152022;
  color: #fff;
  opacity: 1;
  text-shadow: 1px 1px #4e0000;
}

.panic-button:hover {
  background: #e23838;
  box-shadow: 2px 2px 0 #152022;
  transform: none;
}

.panic-button strong {
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
}

.modal-backdrop {
  padding: 14px;
  background: rgba(0, 30, 31, .72);
  backdrop-filter: none;
}

.modal {
  width: min(700px, 100%);
  max-height: calc(100vh - 28px);
  padding: 38px 18px 18px;
  border: 4px solid;
  border-color: #fff #383838 #383838 #fff;
  background: var(--ui-face);
  box-shadow: 5px 5px 0 #182526;
  color: #111;
  animation: none;
}

.modal::before {
  content: "HELLthcare Simulator";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #000;
  background: var(--ui-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 1px 1px #000;
}

.modal-close {
  z-index: 2;
  top: 7px;
  right: 8px;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid;
  border-color: #fff #333 #333 #fff;
  background: var(--ui-face);
  color: #000;
  font-size: 0;
}

.modal-close::after {
  content: "×";
  font-size: 14px;
  font-weight: 900;
}

.modal h2,
.modal h2.plain-modal-title {
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
}

.modal .eyebrow {
  margin-bottom: 7px;
  color: #000080;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.modal-intro {
  margin: 10px 0 16px;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.briefing-grid,
.model-grid {
  gap: 6px;
  margin: 14px 0;
}

.briefing-grid > div,
.model-grid > div {
  min-height: 108px;
  padding: 11px;
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #deded8;
  color: #111;
}

.briefing-grid strong {
  color: #000080;
  font-family: Arial, sans-serif;
  font-size: 28px;
}

.briefing-grid p,
.model-grid p {
  color: #111;
  font-size: 10px;
  line-height: 1.4;
}

.model-grid span {
  color: #000080;
  font-size: 9px;
}

.model-grid strong {
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 15px;
}

.method-note,
.report-caveat {
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #fff4a8;
  color: #111;
  font-size: 10px;
}

.primary-action {
  min-height: 42px;
  padding: 8px 14px;
  border: 3px solid;
  border-color: #fff #414141 #414141 #fff;
  background: var(--ui-face);
  box-shadow: 1px 1px 0 #111;
  color: #000;
  font-size: 11px;
  text-transform: none;
  transition: none;
}

.primary-action:hover {
  background: #fff4a8;
  box-shadow: 1px 1px 0 #111;
  transform: none;
}

.source-list {
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #efefe9;
}

.source-list a {
  border-bottom: 1px solid #777;
  color: #000;
}

.source-list strong {
  color: #000;
  font-family: Arial, sans-serif;
}

.source-list small,
.source-list a > span {
  color: #333;
}

.source-list i {
  color: #000080;
}

.adviser-report {
  --adviser-color: #000080;
}

.adviser-report.care { --adviser-color: #087c5a; }
.adviser-report.human { --adviser-color: #275daa; }
.adviser-report.antagonist { --adviser-color: #a51f28; }

.adviser-portrait {
  border: 3px solid;
  border-color: #fff #3d3d3d #3d3d3d #fff;
  background:
    radial-gradient(circle at 50% 31%, #f2c7a0 0 18px, transparent 19px),
    radial-gradient(ellipse at 50% 100%, var(--adviser-color) 0 50px, transparent 51px),
    #65a9cf;
  image-rendering: pixelated;
}

.adviser-portrait span {
  background: #000080;
  color: #fff;
}

.adviser-person p,
.adviser-person small {
  color: #333;
  font-size: 9px;
  letter-spacing: 0;
}

.adviser-person strong {
  color: #000;
  font-family: Arial, sans-serif;
  font-size: clamp(24px, 4vw, 34px);
  text-shadow: 1px 1px #fff;
}

.speech-card {
  border: 2px solid;
  border-color: #444 #fff #fff #444;
  background: #fffef4;
}

.speech-card::before {
  border-color: #444 transparent transparent #444;
  background: #fffef4;
}

.speech-card p {
  color: #222;
  font-size: 11px;
}

.speech-card .adviser-quote {
  color: #000;
  font-family: Arial, sans-serif;
  font-size: clamp(18px, 3vw, 24px);
}

.popup-ledger {
  border: 2px solid;
  border-color: #444 #fff #fff #444;
  background: #dfdfd9;
}

.popup-ledger div {
  border-color: #777;
}

.popup-ledger span,
.popup-impact span {
  color: #333;
  font-size: 9px;
}

.popup-ledger strong,
.popup-impact strong {
  color: #000;
}

.ending-screen {
  width: min(calc(100% - 30px), 980px);
  min-height: auto;
  margin: 18px auto 40px;
  padding: clamp(25px, 5vw, 50px);
  border: 4px solid;
  border-color: #fff #3d3d3d #3d3d3d #fff;
  background: var(--ui-face);
  box-shadow: 5px 5px 0 #172224;
  color: #111;
}

.ending-main .eyebrow {
  color: #000080;
  font-weight: 700;
}

.ending-main h1 {
  color: #000080;
  font-family: Arial, sans-serif;
  font-size: clamp(46px, 8vw, 82px);
  letter-spacing: -.055em;
  text-shadow: 2px 2px #fff;
}

.ending-main h2 {
  color: #000;
  font-family: Arial, sans-serif;
}

.ending-main > p:not(.eyebrow):not(.discovered-note) {
  color: #111;
  font-family: Arial, sans-serif;
}

.ending-main blockquote {
  border: 2px solid;
  border-color: #454545 #fff #fff #454545;
  background: #fffef4;
  color: #111;
}

.compact-vitals {
  border: 2px solid;
  border-color: #484848 #fff #fff #484848;
  background: #deded8;
}

.compact-vitals span {
  border-color: #777;
  color: #333;
}

.compact-vitals strong {
  color: #000;
}

.compact-audit summary {
  color: #000080;
}

.ending-ledger {
  background: #777;
}

.ending-ledger span {
  background: #deded8;
  color: #333;
}

.ending-ledger strong,
.discovered-note {
  color: #111;
}

@media (max-width: 820px) {
  .streamlined-layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .streamlined-choices .choice {
    min-height: 140px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .streamlined-game {
    padding: 8px 7px 28px;
  }

  .policy-stage {
    padding: 6px;
  }

  .hospital-update {
    padding: 15px;
  }

  .hospital-update p {
    font-size: 16px;
  }

  .hospital-update p + p {
    font-size: 11px;
  }

  .primary-readouts strong {
    font-size: 23px;
  }

  .streamlined-choices .choice {
    min-height: 132px;
  }

  .choice strong {
    font-size: 16px;
  }

  .choice p {
    font-size: 11px;
  }

  .side-metric span,
  .side-ledger span,
  .side-metric strong,
  .side-ledger strong {
    font-size: 11px;
  }

  .modal {
    padding: 36px 12px 12px;
  }
}

@media (max-width: 360px) {
  .masthead {
    height: auto;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 5px;
  }

  .brand {
    width: 100%;
  }

  .masthead nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .brand strong {
    font-size: 16px;
  }

  .masthead nav button {
    min-height: 38px;
    font-size: 10px;
  }

  .primary-readouts > div {
    padding: 7px;
  }

  .primary-readouts strong {
    font-size: 20px;
  }

  .ending-main h1 {
    font-size: 31px;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
}

/* Quarter briefings: one visible speaker carries the update into its result. */
.hospital-update {
  display: block;
  padding: 14px 16px;
}

.update-portrait {
  width: 116px;
  height: 132px;
  flex: 0 0 116px;
}

.hospital-update p,
.hospital-update p + p,
.update-copy p {
  margin: 0 0 12px;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.update-risk strong {
  font-size: inherit;
}

.update-risk,
.hospital-update .update-risk {
  margin: 0;
  padding: 10px 12px;
  border: 2px solid;
}

.update-message {
  width: 100%;
  box-sizing: border-box;
}

.update-system-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 2px solid;
  border-color: #666 #fff #fff #666;
  background: #fffef4;
}

.character-quote-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.character-quote-content {
  min-width: 0;
}

.hospital-update .quote-speaker {
  margin: 0 0 7px;
}

.hospital-update .update-system-message p,
.hospital-update .update-character-message p {
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.update-character-message {
  position: relative;
  font-style: normal;
}

.update-character-message::before {
  content: "";
  position: absolute;
  top: 17px;
  left: -8px;
  width: 12px;
  height: 12px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  background: inherit;
  transform: rotate(45deg);
}

.update-advisory,
.hospital-update .update-advisory {
  border-color: #315f37 #fff #fff #315f37;
  background: #e1efda;
  box-shadow: inset 5px 0 0 #4c814e;
  color: #173b1b;
}

.update-caution,
.hospital-update .update-caution {
  border-color: #756000 #fff #fff #756000;
  background: #fff1b8;
  box-shadow: inset 5px 0 0 #c58a00;
  color: #4c3800;
}

.update-bad-news,
.hospital-update .update-bad-news {
  border-color: #7c0000 #fff #fff #7c0000;
  background: #ffe0cf;
  box-shadow: inset 5px 0 0 #b4141b;
  color: #630006;
}

.adviser-portrait.character-nurse {
  --adviser-color: #06705d;
  background-color: #78b3cf;
  background-image: url("graphics/nurse.png");
  background-position: center 18%;
  background-repeat: no-repeat;
  background-size: cover;
}

.adviser-portrait.character-nurse span {
  display: none;
}
.adviser-portrait.character-finance {
  --adviser-color: #183f8f;
  background-color: #78b3cf;
  background-image: url("graphics/cfo.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

.adviser-portrait.character-finance span {
  display: none;
}
.adviser-portrait.character-insurer {
  --adviser-color: #842028;
  background-color: #d3aa75;
  background-image: url("graphics/evil.png");
  background-position: center 18%;
  background-repeat: no-repeat;
  background-size: cover;
}

.adviser-portrait.character-insurer span {
  display: none;
}
.adviser-portrait.character-casework {
  --adviser-color: #765399;
  background-color: #75aac0;
  background-image: url("graphics/casemanager.png");
  background-position: center 18%;
  background-repeat: no-repeat;
  background-size: cover;
}

.adviser-portrait.character-casework span {
  display: none;
}
.adviser-portrait.character-services {
  --adviser-color: #c2641c;
  background-color: #78b3cf;
  background-image: url("graphics/evs.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

.adviser-portrait.character-services span {
  display: none;
}
.adviser-portrait.character-state {
  --adviser-color: #6f2631;
  background-color: #78b3cf;
  background-image: url("graphics/medicare.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

.adviser-portrait.character-state span {
  display: none;
}
.adviser-portrait.character-advocate { --adviser-color: #275daa; background-color: #d5a06e; }
.adviser-portrait.character-physician { --adviser-color: #15738c; background-color: #8db4bf; }

@media (max-width: 620px) {
  .hospital-update {
    padding: 12px;
  }

  .update-portrait {
    width: 84px;
    height: 96px;
    flex-basis: 84px;
  }

  .character-quote-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 9px;
  }
}

/* Sidebar newspaper clipping */
.local-press {
  padding: 7px;
  border: 1px solid #24231d;
  background:
    repeating-linear-gradient(0deg, rgba(68, 61, 40, 0.035) 0 1px, transparent 1px 4px),
    #eee8c9;
  box-shadow: 2px 2px 0 #5d5a4d, inset 0 0 18px rgba(96, 78, 33, 0.12);
  color: #171610;
  transform: rotate(-0.12deg);
  transform-origin: 50% 0;
}

.newspaper-masthead {
  padding: 2px 2px 4px;
  border-top: 3px double #171610;
  border-bottom: 4px double #171610;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.7px;
  line-height: 1;
  text-align: center;
  text-shadow: 1px 1px rgba(255, 255, 255, 0.4);
}

.newspaper-dateline,
.newspaper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: "Courier New", monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.25px;
  line-height: 1.2;
  text-transform: uppercase;
}

.newspaper-dateline {
  padding: 4px 1px 3px;
  border-bottom: 1px solid #595545;
}

.local-press .newspaper-headline {
  margin: 0;
  padding: 8px 2px 9px;
  border: 0;
  background: transparent;
  color: #11100c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.2px;
  line-height: 1.08;
  text-align: left;
  text-transform: none;
}

.newspaper-footer {
  padding: 3px 1px 0;
  border-top: 3px double #171610;
}

@media (max-width: 620px) {
  .local-press {
    transform: none;
  }

  .newspaper-masthead {
    font-size: 17px;
  }
}

/* Final hospital disposition window */
.ending-screen {
  width: min(calc(100% - 24px), 1120px);
  margin: 14px auto 38px;
  padding: 0;
  border: 4px solid;
  border-color: #fff #3d3d3d #3d3d3d #fff;
  background: var(--ui-face);
  box-shadow: 5px 5px 0 #172224;
  color: #111;
}

.ending-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #000;
  background: var(--ui-blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-shadow: 1px 1px #000;
}

.ending-titlebar strong {
  padding: 2px 5px;
  border: 1px solid #fff;
  background: #a40000;
  font-size: 9px;
  white-space: nowrap;
}

.ending-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 10px;
  padding: 10px;
}

.ending-report,
.ending-stat-panel,
.ending-audit {
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #deded8;
}

.ending-report {
  min-width: 0;
  padding: clamp(15px, 3vw, 26px);
}

.ending-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #777;
  color: #333;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.ending-code-row strong {
  padding: 6px 8px 5px;
  border: 3px double #8a0000;
  background: #f3d4c9;
  color: #8a0000;
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-align: center;
  transform: rotate(-1deg);
}

.ending-parachute .ending-code-row strong {
  border-color: #006837;
  background: #d8ecd8;
  color: #006837;
}

.ending-screen .ending-main > p.ending-overline {
  margin: 16px 0 4px;
  color: #000080;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ending-screen .ending-main h1 {
  margin: 0;
  color: #000080;
  font-family: Arial, sans-serif;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.94;
  overflow-wrap: normal;
  text-shadow: 2px 2px #fff;
}

.ending-screen .ending-main > p.ending-kicker {
  margin: 14px 0 18px;
  padding: 8px 10px;
  border: 2px solid;
  border-color: #424242 #fff #fff #424242;
  background: #c9c9c3;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.ending-narrative {
  border: 2px solid;
  border-color: #4c4c4c #fff #fff #4c4c4c;
  background: #fffef4;
}

.ending-narrative > span,
.ending-final-note > span {
  display: block;
  padding: 5px 7px;
  border-bottom: 1px solid #555;
  background: var(--ui-blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 1px 1px #000;
}

.ending-narrative p {
  margin: 0;
  padding: 13px 14px;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.48;
}

.ending-main .ending-final-note {
  margin: 12px 0 0;
  padding: 0;
  border: 2px solid;
  border-color: #4b4b4b #fff #fff #4b4b4b;
  background: #fff3bf;
  color: #111;
}

.ending-final-note > span {
  background: #3e3e38;
}

.ending-final-note p {
  margin: 0;
  padding: 12px 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  line-height: 1.4;
}

.ending-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.ending-newspaper {
  margin: 2px 3px 4px;
}

.ending-stat-panel {
  overflow: hidden;
}

.ending-stat-panel .panel-heading {
  min-height: auto;
}

.ending-stat-panel .final-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 0;
  background: #777;
  gap: 1px;
}

.ending-stat-panel .final-vitals span {
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  background: #deded8;
  color: #333;
  font-size: 9px;
}

.ending-stat-panel .final-vitals strong {
  margin-top: 3px;
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 15px;
}

.ending-audit {
  margin: 0;
  overflow: hidden;
}

.ending-audit summary {
  padding: 8px 9px;
  background: #c9c9c3;
  color: #000080;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.ending-audit[open] summary {
  border-bottom: 1px solid #666;
}

.ending-audit .ending-ledger {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  padding: 0;
  background: #777;
}

.ending-audit .ending-ledger span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: #deded8;
  color: #333;
  font-size: 9px;
}

.ending-audit .ending-ledger strong {
  font-size: 10px;
  white-space: nowrap;
}

.ending-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px 10px;
  border-top: 1px solid #777;
  background: #c9c9c3;
}

.ending-footer .discovered-note {
  margin: 0;
  color: #333;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.ending-footer .ending-restart {
  width: auto;
  min-width: 240px;
  margin: 0;
}

@media (max-width: 760px) {
  .ending-screen {
    width: calc(100% - 12px);
    margin-top: 7px;
  }

  .ending-layout {
    grid-template-columns: 1fr;
    padding: 7px;
  }

  .ending-rail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .ending-audit {
    grid-column: 1 / -1;
  }

  .ending-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ending-footer .ending-restart {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .ending-titlebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .ending-code-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .ending-screen .ending-main h1 {
    font-size: 40px;
  }

  .ending-rail {
    grid-template-columns: 1fr;
  }

  .ending-audit {
    grid-column: auto;
  }
}

/* Policy forecast rows */
.streamlined-choices .policy-choice {
  min-height: 270px;
}

.policy-forecast-label {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
  padding: 4px 6px;
  border: 1px solid #000;
  background: var(--ui-blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 1px 1px #000;
  text-transform: uppercase;
}

.policy-forecast {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  gap: 1px;
  padding: 2px;
  border: 2px solid;
  border-color: #3f3f3f #fff #fff #3f3f3f;
  background: #777;
}

.policy-impact {
  display: grid;
  grid-template-columns: 42px 55px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 3px 5px;
  box-sizing: border-box;
  background: #deded8;
  color: #222;
  font-family: var(--mono);
  line-height: 1.1;
}

.choice .policy-impact small {
  margin: 0;
  color: #333;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.policy-impact b {
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.policy-impact em {
  color: #333;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.policy-impact.positive {
  background: #d8ead8;
  box-shadow: inset 4px 0 0 #16804b;
}

.policy-impact.positive b {
  color: #006837;
}

.policy-impact.warning {
  background: #fff0b8;
  box-shadow: inset 4px 0 0 #c58a00;
}

.policy-impact.warning b {
  color: #735000;
}

.policy-impact.negative {
  background: #f3d1c8;
  box-shadow: inset 4px 0 0 #b4141b;
}

.policy-impact.negative b {
  color: #8a0000;
}

.policy-impact.neutral {
  background: #e5e5df;
  box-shadow: inset 4px 0 0 #777;
}

@media (max-width: 820px) {
  .streamlined-choices .policy-choice {
    min-height: 282px;
  }

  .policy-impact {
    grid-template-columns: 39px 48px minmax(0, 1fr);
    gap: 3px;
    padding-inline: 4px;
  }

  .policy-impact em,
  .choice .policy-impact small {
    font-size: 7px;
  }
}

@media (max-width: 620px) {
  .streamlined-choices .policy-choice {
    min-height: 245px;
  }

  .policy-impact {
    grid-template-columns: 52px 62px minmax(0, 1fr);
  }

  .policy-impact em,
  .choice .policy-impact small {
    font-size: 8px;
  }
}

/* Between-quarter before/after report */
.report-comparison {
  margin-top: 14px;
  border: 2px solid;
  border-color: #444 #fff #fff #444;
  background: #777;
}

.report-comparison-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-bottom: 1px solid #000;
  background: var(--ui-blue);
  color: #fff;
  font-family: var(--mono);
  text-shadow: 1px 1px #000;
}

.report-comparison-heading strong,
.report-comparison-heading small {
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.report-comparison-body {
  display: grid;
  gap: 1px;
}

.report-comparison-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.25fr) minmax(72px, 0.8fr) 18px minmax(72px, 0.8fr) minmax(88px, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 35px;
  padding: 4px 7px;
  background: #deded8;
  color: #111;
}

.comparison-measure {
  color: #222;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
}

.comparison-value {
  display: block;
  min-width: 0;
}

.comparison-value small {
  display: block;
  margin-bottom: 2px;
  color: #555;
  font-family: var(--mono);
  font-size: 6px;
  font-weight: 700;
  text-transform: uppercase;
}

.comparison-value strong {
  display: block;
  overflow: hidden;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-arrow {
  color: #555;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.comparison-change {
  justify-self: stretch;
  padding: 4px 5px;
  border: 1px solid #777;
  background: #e9e9e3;
  color: #333;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.comparison-change.good {
  border-color: #4b7758;
  background: #d8ead8;
  color: #006837 !important;
}

.comparison-change.bad {
  border-color: #9a4b4b;
  background: #f3d1c8;
  color: #8a0000 !important;
}

.comparison-change.same {
  border-color: #888;
  background: #e5e5df;
  color: #555;
}

@media (max-width: 620px) {
  .report-comparison-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .report-comparison-row {
    grid-template-columns: 65px 54px 12px 54px minmax(68px, 1fr);
    gap: 3px;
    min-height: 33px;
    padding-inline: 4px;
  }

  .comparison-measure,
  .comparison-value strong {
    font-size: 9px;
  }

  .comparison-change {
    padding-inline: 3px;
    font-size: 7px;
  }
}

@media (max-width: 380px) {
  .report-comparison-row {
    grid-template-columns: 58px 48px 10px 48px minmax(60px, 1fr);
  }

  .comparison-measure,
  .comparison-value strong {
    font-size: 8px;
  }
}
