/* failtoprepare.com — theme_04 Warm Paper Field Dossier */
:root {
  --bg: #f5efe6;
  --surface: #fffdf9;
  --surface-2: #f3ead9;
  --ink: #292524;
  --accent: #b45309;
  --accent-dim: #92400e;
  --accent-soft: #f7e7d7;
  --muted: #57534e;
  --line: #d8cbb8;
  --warn: #b45309;
  --fail: #991b1b;
  --info: #1d4ed8;
  --ok: #166534;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(180, 83, 9, 0.045), transparent 220px),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
}
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

details summary { cursor: pointer; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 14px; z-index: 100;
  font-family: var(--mono); text-decoration: none; border-radius: 999px;
}
.skip-link:focus { left: 8px; top: 8px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 30px; padding: 0 8px;
  border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 12px; font-weight: 800;
}
.brand-name { font-family: var(--serif); font-weight: 800; letter-spacing: 0.02em; font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 13px; font-family: var(--serif); font-style: italic; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav a {
  color: var(--ink); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: 999px;
}
.topnav a:hover { background: var(--surface-2); color: var(--accent); }

.disclosure-strip {
  background: var(--accent-soft);
  border-bottom: 1px solid #e7c9a8;
  color: #6f3d08;
  font-size: 13px;
  padding: 9px 22px;
}
.disclosure-strip a { color: var(--accent-dim); }

main { max-width: 1220px; margin: 0 auto; padding: 28px 22px 64px; }

.hero { margin-bottom: 30px; max-width: 940px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  margin: 0 0 14px;
  line-height: 1.08;
}
.hero h1 .accent { color: var(--accent); }
.hero p { max-width: 78ch; color: var(--muted); margin: 0 0 10px; font-size: 16px; }
.archive-note {
  border-left: 3px solid var(--accent);
  background: rgba(180, 83, 9, 0.06);
  padding: 10px 14px;
  color: var(--ink);
  font-size: 13px;
}
.hero .meta {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px;
}

section { margin: 38px 0; }
h2 { font-size: 27px; margin: 0 0 8px; color: var(--ink); }
h2 .idx { color: var(--accent); margin-right: 10px; font-family: var(--mono); font-size: 15px; }
.section-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 84ch; }

.dossier {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(41, 37, 36, 0.08);
  overflow: hidden;
}
.tabbar {
  display: flex; gap: 8px; padding: 14px 18px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.tabbtn {
  appearance: none; border: 1px solid transparent; background: transparent;
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  color: var(--muted); padding: 10px 18px; border-radius: 999px 999px 0 0;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.tabbtn .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--muted);
  font-family: var(--mono); font-size: 11px;
}
.tabbtn.active { color: var(--accent); background: var(--surface); border-color: var(--line); border-bottom-color: var(--surface); }
.tabbtn.active .n { background: var(--accent); color: #fff; }
.tabbtn.done { color: var(--ok); }
.tabbtn.done .n { background: var(--ok); color: #fff; }

.progress-wrap { padding: 12px 18px 0; }
.progress-track {
  height: 8px; background: #e8dcc8; border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 25%; background: var(--accent);
  border-radius: 999px; transition: width 0.25s ease;
}
.step-status {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em;
}

.worksheet { padding: 20px 18px 10px; }
.worksheet[hidden] { display: none; }

.console {
  display: grid;
  grid-template-columns: minmax(340px, 470px) 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1020px) { .console { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.panel h3 {
  font-size: 18px; margin: 0 0 12px;
  color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 9px;
}
.panel h4.subhead { margin: 14px 0 8px; font-size: 14px; color: var(--ink); }

.field { margin-bottom: 12px; }
.field label {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); font-weight: 700;
  margin-bottom: 5px;
}
.field label output { color: var(--accent); font-family: var(--mono); }
.field input[type="range"], .field select {
  width: 100%; accent-color: var(--accent);
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
  font-size: 13px;
}
select { border-radius: 14px !important; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.check-field {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--ink); margin-bottom: 6px; cursor: pointer;
}
.check-field input { accent-color: var(--accent); width: 16px; height: 16px; }

@media (max-width: 900px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row, .check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
}

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.btn {
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: var(--sans);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dim); color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn[disabled]:hover { border-color: var(--line); color: var(--ink); }

.telemetry { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin-bottom: 14px; }
.readout {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.readout .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.readout .v { font-family: var(--mono); font-size: 17px; color: var(--accent); margin-top: 2px; }
.readout .v.warn { color: var(--warn); }
.readout .v.fail { color: var(--fail); }
.readout .u { font-size: 11px; color: var(--muted); }

.gauge-wrap { margin: 6px 0 14px; }
.gauge-wrap svg { width: 100%; height: auto; display: block; }
.gauge-label { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; font-family: var(--mono); }

.dimension-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.dimension {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.dimension .dk { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.dimension .dv { font-family: var(--mono); color: var(--accent); font-size: 14px; margin: 4px 0 7px; }
.dimension .track { height: 7px; background: #e8dcc8; border-radius: 999px; overflow: hidden; }
.dimension .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.dimension .fill.warn { background: var(--warn); }
.dimension .fill.fail { background: var(--fail); }

.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 8px; font-family: var(--mono); }
.chart-legend span::before { content: "■ "; }
.chart-legend .l1::before { color: var(--accent); }
.chart-legend .l2::before { color: var(--warn); }
.chart-legend .l3::before { color: var(--info); }

.audit { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit th, .audit td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 0.07em; }
.audit-wrap { overflow-x: auto; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
}
.badge.pass { background: #dcfce7; color: #166534; }
.badge.fail { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.info { background: #dbeafe; color: #1d4ed8; }

.verdict-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.verdict-row .k { font-size: 12px; color: var(--muted); font-weight: 700; }

.export-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.receipt {
  margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-family: var(--mono); font-size: 11px;
  white-space: pre-wrap; word-break: break-all; color: var(--muted);
  max-height: 280px; overflow: auto;
}
.receipt .sha { color: var(--accent); }

.print-card {
  border: 1px dashed var(--accent);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}
.print-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
}
.print-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin: 0;
}
.print-grid div { min-width: 0; }
.print-grid dt { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.print-grid dd { margin: 2px 0 0; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.print-note { margin: 12px 0 0; font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .print-grid { grid-template-columns: 1fr 1fr; } }

.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ref-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.ref-card h3 { font-size: 17px; color: var(--accent); margin: 0 0 8px; }
.ref-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ref-card td, .ref-card th { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ref-card th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.ref-card p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.prose { max-width: 78ch; color: var(--muted); }
.prose h3 { color: var(--ink); font-size: 19px; }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; color: var(--accent); font-size: 12px; }
.prose ul { padding-left: 20px; }

footer.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 26px 22px 40px; margin-top: 42px;
}
.footer-inner { max-width: 1220px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner .col { font-size: 12px; color: var(--muted); }
.footer-inner .col a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.footer-inner .col a:hover { color: var(--accent); }
.footer-inner .legal { margin-top: 10px; }

@media print {
  body * { visibility: hidden; }
  .print-card, .print-card * { visibility: visible; }
  .print-card {
    position: absolute; inset: 0 auto auto 0; width: 100%;
    border: 1px solid #999; box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-fill { transition: none; }
}
