/* chillin.one — theme_04: Warm Paper Field Dossier
   bg #f5efe6 · surface #fffdf9 · ink #292524 · accent #b45309 · muted #57534e
   Serif dossier typography (Iowan Old Style / Palatino / Georgia) with clean
   sans-serif form controls. */

:root {
  --bg: #f5efe6;
  --surface: #fffdf9;
  --surface-2: #efe7d8;
  --ink: #292524;
  --accent: #b45309;
  --accent-dim: #92400e;
  --muted: #57534e;
  --line: #ddd3c2;
  --ok: #15803d;
  --warn: #b45309;
  --fail: #b91c1c;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.mono, code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.92em; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- disclosure bar (above the fold) ---- */
.disclosure-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--sans);
  padding: 0.5rem 1rem;
  text-align: center;
}
.disclosure-bar strong { color: var(--accent-dim); }

/* ---- hero ---- */
.hero { max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.25rem 1.25rem; }
.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-family: var(--sans); margin: 0 0 0.5rem; }
.hero h1 { margin: 0 0 0.75rem; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; font-weight: 600; }
.accent { color: var(--accent); }
.lede { max-width: 62ch; color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---- tabs (field worksheets) ---- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  max-width: 1080px; margin: 1rem auto 0; padding: 0 1.25rem;
}
.tab {
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0; padding: 0.55rem 1.1rem;
  font: inherit; font-family: var(--sans); font-size: 0.92rem; cursor: pointer;
}
.tab.active { background: var(--bg); color: var(--ink); border-color: var(--accent); position: relative; top: 1px; }
.tab:hover { color: var(--ink); }

main { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem 3rem; }

.tabpane {
  display: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 1.25rem;
}
.tabpane.active { display: block; }

/* ---- asymmetric 65/35 workbench + sticky inspector ---- */
.workbench {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 1rem;
  align-items: start;
}
.inspector { position: sticky; top: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(41, 37, 36, 0.08);
}
.card h2, .card h3 { margin-top: 0; font-size: 1.15rem; font-weight: 600; }
.reference { margin-top: 1.5rem; }
.reference ul { padding-left: 1.2rem; }
.reference li { margin-bottom: 0.4rem; }

.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.75rem 0; }
.row label { color: var(--muted); font-size: 0.9rem; font-family: var(--sans); display: inline-flex; gap: 0.4rem; align-items: center; }

textarea, input[type="number"], select {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
}
select { font-family: var(--sans); }
textarea { width: 100%; resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); }

button {
  font: inherit; font-family: var(--sans); font-size: 0.92rem; cursor: pointer;
  border-radius: 6px; padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fffdf9; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { color: var(--ink); border-color: var(--muted); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.hint { color: var(--muted); font-size: 0.85rem; }

/* ---- output blocks ---- */
.out {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  overflow-x: auto;
}
.out table { border-collapse: collapse; width: 100%; }
.out th, .out td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.out th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--sans); }

.badge { display: inline-block; padding: 0.1em 0.55em; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid; font-family: var(--sans); }
.badge.pass, .badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.fail, .badge.bad { color: var(--fail); border-color: var(--fail); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.info, .badge.manual { color: var(--muted); border-color: var(--muted); }
.badge.grade { color: var(--accent-dim); border-color: var(--accent); font-size: 1.1rem; padding: 0.15em 0.7em; }

/* ---- inspector dl ---- */
.inspector dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; margin: 0; font-size: 0.9rem; }
.inspector dt { color: var(--muted); }
.inspector dd { margin: 0; }
.inspector-note { margin-top: 1rem; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }

/* ---- chart ---- */
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; overflow-x: auto; }
.chart-wrap svg { display: block; max-width: 100%; height: auto; }
.axis { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--muted); font-size: 11px; font-family: ui-monospace, monospace; }
.bubble { fill: var(--accent); fill-opacity: 0.55; stroke: var(--accent); stroke-width: 1.5; }
.bubble.pareto { stroke: var(--ink); stroke-width: 2; fill-opacity: 0.8; }
.bubble-label { fill: var(--ink); font-size: 11px; font-family: var(--serif); }
.grid-line { stroke: #e9e0d0; stroke-width: 1; stroke-dasharray: 3 4; }

/* ---- table wrap ---- */
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
.table-wrap th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--sans); }
.table-wrap tr.pareto-row td { color: var(--accent-dim); font-weight: 600; }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem; padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted); font-size: 0.85rem; text-align: center;
}
.site-footer nav a { color: var(--muted); margin: 0 0.4rem; }
.site-footer nav a:hover { color: var(--accent); }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; }
  .inspector { position: static; }
}
