/* ==========================================================================
   SANDAR Design System v2 — calm, premium, accessible (WCAG 2.2 AA target)
   Fonts: Inter (UI/body) + Fraunces (display), self-hosted, SIL OFL 1.1.
   ========================================================================== */
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/static/fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* Brand */
  --brand-900: #0a3329; --brand-800: #0d4236; --brand: #0f5545; --brand-600: #17705c; --brand-100: #e4efe9; --brand-50: #f1f7f3;
  --accent: #9a6a2a; --accent-50: #f7efe2;
  /* Neutrals (warm) */
  --bg: #f6f3ec; --bg-deep: #efeae0; --surface: #ffffff; --surface-2: #fbf9f5;
  --ink: #17201c; --ink-2: #33403a; --muted: #56625c; --line: #e2ddd1; --line-strong: #c9c2b2;
  /* Semantic */
  --ok: #1c6b3c; --ok-bg: #e8f4ec; --warn: #85570a; --warn-bg: #fbf1dc; --bad: #a3282a; --bad-bg: #fbeaea; --info: #1f4e86; --info-bg: #e9f0fa;
  --focus: #1a5fd0;
  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --fs-xs: .78rem; --fs-sm: .9rem; --fs-base: 1rem; --fs-md: 1.0625rem; --fs-lg: 1.2rem;
  /* Space / shape */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --r-sm: 8px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(23,32,28,.05);
  --shadow-2: 0 1px 2px rgba(23,32,28,.04), 0 8px 24px rgba(23,32,28,.06);
  --shadow-3: 0 2px 6px rgba(23,32,28,.06), 0 24px 48px rgba(23,32,28,.10);
  --ease: cubic-bezier(.2,.7,.2,1);
  --maxw: 1160px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.62; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-900); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand-100); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 10px; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 200; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { left: 10px; color: #fff; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 560; font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 var(--s4); font-variation-settings: "SOFT" 50, "opsz" 96; }
h2 { font-family: var(--display); font-weight: 560; font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.2; letter-spacing: -.01em; margin: var(--s7) 0 var(--s3); }
h3 { font-size: 1.08rem; font-weight: 650; line-height: 1.35; margin: 0 0 var(--s2); letter-spacing: -.005em; }
p { margin: 0 0 var(--s4); }
p.lead, .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 44rem; line-height: 1.65; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.eyebrow, .card-kicker, .step-label { display: inline-block; font-size: var(--fs-xs); letter-spacing: .14em; font-weight: 700; color: var(--brand-600); text-transform: uppercase; }
.err { color: var(--bad); font-weight: 600; margin: var(--s2) 0; }

/* ---------- Header / navigation ---------- */
header.site { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
header.site .wrap { display: flex; align-items: center; gap: var(--s4); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; letter-spacing: .14em; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand:hover { color: var(--ink); }
nav.main { margin-left: auto; }
nav.main ul { list-style: none; display: flex; align-items: center; gap: .15rem; margin: 0; padding: 0; }
nav.main a, nav.main button { display: inline-flex; align-items: center; min-height: 42px; padding: .45rem .85rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; font: inherit; font-size: .95rem; font-weight: 550; background: none; border: 0; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
nav.main a:hover, nav.main button:hover { background: var(--bg-deep); color: var(--ink); }
nav.main a[aria-current="page"] { background: var(--brand-100); color: var(--brand-800); font-weight: 650; }
nav.main .nav-cta a, nav.main .nav-cta button { background: var(--brand); color: #fff; margin-left: .35rem; }
nav.main .nav-cta a:hover, nav.main .nav-cta button:hover { background: var(--brand-800); color: #fff; }
nav.main .nav-cta a[aria-current="page"] { background: var(--brand-800); color: #fff; }
.menu-toggle { display: none; margin-left: auto; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .9rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.menu-toggle .bars { display: inline-grid; gap: 4px; }
.menu-toggle .bars span { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s var(--ease), opacity .2s; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
#offline-banner { background: #4f3c05; color: #fff; text-align: center; padding: .45rem; font-size: var(--fs-sm); }

/* ---------- Layout ---------- */
main { padding: var(--s6) 0 var(--s8); min-height: 62vh; }
main:focus { outline: none; }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.stack > * + * { margin-top: var(--s4); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: var(--s5); margin: var(--s7) 0 var(--s5); }
.section-heading h2 { margin: .35rem 0 0; }
.section-heading > p { max-width: 22rem; margin: 0; }
.page-head { margin-bottom: var(--s6); max-width: 48rem; }
.page-head h1 { margin-top: .4rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 var(--s4); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); }
.back-link:hover { color: var(--brand); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow-1); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card.task { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.card.task:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-2); color: var(--ink); }
.card.task .icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); font-size: 1.3rem; border: 1px solid var(--brand-100); }
.card-link { margin-top: auto; padding-top: var(--s3); color: var(--brand); font-size: var(--fs-sm); font-weight: 650; }
.panel-title { font-family: var(--font); font-size: 1rem; font-weight: 650; margin: 0 0 var(--s3); letter-spacing: 0; }
.trust { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--r); padding: var(--s4) var(--s5); margin: var(--s5) 0; color: var(--ink-2); }
.layer { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); margin: var(--s4) 0; background: var(--surface); }
.layer > h3 { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: 1rem; }
.layer ul { margin: .4rem 0 0; padding-left: 1.15rem; }
.layer li { margin: .4rem 0; }
.layer li::marker { color: var(--line-strong); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-sm); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: .6rem 1.2rem; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-size: .97rem; font-weight: 620; cursor: pointer; text-decoration: none; transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .1s; letter-spacing: .005em; }
.btn:hover { background: var(--brand-800); border-color: var(--brand-800); color: #fff; box-shadow: 0 6px 16px rgba(15,85,69,.18); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn.ghost:hover { background: var(--brand-50); box-shadow: none; color: var(--brand-800); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: #7f1d1f; border-color: #7f1d1f; box-shadow: none; }
.btn.link { background: none; border: 0; color: var(--brand); padding: .25rem .5rem; min-height: 36px; text-decoration: underline; font-weight: 550; box-shadow: none; }
.btn.link:hover { color: var(--brand-900); background: none; box-shadow: none; }
.btn.small-btn { min-height: 38px; padding: .4rem .9rem; font-size: var(--fs-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------- Forms ---------- */
form .field, .field { margin-bottom: var(--s4); display: flex; flex-direction: column; gap: .35rem; max-width: 40rem; }
label { font-weight: 600; font-size: .96rem; color: var(--ink); }
.hint { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=email], select, textarea { font: inherit; font-size: 1rem; padding: .7rem .85rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); min-height: 48px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15,85,69,.12); outline: none; }
input[aria-invalid="true"] { border-color: var(--bad); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s4) var(--s4); margin: 0 0 var(--s4); background: var(--surface-2); }
legend { font-weight: 650; padding: 0 .35rem; font-size: .96rem; }
.choice { display: flex; gap: .65rem; align-items: flex-start; margin: .35rem 0; min-height: 36px; font-weight: 450; cursor: pointer; line-height: 1.5; }
.choice input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--brand); flex: none; }
.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.segmented label { display: flex; align-items: center; gap: .55rem; padding: .7rem .9rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 550; min-height: 48px; }
.segmented label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(15,85,69,.10); }
.segmented input { accent-color: var(--brand); width: 18px; height: 18px; }

/* ---------- Badges & notices ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 650; padding: .2rem .6rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; letter-spacing: .01em; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: #c6e3cf; }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: #efd9a8; }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: #efc4c4; }
.badge.info { color: var(--info); background: var(--info-bg); border-color: #c8d8ef; }
.badge.neutral { color: var(--ink-2); background: var(--bg-deep); border-color: var(--line); }
.notice { border: 1px solid #c8d8ef; border-left: 4px solid var(--info); background: var(--info-bg); padding: .85rem 1.1rem; border-radius: var(--r-sm); margin: var(--s4) 0; color: var(--ink-2); }
.notice.warn { border-color: #efd9a8; border-left-color: var(--warn); background: var(--warn-bg); }
.notice.bad { border-color: #efc4c4; border-left-color: var(--bad); background: var(--bad-bg); }
.notice.ok { border-color: #c6e3cf; border-left-color: var(--ok); background: var(--ok-bg); }

/* ---------- Tables / data ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { height: 8px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-600), var(--brand)); border-radius: 999px; transition: width .4s var(--ease); }
.meter { display: grid; gap: .35rem; margin-bottom: var(--s3); }
.stat { font-family: var(--display); font-size: 2rem; font-weight: 560; line-height: 1; color: var(--ink); }
.step-item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.step-item:last-of-type { border-bottom: 0; }
.step-item input[type=checkbox] { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--brand); flex: none; }
.step-item.done .t { text-decoration: line-through; color: var(--muted); }
.loading { display: inline-flex; gap: .6rem; align-items: center; color: var(--muted); }
.loading::before { content: ""; width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--bg-deep) 25%, #f4f0e8 50%, var(--bg-deep) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); min-height: 120px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: var(--s6) var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); color: var(--muted); }
.empty h3 { color: var(--ink); }

/* ---------- Home ---------- */
.hero-home { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.9fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: var(--s5) 0 var(--s6); }
.hero-home h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); max-width: 14ch; margin: var(--s3) 0 var(--s4); }
.hero-actions { margin-top: var(--s5); }
.hero-note { margin-top: var(--s3); }
.hero-panel { position: relative; background: var(--brand-900); color: #fff; border-radius: var(--r-xl); padding: var(--s6); box-shadow: var(--shadow-3); overflow: hidden; }
.hero-panel::after { content: ""; position: absolute; inset: auto -30% -45% auto; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 40px rgba(255,255,255,.025), 0 0 0 80px rgba(255,255,255,.02); }
.hero-panel-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.1); font-family: var(--display); font-size: 1.7rem; }
.hero-panel-title { font-family: var(--display); font-size: 1.45rem; font-weight: 520; margin: var(--s4) 0 var(--s2); }
.hero-panel p { color: rgba(255,255,255,.82); }
.hero-points { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: .65rem; font-size: .93rem; position: relative; z-index: 1; }
.hero-points li { display: flex; gap: .6rem; align-items: center; }
.hero-points li::before { content: "✓"; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: rgba(255,255,255,.12); font-size: .75rem; font-weight: 800; flex: none; }
.journey-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.journey-card { min-height: 240px; padding: var(--s5); }
.journey-card h3 { font-size: 1.08rem; margin: .55rem 0 .25rem; }
.steps-howto { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(4, minmax(0,1fr)); counter-reset: s; }
.steps-howto li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); }
.steps-howto .step-label { margin-bottom: var(--s3); }
.trust-wide { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s6); align-items: center; margin: var(--s7) 0 0; padding: var(--s6); border-radius: var(--r-lg); }
.trust-wide h2 { margin: .3rem 0 .6rem; }
.trust-wide ul { margin: 0; padding-left: 1.15rem; display: grid; gap: .4rem; }

/* ---------- Onboarding ---------- */
.onboarding-wrap { max-width: 880px; margin: 0 auto; }
.onboarding-heading { max-width: 46rem; }
.onboarding-heading h1 { margin: .5rem 0 .7rem; }
.onboarding-progress { display: flex; gap: .4rem; margin: var(--s5) 0 var(--s2); }
.onboarding-progress span { height: 4px; flex: 1; border-radius: 99px; background: var(--line); }
.onboarding-progress span.active { background: var(--brand); }
.onboarding-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin: var(--s4) 0; }
.onboarding-choice { position: relative; min-height: 150px; padding: var(--s5) 3.4rem var(--s5) var(--s5); }
.onboarding-choice.selected { border: 1.5px solid var(--brand); background: var(--brand-50); box-shadow: 0 0 0 4px rgba(15,85,69,.08); }
.choice-indicator { position: absolute; right: 1.1rem; top: 1.1rem; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; font-weight: 800; color: var(--brand); background: var(--surface); }
.onboarding-choice.selected .choice-indicator { background: var(--brand); color: #fff; border-color: var(--brand); }
.onboarding-next { display: flex; justify-content: space-between; align-items: center; gap: var(--s5); }
.onboarding-next h2 { font-size: 1.3rem; margin: .3rem 0; }
.onboarding-next p { max-width: 36rem; margin: .2rem 0 0; }
.onboarding-privacy { margin: var(--s4) 0; }

/* ---------- Workspace ---------- */
.sidebar-layout { display: grid; gap: var(--s6); grid-template-columns: 236px minmax(0,1fr); align-items: start; }
.sidebar { position: sticky; top: 92px; }
.sidebar nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s2); }
.sidebar nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; padding: .62rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 550; font-size: .95rem; }
.sidebar nav a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-800); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .nav-ico { width: 1.2rem; text-align: center; opacity: .8; }
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.ws-head h1 { margin: .3rem 0 0; font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.dash-grid { display: grid; gap: var(--s4); grid-template-columns: 1.3fr 1fr 1fr; }
.next-card { background: var(--brand-900); color: #fff; border: 0; }
.next-card h2, .next-card .panel-title { color: #fff; }
.next-card .muted, .next-card .small { color: rgba(255,255,255,.78); }
.next-card .btn { background: #fff; color: var(--brand-900); border-color: #fff; }
.next-card .btn:hover { background: var(--brand-50); color: var(--brand-900); }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list a { font-weight: 600; text-decoration: none; color: var(--ink); flex: 1 1 14rem; }
.task-list a:hover { color: var(--brand); }
.price { font-family: var(--display); font-size: 2.1rem; font-weight: 560; line-height: 1.1; }
.plan-card { display: flex; flex-direction: column; gap: var(--s2); }
.plan-card.featured { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15,85,69,.07), var(--shadow-2); }
.plan-card ul { padding-left: 1.1rem; margin: var(--s2) 0; }

/* ---------- Dialog & toast ---------- */
dialog.sd-dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(460px, calc(100vw - 2rem)); box-shadow: var(--shadow-3); color: var(--ink); }
dialog.sd-dialog::backdrop { background: rgba(10,25,20,.45); }
.sd-dialog .dlg-body { padding: var(--s5) var(--s5) var(--s4); }
.sd-dialog h2 { margin: 0 0 var(--s2); font-size: 1.3rem; }
.sd-dialog .dlg-actions { display: flex; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s5) var(--s5); flex-wrap: wrap; }
.toast-region { position: fixed; z-index: 300; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; width: min(440px, calc(100vw - 2rem)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .8rem 1rem; border-radius: 12px; box-shadow: var(--shadow-3); font-size: .95rem; animation: toast-in .25s var(--ease); pointer-events: auto; }
.toast.bad { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Clerk ---------- */
.auth-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,440px); gap: var(--s7); align-items: start; }
.auth-aside ul { padding-left: 1.1rem; display: grid; gap: .45rem; }
#clerk-mount { min-height: 300px; display: flex; justify-content: center; }
#clerk-mount .cl-rootBox { width: 100%; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s7) 0 var(--s6); font-size: var(--fs-sm); color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s6); }
footer.site strong { color: var(--ink); font-size: 1rem; }
footer.site ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0; }
footer.site a { color: var(--ink-2); text-decoration: none; }
footer.site a:hover { color: var(--brand); text-decoration: underline; }
.footer-meta { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .journey-grid, .steps-howto { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid .next-card { grid-column: 1 / -1; }
  .sidebar-layout { grid-template-columns: 200px minmax(0,1fr); gap: var(--s5); }
  .auth-layout { grid-template-columns: 1fr; gap: var(--s5); }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  nav.main { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); padding: var(--s2) clamp(1rem,3vw,2rem) var(--s4); display: none; }
  nav.main.open { display: block; }
  nav.main ul { flex-direction: column; align-items: stretch; gap: 2px; }
  nav.main a, nav.main button { width: 100%; border-radius: 12px; min-height: 48px; padding: .6rem .9rem; font-size: 1rem; }
  nav.main .nav-cta a, nav.main .nav-cta button { margin: .4rem 0 0; justify-content: center; }
  header.site .wrap { position: relative; }
  .hero-home { grid-template-columns: 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { overflow-x: auto; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav ul { display: flex; width: max-content; min-width: 100%; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brand); }
  .trust-wide, .footer-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .onboarding-next { display: block; }
  .onboarding-next .row { margin-top: var(--s4); }
  .section-heading { display: block; }
  .section-heading > p { margin-top: var(--s2); }
}
@media (max-width: 560px) {
  body { font-size: var(--fs-base); }
  main { padding: var(--s5) 0 var(--s7); }
  h2 { margin-top: var(--s6); }
  .card, .layer { padding: var(--s4); }
  .journey-grid, .steps-howto, .onboarding-grid, .dash-grid { grid-template-columns: 1fr; }
  .journey-card, .onboarding-choice { min-height: unset; }
  .hero-actions, .onboarding-next .row, .stack-mobile { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn, .onboarding-next .btn, .stack-mobile .btn { width: 100%; }
  .hero-panel { padding: var(--s5); border-radius: var(--r-lg); }
  .trust-wide { padding: var(--s5); }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .55rem; }
  .sd-dialog .dlg-actions .btn { flex: 1 1 100%; }
  th, td { padding: .6rem .65rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .badge, .btn, .card { border: 1px solid CanvasText; } }
@media print { header.site, footer.site, .sidebar, .btn { display: none !important; } body { background: #fff; } }

/* Touch-target refinements */
.back-link { min-height: 44px; }
.card h3 a { display: inline-block; padding: .2rem 0; text-decoration: none; color: var(--ink); }
.card h3 a:hover { color: var(--brand); text-decoration: underline; }
.listing-card { display: flex; flex-direction: column; gap: .4rem; }
.listing-card .meta { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); }
