/* messagestore.net — theme_08: Minimalist Magazine Calculator */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --ink: #0f172a;
  --accent: #6d28d9;
  --muted: #475569;
  --line: #e2e8f0;
  --pass: #15803d;
  --warn: #b45309;
  --fail: #b91c1c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, .serif { font-family: Charter, Georgia, "Times New Roman", serif; }

a { color: var(--accent); }

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

/* Full-bleed minimalist header */
.masthead {
  border-bottom: 1px solid var(--line);
  padding: 28px 0 18px;
  background: var(--bg);
}
.masthead .wrap { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.masthead h1 { font-size: 1.9rem; margin: 0; letter-spacing: -0.01em; }
.masthead .tagline { color: var(--muted); font-size: 0.95rem; }
.masthead nav a { margin-left: 18px; font-size: 0.9rem; text-decoration: none; border-bottom: 1px solid transparent; }
.masthead nav a:hover { border-bottom-color: var(--accent); }

/* Above-fold affiliate disclosure */
.disclosure-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.disclosure-strip .wrap { padding-top: 8px; padding-bottom: 8px; }
.disclosure-strip a { color: var(--accent); }

section { padding: 36px 0; }
section + section { border-top: 1px solid var(--line); }

h2 { font-size: 1.5rem; margin: 0 0 6px; }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 24px; }

/* Workbench layout */
.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 860px) { .workbench { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.panel h3 { margin: 0 0 14px; font-size: 1.05rem; }

label.field { display: block; margin-bottom: 12px; font-size: 0.88rem; color: var(--muted); }
label.field .flabel { display: flex; justify-content: space-between; margin-bottom: 4px; }
label.field input[type="number"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
label.field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
label.field .bool-row { display: flex; align-items: center; gap: 8px; color: var(--ink); }

#eval-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--fail);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

/* Results grid */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.stat .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat .v { font-family: Charter, Georgia, serif; font-size: 1.35rem; }
#out-grade { font-weight: 700; }
#out-grade[data-grade="A"] { color: var(--pass); }
#out-grade[data-grade="B"] { color: var(--accent); }
#out-grade[data-grade="C"] { color: var(--warn); }
#out-grade[data-grade="F"] { color: var(--fail); }

/* Chart */
.chart-box { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 18px; }
.chart-box svg { width: 100%; height: auto; display: block; }
.grid { stroke: var(--line); stroke-width: 1; }
.axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.axis-label { fill: var(--muted); font-size: 12px; font-family: Charter, Georgia, serif; }
.pt { fill: var(--accent); fill-opacity: 0.75; stroke: #fff; stroke-width: 1.5; }
.pt-r1 { fill: #7c3aed; }
.pt-r2 { fill: #6d28d9; }
.pt-r3 { fill: #5b21b6; }
.pt-r4 { fill: #4c1d95; }
.pt-r5 { fill: #3b0764; }
.chart-legend { font-size: 0.78rem; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.chart-legend span::before { content: "●"; margin-right: 5px; color: var(--accent); }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.check {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.check:last-child { border-bottom: none; }
.check-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; color: var(--muted); padding-top: 2px; }
.check-detail { grid-column: 2; color: var(--muted); font-size: 0.8rem; }
.check.pass .check-id::after { content: " PASS"; color: var(--pass); font-weight: 700; }
.check.warn .check-id::after { content: " WARN"; color: var(--warn); font-weight: 700; }
.check.fail .check-id::after { content: " FAIL"; color: var(--fail); font-weight: 700; }
.check.pass .check-label { color: var(--ink); }
.check.warn .check-label { color: var(--warn); }
.check.fail .check-label { color: var(--fail); }

#checklist-summary { font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; }

/* Export bar */
.export-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
button {
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: #fff; color: var(--accent); }
button:hover { filter: brightness(1.08); }
#sha256 {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
#sha-status { font-size: 0.8rem; color: var(--pass); }

/* Reference dataset table */
table.ref { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: var(--surface); }
table.ref th, table.ref td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.ref th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
table.ref td.num { font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* FAQ */
details.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
details.faq summary { cursor: pointer; font-family: Charter, Georgia, serif; font-size: 1.05rem; }
details.faq p { color: var(--muted); margin: 10px 0 0; max-width: 68ch; }

/* Footer — strictly native */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer nav a { margin-right: 18px; color: var(--ink); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); }
.site-footer p { margin: 8px 0 0; max-width: 70ch; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
