/* fruitllama.com — theme_01 Editorial Split-Column Reference */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #18181b;
  --accent: #1d4ed8;
  --muted: #52525b;
  --line: #e4e0d8;
  --ok: #15803d;
  --warn: #b45309;
  --fail: #b91c1c;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.6rem; margin: 0.2em 0 0.3em; }
h2 { font-size: 1.7rem; margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.5em; }
h4 { font-size: 1rem; margin: 1.4em 0 0.4em; font-family: var(--sans); }
p { margin: 0.5em 0; }
a { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: #f1ede6; padding: 0.1em 0.35em; border-radius: 3px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.header-row {
  max-width: 1180px; margin: 0 auto; padding: 0.7rem 1.25rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-dot { color: var(--accent); }
.site-nav a { color: var(--ink); text-decoration: none; margin-left: 1.1rem; font-size: 0.92rem; }
.site-nav a:hover { color: var(--accent); }

/* ---------- disclosure banner (above the fold) ---------- */
.disclosure-banner {
  background: #fff7ed; border-bottom: 1px solid #fed7aa; color: #7c2d12;
  font-size: 0.85rem;
}
.banner-inner { max-width: 1180px; margin: 0 auto; padding: 0.45rem 1.25rem; }
.disclosure-banner a { color: #9a3412; }

/* ---------- theme_01 split layout ---------- */
.layout {
  max-width: 1180px; margin: 0 auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem;
}
.toc-rail { position: sticky; top: 4.2rem; align-self: start; padding: 1.6rem 0; }
.rail-title { font-family: var(--serif); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 0.6rem; }
.toc-rail nav { display: flex; flex-direction: column; gap: 0.15rem; }
.toc-rail nav a {
  color: var(--muted); text-decoration: none; font-size: 0.88rem;
  padding: 0.28rem 0.6rem; border-left: 2px solid var(--line); border-radius: 0 4px 4px 0;
}
.toc-rail nav a:hover { color: var(--accent); border-left-color: var(--accent); }
.rail-meta { margin-top: 1.4rem; font-size: 0.78rem; color: var(--muted); }
.workbench { min-width: 0; padding: 1.6rem 0 3rem; }

.hero { padding: 1.2rem 0 2rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.kicker { color: var(--accent); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin: 0; }
.lede { font-size: 1.08rem; color: #3f3f46; max-width: 62ch; }
.section { margin-bottom: 2.6rem; }

/* ---------- workbench modules ---------- */
.module {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.2rem 1.4rem; margin: 1.2rem 0;
}
.mod-num { color: var(--accent); font-family: var(--sans); font-size: 0.8rem; font-weight: 700; margin-right: 0.4rem; }
.muted { color: var(--muted); font-size: 0.88rem; }
.error-line { color: var(--fail); font-size: 0.9rem; min-height: 1.3em; margin: 0.5rem 0 0; }

.preset-row { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; font-size: 0.9rem; }
.preset-row select {
  font: inherit; padding: 0.35rem 0.6rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--ink); max-width: 34rem;
}
.config-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem;
}
.config-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.config-grid input, .config-grid select {
  font: inherit; font-size: 0.95rem; color: var(--ink); padding: 0.45rem 0.6rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
.config-grid input:focus, .config-grid select:focus, .preset-row select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

/* ---------- metrics ---------- */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem;
  margin: 1.2rem 0;
}
.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.metric-k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.metric-v { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.metric-v.ok { color: var(--ok); }
.metric-v.warn { color: var(--warn); }
.metric-v.fail { color: var(--fail); }

/* ---------- chart ---------- */
.chart-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.chart-btn {
  font: inherit; font-size: 0.82rem; padding: 0.35rem 0.8rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink);
}
.chart-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart { width: 100%; height: 300px; display: block; }
.chart .axis { stroke: var(--line); }
.chart .grid { stroke: #efece6; stroke-dasharray: 3 3; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart text { font-family: var(--sans); font-size: 11px; fill: var(--muted); }

/* ---------- checklist & tables ---------- */
.checklist { list-style: none; margin: 0.6rem 0 1.2rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.checklist li {
  display: flex; gap: 0.7rem; align-items: baseline; font-size: 0.92rem;
  padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
.checklist .cid { font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--accent); min-width: 2.4rem; }
.checklist .cstatus { margin-left: auto; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.checklist .pass .cstatus { color: var(--ok); }
.checklist .warn .cstatus { color: var(--warn); }
.checklist .fail .cstatus { color: var(--fail); }
.checklist .cdetail { color: var(--muted); font-size: 0.85rem; }

.edge-table, .data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 0.6rem 0 1rem; }
.edge-table th, .edge-table td, .data-table th, .data-table td {
  text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line);
}
.edge-table th, .data-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.edge-table td:last-child { font-weight: 700; }
.edge-table .ok { color: var(--ok); }
.edge-table .error { color: var(--fail); }
.data-table { background: var(--surface); }

/* ---------- presets ---------- */
.preset-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.preset-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; }
.preset-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0; }

/* ---------- export ---------- */
.export-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.8rem; }
.export-row button, #btn-copy {
  font: inherit; font-size: 0.88rem; padding: 0.5rem 1rem; cursor: pointer;
  border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff;
}
.export-row button + button, #btn-copy { background: var(--surface); color: var(--accent); }
.export-row button:hover, #btn-copy:hover { opacity: 0.9; }
.receipt {
  background: #18181b; color: #e4e4e7; font-family: ui-monospace, monospace; font-size: 0.78rem;
  padding: 1rem; border-radius: 8px; overflow-x: auto; max-height: 320px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-all;
}

/* ---------- faq ---------- */
details { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
details summary { cursor: pointer; font-weight: 600; font-family: var(--serif); font-size: 1.05rem; }
details p { color: #3f3f46; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.25rem; font-size: 0.88rem; color: var(--muted); }
.footer-inner p { margin: 0.3rem 0; }
.site-footer nav a { color: var(--muted); margin-right: 1.2rem; text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); }

/* ---------- legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.25rem; margin-top: 1.8rem; }
.legal p, .legal li { color: #3f3f46; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc-rail { position: static; padding: 1rem 0 0; }
  .toc-rail nav { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
  .toc-rail nav a { border-left: none; border-bottom: 2px solid var(--line); border-radius: 0; padding: 0.3rem 0.5rem; }
  .rail-meta { display: none; }
  h1 { font-size: 2rem; }
}
