:root {
  --bg: #f7f5f1;
  --card: #ffffff;
  --border: #e3ddd1;
  --fg: #1c1917;
  --fg-secondary: #57534e;
  --fg-muted: #736a5d;
  --primary: #b8481f;
  --primary-dim: rgba(184, 72, 31, 0.08);
  --primary-glow: rgba(184, 72, 31, 0.04);
  --accent: #b8481f;
  --green: #15803d;
  --red: #b91c1c;
  --yellow: #b45309;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --surface-mid: #efece4;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px;
       line-height: 1.55; padding: 2rem 1rem 3rem; }
.page { max-width: 1180px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
h1 { font-size: 1.9rem; margin-bottom: .5rem; }
h2 { font-size: 1.3rem; margin: 2.2rem 0 .6rem; padding-bottom: .3rem; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.02rem; margin: 1.2rem 0 .4rem; color: var(--fg-secondary); }
p { margin: .35rem 0; }
.lead { color: var(--fg-secondary); }
.warn { border-left: 4px solid var(--yellow); background: var(--card); padding: .6rem .9rem; margin: .8rem 0;
        border-radius: 6px; }
.intro { color: var(--fg-muted); font-size: .9rem; }
.block { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1.1rem;
         margin: .8rem 0; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .84rem; margin-top: .6rem; }
th { text-align: left; padding: .4rem .55rem; border-bottom: 2px solid var(--border); color: var(--fg-secondary);
     font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; vertical-align: bottom; }
td { padding: .35rem .55rem; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:nth-child(even) { background: var(--surface-mid); }
td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cap { color: var(--fg-muted); font-size: .8rem; font-style: italic; }
.stats { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: .7rem 1.2rem; min-width: 120px; }
.stat .v { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--fg-muted); font-size: .78rem; }
.stat.red .v { color: var(--red); }
.stat.yellow .v { color: var(--yellow); }
.stat.green .v { color: var(--green); }
details.acc { border: 1px solid var(--border); border-radius: 8px; background: var(--card); margin: .75rem 0; }
details.acc > summary { cursor: pointer; list-style: none; user-select: none; display: flex; align-items: center; gap: .75rem;
                        padding: .8rem 1.1rem; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: "\203a"; color: var(--fg-muted); font-size: 1.4rem; line-height: 1; flex: none;
                                transition: transform .15s ease; }
details.acc[open] > summary::before { transform: rotate(90deg); }
details.acc > summary:hover::before, details.acc > summary:focus-visible::before { color: var(--primary); }
details.acc > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
details.acc > summary h2 { margin: 0; padding: 0; border: 0; font-size: 1.2rem; flex: 1; }
details.acc > summary .count { color: var(--fg-muted); font-size: .8rem; white-space: nowrap; }
details.acc > .acc-body { padding: 0 1.1rem 1rem; }
details.acc > .acc-body > .block { border: 0; background: transparent; padding: .2rem 0; margin: .5rem 0; }
details.acc.lvl2 { background: var(--surface-mid); margin: .6rem 0 0; }
details.acc.lvl2 > summary { padding: .45rem .8rem; font-size: .85rem; color: var(--primary); }
details.acc.lvl2 > summary::before { font-size: 1.1rem; }
details.acc.lvl2 > .acc-body { padding: 0 .8rem .8rem; }
footer { margin-top: 3rem; color: var(--fg-muted); font-size: .78rem; }
@media print {
  body { background: var(--card); padding: 0; }
  .block { break-inside: avoid; border: none; padding: 0; }
  details.acc { border: none; }
  details.acc > summary::before { display: none; }
}
/* A paper copy shows every section: a closed details element hides its body in print unless the browser is told otherwise.
   Its own rule, because a browser that does not know the pseudo-element drops the whole rule it sits in. */
@media print {
  details.acc:not([open])::details-content { display: block; content-visibility: visible; }
}
/* "Show every section": a checkbox before the sections, no script. Ticked, every closed section's body is shown; unticked, each section
   is back to how it was opened or closed. Only offered to a browser that knows the details-content pseudo-element. */
.fz-all, .fz-tool { display: none; }
@supports selector(details::details-content) {
  .fz-all { display: block; position: absolute; opacity: 0; pointer-events: none; }
  .fz-tool { display: inline-block; cursor: pointer; margin: .4rem 0 .2rem; padding: .35rem .85rem; border: 1px solid var(--border);
             border-radius: 6px; background: var(--card); color: var(--fg-secondary); font-size: .85rem; user-select: none; }
  .fz-tool:hover { border-color: var(--primary); color: var(--primary); }
  .fz-all:focus-visible + .fz-tool { outline: 2px solid var(--primary); outline-offset: 2px; }
  .fz-all:checked + .fz-tool { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
  .fz-all:checked ~ details.acc > summary::before { transform: rotate(90deg); }
}
@supports selector(details::details-content) {
  .fz-all:checked ~ details.acc::details-content { display: block; content-visibility: visible; }
}
@media print { .fz-all, .fz-tool { display: none; } }

/* the note bar above a sample report; same tokens as the report */
.sample-note { margin: 0; padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--border);
               color: var(--fg-secondary); font-size: .85rem; }
.sample-note a { color: var(--primary); }
