/* Metropolitandiagnostic — theme_11 Terracotta Workshop Guide */
:root {
  --bg: #fbf7f4;
  --surface: #ffffff;
  --ink: #271c19;
  --accent: #c2410c;
  --accent-soft: #fde8d7;
  --muted: #6b5b53;
  --line: #e8ddd6;
  --ok: #2f6b3a;
  --warn: #9a5b00;
  --bad: #a01d1d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(39,28,25,.06), 0 4px 14px rgba(39,28,25,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
  margin: 0 0 .5em;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 99; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand .accent { color: var(--accent); }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

/* Disclosure banner (above the fold, always visible) */
.disclosure-banner {
  background: var(--accent-soft);
  border-bottom: 1px solid #f3d3b3;
  font-size: .9rem;
  color: var(--ink);
}
.disclosure-banner .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.disclosure-banner strong { font-family: Georgia, serif; }
.disclosure-banner a { font-weight: 600; }

/* Hero */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: 2.2rem; max-width: 18ch; }
.hero p.lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; margin: 0; }
.hero .meta { margin-top: 14px; font-size: .85rem; color: var(--muted); }

/* Wizard shell */
.workbench {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 32px 0;
  overflow: hidden;
}
.wizard-steps { display: flex; border-bottom: 1px solid var(--line); background: #fdfaf8; overflow-x: auto; }
.step-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 14px 18px; font: inherit; font-size: .95rem; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap;
  display: flex; gap: 8px; align-items: center;
}
.step-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.step-num {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--line); color: var(--ink); font-size: .75rem; font-weight: 700;
}
.step-tab[aria-selected="true"] .step-num { background: var(--accent); color: #fff; }
.step-tab .step-state { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }

.progress-track { height: 6px; background: var(--line); }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .25s ease; }

.wizard-panels { padding: 28px; }
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel h2 { font-size: 1.5rem; }
.step-panel .hint { color: var(--muted); font-size: .92rem; max-width: 70ch; }

/* Forms */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 18px 0; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.field .unit { font-weight: 400; color: var(--muted); }
.field input, .field select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.field .err { color: var(--bad); font-size: .82rem; min-height: 1.2em; }
.field.invalid input { border-color: var(--bad); }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.preset-row button {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; cursor: pointer;
}
.preset-row button:hover, .preset-row button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }

/* Results + chart */
.results-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
@media (min-width: 820px) { .results-grid { grid-template-columns: 1.2fr .8fr; } }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card h3 { font-size: 1.15rem; margin-bottom: .4em; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .k { color: var(--muted); }
.stat-row .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.stat-row .v.good { color: var(--ok); }
.stat-row .v.warn { color: var(--warn); }
.stat-row .v.bad { color: var(--bad); }

svg.chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.lg-lat::before { background: var(--accent); }
.lg-cost::before { background: var(--warn); }
.lg-tput::before { background: var(--ok); }

/* Checklist */
.checklist { list-style: none; margin: 16px 0; padding: 0; }
.checklist li {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--bg);
}
.checklist li.pass { border-left: 4px solid var(--ok); }
.checklist li.fail { border-left: 4px solid var(--bad); }
.checklist .mark { font-weight: 700; flex: none; }
.checklist li.pass .mark { color: var(--ok); }
.checklist li.fail .mark { color: var(--bad); }
.checklist .why { font-size: .85rem; color: var(--muted); display: block; }
.checklist select { margin-left: auto; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: 8px; padding: 11px 20px; background: var(--accent); color: #fff;
}
.btn:hover { background: #a03808; }
.btn.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Export receipt */
.receipt {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .8rem; background: #241c18; color: #e9ded7; border-radius: 8px;
  padding: 16px; overflow-x: auto; white-space: pre; margin-top: 14px;
}
.export-status { font-size: .85rem; color: var(--ok); min-height: 1.4em; }

/* Reference sections */
section.ref { padding: 40px 0 8px; }
section.ref h2 { font-size: 1.7rem; border-bottom: 2px solid var(--line); padding-bottom: .3em; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.ref-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.ref-card h3 { font-size: 1.05rem; margin-bottom: .3em; }
.ref-card p { font-size: .9rem; color: var(--muted); margin: 0; }
table.dataset { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.dataset th, table.dataset td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.dataset th { background: #fdf3ec; font-family: Georgia, serif; }
table.dataset tr:last-child td { border-bottom: 0; }
table.dataset td.num, table.dataset th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: grid; gap: 20px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; margin-bottom: .5em; }
.site-footer p, .site-footer li { font-size: .88rem; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.copyright { font-size: .82rem; color: var(--muted); margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* Legal pages reuse same tokens */
.legal-body { padding: 40px 0 20px; max-width: 72ch; }
.legal-body h1 { font-size: 2rem; }
.legal-body h2 { font-size: 1.3rem; margin-top: 1.6em; }
.legal-body p, .legal-body li { color: #3a2f2b; }
.legal-body ul { padding-left: 1.4em; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
