/* ============================================================
   HuynhThang Antidetect — Dashboard SPA styles
   Design tokens mirror the marketing landing page exactly.
   ============================================================ */
:root {
  --c-purple: #7c5cff;
  --c-cyan: #00d4ff;
  --c-pink: #f472b6;

  --bg: #0a0a14;
  --bg-soft: #0f0f1e;
  --surface: rgba(20,20,36,.5);

  --text: #f2f3ff;
  --text-muted: #b3b7d6;
  --text-dim: #868bab;

  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.15);

  --ok: #34d399;
  --warn: #f59e0b;
  --err: #f87171;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem;
  --s-6: 1.5rem; --s-8: 2rem; --s-12: 3rem; --s-16: 4rem; --s-24: 6rem;

  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1280px;
  --maxw-narrow: 900px;
  --sidebar-w: 250px;

  --grad: linear-gradient(120deg, var(--c-purple), var(--c-cyan));
  --grad-tri: linear-gradient(120deg, var(--c-purple) 0%, var(--c-pink) 45%, var(--c-cyan) 100%);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow-glow: 0 0 60px -20px rgba(124,92,255,.6);

  --t-fast: 160ms ease;
  --t-norm: 320ms cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
input, button, select, textarea { font-family: inherit; }

/* ---------- Decorative background ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); }
.orb-1 { width: 520px; height: 520px; background: var(--c-purple); top: -180px; left: -120px; opacity: .42; }
.orb-2 { width: 460px; height: 460px; background: var(--c-cyan); top: 30%; right: -180px; opacity: .26; }
.orb-3 { width: 420px; height: 420px; background: var(--c-pink); bottom: -160px; left: 22%; opacity: .18; }
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* ---------- Focus + a11y ---------- */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 2px;
  border-radius: 6px;
}
.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;
}
[hidden] { display: none !important; }

.gradient-text {
  background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-weight: 600; font-size: .95rem; line-height: 1;
  padding: .8rem 1.3rem; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap; text-align: center; color: var(--text);
}
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #0a0a14; font-weight: 700; box-shadow: var(--shadow-glow); }
.btn-primary:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 14px 40px -12px rgba(0,212,255,.55); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:not([disabled]):hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.btn-sm { padding: .5rem .85rem; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
/* Constrain icons inside any button (logout, copy, etc.) so they sit next to the label. */
.btn .ico { width: 18px; height: 18px; flex: 0 0 auto; color: currentColor; }
.btn-sm .ico { width: 16px; height: 16px; }

/* Inline spinner inside buttons */
.btn .spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(10,10,20,.35); border-top-color: #0a0a14; animation: spin .7s linear infinite; }
.btn-ghost .spin { border-color: rgba(255,255,255,.25); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: var(--s-4); }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; background: rgba(255,255,255,.03); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 11px;
  padding: .7rem .85rem; font-size: .95rem; transition: border-color var(--t-fast), background var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-cyan); background: rgba(255,255,255,.05); outline: none; box-shadow: 0 0 0 3px rgba(0,212,255,.15); }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.textarea { resize: vertical; min-height: 120px; font-family: var(--mono); line-height: 1.5; }
.field-hint { font-size: .78rem; color: var(--text-dim); }
.field-err { font-size: .82rem; color: var(--err); min-height: 1.1em; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text-muted); cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--c-purple); }

/* Generic card / panel */
.card {
  border: 1px solid var(--border); background: var(--surface);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: var(--radius); padding: var(--s-6);
}
.card.glow { box-shadow: var(--shadow-md); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: rgba(255,255,255,.04); color: var(--text-muted);
}
.badge-plan { background: var(--grad); color: #0a0a14; border-color: transparent; }
.badge-ok { color: var(--ok); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.12); }
.badge-warn { color: var(--warn); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.12); }

/* ============================================================
   Boot splash
   ============================================================ */
.boot-splash {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s-4);
  color: var(--text-dim); z-index: 50;
}
.boot-spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--c-cyan); animation: spin .8s linear infinite; }

/* ============================================================
   Auth view (centered card)
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s-8) var(--s-4); }
.auth-card {
  width: 100%; max-width: 440px; border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box,
    var(--grad-tri) border-box;
  box-shadow: var(--shadow-glow);
  padding: var(--s-8);
}
.auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; justify-content: center; margin-bottom: var(--s-2); }
.auth-brand .mark { width: 30px; height: 30px; }
.auth-sub { text-align: center; color: var(--text-dim); font-size: .9rem; margin: 0 0 var(--s-6); }
.auth-tabs { display: flex; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: var(--s-6); }
.auth-tabs button {
  flex: 1; border: none; background: transparent; color: var(--text-dim); font: inherit; font-weight: 700; font-size: .9rem;
  padding: .6rem; border-radius: 9px; cursor: pointer; transition: all var(--t-fast);
}
.auth-tabs button[aria-selected="true"] { background: var(--grad); color: #0a0a14; }
.auth-alert { font-size: .85rem; padding: .65rem .8rem; border-radius: 10px; margin-bottom: var(--s-4); border: 1px solid; }
.auth-alert.err { color: var(--err); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.1); }
.auth-foot { text-align: center; font-size: .82rem; color: var(--text-dim); margin-top: var(--s-6); }
.auth-foot a { color: var(--c-cyan); }

/* ============================================================
   Dashboard shell: topbar + sidebar + content
   ============================================================ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }

/* Topbar spans the content column */
.topbar {
  grid-column: 2; position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--s-4); height: 64px; padding: 0 var(--s-6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  background: rgba(10,10,20,.7); border-bottom: 1px solid var(--border);
}
.topbar .hamburger { display: none; }
.topbar .page-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.topbar-spacer { margin-left: auto; }
.topbar .user-meta { display: flex; align-items: center; gap: var(--s-3); }
.topbar .user-email { font-size: .85rem; color: var(--text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-toggle { display: inline-flex; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.lang-toggle button {
  border: none; background: transparent; color: var(--text-dim); font: inherit; font-size: .8rem; font-weight: 700;
  padding: .3rem .55rem; border-radius: 7px; cursor: pointer; transition: all var(--t-fast); letter-spacing: .02em;
}
.lang-toggle button[aria-pressed="true"] { background: var(--grad); color: #0a0a14; }

.hamburger { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; cursor: pointer; color: var(--text); display: grid; place-items: center; }

/* Sidebar */
.sidebar {
  grid-row: 1 / -1; grid-column: 1; position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-6) var(--s-4); border-right: 1px solid var(--border);
  background: rgba(15,15,30,.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.02rem; padding: 0 .4rem var(--s-4); }
.sidebar .brand .mark { width: 28px; height: 28px; }
.nav-group { margin-top: var(--s-4); }
.nav-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); padding: 0 .6rem; margin-bottom: var(--s-2); font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: .65rem; padding: .6rem .65rem; border-radius: 11px;
  color: var(--text-muted); font-size: .92rem; font-weight: 500; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast); border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; }
.nav-item.active { color: var(--text); background: linear-gradient(120deg, rgba(124,92,255,.2), rgba(0,212,255,.12)); border-color: var(--border-strong); }
.nav-item.active .ico { color: var(--c-cyan); }
.sidebar-foot { margin-top: auto; padding-top: var(--s-4); }

/* Mobile drawer backdrop */
.drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 45; }

/* Content area — centered reading column so wide screens stay balanced */
.content { grid-column: 2; padding: var(--s-8) var(--s-6); max-width: var(--maxw); width: 100%; margin-inline: auto; }
/* The Text tool reads as a single column, so it gets a narrower, comfortable measure. */
.content.content-narrow { max-width: var(--maxw-narrow); }
/* .content is focused programmatically on each route change (a11y). Don't paint a
   focus ring around the whole container — it shows as stray cyan edges after F5. */
#content:focus, #content:focus-visible { outline: none; }
.content-inner { animation: viewIn var(--t-norm) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: var(--s-8); }
.view-head h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 .35rem; letter-spacing: -.02em; font-weight: 800;
  background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  width: fit-content;
}
.view-head p { margin: 0; color: var(--text-muted); font-size: .98rem; max-width: 68ch; }
/* Emoji inside a gradient-clipped title: opt back out so it keeps its own colour. */
.view-head h1 .title-emoji {
  -webkit-background-clip: initial; background-clip: initial;
  -webkit-text-fill-color: initial; color: initial;
}

/* Grid helpers */
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Plan card (dashboard home + account) */
.plan-card {
  border-radius: var(--radius-lg); padding: var(--s-6);
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad-tri) border-box;
}
.plan-card .plan-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.plan-card .plan-name { font-size: 1.2rem; font-weight: 800; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: .4rem var(--s-4); font-size: .92rem; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

/* Quick-link tool cards */
.tool-link {
  display: flex; flex-direction: column; gap: .5rem; padding: var(--s-6); border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  transition: transform var(--t-norm), border-color var(--t-norm), box-shadow var(--t-norm);
}
.tool-link:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.tool-link .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .25rem;
  background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(0,212,255,.18)); border: 1px solid var(--border-strong); color: var(--c-cyan);
}
.tool-link h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.tool-link p { margin: 0; font-size: .88rem; color: var(--text-muted); }

/* Upgrade CTA strip */
.upgrade-cta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  border-radius: var(--radius); padding: var(--s-6);
  background: radial-gradient(ellipse 90% 140% at 0% 0%, rgba(124,92,255,.16), transparent 70%), var(--bg-soft);
  border: 1px solid var(--border-strong);
}
.upgrade-cta h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.upgrade-cta p { margin: 0; color: var(--text-muted); font-size: .9rem; }

/* ============================================================
   Tool-specific UI
   ============================================================ */
.section-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 var(--s-3); display: flex; align-items: center; gap: .5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-4); }
.toolbar .field { margin-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Copy button (ghost mini) */
.copy-btn { display: inline-flex; align-items: center; gap: .35rem; }

/* Empty-state placeholder (shown before a tool runs) */
.empty-state {
  grid-column: 1 / -1;
  display: grid; place-items: center; gap: var(--s-3); text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: rgba(255,255,255,.02); color: var(--text-dim);
  padding: var(--s-12) var(--s-6);
}
.empty-state .empty-ico { width: 40px; height: 40px; color: var(--text-dim); opacity: .8; }
.empty-state .empty-ico .ico { width: 40px; height: 40px; }
.empty-state h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-muted); }
.empty-state p { margin: 0; font-size: .9rem; max-width: 42ch; }

/* Fingerprint report cards */
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.fp-card {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: var(--s-6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.fp-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fp-card h3 { color: var(--text); }
.fp-card h3 { margin: 0 0 var(--s-3); font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.fp-rows { display: grid; gap: .5rem; }
.fp-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: var(--s-3); font-size: .86rem; align-items: start; }
.fp-row .k { color: var(--text-dim); }
.fp-row .v { color: var(--text); font-family: var(--mono); font-size: .82rem; word-break: break-word; overflow-wrap: anywhere; }
.fp-row .v.muted { color: var(--text-dim); font-family: var(--font); }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.status-pill .d { width: 7px; height: 7px; border-radius: 50%; }
.status-pill.ok { color: var(--ok); background: rgba(52,211,153,.12); } .status-pill.ok .d { background: var(--ok); }
.status-pill.warn { color: var(--warn); background: rgba(245,158,11,.12); } .status-pill.warn .d { background: var(--warn); }
.status-pill.err { color: var(--err); background: rgba(248,113,113,.12); } .status-pill.err .d { background: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-sm { font-size: .74rem; padding: .2rem .5rem; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text-muted); font-family: var(--mono); }

/* Data table (text tool / dev) */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; max-height: 460px; }
table.dt { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.dt th, table.dt td { padding: .5rem .65rem; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; white-space: pre-wrap; vertical-align: top; }
table.dt thead th { position: sticky; top: 0; background: #14142a; color: var(--text); font-weight: 700; z-index: 1; }
table.dt tbody tr:hover { background: rgba(255,255,255,.03); }
table.dt td.idx { color: var(--text-dim); font-family: var(--mono); width: 1%; white-space: nowrap; }
.col-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.col-toggle { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .25rem .55rem; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(255,255,255,.03); cursor: pointer; }
.col-toggle input { accent-color: var(--c-purple); }

/* Accordion (dev tools) — responsive multi-column grid on wide screens.
   The first item (JSON, open by default) spans full width as a featured panel. */
.acc-grid { display: grid; gap: var(--s-4); align-items: start; }
@media (min-width: 1000px) {
  .acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-grid > .acc:first-child { grid-column: 1 / -1; }
}
.acc {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.acc:not([open]):hover { border-color: var(--border-strong); transform: translateY(-2px); }
.acc[open] { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
/* Subtle brand accent bar on the open panel */
.acc[open] > summary { background: linear-gradient(120deg, rgba(124,92,255,.14), rgba(0,212,255,.08)); }
.acc summary {
  list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: background var(--t-fast), color var(--t-fast);
}
.acc summary:hover { color: var(--text); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .pm { color: var(--c-cyan); font-size: 1.4rem; line-height: 1; transition: transform var(--t-norm); }
.acc[open] summary .pm { transform: rotate(135deg); }
.acc[open] .acc-body { animation: accReveal var(--t-norm) both; }
@keyframes accReveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.acc .acc-body { padding: 0 1.2rem 1.2rem; }
.io-grid { display: grid; gap: var(--s-3); }
.out-box { background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 11px; padding: .75rem .85rem; font-family: var(--mono); font-size: .82rem; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; min-height: 44px; max-height: 320px; overflow: auto; }
.out-box.err { color: var(--err); }
.kvline { display: flex; gap: .5rem; font-size: .85rem; flex-wrap: wrap; }
.kvline .k { color: var(--text-dim); min-width: 90px; }

/* Toasts */
.toasts { position: fixed; bottom: var(--s-6); right: var(--s-6); display: grid; gap: var(--s-2); z-index: 100; }
.toast {
  background: #16162c; border: 1px solid var(--border-strong); border-radius: 12px; padding: .65rem .9rem;
  font-size: .85rem; box-shadow: var(--shadow-md); animation: toastIn .25s ease both; max-width: 320px;
}
.toast.ok { border-color: rgba(52,211,153,.45); }
.toast.err { border-color: rgba(248,113,113,.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Language crossfade */
[data-i18n] { transition: opacity .16s ease; }
.lang-swapping [data-i18n] { opacity: 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { grid-column: 1; }
  .content { grid-column: 1; padding: var(--s-6) var(--s-4); }
  .topbar .hamburger { display: grid; }
  .topbar .user-email { display: none; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px; z-index: 46;
    transform: translateX(-100%); transition: transform var(--t-norm); grid-column: auto;
  }
  .sidebar.open { transform: none; }
  .drawer-backdrop.show { display: block; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-auto { grid-template-columns: 1fr; }
  .fp-grid { grid-template-columns: 1fr; }
  .auth-card { padding: var(--s-6); }
  .topbar .page-title { font-size: .95rem; }
}

/* ============================================================
   Reduced motion — neutralize animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .content-inner { animation: none; }
  .boot-spinner, .btn .spin { animation: spin 1.2s linear infinite !important; }
}
