:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1d1f1e;
  --muted: #5d625f;
  --line: #e2ded4;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --good: #15803d;
  --watch: #b45309;
  --replace: #b91c1c;
  --zone: #fde7c7;
  --r-year: #dbeafe; --r-year-ink: #1e40af;
  --r-month: #dcfce7; --r-month-ink: #166534;
  --r-week: #dcfce7; --r-week-ink: #166534;
  --r-plant: #ede9e3; --r-plant-ink: #57534e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141615; --surface: #1d201f; --ink: #ecebe7; --muted: #a4a8a5; --line: #303432;
    --accent: #fb923c; --accent-ink: #1a0d04; --good: #4ade80; --watch: #fbbf24; --replace: #f87171;
    --zone: #4a3415;
    --r-year: #1e3a8a; --r-year-ink: #dbeafe; --r-month: #14532d; --r-month-ink: #dcfce7;
    --r-week: #14532d; --r-week-ink: #dcfce7; --r-plant: #33302c; --r-plant-ink: #d6d3d1;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; font-size: 18px; }
.logo b { color: var(--accent); }
nav.top a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 15px; }
nav.top a:hover { color: var(--ink); }
main { padding: 28px 0 56px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -.02em; margin: 8px 0 10px; }
h2 { font-size: 23px; line-height: 1.25; margin: 40px 0 10px; letter-spacing: -.01em; }
h3 { font-size: 18px; margin: 24px 0 6px; }
.lede { color: var(--muted); font-size: 19px; margin: 0 0 22px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }

.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.tool form { display: grid; gap: 14px; }
.field label, .serial-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.tool select, .tool input {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px;
}
.tool input { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.tool input::placeholder { text-transform: none; letter-spacing: 0; font-family: inherit; }
.tool select:focus, .tool input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
button {
  font: inherit; font-weight: 700; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  padding: 0 22px; min-height: 48px; cursor: pointer;
}
button:hover { filter: brightness(1.07); }
.hint { font-size: 14px; color: var(--muted); margin: 0; }

.result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.result-error { margin: 0; color: var(--replace); font-weight: 600; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.result-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result-date { font-size: 28px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.result-age { text-align: right; }
.result-age-val { font-size: 28px; font-weight: 800; line-height: 1.2; }
.v-good .result-age-val { color: var(--good); }
.v-watch .result-age-val { color: var(--watch); }
.v-replace .result-age-val { color: var(--replace); }
.verdict { font-weight: 600; margin: 10px 0 0; }

.life { margin-top: 16px; }
.life-track { position: relative; height: 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.life-zone { position: absolute; top: 0; bottom: 0; background: var(--zone); }
.life-mark { position: absolute; top: -5px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); }
.life-cap { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }

.how { margin-top: 18px; background: var(--bg); border-radius: 10px; padding: 14px; }
.serial-hl { font-family: var(--mono); font-size: 22px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 2px; }
.ch { padding: 2px 4px; border-radius: 4px; }
.r-year { background: var(--r-year); color: var(--r-year-ink); font-weight: 700; }
.r-month, .r-week { background: var(--r-month); color: var(--r-month-ink); font-weight: 700; }
.r-plant { background: var(--r-plant); color: var(--r-plant-ink); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fmt { margin: 8px 0 0; font-size: 15px; }
.meta, .alt { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.c-high { color: var(--good); } .c-medium { color: var(--watch); } .c-low { color: var(--replace); }
.cta { display: block; margin-top: 16px; text-align: center; background: var(--ink); color: var(--bg); padding: 12px; border-radius: 10px; font-weight: 700; text-decoration: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--accent); }
.card strong { display: block; font-size: 17px; }
.card span { color: var(--muted); font-size: 14px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0; list-style: none; }
.brand-grid a { display: block; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; }
.brand-grid a:hover { border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
.table-scroll { overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td code, p code, li code { font-family: var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: .92em; }
.letters { font-family: var(--mono); font-size: 14px; }
.letters td, .letters th { padding: 4px 8px; text-align: center; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; }

.ad-slot { margin: 28px 0; min-height: 100px; }
footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer.site a { color: var(--muted); margin-right: 14px; }
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .result-age { text-align: left; }
  nav.top a { margin: 0 14px 0 0; }
}
