/* ==========================================================================
   SafeID.app — design system
   High-trust fintech aesthetic: quiet neutrals, one accent, one "secure" hue.
   Every colour is a token; light/dark are two token sets.
   ========================================================================== */

/* ---------- Self-hosted fonts (no third-party requests) ---------- */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-var-latin.woff2") format("woff2-variations"), url("fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-var-latin.woff2") format("woff2-variations"), url("fonts/jetbrains-mono-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter Variable", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 22px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: 160ms;

  --topbar-h: 58px;
  --panel-w: 364px;

  /* Light theme */
  --bg: #f6f6f7;
  --bg-glow: rgba(62, 92, 245, .07);
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --surface-3: #e7e7eb;
  --border: rgba(16, 17, 24, .085);
  --border-strong: rgba(16, 17, 24, .16);
  --text: #0d0e12;
  --text-2: #50525c;
  --text-3: #868892;
  --accent: #3e5cf5;
  --accent-hover: #3050e8;
  --accent-soft: rgba(62, 92, 245, .09);
  --accent-ring: rgba(62, 92, 245, .28);
  --on-accent: #ffffff;
  --secure: #0f9e64;
  --secure-text: #0a7d4e;
  --secure-soft: rgba(15, 158, 100, .09);
  --secure-border: rgba(15, 158, 100, .28);
  --danger: #e03e45;
  --danger-soft: rgba(224, 62, 69, .09);
  --warn: #c26a00;
  --warn-soft: rgba(217, 119, 6, .1);
  --stage-bg: #ebebee;
  --stage-dot: rgba(16, 17, 24, .075);
  --mini-doc: #ffffff;
  --mini-line: #d9dae0;
  --toast-bg: #16171c;
  --toast-text: #f4f4f6;
  --shadow-xs: 0 1px 1px rgba(16, 17, 24, .04);
  --shadow-sm: 0 1px 2px rgba(16, 17, 24, .06), 0 1px 1px rgba(16, 17, 24, .03);
  --shadow-md: 0 1px 2px rgba(16, 17, 24, .04), 0 6px 20px -4px rgba(16, 17, 24, .1);
  --shadow-lg: 0 2px 6px rgba(16, 17, 24, .05), 0 28px 70px -12px rgba(16, 17, 24, .28);
  --glass: rgba(246, 246, 247, .78);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --bg-glow: rgba(109, 132, 255, .09);
    --surface: #111114;
    --surface-2: #18181c;
    --surface-3: #26262d;
    --border: rgba(255, 255, 255, .07);
    --border-strong: rgba(255, 255, 255, .13);
    --text: #ededf1;
    --text-2: #a3a4ae;
    --text-3: #6f707a;
    --accent: #6f86ff;
    --accent-hover: #8497ff;
    --accent-soft: rgba(111, 134, 255, .13);
    --accent-ring: rgba(111, 134, 255, .35);
    --on-accent: #ffffff;
    --secure: #34d399;
    --secure-text: #4ade9f;
    --secure-soft: rgba(52, 211, 153, .09);
    --secure-border: rgba(52, 211, 153, .26);
    --danger: #ff6b70;
    --danger-soft: rgba(255, 107, 112, .1);
    --warn: #f5a524;
    --warn-soft: rgba(245, 165, 36, .1);
    --stage-bg: #0c0c0f;
    --stage-dot: rgba(255, 255, 255, .05);
    --mini-doc: #2a2a31;
    --mini-line: #3b3b44;
    --toast-bg: #f4f4f6;
    --toast-text: #111114;
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 80px -10px rgba(0, 0, 0, .7);
    --glass: rgba(9, 9, 11, .74);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b;
  --bg-glow: rgba(109, 132, 255, .09);
  --surface: #111114;
  --surface-2: #18181c;
  --surface-3: #26262d;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #ededf1;
  --text-2: #a3a4ae;
  --text-3: #6f707a;
  --accent: #6f86ff;
  --accent-hover: #8497ff;
  --accent-soft: rgba(111, 134, 255, .13);
  --accent-ring: rgba(111, 134, 255, .35);
  --on-accent: #ffffff;
  --secure: #34d399;
  --secure-text: #4ade9f;
  --secure-soft: rgba(52, 211, 153, .09);
  --secure-border: rgba(52, 211, 153, .26);
  --danger: #ff6b70;
  --danger-soft: rgba(255, 107, 112, .1);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, .1);
  --stage-bg: #0c0c0f;
  --stage-dot: rgba(255, 255, 255, .05);
  --mini-doc: #2a2a31;
  --mini-line: #3b3b44;
  --toast-bg: #f4f4f6;
  --toast-text: #111114;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 80px -10px rgba(0, 0, 0, .7);
  --glass: rgba(9, 9, 11, .74);
  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* scroll-padding keeps focused/anchored content clear of the sticky top bar */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -180px, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss03", "cv05";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 620; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs); padding: .05em .35em; }
kbd {
  display: inline-block; min-width: 1.6em; padding: .05em .4em; text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: var(--r-xs); font-size: .82em; color: var(--text-2);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px;
  background: var(--accent); color: var(--on-accent); border-radius: var(--r-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 10px; }

/* thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 14px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 550; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid transparent; user-select: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 90ms var(--ease), opacity var(--dur);
}
.btn:active:not(:disabled) { transform: translateY(.5px) scale(.99); }
.btn:disabled { opacity: .42; }
.btn .i { width: 16px; height: 16px; }
.btn--primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(16, 17, 24, .18), 0 0 0 1px rgba(16, 17, 24, .06);
}
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); text-decoration: none; }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); text-decoration: none; }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn--danger { color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.btn--sm { --btn-h: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); gap: 6px; }
.btn--sm .i { width: 14px; height: 14px; }
.btn--lg { --btn-h: 46px; padding: 0 18px; font-size: 15px; border-radius: 12px; }
.btn--lg .i { width: 18px; height: 18px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: var(--r-sm); color: var(--text-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { opacity: .35; }
.icon-btn--sm { width: 26px; height: 26px; }
.icon-btn--sm .i { width: 15px; height: 15px; }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); font-size: 12.5px; font-weight: 520;
}
.link-btn .i { width: 13px; height: 13px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase;
}
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border);
}
.pill--ok { background: var(--secure-soft); color: var(--secure-text); border-color: var(--secure-border); }
.pill--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field__label, .range > label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 560; color: var(--text-2);
}
.field__help { font-size: 11.5px; color: var(--text-3); }
.field__help code { font-size: 11px; }
.field input[type="text"], .field input[type="password"], .field input[type="date"], .field select, .field textarea,
.fw-term-form input, .fw-term-form select {
  width: 100%; height: 36px; padding: 0 11px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 13.5px; outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { height: auto; min-height: 56px; padding: 8px 11px; resize: vertical; line-height: 1.45; font-family: var(--font-mono); font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus, .fw-term-form input:focus, .fw-term-form select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.field input::placeholder, .field textarea::placeholder, .fw-textarea::placeholder, .fw-term-form input::placeholder { color: var(--text-3); }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8b95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
  cursor: pointer;
}
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 8px; }
.field--inline { gap: 4px; }
.field--inline > span { font-size: 11.5px; font-weight: 560; color: var(--text-3); }

/* Switch */
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  position: relative; width: 36px; height: 21px; margin: 0; border-radius: 999px;
  background: var(--surface-3); cursor: pointer;
  transition: background-color 200ms var(--ease);
  box-shadow: inset 0 0 0 1px var(--border);
}
.switch::before {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .06);
  transition: transform 220ms var(--ease-spring);
}
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(15px); }
.switch:disabled { opacity: .4; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch-row__text { display: flex; flex-direction: column; gap: 2px; }
.switch-row__text strong { font-size: 13px; font-weight: 560; }
.switch-row__text small { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.switch-row .switch { margin-top: 1px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
/* Sub-option that belongs to the switch above it */
.check--sub {
  display: flex; align-items: flex-start; gap: 9px; margin-top: -4px; padding: 10px 12px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; line-height: 1.45; color: var(--text-3);
}
.check--sub input { margin-top: 1px; flex: none; }
.check--sub strong { color: var(--text); font-weight: 580; }
.check--sub:has(input:checked) { border-color: var(--accent-ring); background: var(--accent-soft); }

/* Quick-pick chips */
.picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.pick {
  height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 540; white-space: nowrap;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pick:hover { border-color: var(--border-strong); color: var(--text); }
.pick[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent); }

/* Range */
.range { display: flex; flex-direction: column; gap: 4px; }
.range output { font-family: var(--font-mono); font-size: 11.5px; color: var(--text); font-variant-numeric: tabular-nums; }
input[type="range"] {
  --fill: 50%;
  appearance: none; -webkit-appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0 var(--fill), var(--surface-3) var(--fill) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(16, 17, 24, .14), 0 1px 3px rgba(16, 17, 24, .25);
  transition: transform 120ms var(--ease);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 1px rgba(16, 17, 24, .14), 0 1px 3px rgba(16, 17, 24, .25);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-ring); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Segmented control */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.seg__btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.seg__btn .i { width: 16px; height: 16px; }
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.seg--lg .seg__btn { height: 34px; padding: 0 14px; font-size: 13.5px; }
.seg__num {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-3); font-size: 11px; font-weight: 650; color: var(--text-2);
}
.seg__btn.is-active .seg__num { background: var(--accent); color: var(--on-accent); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); justify-self: start; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; }
.brand__shield { fill: var(--text); }
.brand__bar { fill: var(--bg); }
.brand__line { fill: var(--secure); }
.brand__name { font-size: 16px; font-weight: 680; letter-spacing: -0.03em; }
.brand__tld { color: var(--text-3); font-weight: 520; }

.trust-badge {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 4px 0 12px;
  border-radius: 999px; background: var(--secure-soft); border: 1px solid var(--secure-border);
  color: var(--secure-text); font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.trust-badge:hover { box-shadow: 0 0 0 4px var(--secure-soft); }
.trust-badge__text { display: inline-flex; gap: 7px; white-space: nowrap; }
.trust-badge__sep { opacity: .55; }
.trust-badge__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--secure); flex: none;
  box-shadow: 0 0 0 0 var(--secure-border);
  animation: pulse 2.4s var(--ease) infinite;
}
.trust-badge__verify {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 560; white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.trust-badge:hover .trust-badge__verify { color: var(--accent); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--secure-border); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.topbar__actions { justify-self: end; display: flex; align-items: center; gap: 6px; }
.donate-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 12.5px; font-weight: 580; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.donate-btn .i { width: 15px; height: 15px; color: var(--danger); transition: transform 200ms var(--ease-spring); }
.donate-btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--danger) 45%, var(--border-strong)); }
.donate-btn:hover .i { transform: scale(1.15); fill: currentColor; }
.i--moon { display: none; }
:root[data-theme="dark"] .i--sun { display: none; }
:root[data-theme="dark"] .i--moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i--sun { display: none; }
  :root:not([data-theme="light"]) .i--moon { display: block; }
}

/* ---------- Hero ---------- */
.hero { max-width: 880px; margin: 0 auto; padding: 48px 20px 26px; text-align: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 4px 10px 4px 8px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  font-size: 12px; font-weight: 560; color: var(--text-2);
}
.hero__eyebrow .i { width: 14px; height: 14px; color: var(--secure); }
.hero__title { font-size: clamp(32px, 5.4vw, 56px); line-height: 1.04; letter-spacing: -0.042em; font-weight: 680; }
.hero__muted { color: var(--text-3); }
.hero__lead { max-width: 640px; margin: 16px auto 0; font-size: clamp(15px, 1.6vw, 17px); line-height: 1.55; color: var(--text-2); }
.hero__proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 20px; }
.hero__proof li { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 520; color: var(--text-2); }
.hero__proof .i { width: 15px; height: 15px; color: var(--secure); }

/* ---------- Mode tabs ---------- */
.modes { display: flex; justify-content: center; padding: 6px 20px 18px; }
.modes__track {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto;
}
.modes__tab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 560; color: var(--text-2); white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.modes__tab .i { width: 17px; height: 17px; }
.modes__tab:hover { color: var(--text); }
.modes__tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.modes__tab[aria-selected="true"] .i { color: var(--accent); }
.modes__short { display: none; }

/* ---------- Workspace ---------- */
.view--doc { max-width: 1480px; margin: 0 auto; padding: 0 20px; }
.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); gap: 14px;
  height: clamp(580px, calc(100vh - var(--topbar-h) - 36px), 1000px);
  height: clamp(580px, calc(100dvh - var(--topbar-h) - 36px), 1000px);
}
.workspace.is-empty { height: clamp(540px, calc(100dvh - var(--topbar-h) - 280px), 680px); }
.stage-col, .panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-md); overflow: hidden;
}

/* Toolbar */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 50px; padding: 0 8px; flex: none; border-bottom: 1px solid var(--border);
}
.toolbar__group { display: flex; align-items: center; gap: 2px; }
.toolbar__sep { width: 1px; height: 20px; margin: 0 6px; background: var(--border-strong); }
.toolbar__doc {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 4px 0 10px; height: 30px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.toolbar__doc .i { width: 14px; height: 14px; }
.toolbar__docname { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 520; color: var(--text); }
.zoom-label {
  min-width: 52px; height: 28px; padding: 0 6px; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.zoom-label:hover { background: var(--surface-2); color: var(--text); }
.i--eye { transition: color var(--dur); }

/* Stage */
.stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background-color: var(--stage-bg);
  background-image: radial-gradient(var(--stage-dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.stage.is-empty .stage__canvas { visibility: hidden; }

.dropzone {
  position: absolute; inset: 16px; display: grid; place-items: center; padding: 24px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__inner { max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.dropzone__icon {
  display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); color: var(--accent);
}
.dropzone__icon .i { width: 26px; height: 26px; }
.dropzone__title { font-size: 21px; letter-spacing: -0.025em; }
.dropzone__sub { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
.dropzone__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.dropzone__lock { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 12px; color: var(--secure-text); font-weight: 520; }
.dropzone__lock .i { width: 13px; height: 13px; }

.stage__dragover {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.stage__dragover > div {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; color: var(--accent);
}
.stage__hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
  max-width: calc(100% - 24px); padding: 7px 12px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  animation: fade-up 300ms var(--ease);
}
.stage__busy {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center;
  background: color-mix(in srgb, var(--stage-bg) 55%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.busy-card {
  width: min(320px, calc(100% - 32px)); display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.busy-card__text { display: flex; flex-direction: column; min-width: 0; }
.busy-card__text strong { font-size: 13.5px; font-weight: 600; }
.busy-card__text span { font-size: 12px; color: var(--text-2); }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.progress { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; width: 0%; background: var(--accent); border-radius: inherit; transition: width 200ms var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Page strip */
.pagestrip {
  position: relative; display: flex; gap: 8px; flex: none; padding: 10px 12px; overflow-x: auto; overflow-y: hidden;
  border-top: 1px solid var(--border); background: var(--surface);
}
.thumb {
  position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 78px; padding: 0; border-radius: var(--r-md); border: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.thumb__main { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; padding: 6px 6px 5px; border-radius: inherit; }
.thumb:hover { background: var(--surface-2); }
.thumb.is-current { border-color: var(--accent); background: var(--accent-soft); }
.thumb__img { display: grid; place-items: center; width: 64px; height: 64px; }
.thumb__img canvas { max-width: 64px; max-height: 64px; border-radius: 3px; box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-sm); background: #fff; }
.thumb__label { font-size: 11px; font-weight: 560; color: var(--text-2); font-variant-numeric: tabular-nums; }
.thumb__badge {
  position: absolute; top: 3px; left: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #0d0e12; color: #fff; font-size: 10.5px; font-weight: 650; display: grid; place-items: center;
}
.thumb__toggle {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; background: var(--surface); color: var(--text-2);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-sm);
}
.thumb__toggle .i { width: 13px; height: 13px; }
.thumb__toggle:hover { color: var(--text); }
.thumb.is-excluded .thumb__img { opacity: .32; filter: grayscale(1); }
.thumb.is-excluded .thumb__label { text-decoration: line-through; color: var(--text-3); }
.thumb.is-excluded .thumb__toggle { color: var(--danger); }
.thumb--add {
  justify-content: center; width: 78px; color: var(--text-3); border: 1.5px dashed var(--border-strong);
  font-size: 11px; font-weight: 560; gap: 4px;
}
.thumb--add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Panel ---------- */
.panel__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.card:last-child { border-bottom: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__title { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 620; letter-spacing: -0.01em; }
.card__title .i { width: 16px; height: 16px; color: var(--text-3); }
.card__meta { font-size: 11.5px; color: var(--text-3); }
.hint { font-size: 12px; line-height: 1.5; color: var(--text-3); }

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0;
  padding: 8px; border-radius: var(--r-md); text-align: left;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.preset:hover:not(:disabled) { border-color: var(--accent); background: var(--surface); }
.preset:active:not(:disabled) { transform: scale(.98); }
.preset:disabled { opacity: .45; }
.preset.is-applied { border-color: var(--secure-border); background: var(--secure-soft); }
.preset__name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.preset__desc { font-size: 11px; color: var(--text-3); }
.preset__art {
  position: relative; width: 100%; height: 40px; margin-bottom: 6px; border-radius: 5px;
  background:
    linear-gradient(var(--mini-line), var(--mini-line)) 42% 30% / 34% 2px no-repeat,
    linear-gradient(var(--mini-line), var(--mini-line)) 42% 46% / 44% 2px no-repeat,
    linear-gradient(var(--mini-line), var(--mini-line)) 42% 62% / 28% 2px no-repeat,
    linear-gradient(var(--mini-line), var(--mini-line)) 8% 30% / 16% 44% no-repeat,
    var(--mini-doc);
  box-shadow: 0 0 0 1px var(--border);
}
.preset__art::after { content: ""; position: absolute; background: #050507; border-radius: 1.5px; }
.preset__art--mrz2::after { left: 5%; right: 5%; bottom: 8%; height: 20%; }
.preset__art--mrz3::after { left: 5%; right: 5%; bottom: 7%; height: 32%; }
.preset__art--docno::after { right: 5%; top: 9%; width: 30%; height: 16%; }
.preset__art--ssn::after { left: 28%; top: 40%; width: 44%; height: 18%; }
.preset__art--txn::after { left: 5%; right: 5%; top: 44%; bottom: 7%; }
.preset__art--bal::after { right: 5%; top: 18%; width: 38%; height: 24%; }
.preset__art--acct::after { right: 5%; top: 9%; width: 38%; height: 10%; }
.preset__art--below::after { left: 0; right: 0; top: 36%; bottom: 0; border-radius: 0 0 5px 5px; }

.keep-hide { display: flex; flex-direction: column; gap: 6px; }
.keep-hide li { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.keep-hide .i { width: 15px; height: 15px; margin-top: 1px; }
.keep-hide__keep .i { color: var(--secure); }
.keep-hide__hide .i { color: var(--danger); }
.keep-hide strong { color: var(--text); font-weight: 580; }
.stack-btns { display: flex; flex-direction: column; gap: 6px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* Redaction list */
.box-list { display: flex; flex-direction: column; gap: 2px; }
.box-list:empty { display: none; }
.box-item {
  display: flex; align-items: center; gap: 10px; padding: 5px 4px 5px 8px; border-radius: var(--r-sm);
  cursor: pointer; transition: background-color var(--dur) var(--ease);
}
.box-item:hover { background: var(--surface-2); }
.box-item.is-selected { background: var(--accent-soft); }
.box-item__swatch { width: 14px; height: 10px; border-radius: 2px; background: #050507; box-shadow: 0 0 0 1px var(--border-strong); flex: none; }
.box-item__label { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-item__size { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.hint--empty { padding: 2px 0; }

/* Watermark */
.wm-body { display: flex; flex-direction: column; gap: 14px; transition: opacity var(--dur) var(--ease); }
.wm-body.is-off { opacity: .45; pointer-events: none; }
.wm-resolved {
  display: block; padding: 8px 10px; border-radius: var(--r-sm); border: 1px dashed var(--border-strong);
  background: var(--surface-2); font-family: var(--font-mono); font-size: 11px; line-height: 1.5; color: var(--text-2);
  word-break: break-word;
}
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch--crimson { background: #c4161c; }
.swatch--graphite { background: #1f2430; }
.swatch--cobalt { background: #1d4ed8; }
.swatch--white { background: #ffffff; }

/* Scan list */
.scan-list { display: flex; flex-direction: column; gap: 8px; }
.scan-list:empty { display: none; }
.scan-item { display: flex; gap: 10px; align-items: flex-start; }
.scan-item__icon {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.scan-item__icon .i { width: 14px; height: 14px; }
.scan-item--high .scan-item__icon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.scan-item--ok .scan-item__icon { background: var(--secure-soft); color: var(--secure); border-color: transparent; }
.scan-item__body { display: flex; flex-direction: column; min-width: 0; }
.scan-item__label { font-size: 12.5px; font-weight: 580; }
.scan-item__value { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); word-break: break-word; }
.scan-item__value s { color: var(--text-3); }

/* Export footer */
.panel__footer {
  flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 16px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.export-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-opts select { height: 32px; font-size: 13px; }
.fineprint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.fineprint .i { width: 12px; height: 12px; color: var(--secure); }

/* ---------- Firewall ---------- */
.view--firewall { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.fw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.fw-head__text h2 { font-size: 22px; letter-spacing: -0.03em; }
.fw-head__text p { max-width: 680px; margin-top: 6px; color: var(--text-2); font-size: 14px; }
.fw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fw-grid--lower { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-top: 14px; }
.fw-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-md);
}
.fw-card--accent { box-shadow: var(--shadow-md), inset 0 1px 0 var(--accent-soft); }
.fw-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.fw-card__head h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 620; }
.fw-card__head h3 .i { width: 16px; height: 16px; color: var(--secure); }
.fw-card__head--sub { margin-top: 6px; }
.fw-card__head--sub h3 .i { color: var(--text-3); }
.fw-card__actions { display: flex; gap: 2px; }
.fw-card__meta { font-size: 11.5px; color: var(--text-3); }
.fw-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fw-stat { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fw-textarea, .fw-output {
  width: 100%; min-height: 340px; padding: 12px 14px; border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 12.75px; line-height: 1.65;
}
.fw-textarea {
  resize: vertical; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.fw-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fw-output {
  max-height: 560px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--border);
}
.fw-placeholder { color: var(--text-3); font-family: var(--font-sans); font-size: 13px; }
.tok {
  padding: 0 3px; border-radius: 4px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.tok--restored { background: var(--secure-soft); color: var(--secure-text); box-shadow: inset 0 0 0 1px var(--secure-border); font-weight: 560; }
.tok--unknown { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.fw-entities { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; max-height: 280px; overflow: auto; }
.entity {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 28px; padding: 0 10px 0 4px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px;
  transition: opacity var(--dur), border-color var(--dur);
}
.entity:hover { border-color: var(--border-strong); }
.entity__tok { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: 11px; font-weight: 650; }
.entity__val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; color: var(--text-2); }
.entity.is-kept { opacity: .55; }
.entity.is-kept .entity__tok { text-decoration: line-through; background: var(--surface-3); color: var(--text-3); }
.fw-detectors { display: flex; flex-wrap: wrap; gap: 6px; }
.det {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
}
.det input { accent-color: var(--accent); margin: 0; width: 13px; height: 13px; }
.det:has(input:checked) { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.fw-term-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.fw-term-form input, .fw-term-form select { height: 30px; font-size: 12.5px; }
.fw-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.fw-terms:empty { display: none; }
.term {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px;
}
.term small { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.term button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--text-3); }
.term button:hover { background: var(--surface-3); color: var(--text); }
.term button .i { width: 12px; height: 12px; }

/* ---------- Explainer & FAQ ---------- */
.explainer { max-width: 1120px; margin: 72px auto 0; padding: 0 20px; }
.explainer__title { text-align: center; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.03em; }
.explainer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.step { padding: 22px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.step__num { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent); }
.step h3 { margin-top: 10px; font-size: 16px; }
.step p { margin-top: 6px; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.faq { max-width: 760px; margin: 48px auto 0; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px;
  font-size: 15px; font-weight: 580; letter-spacing: -0.01em; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 9px; height: 9px; flex: none; margin-right: 4px;
  border-right: 1.75px solid var(--text-3); border-bottom: 1.75px solid var(--text-3);
  transform: rotate(45deg) translateY(-3px); transition: transform 200ms var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq details p { padding: 0 2px 18px; font-size: 14px; line-height: 1.6; color: var(--text-2); }

.footer { margin-top: 72px; border-top: 1px solid var(--border); }
.footer__inner {
  max-width: 1480px; margin: 0 auto; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3);
}
.footer__brand strong { color: var(--text); margin-right: 8px; }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer__links a, .footer__links .link-btn { color: var(--text-2); font-size: 12.5px; font-weight: 500; }

/* ---------- Modals ---------- */
.modal {
  width: min(560px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px);
  padding: 0; margin: auto; border: 0; background: transparent; color: var(--text); overflow: visible;
}
.modal--wide { width: min(780px, calc(100vw - 24px)); }
.modal--narrow { width: min(420px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(6, 6, 10, .56); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in 260ms var(--ease); }
.modal[open]::backdrop { animation: fade-in 200ms var(--ease); }
.modal__card {
  position: relative; display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 30px 28px 24px; border-radius: var(--r-2xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
/* Children keep their natural height; the card scrolls instead of squashing them. */
.modal__card > * { flex-shrink: 0; }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal__icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; align-self: center;
  background: var(--accent-soft); color: var(--accent);
}
.modal__icon .i { width: 24px; height: 24px; }
.modal__icon--secure { background: var(--secure-soft); color: var(--secure); }
.modal__title:focus { outline: none; }
.modal__title { text-align: center; font-size: 22px; letter-spacing: -0.03em; font-weight: 660; }
.modal__lead { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.modal__lead--center { text-align: center; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal__dismiss { margin-top: -4px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Verify */
.codeblock { border-radius: var(--r-lg); overflow: hidden; border: 1px solid rgba(255, 255, 255, .06); background: #0c0d11; }
.codeblock__head {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 14px;
  background: #15161c; color: #9a9caa; font-family: var(--font-mono); font-size: 11.5px;
}
.codeblock__head .link-btn { color: #aab6ff; }
.codeblock pre { margin: 0; padding: 14px; color: #c9cbd6; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.csp-dir { color: #8ea2ff; }
.csp-hot { color: #4ade9f; font-weight: 700; background: rgba(74, 222, 159, .1); border-radius: 4px; padding: 0 3px; }
.verify-live { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.verify-live__stat {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); line-height: 1.35;
}
.verify-live__num { font-family: var(--font-mono); font-size: 26px; font-weight: 620; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.verify-live__stat:first-child .verify-live__num { color: var(--secure-text); }
.verify-test { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px dashed var(--border-strong); }
.verify-test__result { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.verify-test__result.is-ok { color: var(--secure-text); font-weight: 560; }
.verify-test__result.is-bad { color: var(--warn); font-weight: 560; }
.verify-ext {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border);
}
.verify-ext.is-warn { background: var(--warn-soft); border-color: transparent; }
.verify-ext__icon {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px;
  background: var(--secure-soft); color: var(--secure);
}
.verify-ext.is-warn .verify-ext__icon { background: var(--surface); color: var(--warn); }
.verify-ext__icon .i { width: 16px; height: 16px; }
.verify-ext__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.verify-ext__body strong { font-size: 13.5px; color: var(--text); font-weight: 600; }
.verify-ext__list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.verify-ext__list:empty { display: none; }
.verify-ext__list li, .verify-ext__list strong { font-size: 12px; }

/* Browser-extension warning banner */
.ext-banner {
  display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 16px auto 0; padding: 12px 12px 12px 16px;
  border-radius: var(--r-lg); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--text-2); font-size: 13px; line-height: 1.5;
  animation: fade-in 240ms var(--ease);
}
.ext-banner__icon { width: 20px; height: 20px; color: var(--warn); flex: none; }
.ext-banner__text { flex: 1; min-width: 0; }
.ext-banner__text strong { color: var(--text); font-weight: 600; }

.verify-steps { counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.verify-steps li { counter-increment: step; position: relative; padding-left: 34px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.verify-steps li strong { color: var(--text); font-weight: 600; }
.verify-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 650; color: var(--text-2);
}
.netlog summary { cursor: pointer; font-size: 12.5px; font-weight: 560; color: var(--text-2); }
.netlog__list { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow: auto; }
.netlog__list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 4px 8px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
}
.netlog__list li:nth-child(odd) { background: var(--surface-2); }
.netlog__list li.is-after { color: var(--warn); }
.netlog__list span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Success + donate */
.success-burst {
  position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; align-self: center;
  background: var(--secure); color: #fff; box-shadow: 0 10px 30px -8px var(--secure);
  animation: burst 520ms var(--ease-spring);
}
.success-burst::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--secure-border);
  animation: ring 1.6s var(--ease) 200ms both;
}
.success-burst .i { width: 30px; height: 30px; stroke-width: 2.6; }
@keyframes burst { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ring { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.receipt { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); }
.receipt li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.receipt li .i { width: 16px; height: 16px; margin-top: 1px; color: var(--secure); }
.receipt li strong { color: var(--text); font-weight: 580; }
.receipt code { font-size: 11.5px; overflow-wrap: anywhere; }
.receipt-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.donate { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.donate__ask { text-align: center; font-size: 14px; font-weight: 540; color: var(--text); line-height: 1.5; text-wrap: balance; }
.donate__grid { display: flex; flex-direction: column; gap: 10px; }
.btc { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); }
.btc__qr { flex: none; width: 124px; height: 124px; padding: 8px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.btc__qr svg { display: block; width: 100%; height: 100%; }
.btc__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Keyboard shortcuts sheet */
.keys { display: flex; flex-direction: column; margin: 0; }
.keys__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.keys__row:last-child { border-bottom: 0; }
.keys dt { font-size: 13px; color: var(--text-2); }
.keys dd { display: flex; gap: 4px; margin: 0; flex: none; }
.seg--crypto { align-self: flex-start; }
.seg--crypto .seg__btn { height: 26px; padding: 0 9px; font-size: 11.5px; gap: 5px; }
.seg--crypto .seg__btn .i { width: 13px; height: 13px; }
.btc__label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.btc__label .i { width: 15px; height: 15px; color: #f7931a; }
.btc__addr {
  display: block; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; line-height: 1.45; word-break: break-all; user-select: all; -webkit-user-select: all;
}
.btc__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bmac {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg);
  background: #ffdd00; color: #0d0c22; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  transition: filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.bmac:hover { filter: brightness(1.04); text-decoration: none; transform: translateY(-1px); }
.bmac > .i { width: 22px; height: 22px; }
.bmac span { display: flex; flex-direction: column; flex: 1; line-height: 1.3; }
.bmac strong { font-size: 14px; font-weight: 680; }
.bmac small { font-size: 11.5px; opacity: .7; }
.bmac__arrow { width: 16px !important; height: 16px !important; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 24px);
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 520; pointer-events: none; max-width: 100%;
  animation: toast-in 260ms var(--ease-spring);
}
.toast .i { width: 16px; height: 16px; }
.toast--success .i { color: #3ddc97; }
.toast--error .i { color: #ff6b70; }
.toast--info .i { color: #8ea2ff; }
.toast.is-leaving { animation: toast-out 200ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  :root { --panel-w: 330px; }
}
@media (max-width: 940px) {
  .workspace, .workspace.is-empty { grid-template-columns: 1fr; height: auto; }
  .stage-col { height: clamp(440px, 72svh, 760px); }
  .workspace.is-empty .stage-col { height: clamp(400px, 58svh, 560px); }
  .panel { overflow: visible; }
  .panel__scroll { overflow: visible; }
  .panel__footer { position: sticky; bottom: 0; z-index: 10; border-radius: 0 0 var(--r-xl) var(--r-xl); box-shadow: 0 -10px 24px -16px rgba(0, 0, 0, .25); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .fw-grid, .fw-grid--lower { grid-template-columns: 1fr; }
  .fw-head { flex-direction: column; align-items: stretch; }
  .fw-head .seg { align-self: flex-start; }
  .explainer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar__inner { grid-template-columns: auto 1fr auto; padding: 0 12px; }
  .trust-badge { justify-self: center; padding: 0 10px; gap: 7px; font-size: 11.5px; height: 30px; }
  .trust-badge__verify { display: none; }
  .brand__tld { display: none; }
  .toolbar__docname { max-width: 120px; }
  .seg__label { display: none; }
  .hide-sm { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .hero { padding: 34px 16px 20px; }
  .hero__proof { gap: 6px 14px; }
  .hero__proof li { font-size: 12px; }
  .modes { padding: 4px 10px 14px; }
  .modes__track { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .modes__tab { flex-direction: column; justify-content: center; height: 54px; padding: 0 4px; font-size: 12px; gap: 3px; }
  .modes__tab .tag { display: none; }
  .modes__long { display: none; }
  .modes__short { display: inline; }
  .view--doc, .view--firewall { padding: 0 10px; }
  .toolbar { padding: 0 4px; gap: 2px; }
  .toolbar__doc { display: none !important; }
  .toolbar__sep { margin: 0 2px; }
  .icon-btn { width: 32px; height: 32px; }
  .zoom-label { min-width: 44px; }
  .panel__scroll { padding: 4px 14px; }
  .panel__footer { padding-left: 14px; padding-right: 14px; }
  .field-row { grid-template-columns: 1fr; }
  .modal__card { padding: 26px 18px 18px; border-radius: 18px; }
  .verify-live { grid-template-columns: 1fr; }
  .verify-live__stat { flex-direction: row; align-items: center; gap: 12px; }
  .verify-live__num { font-size: 20px; min-width: 40px; }
  .verify-test { flex-direction: column; align-items: stretch; }
  .ext-banner { flex-wrap: wrap; align-items: flex-start; margin: 12px 10px 0; }
  .ext-banner__icon { margin-top: 2px; }
  .ext-banner__text { flex-basis: calc(100% - 64px); }
  .btc { flex-direction: column; text-align: center; }
  .btc__body { align-items: center; width: 100%; }
  .seg--crypto { align-self: center; }
  .btc__addr { width: 100%; }
  .btc__actions { justify-content: center; }
  .trust-badge__text > span:first-child { display: none; }
  .trust-badge__sep { display: none; }
  .fw-term-form { grid-template-columns: 1fr 1fr; }
  .fw-term-form input { grid-column: 1 / -1; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
/* Very small phones: logo-only brand so Donate and the theme toggle always fit. */
@media (max-width: 379px) {
  .brand__name { display: none; }
  .topbar__inner { gap: 8px; }
}
@media (hover: none) {
  .preset:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); }
}
@media (pointer: coarse) {
  .hide-touch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .modes, .explainer, .footer, .toasts { display: none !important; }
}
