/* ==========================================================================
   Mandate Studio — design system
   Layout concept: liquid-glass surfaces floating over a deep blue-green
   black canvas (dark-first), mirrored to a cool mist-white light theme.
   One accent family (blue into green, cyan where they meet), one display
   face (Archivo Expanded Black), one UI face (Plus Jakarta Sans).
   Glass, pills and radii follow the Roletrips system.
   ========================================================================== */

:root {
  color-scheme: dark;
  /* canvas + surfaces */
  --bg: #050b0f;
  --bg-raise: #0b161c;
  --glass: rgba(15, 32, 42, 0.56);
  --glass-2: rgba(21, 42, 55, 0.74);
  --glass-solid: #0f1b22;
  --stroke: rgba(255, 255, 255, 0.085);
  --stroke-2: rgba(255, 255, 255, 0.16);
  --hi: rgba(255, 255, 255, 0.13);
  --edge-glow: rgba(255, 255, 255, 0.07);
  /* text */
  --fg: #f1f7f9;
  --fg-2: #cddbe1;
  --muted: #94a9b3;
  --faint: #5f7480;
  /* accent: blue into green */
  --accent: #1fc0db;
  --accent-2: #34d399;
  --accent-ink: #7adcf0;
  --accent-soft: rgba(31, 192, 219, 0.15);
  --accent-line: rgba(100, 214, 236, 0.42);
  --btn-a: #3b82f6;
  --btn-b: #10b981;
  --grad-a: #6aa8ff;
  --grad-b: #3ee0a1;
  --orb-a: #2563eb;
  --orb-b: #0d9f7a;
  --orb-c: #064e4a;
  --on-accent: #03141b;
  --inv-grad-a: #1d5fd6;
  --inv-grad-b: #067a52;
  --lit: rgba(31, 160, 219, 0.3);
  /* inverse (white pill on dark, ink pill on light) */
  --inv-bg: #f1f7f9;
  --inv-fg: #06131a;
  /* semantic (never the accent) */
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, 0.12);
  /* document paper (always light: it previews what the client receives) */
  --paper: #ffffff;
  --paper-ink: #0f1a1f;
  --paper-muted: #4f6069;
  --paper-line: #dde7eb;
  --paper-accent: #0e7490;
  /* depth */
  --shadow: 0 30px 70px -32px rgba(0, 0, 0, 0.9);
  --shadow-sm: 0 12px 30px -14px rgba(0, 0, 0, 0.7);
  /* ambient light behind the glass */
  --blob-1: rgba(37, 99, 235, 0.4);
  --blob-2: rgba(16, 185, 129, 0.24);
  --blob-3: rgba(6, 70, 90, 0.5);
  --grain: 0.06;

  --font-display: "Archivo", "Arial Black", "Helvetica Neue", sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #edf3f5;
    --bg-raise: #ffffff;
    --glass: rgba(255, 255, 255, 0.6);
    --glass-2: rgba(255, 255, 255, 0.84);
    --glass-solid: #ffffff;
    --stroke: rgba(6, 48, 66, 0.1);
    --stroke-2: rgba(6, 48, 66, 0.18);
    --hi: rgba(255, 255, 255, 0.95);
    --edge-glow: rgba(255, 255, 255, 0.7);
    --fg: #0a161b;
    --fg-2: #2b3c44;
    --muted: #536770;
    --faint: #869aa3;
    --accent: #0891b2;
    --accent-2: #059669;
    --accent-ink: #0b6c87;
    --accent-soft: rgba(8, 145, 178, 0.1);
    --accent-line: rgba(8, 145, 178, 0.34);
    --btn-a: #2563eb;
    --btn-b: #047857;
    --grad-a: #1d5fd6;
    --grad-b: #067a52;
    --on-accent: #ffffff;
    --inv-grad-a: #6aa8ff;
    --inv-grad-b: #3ee0a1;
    --lit: rgba(14, 165, 200, 0.15);
    --inv-bg: #0c1a20;
    --inv-fg: #ffffff;
    --ok: #047857;
    --ok-soft: rgba(4, 120, 87, 0.09);
    --warn: #a3520a;
    --warn-soft: rgba(180, 83, 9, 0.09);
    --bad: #be123c;
    --bad-soft: rgba(190, 18, 60, 0.07);
    --shadow: 0 26px 60px -30px rgba(8, 52, 72, 0.3);
    --shadow-sm: 0 10px 26px -14px rgba(8, 52, 72, 0.24);
    --blob-1: rgba(59, 130, 246, 0.18);
    --blob-2: rgba(16, 185, 129, 0.18);
    --blob-3: rgba(34, 211, 238, 0.14);
    --grain: 0.035;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f5;
  --bg-raise: #ffffff;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-2: rgba(255, 255, 255, 0.84);
  --glass-solid: #ffffff;
  --stroke: rgba(6, 48, 66, 0.1);
  --stroke-2: rgba(6, 48, 66, 0.18);
  --hi: rgba(255, 255, 255, 0.95);
  --edge-glow: rgba(255, 255, 255, 0.7);
  --fg: #0a161b;
  --fg-2: #2b3c44;
  --muted: #536770;
  --faint: #869aa3;
  --accent: #0891b2;
  --accent-2: #059669;
  --accent-ink: #0b6c87;
  --accent-soft: rgba(8, 145, 178, 0.1);
  --accent-line: rgba(8, 145, 178, 0.34);
  --btn-a: #2563eb;
  --btn-b: #047857;
  --grad-a: #1d5fd6;
  --grad-b: #067a52;
  --on-accent: #ffffff;
  --inv-grad-a: #6aa8ff;
  --inv-grad-b: #3ee0a1;
  --lit: rgba(14, 165, 200, 0.15);
  --inv-bg: #0c1a20;
  --inv-fg: #ffffff;
  --ok: #047857;
  --ok-soft: rgba(4, 120, 87, 0.09);
  --warn: #a3520a;
  --warn-soft: rgba(180, 83, 9, 0.09);
  --bad: #be123c;
  --bad-soft: rgba(190, 18, 60, 0.07);
  --shadow: 0 26px 60px -30px rgba(8, 52, 72, 0.3);
  --shadow-sm: 0 10px 26px -14px rgba(8, 52, 72, 0.24);
  --blob-1: rgba(59, 130, 246, 0.18);
  --blob-2: rgba(16, 185, 129, 0.18);
  --blob-3: rgba(34, 211, 238, 0.14);
  --grain: 0.035;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--fg); }

/* ambient blue-green light + grain behind every glass surface */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.ambient::before, .ambient::after, .ambient i {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px);
}
.ambient::before { width: 62vw; height: 62vw; left: -18vw; top: -26vw; background: var(--blob-3); }
.ambient::after { width: 46vw; height: 46vw; right: -12vw; top: 8vh; background: var(--blob-1); opacity: 0.75; }
.ambient i { width: 40vw; height: 40vw; left: 30vw; bottom: -28vw; background: var(--blob-2); }
.ambient b {
  position: absolute; inset: 0; opacity: var(--grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-weight: 900; font-stretch: 125%; letter-spacing: -0.025em; line-height: 0.95; text-transform: uppercase; }
.eyebrow { font: 700 11px/1.3 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.micro { font: 700 10.5px/1.3 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.grad-text {
  background: linear-gradient(100deg, var(--grad-a) 0%, var(--grad-b) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- icons ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i-lg { width: 22px; height: 22px; }

/* ---------- liquid glass ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hi);
}
/* liquid edge: light pooled along the rim, clear in the middle */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 36px var(--edge-glow), inset 0 0 0 1px var(--edge-glow);
  -webkit-mask-image: radial-gradient(transparent 46%, #000);
  mask-image: radial-gradient(transparent 46%, #000);
}
.glass > * { position: relative; z-index: 1; }
.glass--lit { background: radial-gradient(120% 90% at 100% 0%, var(--lit) 0%, transparent 58%), var(--glass); }
.glass--lit-l { background: radial-gradient(120% 90% at 0% 0%, var(--lit) 0%, transparent 58%), var(--glass); }
.glass--solid { background: var(--glass-2); }
.glass--flat { box-shadow: inset 0 1px 0 var(--hi); }

/* spotlight rim that follows the pointer (set --mx/--my in JS) */
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-line), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity 0.4s ease;
}
.spot:hover::before { opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  --h: 46px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  height: var(--h); padding: 0 1.3rem;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 700 14px/1 var(--font-ui); letter-spacing: 0.01em; text-decoration: none; white-space: nowrap;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background-color 0.2s, color 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.965); transition-duration: 0.12s; }
.btn .i { transition: transform 0.45s var(--spring); }
.btn:hover .i-arrow { transform: translateX(3px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--btn-a) 0%, var(--btn-b) 100%);
  box-shadow: 0 12px 30px -12px var(--btn-a), inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -2px 8px rgba(0, 26, 38, 0.35);
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.32) 50%, transparent 68%);
  transform: translateX(-130%); transition: transform 0.9s var(--ease);
}
.btn-primary:hover { box-shadow: 0 18px 38px -12px var(--btn-a), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 8px rgba(0, 26, 38, 0.35); }
.btn-primary:hover::before { transform: translateX(130%); }

/* glass pill with an accent rim (Roletrips "botao-liquid") */
.btn-glass {
  color: var(--fg);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  box-shadow: inset 0 1.5px 1px var(--hi), inset 0 -2px 6px rgba(0, 0, 0, 0.18), var(--shadow-sm);
}
.btn-glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-ink), var(--accent)) 0 0 / 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.45; transition: opacity 0.3s, background-position 1.2s var(--ease);
}
.btn-glass:hover::after { opacity: 0.95; background-position: 100% 0; }

.btn-inverse { color: var(--inv-fg); background: var(--inv-bg); box-shadow: var(--shadow-sm); }
.btn-inverse:hover { transform: translateY(-1px); }
.btn-quiet { color: var(--fg-2); background: transparent; }
.btn-quiet:hover { background: var(--accent-soft); color: var(--fg); }
.btn-line { color: var(--fg); background: transparent; box-shadow: inset 0 0 0 1px var(--stroke-2); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--accent-line); background: var(--accent-soft); }
.btn-danger-line { color: var(--bad); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.btn-danger-line:hover { background: var(--bad-soft); }
.btn-sm { --h: 38px; padding: 0 1rem; font-size: 13px; }
.btn-xs { --h: 32px; padding: 0 0.8rem; font-size: 12.5px; }
.btn-lg { --h: 54px; padding: 0 1.7rem; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--stroke); background: var(--glass-2); color: var(--fg-2); cursor: pointer;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 var(--hi);
  transition: transform 0.35s var(--spring), color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--accent-line); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 10px; }
/* headings and regions that receive focus from script after navigation */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, span[tabindex="-1"]:focus { outline: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible { border-radius: 999px; }

/* ---------- chips & marks ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--stroke-2); background: var(--glass-2);
  font: 700 11.5px/1.2 var(--font-ui); letter-spacing: 0.02em; color: var(--fg-2); white-space: nowrap;
}
.chip .i { width: 13px; height: 13px; }
.chip--accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.chip--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 38%, transparent); color: var(--ok); }
.chip--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.chip--bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.chip--ghost { background: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot--pulse { position: relative; }
.dot--pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor; animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- liquid indicator (nav, rail, tabs, segmented) ----------
   Two edges move on different clocks: the leading edge races ahead, the
   trailing edge catches up, so the pill stretches and settles like a drop. */
.liquid { position: relative; }
.liquid-active, .liquid-hover {
  position: absolute; z-index: 0; pointer-events: none; border-radius: 999px;
  left: var(--l, 0); right: var(--r, 100%); top: var(--t, 0); bottom: var(--b, 0);
  transition:
    left var(--tl, 0.45s) var(--ease), right var(--tr, 0.45s) var(--ease),
    top var(--tt, 0.45s) var(--ease), bottom var(--tb, 0.45s) var(--ease),
    opacity 0.25s ease, transform 0.3s var(--spring);
}
.liquid-active {
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 8px 22px -8px var(--btn-a), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.liquid-hover { background: var(--accent-soft); opacity: 0; }
.liquid.is-hovering .liquid-hover { opacity: 1; }
.liquid-active.is-moving { transform: scale(0.94, 0.86); }
.liquid[data-liquid="y"] .liquid-active.is-moving { transform: scale(0.86, 0.94); }
.liquid.no-anim .liquid-active, .liquid.no-anim .liquid-hover { transition: none; }
.liquid [data-liq-item] { position: relative; z-index: 1; }
.liquid-active.is-hidden { opacity: 0; }

/* ---------- theme toggle ---------- */
.theme-toggle {
  position: relative; display: inline-flex; align-items: center; padding: 4px; gap: 2px;
  border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass-2); cursor: pointer;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 var(--hi);
}
.theme-toggle span { position: relative; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: color 0.3s; }
.theme-toggle span .i { width: 17px; height: 17px; transition: transform 0.6s var(--spring); }
.theme-toggle::before {
  content: ""; position: absolute; z-index: 0; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--inv-bg); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  transition: transform 0.55s var(--spring);
}
.theme-toggle[data-mode="dark"]::before { transform: translateX(34px); }
.theme-toggle[data-mode="light"] .t-sun, .theme-toggle[data-mode="dark"] .t-moon { color: var(--inv-fg); }
.theme-toggle[data-mode="light"] .t-sun .i { transform: rotate(90deg); }
.theme-toggle[data-mode="dark"] .t-moon .i { transform: rotate(-20deg) scale(1.05); }
.theme-toggle--v { flex-direction: column; }
.theme-toggle--v[data-mode="dark"]::before { transform: translateY(34px); }

/* ---------- language toggle (same knob as the theme toggle) ---------- */
html.i18n-pending body { visibility: hidden; }
.lang-toggle { position: relative; display: inline-flex; align-items: center; padding: 4px; gap: 2px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass-2); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 var(--hi); }
.lang-toggle::before { content: ""; position: absolute; z-index: 0; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--inv-bg); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.5); transition: transform 0.55s var(--spring); }
.lang-toggle[data-now="pt"]::before { transform: translateX(34px); }
.lang-toggle button { position: relative; z-index: 1; width: 32px; height: 32px; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; font: 800 11px/1 var(--font-ui); letter-spacing: 0.04em; color: var(--muted); transition: color 0.3s, transform 0.4s var(--spring); }
.lang-toggle button:active { transform: scale(0.9); }
.lang-toggle button[aria-pressed="true"] { color: var(--inv-fg); }
.lang-toggle button:focus-visible { border-radius: 50%; }
.lang-toggle--v { flex-direction: column; }
.lang-toggle--v[data-now="pt"]::before { transform: translateY(34px); }
html.vt-lang::view-transition-old(root) { animation: vt-lang-out 0.22s ease both; }
html.vt-lang::view-transition-new(root) { animation: vt-lang-in 0.38s var(--ease) both; }
@keyframes vt-lang-out { to { opacity: 0; filter: blur(4px); } }
@keyframes vt-lang-in { from { opacity: 0; filter: blur(4px); } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label, .label { font: 700 12.5px/1.3 var(--font-ui); color: var(--fg-2); }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--stroke-2); background: var(--glass-2); color: var(--fg);
  font: 500 15px/1.45 var(--font-ui);
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), background-color 0.2s;
}
.textarea { resize: vertical; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.85; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--accent-line); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a49eb6' stroke-width='2.4' 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 14px center; background-size: 16px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; font: 600 12.5px/1.4 var(--font-ui); color: var(--bad); }
.field-hint { font: 500 12.5px/1.45 var(--font-ui); color: var(--muted); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 600 13px/1.3 var(--font-ui); color: var(--fg-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 999px; background: var(--stroke-2); position: relative; transition: background-color 0.25s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.45s var(--spring), width 0.25s var(--ease); }
.switch input:checked + .track { background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch:active .track::after { width: 22px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

/* custom checkbox */
.check { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 1.5px solid var(--stroke-2); display: grid; place-items: center; transition: background-color 0.2s, border-color 0.2s, transform 0.35s var(--spring); background: var(--glass-2); }
.check .box svg { width: 14px; height: 14px; stroke: var(--on-accent); stroke-width: 3; fill: none; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 0.35s var(--ease); }
.check input:checked + .box { background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); border-color: transparent; }
.check input:checked + .box svg { stroke-dashoffset: 0; }
.check:active .box { transform: scale(0.88); }
.check input:focus-visible + .box { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

/* radio cards */
.radio-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--stroke-2); background: var(--glass-2); cursor: pointer; transition: border-color 0.2s, background-color 0.2s, transform 0.3s var(--ease); }
.radio-card:hover { border-color: var(--accent-line); }
.radio-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-card .ring { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--stroke-2); display: grid; place-items: center; transition: border-color 0.2s; }
.radio-card .ring::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform 0.4s var(--spring); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card:has(input:checked) .ring { border-color: var(--accent); }
.radio-card:has(input:checked) .ring::after { transform: scale(1); }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.radio-card b { display: block; font-size: 14px; }
.radio-card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 10px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; font-size: 14px; line-height: 1.45; animation: toast-in 0.6s var(--spring) both; }
.toast.is-out { animation: toast-out 0.35s var(--ease) both; }
.toast .i { margin-top: 2px; color: var(--accent-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(0.94); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* ---------- dialog ---------- */
dialog.dlg { border: 0; padding: 0; background: transparent; color: var(--fg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: visible; }
dialog.dlg::backdrop { background: rgba(5, 3, 12, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in 0.3s ease both; }
dialog.dlg[open] .dlg-card { animation: dlg-in 0.5s var(--spring) both; }
dialog.dlg--wide { width: min(880px, calc(100vw - 32px)); }
.dlg-card { padding: 26px; border-radius: var(--r-xl); max-height: calc(100vh - 48px); overflow: auto; background: var(--glass-solid); }
.dlg-card h2 { font-size: 20px; line-height: 1.3; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font: 800 17px/1 var(--font-ui); letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; flex: none; transition: transform 0.6s var(--spring); }
.brand:hover svg { transform: rotate(-8deg) scale(1.06); }
.brand small { display: block; font: 600 10.5px/1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* ---------- view transitions (route + theme) ---------- */
@keyframes vt-out-fwd { to { opacity: 0; transform: translateX(-28px); filter: blur(6px); } }
@keyframes vt-in-fwd { from { opacity: 0; transform: translateX(36px); filter: blur(8px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(28px); filter: blur(6px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-36px); filter: blur(8px); } }
@keyframes vt-out-up { to { opacity: 0; transform: translateY(-14px) scale(0.985); filter: blur(6px); } }
@keyframes vt-in-up { from { opacity: 0; transform: translateY(22px) scale(0.985); filter: blur(8px); } }
html.vt-route::view-transition-old(root), html.vt-route::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.vt-route.vt-fwd::view-transition-old(main-view) { animation: vt-out-fwd 0.24s var(--ease-io) both; }
html.vt-route.vt-fwd::view-transition-new(main-view) { animation: vt-in-fwd 0.55s var(--ease) both; }
html.vt-route.vt-back::view-transition-old(main-view) { animation: vt-out-back 0.24s var(--ease-io) both; }
html.vt-route.vt-back::view-transition-new(main-view) { animation: vt-in-back 0.55s var(--ease) both; }
html.vt-page::view-transition-old(root) { animation: vt-out-up 0.25s var(--ease-io) both; }
html.vt-page::view-transition-new(root) { animation: vt-in-up 0.6s var(--ease) both; }
html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.vt-theme::view-transition-new(root) { z-index: 2; }
::view-transition-group(doc-status) { animation-duration: 0.5s; animation-timing-function: var(--ease); }

/* ---------- utilities ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--inv-bg); color: var(--inv-fg); font-weight: 700; text-decoration: none; transition: top 0.3s var(--ease); }
.skip:focus { top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
