/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #ffffff;
  --surface: #f6f9f7;
  --surface-2: #eef3ef;
  --text: #141a17;
  --text-muted: #5c6b62;
  --border: #e1e8e3;
  --accent: #14532d;
  --accent-dark: #0e3d21;
  --accent-light: #e8f3ec;
  --accent-contrast: #ffffff;
  --warn-bg: #fff7e6;
  --warn-text: #92600a;
  --warn-border: #f3d38a;
  --danger: #b3261e;
  --ok: #1e7a3d;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 26, 23, .06);
  --shadow: 0 8px 24px rgba(20, 26, 23, .08);
  --shadow-lg: 0 24px 60px rgba(20, 26, 23, .14);
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Sora", var(--sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.12; letter-spacing: -0.01em; font-weight: 700; }
ul { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--accent); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: .75rem; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* =============================================================
   4. Buttons & badges
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out), border-color .2s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #f3c9c6; }
.btn-danger:hover { background: #fdf1f0; }
.btn-block { width: 100%; }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.badge-demo { background: #fff3d6; color: #7a5200; border: 1px solid #f0d68e; }
.badge-accent { background: var(--accent-light); color: var(--accent-dark); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }

.demo-bar {
  background: #fff3d6; color: #7a5200; border-bottom: 1px solid #f0d68e;
  font-size: .85rem; font-weight: 600; text-align: center; padding: .55rem 1rem;
}

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; padding-block: .9rem; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.05rem; font-weight: 800; flex-shrink: 0;
}
.nav-links { display: none; align-items: center; gap: 1.8rem; font-size: .95rem; font-weight: 600; color: var(--text-muted); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: .7rem; }
@media (min-width: 860px) { .nav-links { display: flex; } }

.nav-burger { display: grid; place-items: center; width: 40px; height: 40px; }
@media (min-width: 860px) { .nav-burger { display: none; } }
.nav-mobile { display: none; flex-direction: column; gap: .2rem; padding: .5rem 1.25rem 1rem; border-top: 1px solid var(--border); }
.nav-mobile.is-open { display: flex; }
.nav-mobile a { padding: .7rem 0; font-weight: 600; color: var(--text-muted); }

/* App-shell top bar (calm, no marketing) */
.appbar {
  position: sticky; top: 0; z-index: 500; background: #fff; border-bottom: 1px solid var(--border);
}
.appbar-row { display: flex; align-items: center; justify-content: space-between; padding-block: .8rem; gap: .75rem; }
.credits-pill {
  display: inline-flex; align-items: center; gap: .4rem; background: var(--accent-light); color: var(--accent-dark);
  font-weight: 700; font-size: .88rem; padding: .45rem .85rem; border-radius: 999px;
}
.account-menu { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem .4rem; border-radius: 999px; border: 1px solid var(--border);
}
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + .5rem); background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; padding: .5rem; display: none; z-index: 50;
}
.account-dropdown.is-open { display: block; }
.account-dropdown a, .account-dropdown button {
  display: block; width: 100%; text-align: left; padding: .6rem .7rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface); }

/* =============================================================
   6. Hero
   ============================================================= */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 3rem; } }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); margin-bottom: 1.1rem; }
.hero h1 .accent-text { color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 46ch; margin-bottom: 1.75rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.5rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .85rem; color: var(--text-muted); }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-trust svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* Demo card — before/after visual proof */
.demo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; box-shadow: var(--shadow);
}
.demo-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.demo-card-head strong { font-size: .95rem; }
.demo-doc {
  display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem .8rem; font-size: .85rem; margin-bottom: .6rem;
}
.demo-doc svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.demo-arrow { display: flex; justify-content: center; margin-block: .5rem; color: var(--text-muted); }
.demo-table { width: 100%; font-size: .78rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.demo-table th, .demo-table td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--border); }
.demo-table th { background: var(--surface-2); font-weight: 700; color: var(--text-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; }
.demo-table tr:last-child td { border-bottom: 0; }

/* =============================================================
   7. Steps / How it works
   ============================================================= */
.steps-grid { display: grid; gap: 1.4rem; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; position: relative; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800;
  display: grid; place-items: center; margin-bottom: 1rem; font-family: var(--display);
}
.step-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.step-card p { color: var(--text-muted); font-size: .95rem; }

/* =============================================================
   8. For whom
   ============================================================= */
.whom-grid { display: grid; gap: 1.4rem; }
@media (min-width: 720px) { .whom-grid { grid-template-columns: repeat(3, 1fr); } }
.whom-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.whom-card svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 1rem; }
.whom-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.whom-card p { color: var(--text-muted); font-size: .93rem; }

/* =============================================================
   9. Privacy strip
   ============================================================= */
.privacy-strip {
  background: var(--accent-light); border: 1px solid #cfe4d7; border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem; display: flex; gap: 1rem; align-items: flex-start;
}
.privacy-strip svg { width: 26px; height: 26px; color: var(--accent-dark); flex-shrink: 0; }
.privacy-strip h3 { font-size: 1.05rem; margin-bottom: .35rem; color: var(--accent-dark); }
.privacy-strip p { color: #2c4a37; font-size: .92rem; }

/* =============================================================
   10. Pricing
   ============================================================= */
.pricing-grid { display: grid; gap: 1.4rem; }
@media (min-width: 860px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; } }
.price-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.8rem;
  display: flex; flex-direction: column; background: #fff;
}
.price-card.is-highlight { border-color: var(--accent); box-shadow: var(--shadow-lg); position: relative; }
.price-card-tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; padding: .3rem .8rem; border-radius: 999px;
  letter-spacing: .03em; text-transform: uppercase;
}
.price-card h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.price-card .price-sub { color: var(--text-muted); font-size: .88rem; margin-bottom: 1.1rem; }
.price-amount { display: flex; align-items: baseline; gap: .3rem; margin-bottom: .3rem; }
.price-amount .num { font-family: var(--display); font-size: 2.6rem; font-weight: 800; }
.price-amount .period { color: var(--text-muted); font-size: .95rem; }
.price-credits { font-size: .88rem; color: var(--accent-dark); font-weight: 700; margin-bottom: 1.3rem; }
.price-features { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.5rem; flex: 1; }
.price-features li { display: flex; gap: .55rem; font-size: .9rem; color: var(--text); align-items: flex-start; }
.price-features svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; margin-top: .15rem; }
.pricing-note { text-align: center; color: var(--text-muted); font-size: .85rem; margin-top: 1.6rem; }

/* =============================================================
   11. FAQ
   ============================================================= */
.faq-list { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: .7rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem; font-weight: 700; font-size: .98rem; text-align: left;
}
.faq-q svg { width: 18px; height: 18px; color: var(--text-muted); transition: transform .25s var(--ease-out); flex-shrink: 0; }
.faq-item.is-open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s var(--ease-out); }
.faq-a-inner { padding: 0 1.3rem 1.1rem; color: var(--text-muted); font-size: .93rem; }

/* =============================================================
   12. Footer
   ============================================================= */
.footer { border-top: 1px solid var(--border); padding-block: 2.5rem; background: var(--surface); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; margin-bottom: 1.8rem; }
.footer-brand p { color: var(--text-muted); font-size: .88rem; max-width: 32ch; margin-top: .6rem; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .8rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .55rem; }
.footer-col a { font-size: .9rem; color: var(--text); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.4rem; display: flex; flex-wrap: wrap;
  gap: 1rem; justify-content: space-between; font-size: .82rem; color: var(--text-muted);
}

/* =============================================================
   13. Auth (login/signup)
   ============================================================= */
.auth-shell { min-height: 100svh; display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow); }
.auth-card .logo { justify-content: center; margin-bottom: 1.5rem; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: .3rem; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; text-align: center; padding: .6rem; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--text-muted); }
.auth-tab.is-active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .4rem; }
.field input, .field select {
  width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field-hint { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; }
.auth-form-panel { display: none; }
.auth-form-panel.is-active { display: block; }
.auth-alt { text-align: center; font-size: .87rem; color: var(--text-muted); margin-top: 1.3rem; }
.auth-alt a { color: var(--accent); font-weight: 700; }

.form-msg { padding: .75rem .9rem; border-radius: var(--radius-sm); font-size: .87rem; margin-bottom: 1rem; display: none; }
.form-msg.is-visible { display: block; }
.form-msg.is-error { background: #fdf1f0; color: var(--danger); border: 1px solid #f3c9c6; }
.form-msg.is-ok { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #cfe4d7; }

/* =============================================================
   14. App tool
   ============================================================= */
.app-main { padding-block: 2rem 4rem; min-height: 70vh; }
.app-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; }
.app-head h1 { font-size: 1.6rem; }
.app-head p { color: var(--text-muted); font-size: .93rem; margin-top: .3rem; }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: clamp(1.8rem, 4vw, 3rem);
  text-align: center; background: var(--surface); transition: border-color .2s, background .2s; margin-bottom: 1.6rem;
}
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-light); }
.dropzone svg { width: 42px; height: 42px; color: var(--accent); margin-inline: auto; margin-bottom: .8rem; }
.dropzone h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.dropzone p { color: var(--text-muted); font-size: .88rem; margin-bottom: 1.1rem; }
.dropzone input[type="file"] { display: none; }

.queue-section { margin-bottom: 1.8rem; }
.queue-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; flex-wrap: wrap; gap: .6rem; }
.queue-head h3 { font-size: 1rem; }
.queue-list { display: flex; flex-direction: column; gap: .5rem; }
.queue-item {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .87rem; background: #fff;
}
.queue-item .qi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.queue-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; flex-shrink: 0; }
.queue-status.st-queued { background: var(--surface-2); color: var(--text-muted); }
.queue-status.st-working { background: #e8f0fe; color: #1a56b0; }
.queue-status.st-done { background: var(--accent-light); color: var(--accent-dark); }
.queue-status.st-error { background: #fdf1f0; color: var(--danger); }
.spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary-bar { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.6rem; }
@media (min-width: 720px) { .summary-bar { grid-template-columns: repeat(4, 1fr); } }
.summary-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: #fff; }
.summary-tile .st-label { font-size: .78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .4rem; }
.summary-tile .st-value { font-family: var(--display); font-size: 1.4rem; font-weight: 800; }

.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.results-table { min-width: 920px; font-size: .85rem; }
.results-table th, .results-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.results-table thead th { background: var(--surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); position: sticky; top: 0; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr.is-group { background: var(--surface); font-weight: 700; }
.results-table td[contenteditable="true"] { cursor: text; border-radius: 4px; }
.results-table td[contenteditable="true"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-light); }
.cell-low-confidence { background: var(--warn-bg) !important; }
.cell-mismatch { position: relative; }
.cell-mismatch::after { content: "⚠"; color: var(--warn-text); margin-left: .3rem; }
.row-remove { color: var(--text-muted); }
.row-remove:hover { color: var(--danger); }

.category-summary { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 1.4rem; margin-top: 1.6rem; }
.category-summary h3 { font-size: 1rem; margin-bottom: 1rem; }
.cat-row { display: flex; align-items: center; gap: .8rem; font-size: .88rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.cat-row:last-child { border-bottom: 0; }
.cat-row .cat-name { flex: 1; font-weight: 600; }
.cat-row .cat-bar { flex: 2; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cat-row .cat-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.cat-row .cat-amount { font-weight: 700; width: 90px; text-align: right; flex-shrink: 0; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; color: var(--border); margin-inline: auto; margin-bottom: 1rem; }

/* =============================================================
   15. Account page
   ============================================================= */
.account-grid { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; padding: 1.6rem; }
.card h2 { font-size: 1.1rem; margin-bottom: 1.1rem; }
.plan-row { display: flex; justify-content: space-between; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.plan-row:last-child { border-bottom: 0; }
.plan-row .pr-label { color: var(--text-muted); font-size: .88rem; }
.plan-row .pr-value { font-weight: 700; }
.history-list { display: flex; flex-direction: column; gap: .6rem; max-height: 340px; overflow-y: auto; }
.history-item { display: flex; justify-content: space-between; gap: .8rem; font-size: .86rem; padding: .6rem .8rem; background: var(--surface); border-radius: var(--radius-sm); }
.history-item .hi-date { color: var(--text-muted); font-size: .78rem; }

/* =============================================================
   16. Modal
   ============================================================= */
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 460px; width: 92vw; box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(20, 26, 23, .5); backdrop-filter: blur(2px); }
.modal-body { padding: 1.8rem; }
.modal-body h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.modal-body p { color: var(--text-muted); font-size: .92rem; margin-bottom: 1.2rem; }
.modal-actions { display: flex; gap: .7rem; justify-content: flex-end; margin-top: 1.4rem; }
.fake-card { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; font-family: ui-monospace, monospace; font-size: .95rem; letter-spacing: .05em; color: var(--text-muted); background: var(--surface); margin-bottom: 1rem; }
.plan-pick-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.2rem; }
.plan-pick { display: flex; justify-content: space-between; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; cursor: pointer; }
.plan-pick.is-selected { border-color: var(--accent); background: var(--accent-light); }
.plan-pick input { accent-color: var(--accent); }

/* =============================================================
   17. Toast
   ============================================================= */
#toast-region { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 420px); }
.toast {
  background: var(--text); color: #fff; padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-size: .87rem;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: .6rem; opacity: 0; transform: translateY(8px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #7a1f1a; }
.toast.is-ok { background: var(--accent-dark); }

/* =============================================================
   18. Legal pages
   ============================================================= */
.legal { padding-block: 3rem 5rem; }
.legal h1 { font-size: 2rem; margin-bottom: .5rem; }
.legal .updated { color: var(--text-muted); font-size: .85rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: .7rem; }
.legal p, .legal li { color: var(--text-muted); font-size: .95rem; margin-bottom: .7rem; }
.legal ul { list-style: disc; padding-left: 1.4rem; }
.legal ul li { list-style: disc; }

/* =============================================================
   19. Responsive helpers
   ============================================================= */
@media (max-width: 539px) {
  .hero-ctas .btn { flex: 1; }
  .footer-grid { flex-direction: column; }
}
