
  :root {
    --bg: #FAF9F6; --surface: #FFFFFF; --border: #E3E1DA;
    --ink: #1E2724; --muted: #66716C;
    --accent: #136A54; --accent-soft: #E7F0EC;
    --amber: #9A6B1F; --amber-soft: #F6EFE1;
    --red: #8C2F2F; --red-soft: #F6E4E1;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #121815; --surface: #1A211E; --border: #2B342F;
      --ink: #E6EAE7; --muted: #93A09A;
      --accent: #4CC2A0; --accent-soft: #1C2E28;
      --amber: #D9A44E; --amber-soft: #2B2519;
      --red: #D98A7E; --red-soft: #2E1C19;
    }
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px; line-height: 1.55;
  }
  .wrap { max-width: 780px; margin: 0 auto; padding: 44px 20px 90px; }
  .brand {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--accent); font-weight: 700;
  }
  h1 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 2.1rem; font-weight: 600; margin: 8px 0 6px; line-height: 1.15;
  }
  .dek { color: var(--muted); margin: 0 0 30px; max-width: 56ch; }

  .gate, .uploader {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 22px;
  }
  .gate { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .gate label { font-weight: 600; }
  input[type="password"] {
    flex: 1; min-width: 180px; padding: 10px 12px; font-size: 1rem;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--ink);
  }
  button {
    padding: 10px 20px; font-size: .95rem; font-weight: 600;
    background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer;
  }
  button:disabled { opacity: .5; cursor: default; }
  button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

  .drop {
    border: 2px dashed var(--border); border-radius: 10px;
    padding: 38px 20px; text-align: center; color: var(--muted); cursor: pointer;
    transition: border-color .15s, background .15s;
  }
  .drop.hover { border-color: var(--accent); background: var(--accent-soft); }
  .drop strong { color: var(--ink); }
  .hint { font-size: .82rem; color: var(--muted); margin-top: 10px; }

  .cards { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
  .card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 18px 20px;
  }
  .card .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .fname { font-weight: 650; overflow-wrap: anywhere; }
  .pill {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 999px; font-weight: 700;
  }
  .pill.ok   { background: var(--accent-soft); color: var(--accent); }
  .pill.warn { background: var(--amber-soft);  color: var(--amber); }
  .pill.bad  { background: var(--red-soft);    color: var(--red); }
  .pill.info { background: var(--bg); color: var(--muted); border: 1px dashed var(--muted); }
  .toolsnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; margin: 20px 0 26px; }
  .tnav {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 9px 11px; display: flex; flex-direction: column; gap: 2px;
    color: inherit; text-decoration: none;
  }
  a.tnav:hover { border-color: var(--accent); }
  a.tnav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tnav b { font-size: .8rem; }
  .tnav span {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
    color: var(--muted);
  }
  .tnav.live { border-color: var(--accent); }
  .tnav.live span { color: var(--accent); }
  .headline { margin: 8px 0 0; font-size: .95rem; }
  .facts { color: var(--muted); font-size: .84rem; margin-top: 4px; }
  .pagestrip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0; }
  .pgwrap { position: relative; flex: none; }
  .pagestrip img { height: 440px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: block; }
  .hl {
    position: absolute; display: none; pointer-events: none;
    border: 2px solid var(--red); border-radius: 3px;
    background: rgba(216, 96, 76, 0.14);
  }
  tr.clickable { cursor: pointer; }
  tr.clickable:not(.row-break):not(.row-dup):hover td { background: var(--accent-soft); }
  tr.row-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
  details.preview { margin-top: 10px; }
  details.preview summary { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 600; }
  details.preview summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  #summary { margin-top: 26px; }
  .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
  .tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
  .tile .n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
  .tile.ok .n { color: var(--accent); }
  .tile.warn .n { color: var(--amber); }
  .tile.bad .n { color: var(--red); }
  .tile .l { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }
  .pbc { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
  .pbc h3 { margin: 0 0 8px; font-size: 1rem; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
  .pbc ul { margin: 0 0 12px; padding-left: 1.2em; font-size: .88rem; display: flex; flex-direction: column; gap: 6px; }
  .pbc .copied { color: var(--accent); font-size: .82rem; margin-left: 10px; }
  .chartwrap { position: relative; margin-top: 12px; }
  svg.balchart { display: block; width: 100%; height: auto; }
  .tip {
    position: absolute; display: none; pointer-events: none; z-index: 2;
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    padding: 6px 9px; font-size: .75rem; white-space: nowrap;
    font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  }
  .tip .tf { color: var(--red); text-transform: capitalize; }
  details.rows { margin-top: 10px; }
  details.rows summary { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 600; }
  details.rows summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tablewrap { overflow: auto; max-height: 380px; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }
  table.grid { border-collapse: collapse; width: 100%; font-size: .82rem; font-variant-numeric: tabular-nums; }
  table.grid th {
    position: sticky; top: 0; background: var(--surface); z-index: 1;
    text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border);
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .66rem;
    text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  }
  table.grid th.num, table.grid td.num { text-align: right; }
  table.grid td { padding: 4px 10px; border-bottom: 1px solid var(--border); }
  table.grid td.num { font-family: ui-monospace, "SF Mono", Menlo, monospace; white-space: nowrap; }
  tr.row-break td { background: var(--red-soft); }
  tr.row-dup td { background: var(--amber-soft); }
  .legend { font-size: .75rem; color: var(--muted); margin-top: 6px; display: flex; gap: 16px; }
  .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
  .toc { margin-top: 12px; }
  .toc a { color: var(--accent); text-decoration: none; }
  .toc a:hover { text-decoration: underline; }
  details.stmtbox { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
  details.stmtbox > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
  details.stmtbox > summary::-webkit-details-marker { display: none; }
  details.stmtbox > summary::before { content: "▸"; color: var(--muted); font-size: .8rem; }
  details.stmtbox[open] > summary::before { content: "▾"; }
  .stmt { margin-top: 10px; }
  .stmt .label { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
  .mismatch { color: var(--red); font-size: .8rem; margin: 2px 0 0 18px; }
  ul.checks { list-style: none; margin: 10px 0 0; padding: 0; font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }
  ul.checks .pass::before { content: "✓ "; color: var(--accent); font-weight: 700; }
  ul.checks .fail::before { content: "✗ "; color: var(--red); font-weight: 700; }
  .totals { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; color: var(--muted); margin-top: 8px; }
  .card .actions { margin-top: 12px; }
  details.scopenote { margin-top: 14px; }
  details.scopenote summary { cursor: pointer; color: var(--muted); font-size: .82rem; font-weight: 600; }
  details.scopenote summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .scopebody { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; font-size: .84rem; color: var(--muted); }
  .scopebody b { color: var(--ink); }
  .spinner { color: var(--muted); font-size: .9rem; margin-top: 20px; }
  .error { color: var(--red); margin-top: 14px; font-size: .92rem; }
  footer { margin-top: 60px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); padding-top: 16px; }

/* ---------- tool marketing pages ---------- */
.tp-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft);
           display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
h1.tp { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
        font-size: 2.3rem; font-weight: 600; margin: 12px 0 4px; line-height: 1.12; }
.tp-tagline { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 56ch; }
.tp-crumbs { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.tp-crumbs a { color: var(--accent); text-decoration: none; }
.tp-trust { display: flex; gap: 16px; flex-wrap: wrap; font-size: .76rem; color: var(--muted);
            font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-top: 14px; }
.tp-trust span::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.tp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
            gap: 10px; margin-top: 22px; }
.tp-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
           padding: 14px 16px; }
.tp-stat .n { font-size: 1.5rem; font-weight: 750; color: var(--accent);
              font-variant-numeric: tabular-nums; line-height: 1.15; }
.tp-stat .l { font-size: .78rem; color: var(--muted); margin-top: 3px; }
section.tp-sec { margin-top: 46px; }
.tp-sec h2 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
             font-size: 1.35rem; font-weight: 600; margin: 0 0 14px; }
.tp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.tp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
           padding: 13px 15px; display: flex; gap: 12px; align-items: flex-start; }
.tp-card .ic { flex: none; width: 38px; height: 38px; border-radius: 10px;
               background: var(--accent-soft); display: flex; align-items: center;
               justify-content: center; font-size: 1.1rem; }
.tp-card b { display: block; margin-bottom: 2px; }
.tp-card span { font-size: .85rem; color: var(--muted); }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tp-chip { font-size: .78rem; padding: 5px 12px; border-radius: 999px;
           border: 1px solid var(--border); background: var(--surface); }
.tp-chip::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.tp-get { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column;
          gap: 9px; max-width: 70ch; }
.tp-get li { padding-left: 26px; position: relative; }
.tp-get li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.tp-honest { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column;
             gap: 8px; max-width: 70ch; font-size: .92rem; color: var(--muted); }
.tp-honest li { padding-left: 24px; position: relative; }
.tp-honest li::before { content: "—"; position: absolute; left: 0; font-weight: 700; }
.tp-cta { display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
          font-weight: 650; padding: 13px 26px; border-radius: 10px; margin-top: 22px; }
.tp-cta:hover { filter: brightness(1.07); }
.tp-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-try-lead { color: var(--muted); font-size: .95rem; margin: 0 0 16px; max-width: 62ch; }
.tp-more a { color: var(--accent); text-decoration: none; margin-right: 16px; }
.tp-sample .screen { background: var(--code-bg); border: 1px solid var(--border);
   border-radius: 8px; padding: 14px 16px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
   font-size: .78rem; line-height: 1.6; display: flex; flex-direction: column; gap: 5px;
   margin-bottom: 16px; }
.tp-sample .mrow { display: flex; justify-content: space-between; gap: 12px; }
.tp-sample .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-sample .verdict { font-weight: 700; margin-top: 3px; }
.tp-sample .verdict.ok { color: var(--accent); }
.tp-sample .verdict.warn { color: var(--amber); }
.tp-sample .brow { display: flex; align-items: center; gap: 8px; }
.tp-sample .brow i { height: 8px; background: var(--accent); opacity: .75; border-radius: 2px; flex: none; }
.tp-sample .brow .num { margin-left: auto; }
