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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .9rem;
  padding-bottom: .9rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand-tld { color: var(--accent); }
.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--muted);
  text-decoration: none;
  padding: .3rem .55rem;
  border-radius: 4px;
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--ink);
  background: #f0e8db;
  outline: none;
}
.site-nav a:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- Dossier sheet ---------- */
.dossier { padding-top: 1.5rem; padding-bottom: 3rem; }

.disclosure-banner {
  background: #f7e8d4;
  border: 1px solid #e3c9a4;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: .8rem 1rem;
  font-family: var(--sans);
  font-size: .86rem;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.disclosure-banner a { color: var(--accent); }

.hero { margin-bottom: 2.25rem; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 .6rem;
  letter-spacing: -.02em;
}
.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 44rem;
  margin: 0 0 1rem;
}
.fact-row {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: .88rem;
  color: var(--muted);
}
.fact-row strong { color: var(--ink); font-size: 1.15rem; display: block; }

/* ---------- Worksheets / panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 #e7ddcc, 0 8px 24px rgba(41, 37, 36, .05);
  padding: 1.5rem 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
}
.panel h2 {
  font-size: 1.45rem;
  margin: 0 0 .4rem;
  letter-spacing: -.01em;
}
.panel h3 {
  font-size: 1.12rem;
  margin: 1.4rem 0 .5rem;
  font-family: var(--sans);
  font-weight: 600;
}
.panel-note {
  color: var(--muted);
  font-size: .95rem;
  margin: 0 0 1.25rem;
  max-width: 46rem;
}

.worksheet-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: .6rem;
}
.tab {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .7rem;
  background: transparent;
}
.tab-active { color: var(--accent); border-color: var(--accent); background: #faf3e8; }

/* ---------- Workbench grid ---------- */
.workbench-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 60rem) {
  .workbench-grid { grid-template-columns: 1fr; }
}

.controls { display: grid; gap: .9rem; }
.rule {
  background: #faf6ee;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .7rem .8rem;
}
.rule-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .35rem;
}
.rule-head label {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
}
.rule-value {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rule input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 1.4rem;
}
.rule-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: .68rem;
  color: var(--muted);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--sans);
  font-size: .82rem;
}
th, td {
  text-align: left;
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-dim { color: var(--muted); font-size: .72rem; }

.rubric-bar {
  display: inline-block;
  width: 4.5rem;
  height: .5rem;
  background: #efe7d8;
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: .4rem;
}
.rubric-bar span { display: block; height: 100%; background: var(--accent); }

.rule-badges { display: inline-flex; flex-wrap: wrap; gap: .25rem; max-width: 22rem; }
.badge {
  font-size: .66rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-ok { color: var(--ok); border-color: #b7d9c4; background: #eef7f0; }
.badge-no { color: var(--no); border-color: #e5b8b8; background: #fbeeee; }

.verdict-pass { color: var(--ok); font-weight: 700; white-space: nowrap; }
.verdict-fail { color: var(--no); font-weight: 700; white-space: nowrap; }
.error { color: var(--no); font-family: var(--sans); font-size: .85rem; }

/* ---------- Chart ---------- */
.chart-figure { margin: 0; }
#tradeoff-chart {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.chart-grid { stroke: #ece4d4; stroke-width: 1; }
.chart-axis { stroke: var(--ink); stroke-width: 1.4; }
.chart-label { fill: var(--muted); font-family: var(--sans); font-size: 12px; }
.chart-point { fill: var(--accent); fill-opacity: .82; stroke: var(--surface); stroke-width: 1.5; }
.chart-point.fail { stroke-dasharray: 4 3; stroke: var(--no); fill-opacity: .5; }
.chart-point-label { fill: var(--ink); font-family: var(--sans); font-size: 11px; }
figcaption {
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--muted);
  margin-top: .5rem;
}

/* ---------- Checklist ---------- */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem;
  font-family: var(--sans);
  font-size: .9rem;
}
.checklist li {
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf6ee;
  position: relative;
  padding-left: 2.2rem;
}
.checklist li::before {
  content: "○";
  position: absolute;
  left: .8rem;
  color: var(--muted);
  font-weight: 700;
}
.checklist li[data-verified="true"]::before { content: "●"; color: var(--ok); }
.checklist li[data-verified="false"]::before { content: "✕"; color: var(--no); }
.checklist code { font-size: .85em; background: #f0e8db; padding: .05em .3em; border-radius: 3px; }

/* ---------- Export ---------- */
.export-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.btn {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  padding: .55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffdf9;
  cursor: pointer;
}
.btn:hover { background: #9a4708; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-ghost:hover { background: #faf3e8; }
.receipt {
  background: var(--ink);
  color: #efe7d8;
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--sans);
  font-size: .72rem;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 26rem;
  margin: 0;
}

/* ---------- Methodology ---------- */
#methodology p { max-width: 46rem; }
#methodology code { font-size: .9em; background: #f0e8db; padding: .05em .3em; border-radius: 3px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 1.25rem 0 2rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover, .footer-nav a:focus-visible { color: var(--accent); }
.footer-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Legal pages ---------- */
main.legal { padding-top: 2rem; padding-bottom: 3rem; }
main.legal h1 { font-size: 1.8rem; margin: 0 0 .8rem; }
main.legal h2 { font-size: 1.15rem; margin: 1.4rem 0 .4rem; font-family: var(--sans); }
main.legal p, main.legal li { max-width: 44rem; }
main.legal ul { padding-left: 1.2rem; }
main.legal a { color: var(--accent); }

/* ---------- Print: collapse to a single summary card ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-nav, .disclosure-banner, .worksheet-tabs,
  .controls, .export-row, #receipt-out, .site-footer, .btn { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .panel { border: none; box-shadow: none; padding: 0; margin-bottom: 1rem; page-break-inside: avoid; }
  .panel h2 { font-size: 13pt; }
  table { font-size: 8pt; }
  #tradeoff-chart { max-height: 10rem; }
  .hero h1 { font-size: 16pt; }
  .lede { font-size: 10pt; }
}
