/* ==========================================================================
   sheet.css: one sheet of the Simulators drawing set (Edition 2, Claude Opus 5.5)
   GENERATED by ~/app-redesign/tools/assemble-port.sh from ports-src/ (see README.md).
   Cascade layers, lowest to highest:
   base       ../drawing-set.css (prints, grid, sheet bar, title block, type)
   skeleton   aliases (Edition 1 tokens -> this print) + Edition 1 geometry with its
              visual language stripped by reskin.mjs
   page       this sheet's skin
   ========================================================================== */
@layer base, skeleton, page;
@import url("../drawing-set.css") layer(base);

@layer skeleton {
/* ---------- aliases: Edition 1 tokens -> redline ----------
   --line is NOT aliased: the old and new tokens share the name and the meaning
   (a hairline); `--line: var(--line)` would be a cycle and invalidate it. */
body[data-sheet] {
  --bg: var(--ground); --fg: var(--ink); --dim: var(--ink-2); --dimmer: var(--ink-3);
  --line-bright: var(--line-2);
  --red: #D22B2B; --red-bright: #E53935; --green: #1F7A45; --amber: #B8740A; --blue: #2B5DA8;
  --mono: var(--f-mono);
}
/* ---------- generated skeleton ---------- */
  /* ============================================================
     CODE BLUE - dark terminal aesthetic
     ============================================================ */

  :where(#boot, #game, .overlay) :where(*, *::before, *::after) { margin: 0; padding: 0; }

  html, body {
    color: var(--fg);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
  }

  body {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
  }

  button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid var(--fg);
    padding: 10px 18px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 80ms linear, color 80ms linear;
  }
  button:hover { color: var(--bg); }
  button:disabled { opacity: 0.3; cursor: not-allowed; }
  button:disabled:hover { background: transparent; color: inherit; }

  button.danger { border-color: var(--red); color: var(--red); }
  button.danger:hover { color: var(--bg); }

  /* ----- Top status bar ----- */
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line-bright);
    padding-bottom: 12px;
    margin-bottom: 24px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim);
  }
  .topbar .brand { color: var(--red); font-weight: 600; font-size: inherit; display: inline; }
  .topbar .right { display: flex; gap: 18px; align-items: center; }
  .topbar .right .item { color: var(--dim); }
  .topbar .blink { animation: blink 1s steps(2) infinite; }
  @keyframes blink { 50% { opacity: 0; } }

  .icon-btn {
    border: 1px solid var(--dimmer);
    color: var(--dim);
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .icon-btn:hover { border-color: var(--fg); color: var(--fg); background: transparent; }
  .icon-btn.on { border-color: var(--red); color: var(--red); }

  /* ============================================================
     BOOT SCREEN
     ============================================================ */
  #boot {
    position: fixed; inset: 0;
    z-index: 900;
    display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center;
    padding: 60px clamp(32px, 8vw, 120px);
    font-family: var(--mono);
  }
  #boot .head {
    color: var(--red);
    font-size: 11px;
    letter-spacing: 0.4em;
    margin-bottom: 32px;
    text-transform: uppercase;
  }
  #boot .head::before { content: '▸ '; }
  #boot pre.bootlog {
    color: var(--fg);
    font-size: clamp(13px, 1.4vw, 16px);
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
  }
  #boot .cursor {
    display: inline-block;
    width: 0.6em; height: 1em;
    vertical-align: middle;
    animation: blink 1s steps(2) infinite;
  }
  #boot .prompt-cta {
    margin-top: 36px;
    color: var(--red);
    font-size: clamp(13px, 1.4vw, 16px);
    opacity: 0;
    transition: opacity 200ms linear;
  }
  #boot .prompt-cta.show { opacity: 1; animation: blink 1.2s steps(2) infinite; }

  /* ============================================================
     OVERLAYS (intros, decisions, interstitials, endings)
     ============================================================ */
  .overlay {
    position: fixed; inset: 0;
    z-index: 800;
    display: none;
    flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
  }
  .overlay.show { display: flex; }
  .overlay .panel {
    width: 100%;
    max-width: 760px;
    border: 1px solid var(--line-bright);
    padding: 36px 40px;
  }
  .overlay .label {
    color: var(--red);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 16px;
  }
  .overlay h2 {
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 600;
    margin-bottom: 18px;
    line-height: 1.35;
    letter-spacing: -0.01em;
  }
  .overlay .body {
    color: var(--fg);
    font-size: clamp(13px, 1.35vw, 15px);
    line-height: 1.7;
    margin-bottom: 28px;
    white-space: pre-wrap;
  }
  .overlay .ascii-art {
    color: var(--dim);
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 24px;
    white-space: pre;
    overflow-x: auto;
  }
  .overlay .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
  }
  .overlay .actions button {
    text-align: left;
    padding: 14px 18px;
    font-size: 13px;
  }
  .overlay .actions button .opt-key {
    color: var(--red);
    margin-right: 12px;
    display: inline-block;
    width: 1.5em;
  }
  .overlay .meta-line {
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 24px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  .overlay .aha-callout {
    color: var(--red);
    font-size: 12px;
    border-left: 2px solid var(--red);
    padding: 8px 14px;
    margin: 16px 0;
  }

  /* ============================================================
     MAIN GAME LAYOUT
     ============================================================ */
  #game { display: none; }
  #game.show { display: block; }

  .scenario-banner {
    border: 1px solid var(--line-bright);
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  .scenario-banner .left { display: flex; flex-direction: column; gap: 4px; }
  .scenario-banner .tag { color: var(--red); font-size: 10px; letter-spacing: 0.3em; }
  .scenario-banner .title { font-size: 15px; }
  .scenario-banner .right { color: var(--dim); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; }

  .grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
  }

  /* ----- Compression panel ----- */
  .compress-panel {
    border: 1px solid var(--line-bright);
    padding: 24px;
    min-height: 540px;
    display: flex;
    flex-direction: column;
  }
  .compress-panel .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .compress-panel .header .title {
    font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim);
  }
  .compress-panel .header .live {
    font-size: 11px; letter-spacing: 0.2em; color: var(--red);
  }
  .compress-panel .header .live::before {
    content: '●'; margin-right: 6px; animation: blink 1s steps(2) infinite;
  }

  .torso-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    position: relative;
  }
  .torso-svg { width: 100%; max-width: 380px; height: auto; }
  .torso-svg .body-line { stroke: var(--fg); stroke-width: 1.4; fill: none; }
  .torso-svg .pad { stroke: var(--red); stroke-width: 1.2; fill: rgba(201,64,64,0.12); opacity: 0; transition: opacity 160ms; }
  .torso-svg .pad.visible { opacity: 1; }
  .torso-svg .grid-line { stroke: var(--line-bright); stroke-width: 0.6; }
  .torso-svg .crosshair { stroke: var(--red); stroke-width: 0.8; opacity: 0.5; }

  .torso-svg .chest-plate {
    fill: none;
    stroke: var(--fg);
    stroke-width: 1.2;
    transform-origin: 200px 240px;
    transition: transform 80ms ease-out;
  }
  .torso-svg .chest-plate.compressed { transform: translateY(8px) scaleY(0.94); }

  .torso-svg .heart {
    fill: var(--red);
    transform-origin: 200px 235px;
    opacity: 0.7;
    transition: opacity 240ms linear;
  }
  .torso-svg .heart.flatlining {
    fill: var(--dimmer);
    opacity: 0.35;
    animation: heart-flat 1.4s steps(2) infinite;
  }
  @keyframes heart-flat { 50% { opacity: 0.1; } }

  .ekg-strip {
    margin-top: 12px;
    border: 1px solid var(--line);
    height: 70px;
    position: relative;
    overflow: hidden;
  }
  .ekg-strip canvas { display: block; width: 100%; height: 100%; }
  .ekg-strip .ekg-label {
    position: absolute;
    left: 8px; top: 6px;
    font-size: 10px; letter-spacing: 0.2em; color: var(--dim); z-index: 2;
    text-transform: uppercase;
  }

  /* ----- Compress button (mobile + visual) ----- */
  .compress-btn-row {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .compress-btn {
    display: block;
    width: 100%;
    padding: 22px;
    border: 1px solid var(--red);
    color: var(--red);
    background: transparent;
    font-family: var(--mono);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: background 60ms linear, color 60ms linear, transform 60ms linear;
  }
  .compress-btn:active, .compress-btn.active { color: var(--bg); transform: translateY(2px);
  }
  .compress-btn .small { display: block; font-size: 10px; color: var(--dim); margin-top: 6px; letter-spacing: 0.3em; }
  .compress-btn:active .small, .compress-btn.active .small { color: rgba(10,10,10,0.7); }

  .feedback-line {
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    height: 22px;
    color: var(--dim);
    transition: color 120ms;
  }
  .feedback-line.good { color: var(--green); }
  .feedback-line.warn { color: var(--amber); }
  .feedback-line.bad { color: var(--red); }

  /* ----- Side: meters + log ----- */
  .side-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .meter {
    border: 1px solid var(--line-bright);
    padding: 14px 16px;
  }
  .meter .head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 10px;
  }
  .meter .head .name {
    font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--dim);
  }
  .meter .head .val {
    font-size: 20px; letter-spacing: 0.05em; font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .meter .bar {
    height: 6px;
    position: relative;
    overflow: hidden;
  }
  .meter .bar .fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0%;
    transition: width 200ms ease-out, background 200ms;
  }
  .meter.red .head .val { color: var(--red); }
  .meter.green .head .val { color: var(--green); }
  .meter.amber .head .val { color: var(--amber); }
  .meter .sub {
    font-size: 10px; color: var(--dim); margin-top: 6px; letter-spacing: 0.1em; text-transform: uppercase;
  }

  .log-panel {
    border: 1px solid var(--line-bright);
    padding: 14px 16px;
    height: 200px;
    display: flex;
    flex-direction: column;
  }
  .log-panel .title {
    font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--dim);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }
  .log-panel .log {
    flex: 1;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.7;
    color: var(--dim);
  }
  .log-panel .log .ts { color: var(--dimmer); margin-right: 8px; }
  .log-panel .log .l-info { color: var(--fg); }
  .log-panel .log .l-good { color: var(--green); }
  .log-panel .log .l-warn { color: var(--amber); }
  .log-panel .log .l-bad { color: var(--red); }
  .log-panel .log .l-aha { color: var(--red); font-style: italic; }

  /* ----- Stats tab ----- */
  .stats-tabs {
    display: flex;
    border-bottom: 1px solid var(--line-bright);
    margin-bottom: 18px;
    gap: 0;
  }
  .stats-tabs button {
    border: none;
    background: transparent;
    padding: 10px 18px;
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    cursor: pointer;
  }
  .stats-tabs button.active { color: var(--fg); border-bottom-color: var(--red); }
  .stats-tabs button:hover { background: transparent; color: var(--fg); }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }
  .stats-grid .stat {
    border: 1px solid var(--line-bright);
    padding: 16px;
  }
  .stats-grid .stat .name {
    font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px;
  }
  .stats-grid .stat .val {
    font-size: 22px; font-variant-numeric: tabular-nums;
  }
  .stats-grid .stat .val.red { color: var(--red); }
  .stats-grid .stat .val.green { color: var(--green); }

  /* ----- Footer ----- */
  footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 0.1em;
    text-align: center;
    line-height: 1.8;
  }
  footer .red { color: var(--red); }

  /* ----- AED mini-game ----- */
  .aed-stage {
    display: flex; flex-direction: column; gap: 20px;
    text-align: center;
  }
  .aed-step {
    display: flex; flex-direction: column; gap: 14px;
    align-items: center;
  }
  .aed-status {
    font-size: 13px; letter-spacing: 0.25em; color: var(--red); text-transform: uppercase;
    min-height: 20px;
  }
  .aed-progress {
    display: flex; gap: 8px; justify-content: center;
    margin: 8px 0 18px;
  }
  .aed-progress .dot {
    width: 30px; height: 4px;
  }
  .aed-progress .dot.active { animation: blink 0.7s steps(2) infinite; }

  .aed-pads-svg { width: 220px; height: 280px; }
  .aed-pads-svg .pad-target {
    fill: rgba(201,64,64,0.1); stroke: var(--red); stroke-width: 1; stroke-dasharray: 4 3;
    cursor: pointer;
    transition: fill 80ms;
  }
  .aed-pads-svg .pad-target.placed { fill: var(--red); stroke-dasharray: none; cursor: default; }
  .aed-pads-svg .pad-label { fill: var(--red); font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; }
  .aed-pads-svg .pad-label.placed { fill: var(--bg); }
  .aed-pads-svg .body-line { stroke: var(--fg); stroke-width: 1; fill: none; }

  .analyze-bar {
    width: 100%; max-width: 360px;
    height: 6px;
    overflow: hidden; position: relative;
    margin: 8px auto;
  }
  .analyze-bar .fill {
    position: absolute; left:0; top:0; bottom:0; width: 0%;
    transition: width 100ms linear;
  }

  /* ----- Endings / shareable card ----- */
  .ending-rank {
    color: var(--red);
    font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase;
    margin-bottom: 10px;
  }
  .ending-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
  }
  .ending-score {
    font-size: 60px;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
    margin: 12px 0 4px;
    letter-spacing: -0.02em;
  }
  .ending-grade-letter {
    color: var(--red);
    font-size: 16px;
    letter-spacing: 0.3em;
    margin-bottom: 24px;
  }
  .share-card {
    border: 1px dashed var(--line-bright);
    padding: 18px;
    margin: 18px 0;
    font-size: 12px;
    color: var(--dim);
    line-height: 1.7;
    white-space: pre-wrap;
  }
  .share-card .red { color: var(--red); }
  .copy-line { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

  /* ============================================================
     RESPONSIVE
     ============================================================ */
  @media (max-width: 900px) {
    body { padding: 14px; }
    .grid { grid-template-columns: 1fr; }
    .compress-panel { min-height: auto; }
    .torso-svg { max-width: 280px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 11px; }
    .topbar .right { width: 100%; justify-content: space-between; }
    .stats-grid { grid-template-columns: 1fr; }
    .compress-btn { font-size: 14px; padding: 28px; }
    .scenario-banner { flex-direction: column; align-items: flex-start; }
    .overlay .panel { padding: 24px 20px; }
    .ending-score { font-size: 44px; }
  }

  /* utility */
  .hidden { display: none !important; }
  .nowrap { white-space: nowrap; }
  .center { text-align: center; }
  .row { display: flex; gap: 10px; flex-wrap: wrap; }
  .grow { flex: 1; }
  .pulse { animation: pulse-fade 1.4s ease-in-out infinite; }
  @keyframes pulse-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
  :is(a, button, input, select, [tabindex]):focus-visible {
    outline: 2px solid var(--red-bright);
    outline-offset: 2px;
  }
  @media (prefers-reduced-motion: reduce) {
    :where(#boot, #game, .overlay) :where(*, *::before, *::after) {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

@layer page {
/* type: the sim speaks in Geist; labels and numbers in Geist Mono */
body[data-sheet] { font-family: var(--f-text); }
button { font-family: var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; background: none; border: 1.5px solid var(--ink); color: var(--ink); }
button:hover:not(:disabled) { background: var(--ink); color: var(--ground); }
button.danger { border-color: var(--red); color: var(--red); }
button.danger:hover { background: var(--red); color: #fff; }
button:disabled { opacity: 0.4; }

/* boot: the first page of the protocol */
#boot { background: var(--ground); color: var(--ink); }
#boot .head { font: 800 clamp(40px, 7vw, 84px)/0.9 var(--f-display); letter-spacing: -0.03em; color: var(--red); }
#boot .head::before { display: none; }
#boot pre.bootlog { font: 500 13px/1.7 var(--f-mono); color: var(--ink-2); }
#boot .cursor { background: var(--red); }
#boot .prompt-cta { font: 600 12px/1 var(--f-mono); letter-spacing: 0.14em; color: var(--red); border: 1.5px solid var(--red); }

/* top bar + tabs */
.topbar { background: var(--ground); border-bottom: 1.5px solid var(--ink); }
.topbar .brand { font: 800 26px/1 var(--f-display); letter-spacing: -0.02em; color: var(--red); }
.topbar .right .item { font-family: var(--f-mono); color: var(--ink-2); }
.icon-btn { border: 1px solid var(--line-2); color: var(--ink-2); font: 600 10.5px/1 var(--f-mono); }
.icon-btn.on { background: var(--red); border-color: var(--red); color: #fff; }
.stats-tabs { border-bottom: 1px solid var(--line-2); }
.stats-tabs button { border: 0; border-bottom: 3px solid transparent; color: var(--ink-2); }
.stats-tabs button:hover { background: none; color: var(--ink); }
.stats-tabs button.active { color: var(--red); border-bottom-color: var(--red); background: none; }

/* scenario banner: the sheet's title strip */
.scenario-banner { border: 1.5px solid var(--ink); background: var(--panel); }
.scenario-banner .tag { font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.12em; color: var(--red); }
.scenario-banner .title { font: 700 22px/1.2 var(--f-display); letter-spacing: -0.01em; color: var(--ink); }
.scenario-banner .right { font-family: var(--f-mono); color: var(--ink-2); }

/* the patient: a technical drawing in black and red */
.compress-panel { background: var(--panel); border: 1.5px solid var(--ink); }
.compress-panel .header { border-bottom: 1px solid var(--line-2); }
.compress-panel .header .title { font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.12em; color: var(--ink); }
.compress-panel .header .live { color: var(--red); font-family: var(--f-mono); }
.compress-panel .header .live::before { background: var(--red); }
.torso-svg .body-line { stroke: var(--ink); }
.torso-svg .grid-line { stroke: rgba(210, 43, 43, 0.25); }
.torso-svg .crosshair { stroke: var(--red); }
.torso-svg .chest-plate { stroke: var(--ink); fill: rgba(26, 26, 26, 0.04); }
.torso-svg .chest-plate.compressed { fill: rgba(210, 43, 43, 0.18); stroke: var(--red); }
.torso-svg .heart { fill: var(--red); }
.torso-svg .pad { fill: rgba(26, 26, 26, 0.12); stroke: var(--ink); }
.ekg-strip { border: 1px solid var(--line-2); background: #FFF7F4; }
.ekg-strip .ekg-label { font-family: var(--f-mono); color: var(--red); }

/* the compress button: the one red slab on the sheet */
.compress-btn { background: var(--red); border: 1.5px solid var(--red); color: #fff; font: 800 30px/1 var(--f-display); letter-spacing: 0.02em; text-transform: uppercase; }
.compress-btn:hover:not(:disabled) { background: #B71F1F; color: #fff; }
.compress-btn:active, .compress-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.compress-btn .small { font: 500 11px/1.3 var(--f-mono); letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.85); }
.feedback-line { font-family: var(--f-mono); color: var(--ink-2); border-top: 1px solid var(--line); }
.feedback-line.good { color: var(--green); } .feedback-line.warn { color: var(--amber); } .feedback-line.bad { color: var(--red); }

/* meters: gauges drawn with rules */
.meter { background: var(--panel); border: 1px solid var(--line-2); }
.meter .head .name { font: 600 10.5px/1.3 var(--f-mono); letter-spacing: 0.12em; color: var(--ink-2); }
.meter .head .val { font: 700 22px/1 var(--f-display); color: var(--ink); }
.meter .bar { background: var(--ground-2); }
.meter .bar .fill { background: var(--ink); }
.meter.green .fill { background: var(--green); } .meter.amber .fill { background: var(--amber); } .meter.red .fill { background: var(--red); }
.meter .sub { font-family: var(--f-mono); color: var(--ink-3); }

/* log: the run sheet */
.log-panel { background: var(--panel); border: 1px solid var(--line-2); }
.log-panel .title { font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.12em; color: var(--ink); border-bottom: 1px solid var(--line); }
.log-panel .log { font: 400 12.5px/1.6 var(--f-mono); color: var(--ink-2); }
.log-panel .log .ts { color: var(--ink-3); }
.log-panel .log .l-good { color: var(--green); } .log-panel .log .l-warn { color: var(--amber); } .log-panel .log .l-bad { color: var(--red); } .log-panel .log .l-aha { color: var(--blue); }

/* overlays: a new page laid over the sheet */
.overlay { background: rgba(246, 243, 238, 0.94); }
.overlay .panel { background: var(--panel); border: 1.5px solid var(--ink); box-shadow: 8px 8px 0 var(--red); }
.overlay .label { font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.14em; color: var(--red); }
.overlay h2 { font: 800 clamp(28px, 4vw, 44px)/0.95 var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.overlay .body { font: 400 16px/1.6 var(--f-text); color: var(--ink); }
.overlay .ascii-art { color: var(--red); }
.overlay .actions button { text-align: left; }
.overlay .actions button .opt-key { color: var(--red); }
.overlay .actions button:hover .opt-key { color: #fff; }
.overlay .meta-line { font-family: var(--f-mono); color: var(--ink-3); }
.overlay .aha-callout { border-left: 3px solid var(--red); background: rgba(210, 43, 43, 0.05); color: var(--ink); }

/* stats + protocol tabs */
.stats-grid .stat { background: var(--panel); border: 1px solid var(--line-2); }
.stats-grid .stat .name { font: 600 10.5px/1.3 var(--f-mono); letter-spacing: 0.12em; color: var(--ink-2); }
.stats-grid .stat .val { font: 700 26px/1 var(--f-display); color: var(--ink); }
.stats-grid .stat .val.red { color: var(--red); } .stats-grid .stat .val.green { color: var(--green); }

/* AED: the device drawn as a schematic */
.aed-stage { background: var(--panel); border: 1.5px solid var(--ink); }
.aed-step, .aed-status { font-family: var(--f-mono); color: var(--ink); }
.aed-progress .dot { background: var(--ground-2); border: 1px solid var(--line-2); }
.aed-progress .dot.done { background: var(--ink); border-color: var(--ink); }
.aed-progress .dot.active { background: var(--red); border-color: var(--red); }
.aed-pads-svg .body-line { stroke: var(--ink); }
.aed-pads-svg .pad-target { stroke: var(--red); fill: rgba(210, 43, 43, 0.08); }
.aed-pads-svg .pad-target.placed { fill: var(--ink); stroke: var(--ink); }
.aed-pads-svg .pad-label { fill: var(--red); font-family: var(--f-mono); }
.analyze-bar { background: var(--ground-2); border: 1px solid var(--line-2); }
.analyze-bar .fill { background: var(--red); }

/* endings */
.ending-rank { font: 600 12px/1.3 var(--f-mono); letter-spacing: 0.16em; color: var(--red); }
.ending-title { font: 800 clamp(40px, 7vw, 84px)/0.9 var(--f-display); letter-spacing: -0.03em; color: var(--ink); }
.ending-score { font: 800 clamp(56px, 10vw, 120px)/0.9 var(--f-display); color: var(--ink); }
.ending-grade-letter { font-family: var(--f-display); color: var(--red); }
.share-card { background: var(--panel); border: 1.5px dashed var(--ink); font-family: var(--f-mono); }
footer { font-family: var(--f-mono); color: var(--ink-3); border-top: 1px solid var(--line); }
}
