/* Layout: one shared shell (top bar, beta strip, centred column, footer); each tool page is a stacked form → result flow.
   Brand set: ink #18191B · navy #263B52 · plum #3B3046 · wine #684052 · cream #F5F3EF */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #18191B;
  --navy: #263B52;
  --plum: #3B3046;
  --wine: #684052;
  --cream: #F5F3EF;

  --bg: #F5F3EF;
  --surface: #FCFBF9;
  --surface-2: #ECE8E1;
  --fg: #18191B;
  --fg-2: #4D4A4F;
  --muted: #7C7780;
  --line: #DDD7CF;
  --accent: #684052;
  --accent-hover: #7D4D63;
  --accent-soft: #EFE3E8;
  --data: #263B52;
  --data-2: #684052;
  --data-band: rgba(38, 59, 82, 0.14);
  --bar-bg: #18191B;
  --bar-fg: #F5F3EF;
  --bar-fg-2: rgba(245, 243, 239, 0.7);
  --on-accent: #F5F3EF;
  --good: #2F6B45;
  --warn: #8A5A12;
  --bad: #9B3434;
  --focus: #263B52;

  --font-display: "Poppins", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(24, 25, 27, 0.05), 0 8px 24px rgba(24, 25, 27, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315; --surface: #1C1D20; --surface-2: #26272B; --fg: #F5F3EF; --fg-2: #C9C4BE;
    --muted: #8F8A92; --line: #33343A; --accent: #C894AA; --accent-hover: #D8A9BC; --accent-soft: #3A2A32;
    --data: #8EAACB; --data-2: #C894AA; --data-band: rgba(142, 170, 203, 0.2);
    --bar-bg: #0C0D0E; --bar-fg: #F5F3EF; --bar-fg-2: rgba(245, 243, 239, 0.7); --on-accent: #18191B;
    --good: #6FBF8B; --warn: #D9A65A; --bad: #E08484; --focus: #8EAACB;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --surface: #1C1D20; --surface-2: #26272B; --fg: #F5F3EF; --fg-2: #C9C4BE;
  --muted: #8F8A92; --line: #33343A; --accent: #C894AA; --accent-hover: #D8A9BC; --accent-soft: #3A2A32;
  --data: #8EAACB; --data-2: #C894AA; --data-band: rgba(142, 170, 203, 0.2);
  --bar-bg: #0C0D0E; --bar-fg: #F5F3EF; --bar-fg-2: rgba(245, 243, 239, 0.7); --on-accent: #18191B;
  --good: #6FBF8B; --warn: #D9A65A; --bad: #E08484; --focus: #8EAACB;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.55rem); font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 480px) { .wrap { padding-inline: 16px; } }

/* ---------- Top bar ---------- */
.topbar { background: var(--bar-bg); color: var(--bar-fg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { color: var(--bar-fg); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand:hover { color: var(--bar-fg); }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(140deg, #263B52, #3B3046 55%, #684052); display: grid; place-items: center; font-size: 0.72rem; letter-spacing: 0.02em; color: #F5F3EF; flex: none; }
.beta-pill { font-family: var(--font-body); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid rgba(245,243,239,0.35); border-radius: 999px; padding: 1px 8px; color: var(--bar-fg-2); }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--bar-fg-2); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 8px 12px; border-radius: var(--radius-sm); }
.nav a:hover { color: var(--bar-fg); background: rgba(245,243,239,0.08); }
.nav a[aria-current="page"] { color: var(--bar-fg); background: rgba(245,243,239,0.12); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(245,243,239,0.3); color: var(--bar-fg); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.85rem; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bar-bg); flex-direction: column; padding: 8px 16px 16px; border-top: 1px solid rgba(245,243,239,0.1); }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; }
}

/* ---------- Beta strip ---------- */
.beta-strip { background: var(--accent-soft); color: var(--fg); border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.beta-strip .wrap { padding-block: 9px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.beta-strip strong { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* ---------- Page intro ---------- */
.page-head { padding-block: 44px 28px; display: grid; gap: 12px; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.lead { color: var(--fg-2); font-size: 1.05rem; max-width: 64ch; }
main { padding-bottom: 64px; }

/* ---------- Panels & controls ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
@media (max-width: 480px) { .panel { padding: 18px 16px; } }
.stack { display: grid; gap: 20px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--on-accent); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none; transition: background .15s ease; }
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label.field { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--fg-2); min-width: 0; }
.field input[type="text"], .field select, .field textarea, .input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; font-weight: 400; color: var(--fg); font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--fg-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; padding: 7px 14px; font-size: 0.88rem; color: var(--fg-2); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ---------- Disclaimer ---------- */
.disclaimer { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--fg-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; }
.disclaimer::before { content: "i"; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font-size: 0.7rem; font-weight: 700; display: grid; place-items: center; font-family: Georgia, serif; font-style: italic; margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { background: var(--surface-2); font-weight: 600; color: var(--fg-2); font-size: 0.8rem; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 26px; font-size: 0.85rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
.site-footer a { color: var(--fg-2); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 0.88rem; z-index: 50; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Affiliate boxes (only rendered when PARTNERS has entries) ---------- */
.partners { margin-top: 40px; display: grid; gap: 10px; }
.partners-label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.partners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.partner { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-decoration: none; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.partner:hover { border-color: var(--accent); color: var(--fg); }
.partner img { height: 40px; width: auto; max-width: 160px; object-fit: contain; flex: none; border-radius: 6px; }
.partner span { display: grid; gap: 2px; font-size: 0.88rem; color: var(--fg-2); min-width: 0; }
.partner strong { color: var(--fg); }
.partner em { font-style: normal; font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.partners-note { font-size: 0.78rem; color: var(--muted); }

/* ---------- Cookie consent bar (inactive unless COOKIE_CONSENT = true) ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; z-index: 60; font-size: 0.9rem; }
.consent .row { justify-content: flex-end; }
