/* Scenario brief — a designed one-pager, not a webpage printout.
   Populated by buildBrief() (src/ui.js); ?brief=1 pre-populates it for
   headless PDF generation. @page margin 0 suppresses browser headers/footers
   and lets the masthead bleed; interior spacing comes from element padding. */

#print-brief { display: none; }

@media print {
  @page { size: letter; margin: 0; }

  html, body {
    background: #fff !important;
    color: #101820 !important;
    height: auto !important;
    overflow: visible !important;
    font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  }
  #app, #intro, #tour { display: none !important; }

  #print-brief {
    display: block !important;
    color: #101820;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #print-brief .num {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
  }

  /* ── Multi-page structure ── */
  .pb-page { page-break-after: always; }
  .pb-page.pb-last { page-break-after: auto; }

  .pb-head {
    background: #06121F; color: #9FB3C8;
    padding: 0.17in 0.55in;
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    font-size: 8.6px; letter-spacing: 0.1em; text-transform: uppercase;
  }
  .pb-head .wm { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: 0.26em; color: #E6EEF6; font-size: 11px; }
  .pb-head .sec { color: #38E1D6; letter-spacing: 0.22em; font-weight: 600; }
  .pb-head .pg { text-transform: none; letter-spacing: 0.02em; }

  .pb-h2 {
    font-size: 12.5px; font-weight: 700; margin: 0 0 5px;
    border-bottom: 1.5px solid #101820; padding-bottom: 3px;
  }
  .pb-lede { font-size: 9px; color: #5A6B7A; margin: 0 0 8px; }
  .pb-note-h {
    font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase;
    color: #5A6B7A; margin: 0 0 6px; border-bottom: 1.5px solid #101820; padding-bottom: 3px;
  }

  .pb-badge {
    font-size: 6.2px; letter-spacing: 0.06em; text-transform: uppercase;
    border: 0.7px solid; border-radius: 2px; padding: 0 3px; margin-left: 4px; vertical-align: 1px;
  }
  .s-verified { color: #1E8C7C; }
  .s-reported { color: #0E7C8C; }
  .s-estimate, .s-illustrative { color: #B97A14; }
  .s-brief-baseline, .s-pending { color: #5A6B7A; }

  .pb-minirow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .pb-minirow .v { font-family: ui-monospace, Menlo, monospace; font-size: 15px; font-weight: 700; white-space: nowrap; }
  .pb-minirow .l { font-size: 7.4px; letter-spacing: 0.1em; text-transform: uppercase; color: #5A6B7A; margin-top: 2px; line-height: 1.4; }

  .cp-hl td { background: #FBEFEA; }
  .pb-ladder td { padding: 6px 8px 6px 0; }

  /* ── Masthead: full-bleed navy band ── */
  .pb-mast {
    background: #06121F;
    color: #E6EEF6;
    padding: 0.4in 0.55in 0.26in;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .pb-mast .wm {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 21px; font-weight: 700; letter-spacing: 0.28em;
  }
  .pb-mast .wm small {
    display: block; font-size: 8.5px; font-weight: 400;
    letter-spacing: 0.18em; color: #9FB3C8; margin-top: 5px;
  }
  .pb-mast .meta { text-align: right; font-size: 9px; color: #9FB3C8; line-height: 1.55; }
  .pb-mast .meta b { color: #38E1D6; font-weight: 600; }

  .pb-body { padding: 0.24in 0.55in 0; }

  /* ── Scenario title ── */
  .pb-title { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
  .pb-title .pct { color: #C7431F; }
  .pb-sub { font-size: 9.5px; color: #5A6B7A; margin: 4px 0 0; }

  /* ── Stat tiles ── */
  .pb-tiles {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 12px; margin: 15px 0 0;
  }
  .pb-tile { border-top: 2.6px solid #101820; padding-top: 6px; }
  .pb-tile .v { font-size: 19px; font-weight: 700; line-height: 1.1; }
  .pb-tile .v small { font-size: 9px; font-weight: 600; color: #5A6B7A; letter-spacing: 0; }
  .pb-tile .l {
    font-size: 7.6px; letter-spacing: 0.13em; text-transform: uppercase;
    color: #5A6B7A; margin-top: 3px; line-height: 1.4;
  }
  .pb-tile.crim { border-top-color: #C7431F; } .pb-tile.crim .v { color: #C7431F; }
  .pb-tile.teal { border-top-color: #1E8C7C; } .pb-tile.teal .v { color: #1E8C7C; }
  .pb-tile.amber { border-top-color: #B97A14; } .pb-tile.amber .v { color: #B97A14; }
  .pb-tile.cyan { border-top-color: #0E7C8C; } .pb-tile.cyan .v { color: #0E7C8C; }

  /* Second-order readouts: smaller tile row */
  .pb-tiles2 { grid-template-columns: repeat(4, 1fr); margin-top: 12px; }
  .pb-tiles2 .pb-tile { border-top-width: 2px; padding-top: 5px; }
  .pb-tiles2 .v { font-size: 15px; }
  .pb-tiles2 .l { font-size: 7px; }

  /* Importer days-of-cover strip */
  .pb-cover {
    font-size: 8.6px; line-height: 1.6; color: #2B3742;
    background: #F2F5F8; border-left: 2.6px solid #0E7C8C;
    padding: 6px 9px;
  }
  .pb-cover .num { font-size: 10px; }
  .pb-cover small { color: #B97A14; font-size: 7px; }

  /* ── Throughput waterfall ── */
  .pb-flow { margin: 15px 0 0; page-break-inside: avoid; }
  .pb-flowbar {
    display: flex; height: 0.22in; border-radius: 3px; overflow: hidden;
  }
  .pb-flowbar .un { background: #C9D4DE; }
  .pb-flowbar .by { background: #1E8C7C; }
  .pb-flowbar .st { background: #C7431F; }
  .pb-flowlab { font-size: 8.6px; color: #42525F; margin-top: 4px; }
  .pb-flowlab b { color: #101820; }
  .pb-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin: 0 3px 0 10px; vertical-align: -1px; }
  .pb-flowlab .first { margin-left: 0; }

  /* ── Two columns: exposure table + reading notes ── */
  .pb-cols { display: grid; grid-template-columns: 1.42fr 1fr; gap: 0.3in; margin-top: 16px; }

  table.pb-x { width: 100%; border-collapse: collapse; font-size: 9.4px; }
  .pb-x th {
    text-align: left; font-size: 7.6px; letter-spacing: 0.11em; text-transform: uppercase;
    color: #5A6B7A; border-bottom: 1.5px solid #101820; padding: 3px 4px 4px;
  }
  .pb-x th.r, .pb-x td.r { text-align: right; }
  .pb-x td { border-bottom: 0.6px solid #D5DDE4; padding: 5px 4px; vertical-align: middle; }
  .pb-x td.name { font-weight: 600; }
  .pb-xbar {
    height: 7px; border-radius: 2px; overflow: hidden; display: flex;
    background: #EDF1F5; width: 100%;
  }
  .pb-xbar .e { background: #1E8C7C; }
  .pb-xbar .s { background: #C7431F; }
  .pb-tag {
    font-size: 6.8px; letter-spacing: 0.08em; text-transform: uppercase;
    border: 0.9px solid; border-radius: 2.5px; padding: 1px 4px; white-space: nowrap;
  }
  .pb-tag.total { color: #C7431F; }
  .pb-tag.high { color: #B97A14; }
  .pb-tag.partial { color: #1E8C7C; }
  .pb-tablenote { font-size: 7.8px; color: #5A6B7A; margin-top: 5px; line-height: 1.5; }

  .pb-note h3 {
    font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase;
    color: #5A6B7A; margin: 0 0 6px; border-bottom: 1.5px solid #101820; padding-bottom: 3px;
  }
  .pb-note h3 + * { margin-top: 0; }
  .pb-note p { font-size: 9px; line-height: 1.55; margin: 0 0 8px; color: #2B3742; }
  .pb-note p b { color: #101820; }
  .pb-note pre {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 7.4px; line-height: 1.6;
    background: #F2F5F8; border-left: 2.6px solid #06121F;
    padding: 7px 9px; margin: 0 0 10px; white-space: pre;
  }
  .pb-callout {
    border-left: 2.6px solid #B97A14; background: #FBF6EA;
    padding: 7px 9px; font-size: 8.8px; line-height: 1.5; margin: 0 0 10px;
  }
  .pb-callout b { color: #8A5A0D; }
  .pb-block { margin-top: 12px; page-break-inside: avoid; }

  /* ── Footer ── */
  .pb-foot {
    margin: 0.18in 0.55in 0;
    border-top: 1.6px solid #101820;
    padding: 7px 0 0.3in;
    font-size: 7.5px; color: #5A6B7A; line-height: 1.6;
  }
  .pb-foot b { color: #101820; }
}
