/* theme_04 — Warm Paper Field Dossier
   bg #f5efe6 / surface #fffdf9 / ink #292524 / accent #b45309 / muted #57534e */
:root {
  --bg: #f5efe6;
  --surface: #fffdf9;
  --ink: #292524;
  --accent: #b45309;
  --muted: #57534e;
  --line: #d6cdbd;
  --pass: #166534;
  --fail: #991b1b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
}

/* ---- page scaffold ---------------------------------------------------- */
.sheet {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}
.masthead {
  border-bottom: 3px double var(--accent);
  padding: 2.2rem 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}
.masthead h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 0;
  letter-spacing: 0.01em;
}
.masthead .stamp {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.3rem 0.7rem;
  background: var(--surface);
}
.lede { max-width: 68ch; color: var(--ink); }
.lede em { color: var(--accent); font-style: italic; }

/* ---- disclosure banner (above the fold) -------------------------------- */
.disclosure-banner {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-left: 6px solid var(--accent);
  padding: 0.8rem 1rem;
  margin: 1.2rem 0 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
}
.disclosure-banner strong { color: var(--accent); }
.disclosure-banner a { color: var(--accent); }

/* ---- tabs ---------------------------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 2rem 0 0;
  border-bottom: 2px solid var(--accent);
}
.tab-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.6rem 1.1rem;
  margin-right: 0.25rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}
.tab-btn[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--accent);
  border-bottom: 2px solid var(--surface);
  margin-bottom: -2px;
}
.tab-btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- worksheet card ------------------------------------------------------ */
.worksheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  padding: 1.4rem 1.5rem 1.8rem;
  box-shadow: 0 1px 0 rgba(41, 37, 36, 0.06);
}
.worksheet h2 {
  font-size: 1.25rem;
  margin: 0 0 0.3rem;
  color: var(--accent);
}
.worksheet .sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.2rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.9rem; }
.field label { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em; }
.field input, .field select {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
}
.field .hint { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }

button.primary {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #fffdf9;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 4px;
  cursor: pointer;
}
button.primary:hover { background: #92400e; }
button.secondary {
  font-family: var(--sans);
  font-size: 0.85rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

/* ---- verdict / score ------------------------------------------------------ */
.verdict {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--line);
  background: var(--bg);
  font-family: var(--sans);
}
.verdict .score { font-size: 2.2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.verdict .verdict-label { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em; }
.verdict .verdict-ready .verdict-label { color: var(--pass); }
.verdict .verdict-near .verdict-label { color: #a16207; }
.verdict .verdict-gaps .verdict-label { color: var(--accent); }
.verdict .verdict-no .verdict-label { color: var(--fail); }

.check-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.check-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--line);
  font-family: var(--sans);
  font-size: 0.88rem;
}
.check-list li .state { font-weight: 700; }
.check-list li.pass .state { color: var(--pass); }
.check-list li.fail .state { color: var(--fail); }
.check-list li small { color: var(--muted); }

/* ---- SVG chart ------------------------------------------------------------ */
.chart-wrap { overflow-x: auto; }
.chart-wrap svg { width: 100%; min-width: 560px; height: auto; display: block; }
.chart-legend { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }
.chart-tip {
  font-family: var(--sans);
  font-size: 0.82rem;
  background: var(--ink);
  color: var(--surface);
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.6rem;
}

/* ---- results table ---------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.88rem;
  margin-top: 1rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
table.data th { color: var(--accent); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.pill.pareto { background: #fef3c7; color: #92400e; }
.pill.ok { background: #dcfce7; color: var(--pass); }
.pill.bad { background: #fee2e2; color: var(--fail); }

/* ---- export ------------------------------------------------------------------ */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
pre.receipt {
  background: var(--ink);
  color: #e7e5e4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 4px;
}
.hash-line { font-family: ui-monospace, monospace; font-size: 0.8rem; color: var(--accent); word-break: break-all; }

/* ---- dossier sections --------------------------------------------------------- */
.dossier-section { margin-top: 2.5rem; }
.dossier-section h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.3rem;
}
.dossier-section h3 { font-size: 1.05rem; color: var(--accent); margin-bottom: 0.3rem; }
.dossier-section p, .dossier-section li { max-width: 72ch; }
.arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.arch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
}
.arch-card h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.arch-card .metrics { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }

/* ---- printable summary card ------------------------------------------------------ */
.print-card {
  border: 2px solid var(--ink);
  background: var(--surface);
  padding: 1.2rem 1.4rem;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
}
.print-card h3 { margin: 0 0 0.5rem; font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; }
.print-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; margin: 0; }
.print-card dt { font-weight: 700; }
.print-card dd { margin: 0; }
@media print {
  body { background: #fff; }
  .tabs, .tab-btn, .no-print { display: none !important; }
  .tab-panel { display: block !important; }
  .worksheet { border: none; box-shadow: none; }
  .sheet { max-width: none; }
}

/* ---- legal pages ------------------------------------------------------------------ */
.legal-body { max-width: 70ch; }
.legal-body h2 { color: var(--accent); font-size: 1.15rem; margin-top: 1.6rem; }
.legal-body p, .legal-body li { font-size: 0.98rem; }
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.site-footer a { color: var(--accent); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead h1 { font-size: 1.5rem; }
  .worksheet { padding: 1rem; }
}
