/* =========================================================================
   AIBRIDGE â€” Design System v2 "Airy Neobank"
   Subscribe. Automate. Earn Smarter.
   -------------------------------------------------------------------------
   A fintech shell with two nav surfaces: a persistent sidebar (fixed rail on
   desktop, off-canvas drawer on mobile) plus a compact docked tab bar at the
   bottom, on every breakpoint. Cream canvas, flat pastel colour-block cards
   (not white-card-plus-icon-chip), fully pill buttons and inputs, one bold
   violet "hero" card for the number that matters most.
   ========================================================================= */

/* ---------- 1. TOKENS -------------------------------------------------- */
:root {
  /* Brand */
  --violet-700: #4C2FB0;
  --violet-600: #7C5CFC;
  --violet-400: #A78BFA;
  --cyan:       #22D3EE;
  --amber:      #F5B400;
  --pink:       #EC7FC2;
  --pos:        #1E9E5A;   /* financial-convention positive green */

  /* Canvas */
  --bg:        #FAF7F1;
  --surface:   #FFFFFF;
  --surface-2: #FFF;
  --border:    #ECE5D8;

  /* Text */
  --ink:       #17141F;
  --ink-soft:  #5B5768;
  --ink-mute:  #938FA0;

  /* Pastel colour-block fills (background, ink-on-it) */
  --p-violet:     #ECE6FF; --p-violet-ink: #5B3DD1;
  --p-cyan:       #DEF7FB; --p-cyan-ink:   #0E7C90;
  --p-amber:      #FFF1D2; --p-amber-ink:  #A66A00;
  --p-pink:       #FCE4F1; --p-pink-ink:   #BE297A;
  --p-green:      #E1F7E8; --p-green-ink:  #15803D;
  --p-slate:      #ECEAF5; --p-slate-ink:  #423D5C;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #7C5CFC 0%, #9C7CFF 55%, #22D3EE 130%);
  --grad-deep:  linear-gradient(160deg, #171232 0%, #382569 55%, #171232 100%);
  --grad-hero:  linear-gradient(135deg, #6D4CFA 0%, #8C6BFF 100%);

  /* Elevation â€” soft, warm-tinted, low spread */
  --e1: 0 1px 2px rgba(76, 60, 29, .05);
  --e2: 0 6px 20px -6px rgba(76, 60, 29, .12);
  --e3: 0 20px 46px -18px rgba(76, 46, 29, .22), 0 4px 12px rgba(76,46,29,.06);
  --glow-violet: 0 12px 28px -10px rgba(124, 92, 252, .55);

  /* Radius â€” big and round, the signature of this pass */
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --fast: .18s var(--ease);
  --base: .32s var(--ease);
  --slow: .6s var(--ease);

  --header-h: 64px;
  --tabbar-h: 64px;
  --screen-w: 640px;
  --sidebar-w: 264px;
}

html.dark {
  --bg:        #15121F;
  --surface:   #1E1A2E;
  --surface-2: #241F37;
  --border:    rgba(255,255,255,.08);
  --ink:       #F5F3FA;
  --ink-soft:  #C7C2DA;
  --ink-mute:  #8B87A3;

  --p-violet:     #2C2350; --p-violet-ink: #C9B8FF;
  --p-cyan:       #163038; --p-cyan-ink:   #7CE6F5;
  --p-amber:      #362A12; --p-amber-ink:  #F5C542;
  --p-pink:       #35202E; --p-pink-ink:   #F5A8D6;
  --p-green:      #14301F; --p-green-ink:  #6EE0A0;
  --p-slate:      #241F37; --p-slate-ink:  #C9C4DE;

  --e1: 0 1px 2px rgba(0,0,0,.4);
  --e2: 0 6px 20px -6px rgba(0,0,0,.5);
  --e3: 0 20px 46px -18px rgba(0,0,0,.7);
}

/* ---------- 2. BASE ---------------------------------------------------- */
* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv02","cv03","cv04";
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3, h4, .font-display {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -.02em;
  color: var(--ink);
}

.data, .stat-value, .eyebrow, .kpi {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-mute);
}

.muted  { color: var(--ink-soft); }
.mutest { color: var(--ink-mute); }

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

::selection { background: rgba(124,92,252,.25); }

:focus-visible {
  outline: 2px solid var(--violet-400);
  outline-offset: 2px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--violet-400); background-clip: content-box; }

html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
.data, .break-all { overflow-wrap: anywhere; }

/* ---------- 3. APP SHELL -------------------------------------------------- */
/* One column, capped at phone-ish width and centred, offset by the sidebar
   rail on wide screens. A persistent sidebar (fixed on desktop, an
   off-canvas drawer on mobile) and a compact docked tab bar are both nav
   chrome at every breakpoint. */
.appwrap { min-height: 100vh; min-height: 100dvh; display: flex !important; flex-direction: column; }
@media (min-width: 1024px) { .appwrap { margin-left: var(--sidebar-w); } }

.topbar-mini {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex !important; align-items: center; gap: 10px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-mini .brandmark { display: flex !important; align-items: center; gap: 9px; }
.topbar-mini .brandmark img { width: 32px; height: 32px; border-radius: 10px; }
.topbar-mini .brandmark span { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 15px; }
@media (min-width: 1024px) { .sidebar-toggle { display: none !important; } }

.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-pill);
  display: grid !important; place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--fast);
  flex: 0 0 auto;
}
.icon-btn:hover { color: var(--violet-600); border-color: var(--violet-400); transform: translateY(-1px); }
html.dark .icon-btn:hover { color: var(--violet-400); }

.searchbar {
  display: flex !important; align-items: center; gap: 10px;
  height: 42px; padding: 0 16px; flex: 1 1 auto; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--ink-mute);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.searchbar:focus-within { border-color: var(--violet-400); box-shadow: 0 0 0 4px rgba(124,92,252,.13); }
.searchbar input { background: transparent; border: 0; outline: 0; width: 100%; font-size: 14px; color: var(--ink); }
.searchbar kbd { font-size: 10px; font-weight: 700; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; color: var(--ink-mute); }

.screen {
  flex: 1 1 auto; width: 100%; max-width: var(--screen-w); margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .screen { padding: 24px 20px calc(var(--tabbar-h) + 32px); } }

/* legacy alias â€” some includes still reference .page */
.page { padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); max-width: var(--screen-w); width: 100%; margin: 0 auto; }
@media (min-width: 640px) { .page { padding: 24px 20px calc(var(--tabbar-h) + 32px); } }

/* Docked tab bar â€” flat, compact toolbar pinned to the bottom */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex !important; justify-content: center;
  padding: 0 10px calc(8px + env(safe-area-inset-bottom));
  pointer-events: none;
}
@media (min-width: 1024px) { .tabbar { left: var(--sidebar-w); } }
.tabbar__inner {
  pointer-events: auto;
  width: 100%; max-width: 400px;
  display: grid !important; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--e2);
  padding: 5px 5px;
  gap: 1px;
}
.tabbar a, .tabbar button {
  display: flex !important; flex-direction: column; align-items: center; gap: 2px;
  font-size: 9.5px; font-weight: 700; color: var(--ink-mute);
  padding: 6px 2px 4px; border-radius: 10px; transition: color var(--fast), background var(--fast);
}
.tabbar a svg, .tabbar button svg { width: 18px; height: 18px; }
.tabbar a.is-active, .tabbar button.is-active { color: var(--violet-600); background: var(--p-violet); }
html.dark .tabbar a.is-active, html.dark .tabbar button.is-active { color: var(--violet-400); }
.tabbar .tab--raised {
  position: relative; top: -12px;
  width: 44px; height: 44px; margin: 0 auto;
  border-radius: var(--r-md);
  background: var(--grad-hero); color: #fff;
  display: grid !important; place-items: center;
  box-shadow: var(--glow-violet);
  font-size: 0;
}
.tabbar .tab--raised svg { width: 21px; height: 21px; }

/* ---------- 3a. SIDEBAR (persistent rail / off-canvas drawer) ------------ */
.sidebar-scrim {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(23,20,31,.45);
  opacity: 0; pointer-events: none;
  transition: opacity var(--base);
}
body.is-drawer-open .sidebar-scrim { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 70;
  width: var(--sidebar-w);
  display: flex !important; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-100%);
  transition: transform var(--base);
  overflow-y: auto;
}
body.is-drawer-open .sidebar { transform: translateX(0); box-shadow: var(--e3); }

.sidebar__brand { display: flex !important; align-items: center; justify-content: space-between; padding: 4px 6px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.sidebar__close { width: 34px; height: 34px; }

.sidebar__nav { display: flex !important; flex-direction: column; gap: 1px; flex: 1 1 auto; }
.sidebar__group { padding: 14px 10px 4px; }
.sidebar__group:first-child { padding-top: 2px; }
.sidebar__link {
  display: flex !important; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  transition: background var(--fast), color var(--fast);
}
.sidebar__link:hover { background: var(--p-slate); color: var(--ink); }
.sidebar__link.is-active { background: var(--p-violet); color: var(--violet-600); font-weight: 700; }
html.dark .sidebar__link.is-active { color: var(--violet-400); }
.sidebar__ico {
  width: 32px; height: 32px; border-radius: var(--r-pill); flex: 0 0 auto;
  display: grid !important; place-items: center;
  background: var(--p-slate); color: var(--p-slate-ink);
}
.sidebar__ico svg { width: 15px; height: 15px; }
.sidebar__link.is-active .sidebar__ico { background: rgba(255,255,255,.6); color: inherit; }
html.dark .sidebar__link.is-active .sidebar__ico { background: rgba(255,255,255,.12); }
.sidebar__signout { color: #C0271F; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.sidebar__signout:hover { background: #FDE4E4; color: #C0271F; }
html.dark .sidebar__signout:hover { background: #3A1A1A; }

/* Desktop: sidebar becomes a permanent rail â€” no scrim, no toggle, no slide */
@media (min-width: 1024px) {
  .sidebar { transform: none !important; box-shadow: none; }
  .sidebar-scrim { display: none !important; }
}

/* ---------- 4. COMPONENTS ------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  transition: transform var(--base), box-shadow var(--base), border-color var(--base);
}
.card--pad { padding: clamp(14px, 1.7vw, 20px); }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--e2); border-color: rgba(124,92,252,.35); }

/* Pastel colour-block card modifiers â€” the visual signature of this pass.
   Used instead of "white card + coloured icon chip" wherever a section
   benefits from being instantly, playfully identifiable by colour.        */
.card--violet { background: var(--p-violet); color: var(--p-violet-ink); border-color: transparent; }
.card--cyan   { background: var(--p-cyan);   color: var(--p-cyan-ink);   border-color: transparent; }
.card--amber  { background: var(--p-amber);  color: var(--p-amber-ink);  border-color: transparent; }
.card--pink   { background: var(--p-pink);   color: var(--p-pink-ink);   border-color: transparent; }
.card--green  { background: var(--p-green);  color: var(--p-green-ink); border-color: transparent; }
.card--slate  { background: var(--p-slate);  color: var(--p-slate-ink); border-color: transparent; }
.card--violet .stat-value, .card--cyan .stat-value, .card--amber .stat-value,
.card--pink .stat-value, .card--green .stat-value, .card--slate .stat-value,
.card--violet h1, .card--violet h2, .card--violet h3,
.card--cyan h1, .card--cyan h2, .card--cyan h3,
.card--amber h1, .card--amber h2, .card--amber h3 { color: inherit; }

.glass {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.sec-head { display: flex !important; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: clamp(17px, 2vw, 20px); font-weight: 700; }
.sec-head p { font-size: 13px; color: var(--ink-mute); margin-top: 2px; }

/* Buttons â€” fully pill */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 52px; padding: 0 24px;
  touch-action: manipulation;
  border-radius: var(--r-pill);
  font-weight: 700; font-size: 14.5px;
  transition: transform var(--fast), box-shadow var(--fast), background var(--fast), color var(--fast), border-color var(--fast);
  cursor: pointer; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--grad-hero); color: #fff; box-shadow: var(--glow-violet); }
.btn--primary:hover { box-shadow: 0 16px 34px -10px rgba(124,92,252,.65); transform: translateY(-2px); }
.btn--solar { background: var(--amber); color: #3D2C00; box-shadow: 0 10px 26px -10px rgba(245,180,0,.55); }
.btn--solar:hover { transform: translateY(-2px); }
.btn--ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--violet-400); color: var(--violet-600); transform: translateY(-2px); }
html.dark .btn--ghost:hover { color: var(--violet-400); }
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--dark:hover { transform: translateY(-2px); }
.btn--sm { height: 44px; padding: 0 18px; font-size: 13.5px; }
@media (min-width: 1024px) { .btn--sm { height: 40px; font-size: 13px; } }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* Pills / chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700;
  background: var(--p-violet); color: var(--p-violet-ink);
  border: none;
}
.chip--solar, .chip--amber { background: var(--p-amber); color: var(--p-amber-ink); }
.chip--hydro, .chip--cyan  { background: var(--p-cyan);  color: var(--p-cyan-ink); }
.chip--wind  { background: var(--p-cyan); color: var(--p-cyan-ink); opacity: .85; }
.chip--grey  { background: var(--p-slate); color: var(--p-slate-ink); }
.chip--danger{ background: #FDE4E4; color: #C0271F; }
html.dark .chip--danger { background: #3A1A1A; color: #F5A3A3; }

.dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.dot--live { box-shadow: 0 0 0 0 rgba(124,92,252,.6); animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(124,92,252,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(124,92,252,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,92,252,0); }
}

/* Stat card */
.stat {
  position: relative; overflow: hidden;
  background: var(--p-slate); color: var(--p-slate-ink);
  border: none;
  border-radius: var(--r-lg); padding: 18px;
  transition: transform var(--base), box-shadow var(--base);
}
.stat:hover { transform: translateY(-3px); }
.stat__icon { width: 34px; height: 34px; border-radius: var(--r-pill); display: grid !important; place-items: center; color: #fff; background: var(--grad-hero); }
.stat__icon svg { width: 16px; height: 16px; }
.stat-value { font-size: clamp(17px, 2vw, 22px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat__spark { position: absolute; right: 0; bottom: 0; width: 120px; height: 46px; opacity: .5; pointer-events: none; }

/* Tone classes for icon chips placed on top of pastel cards (white glass circle) */
.i-violet, .i-green { background: rgba(255,255,255,.55); color: var(--p-violet-ink) !important; }
.i-amber,  .i-solar  { background: rgba(255,255,255,.55); color: var(--p-amber-ink) !important; }
.i-cyan,   .i-hydro  { background: rgba(255,255,255,.55); color: var(--p-cyan-ink) !important; }
.i-slate,  .i-dark   { background: rgba(255,255,255,.55); color: var(--p-slate-ink) !important; }
html.dark .i-violet, html.dark .i-green { background: rgba(255,255,255,.08); }
html.dark .i-amber,  html.dark .i-solar { background: rgba(255,255,255,.08); }
html.dark .i-cyan,   html.dark .i-hydro { background: rgba(255,255,255,.08); }
html.dark .i-slate,  html.dark .i-dark  { background: rgba(255,255,255,.08); }
/* Stand-alone icon chips (not on a pastel card) still want a filled look */
.stat__icon.i-violet, .stat__icon.i-green,
.stat__icon.i-amber,  .stat__icon.i-solar,
.stat__icon.i-cyan,   .stat__icon.i-hydro,
.stat__icon.i-slate,  .stat__icon.i-dark { color: #fff !important; }
.stat__icon.i-violet, .stat__icon.i-green { background: var(--grad-hero); }
.stat__icon.i-amber,  .stat__icon.i-solar  { background: linear-gradient(135deg,#F5B400,#FFD766); color: #3D2C00 !important; }
.stat__icon.i-cyan,   .stat__icon.i-hydro  { background: linear-gradient(135deg,#22D3EE,#67E8F9); color: #06414A !important; }
.stat__icon.i-slate,  .stat__icon.i-dark   { background: var(--ink); }

/* Meter */
.meter { height: 8px; border-radius: 99px; background: rgba(0,0,0,.08); overflow: hidden; }
html.dark .meter { background: rgba(255,255,255,.1); }
.meter__fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad-hero); transition: width 1.4s var(--ease); }
.meter__fill--solar, .meter__fill--amber { background: var(--amber); }
.meter__fill--hydro, .meter__fill--cyan  { background: var(--cyan); }

/* Forms â€” pill inputs */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; height: 54px; padding: 0 20px;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: var(--r-pill);
  font-size: 16px;
  outline: 0;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
@media (min-width: 1024px) { .input, .select, .textarea { height: 50px; font-size: 14.5px; } }
.textarea { height: auto; padding: 16px 20px; min-height: 120px; resize: vertical; border-radius: var(--r-md); }
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--violet-400); box-shadow: 0 0 0 4px rgba(124,92,252,.13); }
.input-group { position: relative; }
.input-group .input { padding-left: 48px; }
.input-group__icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); width: 18px; height: 18px; }
.input-group__action { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); padding: 6px; border-radius: 8px; }
.input-group__action:hover { color: var(--violet-600); }
.hint { font-size: 12px; color: var(--ink-mute); margin-top: 7px; padding-left: 6px; }
.hint--error { color: #C0271F; }
html.dark .hint--error { color: #F5A3A3; }

.checkbox { display: flex !important; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.checkbox input { appearance: none; width: 19px; height: 19px; flex: 0 0 19px; border: 1.5px solid var(--border); border-radius: 7px; margin-top: 1px; transition: all var(--fast); position: relative; }
.checkbox input:checked { background: var(--grad-hero); border-color: transparent; }
.checkbox input:checked::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/13px no-repeat; }

.strength { display: flex !important; gap: 5px; margin-top: 9px; padding: 0 6px; }
.strength span { height: 5px; flex: 1; border-radius: 99px; background: var(--border); transition: background var(--base); }

/* Segmented control â€” pill */
.seg {
  display: flex !important; padding: 4px; background: var(--p-slate);
  border: none; border-radius: var(--r-pill); gap: 3px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; min-height: 40px; padding: 8px 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 700; color: var(--p-slate-ink); opacity: .6; transition: all var(--fast); white-space: nowrap; }
@media (min-width: 1024px) { .seg { display: inline-flex; } .seg button { min-height: 0; font-size: 13px; } }
.seg button.is-active { background: var(--surface); color: var(--violet-600); opacity: 1; box-shadow: var(--e1); }

/* Table (kept minimal â€” used for pure comparison grids) */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 15px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--p-violet); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; max-width: 100%; }
.table th, .table td { white-space: nowrap; }
.table th:first-child, .table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
@media (min-width: 1024px) { .table th:first-child, .table td:first-child { position: static; } }

.avatar { border-radius: var(--r-pill); background: var(--grad-hero); color: #fff; display: grid !important; place-items: center; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; flex: 0 0 auto; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 99px; background: var(--surface); border: 2px solid var(--border); }
.tl-item.is-done::before { background: var(--violet-400); border-color: var(--violet-400); box-shadow: 0 0 0 4px rgba(124,92,252,.16); }
.tl-item.is-current::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 4px rgba(245,180,0,.2); animation: pulse-dot 2s infinite; }

.acc { border-bottom: 1px solid var(--border); }
.acc__btn { display: flex !important; width: 100%; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px; text-align: left; font-weight: 700; font-size: 15px; font-family: 'Plus Jakarta Sans', sans-serif; }
.acc__btn svg { transition: transform var(--base); color: var(--ink-mute); flex: 0 0 auto; }
.acc.is-open .acc__btn svg { transform: rotate(180deg); color: var(--violet-600); }
.acc__body { display: grid !important; grid-template-rows: 0fr; transition: grid-template-rows var(--base); }
.acc.is-open .acc__body { grid-template-rows: 1fr; }
.acc__body > div { overflow: hidden; }
.acc__body p { padding: 0 4px 20px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.7; }

.state { text-align: center; padding: 52px 20px; }
.state__icon { width: 68px; height: 68px; border-radius: var(--r-pill); display: grid !important; place-items: center; margin: 0 auto 18px; background: var(--p-violet); color: var(--p-violet-ink); }
.state__icon svg { width: 28px; height: 28px; }
.state h3 { font-size: 17px; margin-bottom: 6px; }
.state p { color: var(--ink-mute); font-size: 14px; max-width: 380px; margin: 0 auto 20px; }

.skeleton { position: relative; overflow: hidden; background: var(--border); border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.4s infinite; }
html.dark .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Toast â€” sits above the floating tab bar */
.toast-wrap { position: fixed; z-index: 200; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); display: flex !important; flex-direction: column; gap: 10px; align-items: center; }
@media (min-width: 640px) { .toast-wrap { left: auto; right: 20px; width: 380px; align-items: stretch; } }
.toast {
  display: flex !important; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg);
  padding: 14px 20px; border-radius: var(--r-pill); box-shadow: var(--e3);
  font-size: 13.5px; font-weight: 600;
  animation: toast-in .4s var(--ease);
  max-width: 92vw;
}
.toast--error { background: #C0271F; color: #fff; }
.toast--solar { background: var(--amber); color: #3D2C00; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* Modal / sheet â€” ALWAYS a bottom sheet, on every screen size. This is a
   deliberate mobile-first choice: dialogs never "become a desktop dialog." */
.modal { position: fixed; inset: 0; z-index: 150; display: none; place-items: end center; padding: 0; }
.modal.is-open { display: grid !important; }
.modal__scrim { position: absolute; inset: 0; background: rgba(23,20,31,.55); backdrop-filter: blur(4px); animation: fade .3s var(--ease); }
.modal__panel {
  position: relative; width: 100%; max-width: var(--screen-w);
  max-height: 88dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--e3);
  animation: sheet-in .4s var(--ease);
}
.modal__panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--border); margin: -6px auto 16px; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* FAB â€” repositioned above the floating tab bar */
.fabs { position: fixed; right: 14px; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); z-index: 55; display: flex !important; flex-direction: column; gap: 12px; }
.fab { width: 52px; height: 52px; border-radius: var(--r-pill); display: grid !important; place-items: center; color: #fff; box-shadow: var(--e3); transition: transform var(--base), box-shadow var(--base); position: relative; }
.fab:hover { transform: translateY(-3px) scale(1.04); }
.fab svg { width: 22px; height: 22px; }
.fab--chat { background: var(--grad-hero); }
.fab::after {
  content: attr(data-label);
  position: absolute; right: 62px; top: 50%; transform: translateY(-50%) translateX(6px);
  background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all var(--fast);
}
.fab:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* AI Assistant chat thread */
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } }
.chat-thread { max-height: 42vh; overflow-y: auto; display: flex !important; flex-direction: column; gap: 10px; padding: 2px 2px 4px; margin-bottom: 14px; }
.chat-bubble { max-width: 85%; padding: 10px 14px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.55; animation: bubble-in .25s var(--ease); }
.chat-bubble--bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.chat-bubble--user { align-self: flex-end; background: var(--grad-hero); color: #fff; border-bottom-right-radius: 6px; }
.chat-bubble__link { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--violet-600); }
html.dark .chat-bubble__link { color: var(--violet-400); }
.chat-typing { display: inline-flex !important; gap: 4px; padding: 3px 0; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); animation: chat-typing-dot 1.1s ease-in-out infinite; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Hero utilities (marketing + section heroes) */
.hero-deep { background: var(--grad-deep); color: #fff; position: relative; overflow: hidden; border-radius: var(--r-xl); }
.hero-deep h1, .hero-deep h2, .hero-deep h3 { color: #fff; }
.mesh::before, .mesh::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.mesh::before { width: 420px; height: 420px; background: rgba(124,92,252,.4); top: -120px; right: -70px; animation: float-a 16s ease-in-out infinite; }
.mesh::after  { width: 340px; height: 340px; background: rgba(34,211,238,.22); bottom: -130px; left: -50px; animation: float-b 20s ease-in-out infinite; }
@keyframes float-a { 50% { transform: translate(-40px, 50px) scale(1.12); } }
@keyframes float-b { 50% { transform: translate(50px, -40px) scale(1.08); } }

/* ---------- 5. HERO BALANCE + ACTION ROW (new flagship components) ------ */
.hero-balance {
  background: var(--grad-hero); color: #fff;
  border-radius: var(--r-lg);
  padding: 18px 18px;
  position: relative; overflow: hidden;
}
.hero-balance::before { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.12); top: -80px; right: -50px; }
.hero-balance::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.08); bottom: -60px; left: -30px; }
.hero-balance__label { position: relative; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.75); }
.hero-balance__value { position: relative; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(24px, 5.5vw, 32px); letter-spacing: -.02em; margin-top: 4px; }
.hero-balance__row { position: relative; display: flex !important; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hero-balance__pill { background: rgba(255,255,255,.16); border-radius: var(--r-sm); padding: 8px 11px; flex: 1 1 auto; min-width: 96px; }
.hero-balance__pill p:first-child { font-size: 9.5px; color: rgba(255,255,255,.7); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hero-balance__pill p:last-child { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 13.5px; margin-top: 2px; }

.actionrow { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.actionrow--5 { grid-template-columns: repeat(5, 1fr); }
.action-circle { display: flex !important; flex-direction: column; align-items: center; gap: 8px; }
.action-circle__ico {
  width: 56px; height: 56px; border-radius: var(--r-pill);
  display: grid !important; place-items: center;
  background: var(--p-violet); color: var(--p-violet-ink);
  transition: transform var(--fast), box-shadow var(--fast);
}
.action-circle:active .action-circle__ico { transform: scale(.93); }
.action-circle__ico svg { width: 22px; height: 22px; }
.action-circle__label { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: center; }

/* ---------- 6. WALLET CARDS (AI Workspace plans as debit-card visuals) --- */
.walletcards {
  display: flex !important; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 4px 4px 10px; margin: 0 -4px;
}
.walletcards::-webkit-scrollbar { display: none; }
.walletcard {
  flex: 0 0 auto; scroll-snap-align: start;
  width: min(64vw, 250px); aspect-ratio: 1.75 / 1;
  border-radius: var(--r-md); padding: 15px;
  display: flex !important; flex-direction: column; justify-content: space-between;
  color: #fff; position: relative; overflow: hidden;
}
.walletcard::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.walletcard__top { position: relative; display: flex !important; align-items: flex-start; justify-content: space-between; }
.walletcard__ico { width: 32px; height: 32px; border-radius: var(--r-pill); background: rgba(255,255,255,.22); display: grid !important; place-items: center; }
.walletcard__ico svg { width: 15px; height: 15px; }
.walletcard__bottom { position: relative; }
.walletcard__price { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.walletcard__name { font-size: 11px; font-weight: 700; opacity: .9; margin-top: 2px; }

/* ---------- 6a. SUBSCRIBE FLOW: plan list + confirm modal ---------------- */
.plan-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px 14px; margin-bottom: 10px;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
}
.plan-item:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: rgba(124,92,252,.3); }
.plan-item:active { transform: scale(.985); }
.plan-item__ico { width: 34px; height: 34px; border-radius: var(--r-pill); display: grid !important; place-items: center; flex: 0 0 auto; }
.plan-item__ico svg { width: 16px; height: 16px; }
.plan-item__body { flex: 1 1 auto; min-width: 0; }
.plan-item__name { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.plan-item__sub { font-size: 12px; color: var(--ink-mute); margin-top: 1px; }

/* Nicely-styled confirm modal, with distinct success / error result states */
.buy-banner {
  border-radius: var(--r-lg); padding: 24px 20px; text-align: center;
  position: relative; overflow: hidden;
}
.buy-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.buy-banner__ico { position: relative; width: 52px; height: 52px; border-radius: var(--r-pill); background: rgba(255,255,255,.22); display: grid !important; place-items: center; margin: 0 auto; }
.buy-banner__ico svg { width: 24px; height: 24px; }
.buy-banner__name { position: relative; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 19px; margin-top: 12px; }
.buy-banner__sub { position: relative; font-size: 13px; opacity: .85; margin-top: 2px; }

.buy-detail { background: var(--p-slate); color: var(--p-slate-ink); border-radius: var(--r-md); padding: 6px 16px; margin-top: 16px; }
.buy-detail > div { padding: 9px 0; font-size: 14px; }

/* Crossfade between confirm / success / error panels inside the modal */
[data-buy-state] { transition: opacity .32s var(--ease), transform .32s var(--ease); opacity: 0; transform: translateY(10px) scale(.98); }
[data-buy-state].is-active { opacity: 1; transform: none; }

@keyframes buy-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes buy-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes buy-ring { from { transform: scale(.7); opacity: .55; } to { transform: scale(1.5); opacity: 0; } }
.buy-result { position: relative; width: 74px; height: 74px; border-radius: var(--r-pill); display: grid !important; place-items: center; margin: 4px auto 18px; animation: buy-pop .5s var(--ease); }
.buy-result--ok { background: var(--p-green); color: var(--p-green-ink); }
.buy-result--ok::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--p-green-ink); animation: buy-ring 1s ease-out .15s; }
.buy-result--err { background: #FDE4E4; color: #C0271F; animation: buy-pop .5s var(--ease), buy-shake .45s .5s var(--ease); }
html.dark .buy-result--err { background: #3A1A1A; color: #F5A3A3; }
.buy-result svg { width: 34px; height: 34px; }
.buy-result__title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 19px; text-align: center; }
.buy-result__msg { font-size: 13.5px; color: var(--ink-soft); text-align: center; margin-top: 6px; line-height: 1.55; }

/* Modal actions — one confident gradient CTA + a quiet text link, not two competing pills */
.buy-actions { margin-top: 22px; }
.buy-btn-primary {
  position: relative; overflow: hidden; width: 100%; height: 54px;
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill); background: var(--grad-hero); color: #fff;
  font-weight: 800; font-size: 15px; letter-spacing: .01em;
  box-shadow: var(--glow-violet);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.buy-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(124,92,252,.65); }
.buy-btn-primary:active { transform: scale(.97); }
.buy-btn-primary:disabled { opacity: .6; pointer-events: none; }
.buy-btn-primary::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .7s ease;
}
.buy-btn-primary:hover::before { left: 130%; }
.buy-btn-primary svg { position: relative; width: 18px; height: 18px; transition: transform .25s var(--ease); }
.buy-btn-primary:hover svg { transform: translateX(3px); }
.buy-cancel-link {
  display: block; width: 100%; text-align: center; background: none; border: none;
  padding: 14px 0 2px; margin-top: 2px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-mute);
  transition: color .2s var(--ease);
}
.buy-cancel-link:hover { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 6b. AUTH (login / register) — compact, premium, app-like ---- */
.auth-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex !important; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; position: relative; overflow: hidden;
  background: var(--grad-deep);
}
.auth-shell::before, .auth-shell::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .55; }
.auth-shell::before { width: 360px; height: 360px; background: rgba(124,92,252,.35); top: -120px; right: -80px; }
.auth-shell::after  { width: 300px; height: 300px; background: rgba(34,211,238,.16); bottom: -120px; left: -60px; }

.auth-brand { position: relative; display: flex !important; flex-direction: column; align-items: center; gap: 9px; margin-bottom: 20px; }
.auth-brand img { width: 38px; height: 38px; border-radius: 11px; }
.auth-brand span { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; color: #fff; font-size: 14.5px; letter-spacing: -.01em; }

.auth-stats { position: relative; display: flex !important; gap: 20px; justify-content: center; margin-bottom: 20px; }
.auth-stats > div { text-align: center; }
.auth-stats b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; color: #fff; font-size: 14.5px; }
.auth-stats span { display: block; color: rgba(255,255,255,.55); font-size: 10px; margin-top: 2px; }

.auth-card {
  position: relative; width: 100%; max-width: 372px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--e3);
  padding: 28px 24px 26px;
}
.auth-card__head { display: flex !important; align-items: flex-start; justify-content: space-between; gap: 10px; }
.auth-card h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.01em; margin-top: 10px; }
.auth-card__sub { font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; }

.auth-field { margin-bottom: 13px; }
.auth-label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.auth-input-group { position: relative; }
.auth-input {
  width: 100%; height: 45px; padding: 0 16px 0 41px;
  background: var(--bg); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: 13px;
  font-size: 14px; outline: 0;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.auth-input::placeholder { color: var(--ink-mute); }
.auth-input:focus { border-color: var(--violet-400); box-shadow: 0 0 0 4px rgba(124,92,252,.13); background: var(--surface); }
.auth-input-group__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); width: 16px; height: 16px; }
.auth-input-group__action { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); padding: 4px; border-radius: 8px; }
.auth-input-group__action:hover { color: var(--violet-600); }

.auth-btn {
  width: 100%; height: 47px; border-radius: 13px;
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad-hero); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: var(--glow-violet);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(124,92,252,.6); }
.auth-btn:active { transform: scale(.98); }
.auth-btn svg { width: 16px; height: 16px; }
.auth-btn[disabled] { opacity: .6; pointer-events: none; }

.auth-note { display: flex !important; align-items: center; gap: 8px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink-mute); }
.auth-note svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--violet-600); }

/* ---------- 7. GROUPED FEED (transactions / activity) -------------------- */
.feed__date { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); padding: 18px 4px 8px; }
.feed__date:first-child { padding-top: 4px; }
.feed__row { display: flex !important; align-items: center; gap: 13px; padding: 11px 6px; border-radius: var(--r-md); transition: background var(--fast); }
.feed__row:hover { background: var(--p-slate); }
.feed__ico { width: 42px; height: 42px; border-radius: var(--r-pill); display: grid !important; place-items: center; flex: 0 0 auto; }
.feed__ico svg { width: 18px; height: 18px; }
.feed__body { flex: 1 1 auto; min-width: 0; }
.feed__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.feed__sub { font-size: 12px; color: var(--ink-mute); margin-top: 1px; }
.feed__amt { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* ---------- 8. SIGNATURE: AI PIPELINE + CHARTS --------------------------- */
.gridflow { position: relative; }
.gridflow svg { width: 100%; height: auto; display: block; overflow: visible; }
.flow-path { fill: none; stroke-width: 2; stroke-linecap: round; opacity: .30; }
.flow-particle { animation: dash 2.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -220; } }
.node-pulse { transform-origin: center; animation: node-breathe 3s ease-in-out infinite; }
@keyframes node-breathe { 50% { opacity: .35; transform: scale(1.35); } }

.chart { width: 100%; display: block; overflow: visible; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-label { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600; fill: var(--ink-mute); }
.chart-bar { transition: opacity var(--fast); }
.chart-bar:hover { opacity: .78; }
.draw-in { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.8s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.rise { transform-origin: bottom; animation: rise .9s var(--ease) backwards; }
@keyframes rise { from { transform: scaleY(0); } }

/* ---------- MOTION ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
.page-enter { animation: page-in .5s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
.float-y { animation: float-y 6s ease-in-out infinite; }
@keyframes float-y { 50% { transform: translateY(-14px); } }
.spin-slow { animation: spin 14s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.marquee { display: flex !important; gap: 48px; animation: marquee 32s linear infinite; width: max-content; }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .tabbar, .topbar-mini, .fabs, .no-print { display: none !important; }
  .screen, .page { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ---------- 9. LEGACY PATTERNS (still used by a few pages) --------------- */
.hero-shot { position: relative; overflow: hidden; border-radius: var(--r-xl); height: 190px; }
.hero-shot img { width: 100%; height: 100%; object-fit: cover; }
.hero-shot__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,18,50,.15) 0%, rgba(23,18,50,.35) 55%, rgba(23,18,50,.82) 100%); }
.hero-shot__copy { position: absolute; left: 20px; right: 20px; bottom: 18px; color: #fff; }

.tiles { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 8px; }
.tile { display: flex !important; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; border-radius: var(--r-md); transition: transform var(--fast), background var(--fast); }
.tile:active { transform: scale(.94); }
.tile:hover { background: var(--p-slate); }
.tile__ico { width: 44px; height: 44px; border-radius: var(--r-pill); display: grid !important; place-items: center; color: #fff; }
.tile__ico svg { width: 20px; height: 20px; }
.tile__label { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.2; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(8, 1fr); } .tile__ico { width: 50px; height: 50px; } }

.rail { display: flex !important; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; margin: 0 -4px; padding-inline: 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 76%; scroll-snap-align: start; max-width: 300px; }
@media (min-width: 640px) { .rail > * { flex: 0 0 280px; } }

.trust { display: grid !important; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 6px; }
.trust__item { text-align: center; padding: 0 4px; position: relative; }
.trust__item + .trust__item::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.trust__item i { color: var(--violet-600); }
.trust__item p { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); margin-top: 7px; line-height: 1.3; }

.rating { display: flex !important; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; }
.rating i { color: var(--amber); }

.carousel { position: relative; }
.carousel__track { display: flex !important; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.carousel__track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; overflow: hidden; border-radius: var(--r-xl); min-height: 170px; padding: 22px; display: flex !important; flex-direction: column; justify-content: center; color: #fff; background: var(--grad-deep); }
.slide__body { position: relative; max-width: 80%; }
.dots { display: flex !important; gap: 6px; justify-content: center; margin-top: 12px; }
.dots button { width: 7px; height: 7px; border-radius: 99px; background: var(--border); transition: all var(--base); }
.dots button.is-on { width: 22px; background: var(--violet-600); }

.qgrid { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qtile { display: flex !important; flex-direction: column; align-items: center; gap: 9px; padding: 14px 6px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast); }
.qtile:active { transform: scale(.95); }
.qtile:hover { border-color: var(--violet-400); }
.qtile__ico { display: grid !important; place-items: center; width: 30px; height: 30px; color: var(--violet-600); }
.qtile__label { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: center; }

/* ---------- 10. FONT UTILITY REMAP --------------------------------------- */
.font-data { font-family: 'Plus Jakarta Sans', sans-serif; }
