/* ============================================================================
   Asetrix Online — design tokens adopted verbatim from the shared Asetrix
   brand system (portal/marketplace). Teal accent, light + dark via
   [data-theme]. A compat layer below aliases this app's legacy variable
   names onto the brand tokens so every component picks up the brand.
   ========================================================================== */
:root {
  color-scheme: light;

  --bg: #FFFFFF;
  --bg-subtle: #FAFAFA;
  --bg-muted: #F4F4F5;
  --surface: #FFFFFF;
  --surface-2: #FAFAFA;
  --surface-hover: #F4F4F5;
  --border: #E5E7EB;
  --border-strong: #D4D4D8;
  --border-subtle: #F0F0F2;
  --text: #09090B;
  --text-secondary: #52525B;
  --text-tertiary: #71717A;
  --text-on-accent: #FFFFFF;
  --white: #FFFFFF;
  --black: #000000;

  --accent: #0E7490;
  --accent-bright: #0891B2;
  --accent-hover: #155E75;
  --accent-active: #164E63;
  --accent-subtle: #CFFAFE;
  --accent-border: #67E8F9;
  --accent-text: #155E75;

  --hero-grad-top: #155E75;
  --hero-grad-mid: #0C3A44;
  --hero-grad-base: #08090A;
  --auth-hero-base: #08090A;
  --auth-hero-glow-a: #67E8F9;
  --auth-hero-glow-b: #A5F3FC;

  --success: #0E7490;
  --success-subtle: #CFFAFE;
  --warning: #B45309;
  --warning-subtle: #FEF3C7;
  --danger: #B91C1C;
  --danger-subtle: #FEE2E2;
  --info: #1D4ED8;
  --info-subtle: #DBEAFE;

  --shadow-rgb: 0, 0, 0;
  --accent-rgb: 14, 116, 144;
  --accent-bright-rgb: 8, 145, 178;
  --danger-rgb: 185, 28, 28;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --text-2xs: 11px; --text-xs: 12px; --text-sm: 13px; --text-base: 15px; --text-md: 16px;
  --text-lg: 18px; --text-xl: 22px; --text-2xl: 28px; --text-3xl: 36px; --text-4xl: 48px; --text-5xl: 64px;

  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700; --weight-black: 800;
  --leading-tight: 1.15; --leading-snug: 1.35; --leading-normal: 1.55; --leading-relaxed: 1.7;
  --tracking-tighter: -0.03em; --tracking-tight: -0.015em; --tracking-wide: 0.025em; --tracking-wider: 0.08em;

  --space-0: 0; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-7: 28px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --space-14: 56px; --space-16: 64px; --space-20: 80px; --space-24: 96px;

  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --radius-2xl: 20px; --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -2px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px -8px rgba(0,0,0,0.10), 0 4px 8px -4px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 48px -12px rgba(0,0,0,0.18);

  --ease-smooth: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms; --duration-base: 220ms; --duration-slow: 340ms;

  --content-max: 1200px;
  --header-height: 60px;
  --z-sticky: 50;

  /* ─── Compat aliases: legacy component-CSS names → brand tokens ─── */
  --brand: var(--accent);
  --brand-soft: var(--accent-bright);
  --brand-2: var(--accent-hover);
  --brand-gradient: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 58%, var(--accent-hover) 100%);
  --brand-ring: rgba(var(--accent-rgb), 0.20);
  --surface-3: var(--surface-hover);
  --glass: color-mix(in srgb, var(--bg) 82%, transparent);
  --text-muted: var(--text-secondary);
  --text-faint: var(--text-tertiary);
  --ok-bg: var(--success-subtle); --ok-fg: var(--success);
  --bad-bg: var(--danger-subtle); --bad-fg: var(--danger);
  --radius-pill: var(--radius-full);
  --content-width: var(--content-max);
  --motion: var(--duration-base) var(--ease-smooth);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090A;
  --bg-subtle: #0E0F11;
  --bg-muted: #141518;
  --surface: #0E0F11;
  --surface-2: #141518;
  --surface-hover: #1B1D21;
  --border: #23252A;
  --border-strong: #2E3137;
  --border-subtle: #1A1C20;
  --text: #F4F4F5;
  --text-secondary: #A1A1AA;
  --text-tertiary: #8A8A94;
  --text-on-accent: #083344;

  --accent: #22D3EE;
  --accent-bright: #06B6D4;
  --accent-hover: #67E8F9;
  --accent-active: #A5F3FC;
  --accent-subtle: rgba(34, 211, 238, 0.10);
  --accent-border: rgba(34, 211, 238, 0.30);
  --accent-text: #67E8F9;

  --success: #22D3EE;
  --success-subtle: rgba(34, 211, 238, 0.12);
  --warning: #FBBF24;
  --warning-subtle: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-subtle: rgba(248, 113, 113, 0.12);
  --info: #60A5FA;
  --info-subtle: rgba(96, 165, 250, 0.12);

  --accent-rgb: 34, 211, 238;
  --accent-bright-rgb: 6, 182, 212;
  --danger-rgb: 248, 113, 113;

  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.30);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.40), 0 1px 2px -1px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 6px -2px rgba(0,0,0,0.45), 0 2px 4px -2px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 24px -8px rgba(0,0,0,0.55), 0 4px 8px -4px rgba(0,0,0,0.40);
  --shadow-xl: 0 24px 48px -12px rgba(0,0,0,0.70);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  /* Continuous brand-tinted glow at the top of the page, behind both header and hero,
     so the header blends into the hero instead of cutting it with a hard strip. */
  background:
    radial-gradient(1200px 560px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--duration-base) var(--ease-smooth), color var(--duration-base) var(--ease-smooth);
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Auto-focused heading (Blazor FocusOnNavigate) must not draw a visible box. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* ============================== Animations ============================== */
@keyframes auroraDrift {
  0% { transform: translate3d(0,0,0) scale(1); }
  33% { transform: translate3d(4%, -3%, 0) scale(1.08); }
  66% { transform: translate3d(-3%, 4%, 0) scale(0.96); }
  100% { transform: translate3d(0,0,0) scale(1); }
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.82); } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes drawArch { to { stroke-dashoffset: 0; } }
@keyframes flowDash { to { stroke-dashoffset: -200; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Framework error boundary (keep) */
.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiА2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiА2OS43MzА5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiА4Ny4zMDА1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSА5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyА5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiА4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
  border-radius: var(--radius-md);
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ============================== Portal / admin ============================== */
.admin { max-width: 76rem; margin: 0 auto; padding: var(--space-6); }
.admin.wide { max-width: none; margin: 0; padding: var(--space-6) var(--space-8); }
.admin-bar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: var(--space-3); margin-bottom: var(--space-5); }
.admin-tabs { display: flex; gap: var(--space-2); }
.admin-tabs a { padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: var(--text-sm); }
.admin-tabs a:hover { background: var(--surface-2); text-decoration: none; }
.admin-tabs a.active { background: var(--accent); color: var(--text-on-accent); }
.admin-logout { display: flex; align-items: center; gap: var(--space-3); margin: 0; }
.admin-user { color: var(--text-muted); font-size: var(--text-sm); }
.admin-logout button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-pill); padding: var(--space-2) var(--space-4); cursor: pointer; font-size: var(--text-sm); }
.admin-logout button:hover { border-color: var(--accent); color: var(--accent-text); }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.admin-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; letter-spacing: -0.02em; }
.ghost-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); cursor: pointer; }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5); }
.metric { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm); transition: border-color var(--motion), transform var(--motion), box-shadow var(--motion); }
.metric::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--brand-gradient); }
.metric:hover { transform: translateY(-2px); border-color: var(--accent-border); box-shadow: var(--shadow-md); }
.metric-label { display: block; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: var(--space-2); }
.metric-value { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.metric-foot { display: block; margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-faint); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-5); box-shadow: var(--shadow-sm); }
.panel h3 { margin: 0 0 var(--space-4); font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-head h3 { margin: 0; }
.panel-count { font-size: var(--text-xs); font-weight: 600; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px var(--space-3); }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.bars { display: flex; align-items: flex-end; gap: var(--space-2); height: 160px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--space-2); height: 100%; }
.bar { width: 100%; max-width: 38px; background: var(--brand-gradient); border-radius: var(--radius-sm) var(--radius-sm) 0 0; min-height: 4px; transition: height var(--motion); }
.bar-label { font-size: 0.65rem; color: var(--text-faint); white-space: nowrap; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.admin-table th { text-align: left; color: var(--text-faint); font-weight: 600; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.admin-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); color: var(--text); }
.admin-table tr.revoked td { color: var(--text-faint); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.admin-table .muted { color: var(--text-muted); }
.status { font-size: var(--text-xs); font-weight: 700; padding: 2px var(--space-2); border-radius: var(--radius-sm); }
.status.s200 { background: var(--ok-bg); color: var(--ok-fg); }
.status.s401, .status.s403, .status.s404, .status.s429 { background: var(--bad-bg); color: var(--bad-fg); }
.admin-empty { text-align: center; color: var(--text-muted); padding: var(--space-6); }
.admin-empty.error { color: var(--danger); }
.key-form { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.key-form input { flex: 1; min-width: 12rem; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface-2); color: var(--text); }
.key-form input:focus { outline: none; border-color: var(--accent); }
.primary-btn { background: var(--accent); color: var(--text-on-accent); border: none; border-radius: var(--radius-md); padding: var(--space-3) var(--space-5); font-weight: 600; cursor: pointer; }
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:disabled { opacity: 0.6; cursor: default; }
.danger-btn { background: transparent; color: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius-sm); padding: 4px var(--space-3); cursor: pointer; font-size: var(--text-xs); }
.danger-btn:hover { background: var(--danger); color: var(--white); }
.key-reveal { margin-top: var(--space-4); padding: var(--space-4); border: 1px solid var(--accent); border-radius: var(--radius-md); background: var(--accent-subtle); }
.key-reveal-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.key-warn { color: var(--danger); font-size: var(--text-sm); }
.key-value { width: 100%; font-family: var(--font-mono); font-size: var(--text-base); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.scope-pick { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); align-items: center; }
.scope-all { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-right: var(--space-2); }
.scope-chip { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-3); cursor: pointer; }
.scope-chip.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-subtle); }
.scope-chip.live { font-weight: 600; }

/* ─── Dashboard polish ─── */
.admin-head-title { display: flex; align-items: center; gap: var(--space-3); }
.live-pill { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600; color: var(--success); background: var(--success-subtle); border-radius: var(--radius-pill); padding: 2px var(--space-3); }
.live-dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--success); animation: pulseDot 1.8s ease-in-out infinite; }
.bar { transition: height var(--motion), filter var(--motion); }
.bar:hover { filter: brightness(1.1); }
.admin-table tbody tr:hover td { background: var(--surface-2); }
.flag { font-size: 1.05rem; line-height: 1; }
.table-scroll { max-height: 32rem; overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.table-scroll td { vertical-align: middle; }
.bar-cell { display: flex; align-items: center; gap: var(--space-3); }
.bar-track { flex: 1; height: 6px; min-width: 2rem; border-radius: var(--radius-full); background: var(--surface-hover); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: var(--radius-full); background: var(--brand-gradient); }
.bar-val { min-width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--text); }

/* ─── Team management ─── */
.team-invite { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.team-invite input { flex: 1; min-width: 10rem; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface-2); color: var(--text); }
.team-invite input:focus { outline: none; border-color: var(--accent); }
.role-select { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); background: var(--surface-2); color: var(--text); font-size: var(--text-sm); cursor: pointer; }
.role-select:focus { outline: none; border-color: var(--accent); }
.team-hint { color: var(--text-faint); font-size: var(--text-sm); margin: var(--space-3) 0 0; line-height: var(--leading-normal); }
.team-table td { vertical-align: middle; }
.team-user { display: flex; align-items: center; gap: var(--space-3); }
.team-avatar { width: 2rem; height: 2rem; flex: none; display: grid; place-items: center; border-radius: var(--radius-full); background: var(--brand-gradient); color: var(--white); font-size: var(--text-xs); font-weight: 700; }
.team-id { display: flex; flex-direction: column; line-height: 1.25; }
.team-name { font-weight: 600; color: var(--text); }
.team-email { font-size: var(--text-xs); color: var(--text-faint); }
.role-badge { display: inline-block; font-size: var(--text-xs); font-weight: 600; padding: 2px var(--space-3); border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); }
.role-badge.super { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent-text); }
.role-badge.owner { margin-left: var(--space-2); background: var(--warning-subtle); border-color: transparent; color: var(--warning); }
.team-actions { text-align: right; }
.alloc-cell { display: flex; flex-direction: column; gap: var(--space-1); }
.alloc-state { font-size: var(--text-sm); color: var(--text); }
.alloc-shared { font-weight: 600; color: var(--accent-text); }
.alloc-edit { display: flex; align-items: center; gap: var(--space-1); }
.alloc-rand { font-size: var(--text-sm); color: var(--text-faint); }
.alloc-edit input { width: 5.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); background: var(--surface-2); color: var(--text); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.alloc-edit input:focus { outline: none; border-color: var(--accent); }

/* ─── Global users console ─── */
.user-search { min-width: 16rem; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); background: var(--surface-2); color: var(--text); font-size: var(--text-sm); }
.user-search:focus { outline: none; border-color: var(--accent); }
.ghost-btn { white-space: nowrap; }
.ghost-btn.sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.user-actions { text-align: right; white-space: nowrap; }
.user-actions .ghost-btn { margin-left: var(--space-2); }
.credit-cell { display: flex; flex-direction: column; gap: var(--space-1); }
.credit-state { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.credit-edit { display: flex; align-items: center; gap: var(--space-1); }
.credit-rand { font-size: var(--text-sm); color: var(--text-faint); }
.credit-edit input { width: 4.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); background: var(--surface-2); color: var(--text); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.credit-edit input:focus { outline: none; border-color: var(--accent); }
.credit-used { font-size: var(--text-xs); color: var(--text-faint); }
.credit-warn { font-size: var(--text-xs); color: var(--danger); font-weight: 600; }

.tier-select { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); background: var(--surface-2); color: var(--text); font-size: var(--text-sm); }
.tier-select:focus { outline: none; border-color: var(--accent); }

/* ─── API-call visibility + API-key rows ─── */
.metric.metric-accent::before { width: 100%; opacity: 0.06; }
.metric.metric-accent .metric-value { color: var(--accent-text); }
.calls-count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-faint); }
.calls-count.active { color: var(--accent-text); font-weight: 800; }
.role-badge.api { background: var(--warning-subtle); border-color: transparent; color: var(--warning); }
.team-avatar.api { background: var(--surface-2); color: var(--text-muted); border: 1px dashed var(--border); }
.admin-table tr.api-row td { background: color-mix(in srgb, var(--warning) 5%, transparent); }
.admin-table tr.api-row:hover td { background: color-mix(in srgb, var(--warning) 9%, transparent); }

.price-table-wrap { overflow-x: auto; }
.price-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.price-table th { text-align: left; padding: var(--space-2) var(--space-3); color: var(--text-faint); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.price-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle, var(--border)); color: var(--text); font-variant-numeric: tabular-nums; }
.price-table tr:last-child td { border-bottom: none; }
.price-table td:first-child { font-weight: 600; }
.price-free { color: var(--success); font-weight: 700; }
.price-trial { color: var(--warning); font-weight: 700; }

.login-wrap { display: grid; place-items: center; min-height: 70vh; padding: var(--space-6); }
.login-card { width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-7); box-shadow: var(--shadow-lg); text-align: center; }
.login-mark { width: 3rem; height: 3rem; margin: 0 auto var(--space-4); display: grid; place-items: center; border-radius: var(--radius-md); background: var(--brand-gradient); color: var(--white); font-weight: 800; font-size: 1.4rem; }
.login-card h1 { margin: 0 0 var(--space-1); font-size: 1.4rem; }
.login-sub { color: var(--text-muted); margin: 0 0 var(--space-5); font-size: var(--text-sm); }
.login-field { display: block; text-align: left; margin-bottom: var(--space-4); }
.login-field span { display: block; font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-2); }
.login-field input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface-2); color: var(--text); }
.login-field input:focus { outline: none; border-color: var(--accent); }
.login-btn { width: 100%; background: var(--accent); color: var(--text-on-accent); border: none; border-radius: var(--radius-md); padding: var(--space-3); font-weight: 700; cursor: pointer; font-size: var(--text-base); }
.login-btn:hover { background: var(--accent-hover); }
.login-error { background: var(--bad-bg); color: var(--bad-fg); border-radius: var(--radius-md); padding: var(--space-3); margin-bottom: var(--space-4); font-size: var(--text-sm); }

/* ============================== Legal / content pages ============================== */
.doc { max-width: var(--content-narrow, 760px); margin: 0 auto; padding: var(--space-12) var(--space-6) var(--space-20); }
.doc h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
.doc .doc-meta { color: var(--text-faint); font-size: var(--text-sm); margin-bottom: var(--space-8); }
.doc h2 { font-size: var(--text-xl); margin: var(--space-8) 0 var(--space-3); letter-spacing: -0.01em; }
.doc p, .doc li { color: var(--text-secondary); line-height: var(--leading-relaxed); }
.doc ul { padding-left: var(--space-5); }
.doc a { color: var(--accent-text); }

/* ============================== Auth (login / register / reset) ============================== */
.auth-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: calc(100vh - var(--header-height)); }
.auth-hero { position: relative; overflow: hidden; background: var(--auth-hero-base); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-10) var(--space-8); }
.auth-hero .glow-a, .auth-hero .glow-b { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.3; pointer-events: none; }
.auth-hero .glow-a { width: 30rem; height: 30rem; top: -8rem; right: -8rem; background: var(--auth-hero-glow-a); animation: auroraDrift 20s ease-in-out infinite; }
.auth-hero .glow-b { width: 24rem; height: 24rem; bottom: -6rem; left: -6rem; background: var(--auth-hero-glow-b); opacity: 0.22; animation: floatY 16s ease-in-out infinite; }

.auth-hero-inner { position: relative; z-index: 1; width: 100%; max-width: 30rem; display: flex; flex-direction: column; align-items: center; }
.auth-hero-art { width: 100%; max-width: 330px; margin: 0 auto var(--space-6); }
.auth-hero-art svg { width: 100%; height: auto; display: block; }
.auth-hero-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 var(--space-3); }
.auth-hero-sub { color: rgba(255,255,255,0.7); font-size: var(--text-md); max-width: 25rem; line-height: var(--leading-relaxed); margin: 0 0 var(--space-6); }
.auth-hero-points { display: inline-flex; flex-direction: column; gap: var(--space-2); text-align: left; }
.auth-hero-point { display: flex; align-items: center; gap: var(--space-3); color: rgba(255,255,255,0.82); font-size: var(--text-sm); }
.auth-hero-point svg { width: 1.05rem; height: 1.05rem; color: var(--auth-hero-glow-a); flex: none; }

/* orbital data-core illustration */
.ring { transform-box: fill-box; transform-origin: center; }
.ring.r1 { animation: spin 38s linear infinite; }
.ring.r2 { animation: spin 72s linear infinite reverse; }
.ring.r3 { animation: spin 96s linear infinite; }
.orbit-nodes circle { animation: pulseDot 3s ease-in-out infinite; }
.orbit-nodes circle:nth-child(2n) { animation-delay: 0.8s; }
.orbit-nodes circle:nth-child(3n) { animation-delay: 1.5s; }
.core { transform-box: fill-box; transform-origin: center; animation: pulseDot 2.6s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(165,243,252,0.9)); }
.spark { filter: drop-shadow(0 0 6px rgba(165,243,252,0.85)); }

.auth-panel { display: grid; place-items: center; padding: var(--space-8) var(--space-6); }
.auth-card { width: 100%; max-width: 26rem; }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 var(--space-1); }
.auth-card .sub { color: var(--text-secondary); margin: 0 0 var(--space-6); }
.auth-field { display: block; margin-bottom: var(--space-4); }
.auth-field span { display: block; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-2); }
.auth-field input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface); color: var(--text); font-size: var(--text-md); }
.auth-field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.auth-btn { width: 100%; background: var(--accent); color: var(--text-on-accent); border: none; border-radius: var(--radius-md); padding: var(--space-3); font-weight: 700; font-size: var(--text-md); cursor: pointer; transition: background var(--motion); }
.auth-btn:hover { background: var(--accent-hover); }
.auth-fineprint { margin: var(--space-4) 0 0; font-size: var(--text-xs); color: var(--text-tertiary); text-align: center; }
.auth-alt { margin-top: var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); text-align: center; }
.auth-alt a { color: var(--accent-text); font-weight: 600; }
.auth-msg { border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); font-size: var(--text-sm); }
.auth-msg.error { background: var(--bad-bg); color: var(--bad-fg); }
.auth-msg.ok { background: var(--ok-bg); color: var(--ok-fg); }
.auth-msg.warn { background: var(--warning-subtle); color: var(--warning); }
.auth-resend { margin: 0 0 var(--space-4); }
.auth-link-btn { background: none; border: none; padding: 0; color: var(--accent-text); font-weight: 600; font-size: var(--text-sm); cursor: pointer; text-decoration: underline; }
.credit-banner { display: flex; align-items: center; gap: var(--space-3); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); font-size: var(--text-sm); }
.credit-banner.warn { background: var(--warning-subtle); color: var(--warning); border: 1px solid var(--warning-subtle); }
.credit-banner.bad { background: var(--bad-bg); color: var(--bad-fg); }
.metric-value.low { color: var(--danger); }
.metric-value.trial { color: var(--warning); }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

@media (max-width: 760px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}

/* ============================== Phones (≤600px) ============================== */
@media (max-width: 600px) {
  /* Portal chrome */
  .admin { padding: var(--space-4) var(--space-3); }
  .admin-bar { flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .admin-tabs { flex-wrap: wrap; }
  .admin-head { flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .admin-head-title { justify-content: space-between; }
  .panel { padding: var(--space-4); }
  .panel-head { flex-wrap: wrap; }
  .user-search { width: 100%; min-width: 0; }

  /* Wide data tables scroll horizontally instead of breaking the page */
  .admin-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .table-scroll { overflow: auto; }
  .bars { gap: 2px; }
  .bar-label { display: none; }

  /* Auth + forms */
  .auth-panel { padding: var(--space-6) var(--space-4); }
  .key-reveal { padding: var(--space-3); }
  .key-value { font-size: var(--text-sm); }

  /* Doc / legal pages */
  .doc { padding: var(--space-10) var(--space-4) var(--space-12); }
}

@media (max-width: 460px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   Site-wide polish — applies to every page: smooth scroll, branded selection,
   slim scrollbar, accessible focus rings, and a richer doc/legal header.
   ========================================================================== */
html { scroll-behavior: smooth; }

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

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

/* Doc / legal / about — branded header with a gradient accent rule + animated links */
.doc { position: relative; }
.doc h1 { background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 72%, var(--accent))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.doc h1::after {
  content: ""; display: block; width: 64px; height: 4px; margin-top: var(--space-4);
  border-radius: var(--radius-pill); background: var(--brand-gradient);
}
.doc h2 { position: relative; padding-left: var(--space-4); }
.doc h2::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em; width: 3px;
  border-radius: var(--radius-pill); background: var(--brand-gradient);
}
.doc a { text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size var(--duration-base) var(--ease-smooth); }
.doc a:hover { background-size: 100% 1.5px; }

/* Anonymous-search daily-limit paywall (vehicle search) */
.quota-wall {
  max-width: 32rem; margin: var(--space-10) auto; text-align: center;
  padding: var(--space-8) var(--space-6);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.quota-icon { font-size: var(--text-4xl); line-height: 1; margin-bottom: var(--space-3); }
.quota-wall h3 { margin: 0 0 var(--space-3); font-size: var(--text-xl); letter-spacing: var(--tracking-tight); }
.quota-wall p { color: var(--text-secondary); line-height: var(--leading-relaxed); margin: 0 auto var(--space-5); max-width: 26rem; }
.quota-cta { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.quota-fine { color: var(--text-tertiary); font-size: var(--text-xs); margin-top: var(--space-4); }

/* ============================================================================
   ASETRIX DESIGN SYSTEM — Global visual layer (Surface C)
   Additive foundation for the "Trusted Intelligence" upgrade. Everything below
   is new and references only design tokens (no literal colours/sizes) so it
   flips correctly across light + dark. Illustration motion is gated behind
   prefers-reduced-motion at the end of this section.
   Provides: <Illus/> theming, .eyebrow, .display-title, .trust-row/.trust-item,
   .empty-state/.empty-illus, .seal, .field, .soft-card, .stat-pill, .glow-panel,
   plus subtle refinements to existing buttons + inputs.
   ========================================================================== */

/* ─── Illus component: two-tone teal line art ───
   The SVG inherits colour from currentColor. .illus-stroke draws in the accent;
   .illus-fill washes shapes in a soft accent tint so art reads two-tone. */
.illus { display: inline-block; width: 120px; height: 120px; color: var(--accent); vertical-align: middle; }
.illus .illus-stroke { stroke: currentColor; }
.illus .illus-fill { fill: var(--accent-subtle); }
.illus.illus-muted { color: var(--text-tertiary); }
.illus.illus-muted .illus-fill { fill: var(--surface-hover); }
/* Size utilities so callers never hardcode px */
.illus.illus-xs { width: var(--space-8); height: var(--space-8); }
.illus.illus-sm { width: var(--space-12); height: var(--space-12); }
.illus.illus-md { width: var(--space-16); height: var(--space-16); }
.illus.illus-lg { width: var(--space-20); height: var(--space-20); }
.illus.illus-xl { width: var(--space-24); height: var(--space-24); }

/* Gentle, tasteful motion (all gated by reduced-motion at end of section) */
@keyframes illusFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes illusPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.72; } }
@keyframes illusDraw { to { stroke-dashoffset: 0; } }
.illus.illus-float { animation: illusFloat 6s var(--ease-smooth) infinite; }
.illus.illus-pulse .illus-fill { animation: illusPulse 3.4s var(--ease-smooth) infinite; }
.illus.illus-draw-on .illus-draw { stroke-dasharray: 120; stroke-dashoffset: 120; animation: illusDraw var(--duration-slow) var(--ease-out) forwards; }

/* ─── .eyebrow: small uppercase tracked accent label above a heading ─── */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-wider);
  color: var(--accent-text); margin: 0 0 var(--space-3);
}
.eyebrow::before {
  content: ""; width: var(--space-6); height: 2px; border-radius: var(--radius-pill);
  background: var(--brand-gradient);
}
.eyebrow.eyebrow-plain::before { display: none; }

/* ─── .display-title: Fraunces display heading ─── */
.display-title {
  font-family: var(--font-display); font-weight: var(--weight-semibold);
  font-size: clamp(var(--text-2xl), 4.5vw, var(--text-4xl));
  line-height: var(--leading-tight); letter-spacing: var(--tracking-tight);
  color: var(--text); margin: 0 0 var(--space-4);
}

/* ─── .trust-row / .trust-item: horizontal row of trust signals ─── */
.trust-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-3) var(--space-5); margin: var(--space-5) 0 0;
}
.trust-item {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-secondary);
}
.trust-item svg, .trust-item .illus { width: 1.15em; height: 1.15em; color: var(--accent); flex: none; }
.trust-item::before {
  content: ""; width: 6px; height: 6px; border-radius: var(--radius-full);
  background: var(--success); flex: none; box-shadow: 0 0 0 3px var(--success-subtle);
}
.trust-item.no-dot::before { display: none; }

/* ─── .empty-state / .empty-illus: centred empty state ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-3); padding: var(--space-12) var(--space-6); color: var(--text-secondary);
}
.empty-illus { color: var(--accent); margin-bottom: var(--space-2); }
.empty-illus .illus { width: var(--space-20); height: var(--space-20); }
.empty-state h3 { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text); letter-spacing: var(--tracking-tight); }
.empty-state p { margin: 0; max-width: 34ch; line-height: var(--leading-relaxed); font-size: var(--text-sm); }

/* ─── .seal: small circular "Verified by Asetrix" seal ─── */
.seal {
  display: inline-grid; place-items: center; width: var(--space-16); height: var(--space-16);
  border-radius: var(--radius-full); color: var(--accent-text);
  background: radial-gradient(circle at 50% 38%, var(--accent-subtle), transparent 70%), var(--surface);
  border: 1.5px solid var(--accent-border); box-shadow: var(--shadow-sm);
  position: relative;
}
.seal::before {
  content: ""; position: absolute; inset: 4px; border-radius: var(--radius-full);
  border: 1px dashed var(--accent-border); opacity: 0.7;
}
.seal svg, .seal .illus { width: 55%; height: 55%; color: var(--accent); position: relative; }

/* ─── .field: refined form field (larger touch target, soft focus ring) ─── */
.field { display: block; margin-bottom: var(--space-4); }
.field > label, .field > span {
  display: block; font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-secondary); margin-bottom: var(--space-2);
}
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: var(--text-md); line-height: var(--leading-snug);
  transition: border-color var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth),
              background-color var(--duration-fast) var(--ease-smooth);
}
.field textarea { min-height: var(--space-20); resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-tertiary); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}
.field .field-hint { display: block; margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-tertiary); }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field.error .field-hint { color: var(--danger); }

/* ─── .soft-card: soft elevated rounded card with hover lift ─── */
.soft-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-smooth),
              box-shadow var(--duration-base) var(--ease-smooth),
              border-color var(--duration-base) var(--ease-smooth);
}
.soft-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-border); }
.soft-card.is-static:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }

/* ─── .stat-pill: small rounded stat/label pill ─── */
.stat-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--text-secondary); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3); line-height: 1.4;
}
.stat-pill svg, .stat-pill .illus { width: 1em; height: 1em; color: var(--accent); }
.stat-pill.accent { color: var(--accent-text); background: var(--accent-subtle); border-color: var(--accent-border); }
.stat-pill.success { color: var(--success); background: var(--success-subtle); border-color: transparent; }
.stat-pill.warning { color: var(--warning); background: var(--warning-subtle); border-color: transparent; }
.stat-pill.danger { color: var(--danger); background: var(--danger-subtle); border-color: transparent; }

/* ─── .glow-panel: panel with subtle brand radial-glow for hero moments ─── */
.glow-panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: var(--space-8); box-shadow: var(--shadow-md);
}
.glow-panel::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background:
    radial-gradient(60% 80% at 85% -10%, rgba(var(--accent-rgb), 0.16), transparent 60%),
    radial-gradient(50% 70% at 0% 110%, rgba(var(--accent-bright-rgb), 0.12), transparent 60%);
  pointer-events: none;
}
.glow-panel.dark {
  color: var(--white); border-color: transparent;
  background: linear-gradient(160deg, var(--hero-grad-top), var(--hero-grad-mid) 55%, var(--hero-grad-base));
}
.glow-panel.dark::before {
  background:
    radial-gradient(50% 60% at 85% 0%, rgba(var(--accent-bright-rgb), 0.35), transparent 60%),
    radial-gradient(50% 60% at 5% 100%, rgba(var(--accent-rgb), 0.28), transparent 60%);
}

/* ============================================================================
   Refinements to existing primitives — subtle lift across the whole site.
   Additive: these sharpen buttons + inputs already defined above without
   removing any earlier rule.
   ========================================================================== */

/* Primary + auth + login buttons: gentle brand gradient, shadow, hover transform */
.primary-btn, .auth-btn, .login-btn {
  background: var(--brand-gradient);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.10), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-base) var(--ease-smooth),
              filter var(--duration-fast) var(--ease-smooth);
}
.primary-btn:hover, .auth-btn:hover, .login-btn:hover {
  background: var(--brand-gradient);
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}
.primary-btn:active, .auth-btn:active, .login-btn:active { transform: translateY(0); filter: brightness(0.98); }
.primary-btn:disabled { filter: none; box-shadow: none; transform: none; }

/* Ghost button: subtle accent tint on hover */
.ghost-btn { transition: border-color var(--duration-fast) var(--ease-smooth), color var(--duration-fast) var(--ease-smooth), background var(--duration-fast) var(--ease-smooth); }
.ghost-btn:hover { background: var(--accent-subtle); }

/* Global input focus refinement: soft accent ring instead of a bare border flip.
   Scoped to the existing field classes so we lift them without rewriting the rules. */
.auth-field input:focus,
.login-field input:focus,
.key-form input:focus,
.team-invite input:focus,
.user-search:focus,
.role-select:focus,
.tier-select:focus,
.alloc-edit input:focus,
.credit-edit input:focus {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

/* Metric + panel: warmer hover already present on .metric; give .panel a gentle lift too */
.panel { transition: box-shadow var(--duration-base) var(--ease-smooth), border-color var(--duration-base) var(--ease-smooth); }
.panel:hover { box-shadow: var(--shadow-md); }

/* ─── Page atmosphere: a faint, fixed grid/vignette texture behind content.
   Very low opacity so it reads as premium paper, never as noise. ─── */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1000px 600px at 100% 0%, rgba(var(--accent-rgb), 0.04), transparent 55%),
    radial-gradient(900px 700px at 0% 100%, rgba(var(--accent-bright-rgb), 0.035), transparent 55%);
}

/* Reduced-motion: silence all illustration + refinement motion. */
@media (prefers-reduced-motion: reduce) {
  .illus, .illus * { animation: none !important; }
  .illus.illus-draw-on .illus-draw { stroke-dashoffset: 0 !important; }
  .primary-btn, .auth-btn, .login-btn, .soft-card, .ghost-btn { transition: none !important; }
  .primary-btn:hover, .auth-btn:hover, .login-btn:hover, .soft-card:hover { transform: none !important; }
}
