/* kelleyscoins.com — theme_03: Swiss Grid Technical Ledger */
:root {
  --bg: #f4f4f0;
  --surface: #ffffff;
  --ink: #111111;
  --accent: #d9381e;
  --muted: #4b5563;
  --hairline: #111111;
  --good: #1a7f37;
  --bad: #b3261e;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono, code, .num, output { font-family: "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding: 2.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.masthead { max-width: 60ch; }
.kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
h1 .accent { color: var(--accent); }
.tagline { color: var(--muted); margin: 0; max-width: 56ch; }

.topnav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.topnav a {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.4rem 0.7rem;
  background: var(--surface);
}
.topnav a:hover { background: var(--ink); color: var(--bg); }

/* ---------- disclosure strip ---------- */
.disclosure {
  margin: 0;
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: #f4f4f0;
  font-size: 13px;
  border-bottom: 1px solid var(--ink);
}
.disclosure a { color: #ffb4a3; }
.disclosure strong { color: #fff; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  padding: 0 1.5rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}
.module {
  grid-column: span 12;
  border: 1px solid var(--hairline);
  border-top: none;
  margin-top: -1px;
  background: var(--surface);
}
.module:nth-child(odd) { background: var(--surface); }
.mod-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
}
.mod-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.4rem;
}
.mod-head h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.mod-body { padding: 1.25rem; }

@media (min-width: 900px) {
  #m-sim, #m-audit, #m-data { grid-column: span 8; }
  #m-sens, #m-export { grid-column: span 4; }
}
@media (min-width: 1200px) {
  #m-sens, #m-export { grid-column: span 3; }
  #m-sim, #m-audit, #m-data { grid-column: span 9; }
}

/* ---------- controls ---------- */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.controls label, .claim, .rubric-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.controls input, .controls select, .claim textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 0.5rem 0.6rem;
  border-radius: 0;
  text-transform: none;
  letter-spacing: normal;
}
.controls input:focus, .controls select:focus, .claim textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
#preset-alloc { font-size: 11px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.hint { font-size: 12.5px; color: var(--muted); max-width: 80ch; }
.err { color: var(--bad); font-weight: 600; font-size: 13px; min-height: 1.2em; }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 0.4rem; }
.legend .lg i { display: inline-block; width: 14px; height: 3px; margin-right: 0.4rem; vertical-align: middle; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-top: 1px solid var(--hairline);
  margin-top: 1rem;
}
.stat {
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat:last-child { border-right: none; }
.stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat small { font-size: 11px; color: var(--muted); }
.stat.accent b { color: var(--accent); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--hairline); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid #d9d9d2; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; background: var(--bg); border-bottom: 1px solid var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.base-row td { background: #fff3ee; font-weight: 600; }
.neg { color: var(--bad); }
.pos { color: var(--good); }

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  border-radius: 0;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- rubric ---------- */
.rubric-inputs {
  border: 1px solid var(--hairline);
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
}
.rubric-inputs label { flex-direction: row; align-items: center; gap: 0.45rem; font-size: 12.5px; text-transform: none; letter-spacing: normal; color: var(--ink); }
.rubric-inputs legend { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 0 0.3rem; }
.verdict {
  display: flex; align-items: baseline; gap: 0.6rem;
  border: 1px solid var(--ink); padding: 0.8rem 1rem; margin-bottom: 1rem;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
}
.verdict b { font-size: 2rem; line-height: 1; }
.verdict.VERIFIED-PLAUSIBLE { border-color: var(--good); }
.verdict.VERIFIED-PLAUSIBLE b { color: var(--good); }
.verdict.PARTIAL-EVIDENCE { border-color: #b8860b; }
.verdict.PARTIAL-EVIDENCE b { color: #8a6508; }
.verdict.UNVERIFIED { border-color: var(--accent); }
.verdict.UNVERIFIED b { color: var(--accent); }
.verdict.REJECT { border-color: var(--bad); }
.verdict.REJECT b { color: var(--bad); }
.flags { font-size: 12.5px; color: var(--muted); }
.flags code { background: var(--bg); border: 1px solid var(--hairline); padding: 0 0.3rem; font-size: 11px; }
.flags.ok { color: var(--good); }
.rubric { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.rubric li {
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid #d9d9d2;
  font-size: 13.5px;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.rubric li b { font-size: 10.5px; letter-spacing: 0.1em; }
.rubric li.pass b { color: var(--good); }
.rubric li.fail b { color: var(--bad); }
.rubric .hint { font-size: 12px; color: var(--muted); }

/* ---------- footer ---------- */
.sitefoot {
  border-top: 1px solid var(--hairline);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  font-size: 12.5px;
}
.sitefoot nav { display: flex; gap: 1.25rem; }
.sitefoot a { color: var(--ink); }
.foot-legal { margin-left: auto; color: var(--muted); }

h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 1.5rem 0 0.5rem; }

@media (max-width: 640px) {
  .topbar { padding: 1.5rem 1rem 1rem; }
  .grid { padding: 0 0.75rem 2rem; }
  .disclosure { padding: 0.7rem 1rem; }
  .mod-body { padding: 0.9rem; }
  .foot-legal { margin-left: 0; }
}
