:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --text: #2a2320;
  --muted: #7a6f68;
  --line: #e8dfd6;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --good: #2f7d4f;
  --warn: #b7791f;
  --bad: #b42318;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1614;
    --surface: #241f1c;
    --text: #f3ece6;
    --muted: #a59a92;
    --line: #38302b;
    --accent: #f08a4b;
    --accent-ink: #1a1614;
    --good: #5fbf85;
    --warn: #e0b04f;
    --bad: #f07b6f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 64px; }
header.site {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
header.site a.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
header.site nav { display: flex; gap: 18px; }
header.site nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--accent); }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; margin: 40px 0 12px; }
p.lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 24px; max-width: 60ch; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: inherit;
}
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: var(--line); color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.badge.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.bar.low > span { background: var(--bad); }
.bar.mid > span { background: var(--warn); }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.spool-head { display: flex; align-items: center; gap: 10px; }
.spool-head strong { line-height: 1.2; }
.muted { color: var(--muted); font-size: .9rem; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: .92rem; }
.notice {
  border: 1px dashed var(--warn); color: var(--warn); border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 18px; font-size: .92rem;
}
.error { color: var(--bad); }
form { display: grid; gap: 14px; max-width: 560px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 120px; resize: vertical; }
button.primary {
  font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); padding: 12px 20px; justify-self: start;
}
button.primary:disabled { opacity: .6; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.5em; font-weight: 600; }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .bar > span { transition: width .6s ease; } }
