/* Pluvionaut — dark navy surfaces, electric purple for actions, cyan as the secondary accent,
   green for positive events, red for risks, amber for warnings. Thin borders, restrained glow.
   Every value is a token below; pages never write literals. */
:root {
  /* Colour */
  --bg: #070b16;
  --surface: #0d1424;
  --surface-2: #101a2d;
  --surface-3: #18233a;
  --line: #1c2840;
  --line-soft: #141e33;
  --text: #e6eaf2;
  --text-2: #aeb7c8;
  --muted: #7f8aa3;           /* 5.31:1 on --surface */
  --accent: #9b82ff;          /* links, icons, focus — 6.15:1 on --surface */
  --accent-hi: #b9a7ff;
  --accent-ink: #0b1020;      /* text on light fills (accent, amber, green) */
  --accent-soft: rgba(124, 92, 255, .14);
  --brand: #6d4aff;           /* buttons and other action fills — white text 5.15:1 */
  --brand-hi: #5b3df5;
  --on-brand: #ffffff;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, .12);
  --up: #22c55e;
  --up-hi: #4ade80;
  --up-soft: rgba(34, 197, 94, .12);
  --down: #f43f5e;
  --down-soft: rgba(244, 63, 94, .12);
  --down-text: #fb7185;       /* red text on a red tint */
  --warn: #f5a524;            /* warnings and pending actions */
  --warn-soft: rgba(245, 165, 36, .13);
  --line-strong: #5b6984;     /* field border: 3.32:1 to the panel */
  --reserve: #64748b;
  --brand-1: #a78bfa;
  --brand-2: #6d4aff;
  --brand-3: #22d3ee;
  --grad-brand: linear-gradient(135deg, var(--brand), var(--brand-hi) 55%, #4f46e5); /* white text ≥ 5.1:1 on every stop */
  --grad-text: linear-gradient(100deg, var(--brand-1), #818cf8 45%, var(--brand-3));
  --glow: rgba(109, 74, 255, .38);
  --glow-soft: rgba(109, 74, 255, .12);
  --glass: rgba(13, 20, 36, .62);
  --glass-line: rgba(255, 255, 255, .07);
  /* Chart series */
  --c1: #7c5cff;
  --c2: #22c55e;
  --c3: #22d3ee;
  --c4: #f5a524;
  --c5: #f472b6;
  --c6: #60a5fa;
  --c7: #a3e635;
  --c8: #94a3b8;
  --bg-glass: rgba(7, 11, 22, .86);
  --surface-glass: rgba(13, 20, 36, .96);
  --scrim: rgba(2, 4, 10, .7);
  --shadow: 0 16px 40px rgba(0, 0, 0, .5);

  /* Fonts */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Type scale */
  --t-xs: 12px;
  --t-sm: 13px;
  --t-md: 14px;
  --t-lg: 16px;
  --t-xl: 20px;
  --t-2xl: 28px;
  --t-3xl: 44px;
  --t-4xl: 56px;
  --r-pill: 999px;
  --shine: rgba(255, 255, 255, .45);
  --lift: -2px;
  --w-card: 280px;
  --w-search: 260px;
  --w-panel: 380px;
  --h-notif: 420px;
  --h-chat: 560px;
  --w-bubble: 85%;
  --w-bar-label: 9rem;
  --w-num: 4.5em;
  --w-prose: 75ch;
  --w-card-sm: 240px;
  --h-donut: 132px;
  --h-canvas: 240px;

  /* Spacing scale: step 4 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  /* Line heights */
  --lh-tight: 1.1;
  --lh-body: 1.55;
  --lh-loose: 1.65;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* Control heights */
  --h-sm: 32px;
  --h-md: 40px;
  --h-lg: 48px;
  --h-xs: 24px;
  --h-row: 56px;
  --h-bar: 64px;

  /* Icons and bars */
  --i-sm: 16px;
  --i-md: 20px;
  --i-lg: 24px;
  --bar-thick: 12px;
  --bar-thin: 8px;

  /* Content width */
  --w-app: 1200px;
  --w-site: 1280px;
  --gutter: clamp(var(--s4), 4vw, var(--s7));

  --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 var(--t-md)/var(--lh-body) var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
img { display: block; }
h1, h2, h3 { margin: 0; font-family: var(--font); text-wrap: balance; }
h2 { font-size: var(--t-lg); font-weight: 600; }
h3 { font-size: var(--t-md); font-weight: 600; }
p { margin: 0; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.up { color: var(--up); }
.down { color: var(--down); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Rhythm ---------- */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-content: start; }
.stack-sm { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); align-content: start; }
.stack-xs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); align-content: start; }
main { min-width: 0; }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: var(--s4); align-items: start; }
.split > *, .grid > * { min-width: 0; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
body:not(.guest) .shell { margin-left: var(--side); }
.side { position: fixed; z-index: 3; inset: 0 auto 0 0; width: var(--side); padding: var(--s5) var(--s3); display: flex; flex-direction: column; gap: var(--s5);
  background: var(--bg); border-right: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2); color: var(--text); font-size: var(--t-lg); font-weight: 600; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img { width: var(--h-sm); height: var(--h-sm); }
.nav { display: grid; gap: var(--s1); }
.nav a { display: flex; align-items: center; gap: var(--s3); height: var(--h-md); padding: 0 var(--s3); border-radius: var(--r-md); color: var(--muted); font-weight: 500; transition: color .15s, background .15s; }
.nav a svg { width: var(--i-md); height: var(--i-md); flex: none; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav a.active svg { color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: var(--s2); padding: 0 var(--s2); }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  height: var(--h-bar); padding: 0 var(--s6); background: var(--bg-glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.top-title, .top-right { display: flex; align-items: center; gap: var(--s3); }
main { max-width: var(--w-app); padding: var(--s5) var(--s6) var(--s7); outline: none; }
body.guest main { max-width: none; padding: 0; }
.view-enter { animation: view-in .35s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.tabbar { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; display: none; justify-content: space-around; padding: var(--s2) var(--s1) calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  background: var(--surface-glass); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: var(--s1); min-width: var(--h-row); font-size: var(--t-xs); font-weight: 500; color: var(--muted); padding: var(--s1) var(--s2); }
.tabbar a svg { width: var(--i-lg); height: var(--i-lg); }
.tabbar a.active { color: var(--text); }
.tabbar a.active svg { color: var(--accent); }

.demo-banner { position: sticky; top: 0; z-index: 5; min-height: var(--h-sm); display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--s1) var(--s4); font-size: var(--t-sm); font-weight: 500; color: var(--on-brand); background: var(--brand); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--h-md); padding: 0 var(--s4); border: 1px solid transparent; border-radius: var(--r-sm);
  font: 600 var(--t-md) var(--font); color: var(--on-brand); background: var(--brand); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .1s; }
.btn:not(.ghost):not(.danger):not(.up) { background: var(--grad-brand); background-size: 160% 160%; position: relative; overflow: hidden; box-shadow: 0 6px 24px -10px var(--glow); }
.btn:not(.ghost):not(.danger):not(.up)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, var(--shine) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn:not(.ghost):not(.danger):not(.up):hover::after { transform: translateX(120%); }
.btn:hover { background: var(--brand-hi); color: var(--on-brand); }
.btn:not(.ghost):not(.danger):not(.up):hover { background: var(--grad-brand); background-position: 100% 0; box-shadow: 0 10px 32px -10px var(--glow); }
.btn:active { transform: translateY(1px); }
.btn svg { width: var(--i-sm); height: var(--i-sm); }
.btn.big { height: var(--h-lg); padding: 0 var(--s5); font-size: var(--t-lg); }
.btn.sm { height: var(--h-sm); padding: 0 var(--s3); font-size: var(--t-sm); }
.btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.up { background: var(--up); color: var(--accent-ink); }
.btn.up:hover { background: var(--up-hi); }
.btn.danger { background: transparent; color: var(--down); border-color: var(--down); }
.btn.danger:hover { background: var(--down-soft); color: var(--down); }
.btn:disabled, .btn[aria-disabled=true], .btn[aria-busy=true] { opacity: .5; cursor: not-allowed; transform: none; }
.btn:not(.ghost):not(.danger):not(.up)[aria-busy=true]::after { position: static; inset: auto; background: none; transform: none; transition: none; }
.btn[aria-busy=true]::after { content: ""; width: var(--i-sm); height: var(--i-sm); border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.wallet-chip { display: inline-flex; align-items: center; gap: var(--s2); height: var(--h-sm); padding: 0 var(--s3) 0 var(--s2); border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 var(--t-sm) var(--mono); cursor: pointer; }
.wallet-chip:hover { border-color: var(--surface-3); background: var(--surface-2); }
.wallet-chip .dot { width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }

/* ---------- Status tags ---------- */
.tag { display: inline-flex; align-items: center; gap: var(--s1); height: var(--h-xs); padding: 0 var(--s2); border-radius: var(--r-sm); font-size: var(--t-xs); font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.tag.ok { background: var(--up-soft); color: var(--up); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.brand { background: var(--accent-soft); color: var(--accent); }
.tag.bad { background: var(--down-soft); color: var(--down-text); }
.tag.demo { background: var(--accent); color: var(--accent-ink); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s5); display: grid; gap: var(--s4); align-content: start; min-width: 0; }
.panel.flat { background: transparent; border-color: var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: var(--h-sm); }
.panel-head .aside { color: var(--muted); font-size: var(--t-sm); }
.section { display: grid; gap: var(--s3); }
.section > h2 { color: var(--text); }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.page-intro p { max-width: 64ch; color: var(--muted); }
.hint { font-size: var(--t-sm); color: var(--muted); }
.title-lg { font-size: var(--t-xl); font-weight: 600; letter-spacing: -.01em; }
.field-error { font-size: var(--t-sm); color: var(--down-text); }

/* Stat tiles: one strip with dividers */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.tile { display: grid; gap: var(--s1); padding: var(--s4) var(--s5); border-right: 1px solid var(--line-soft); }
.tile:last-child { border-right: 0; }
.tile-label { color: var(--muted); font-size: var(--t-sm); }
.tile-value { font: 500 var(--t-xl)/1.25 var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.tile-sub { color: var(--muted); font-size: var(--t-xs); }
.tile.primary .tile-value { font-size: var(--t-2xl); color: var(--accent); }

/* Allocation bar */
.alloc-bar { display: flex; height: var(--bar-thick); gap: var(--s1); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.alloc-bar span { display: block; height: 100%; transform-origin: left; animation: grow .8s var(--ease) backwards; }
.alloc-bar span.empty { background: repeating-linear-gradient(135deg, var(--surface-3) 0 var(--s1), transparent var(--s1) var(--s2)); }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--t-sm); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: var(--s2); }
.legend b { color: var(--text); font: 500 var(--t-sm) var(--mono); }
.legend i { width: var(--s2); height: var(--s2); border-radius: var(--r-xs); flex: none; }

/* ---------- Collection rows ---------- */
.list { display: grid; }
.item { display: flex; align-items: center; gap: var(--s3); min-height: var(--h-row); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); color: var(--text); transition: background .15s; }
.item:last-child { border-bottom: 0; }
a.item:hover { color: var(--text); background: linear-gradient(90deg, transparent, var(--surface-2) 12%, var(--surface-2) 88%, transparent); }
.item .ico { width: var(--h-sm); height: var(--h-sm); flex: none; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.item .ico svg { width: var(--i-sm); height: var(--i-sm); }
.item .ico.ok { background: var(--up-soft); color: var(--up); }
.item .ico.warn { background: var(--warn-soft); color: var(--warn); }
.item .ico.bad { background: var(--down-soft); color: var(--down); }
.item .main { flex: 1; min-width: 0; display: grid; gap: var(--s1); }
.item .t { font-weight: 500; }
.item .d { color: var(--muted); font-size: var(--t-sm); }
.item .v { font: 500 var(--t-md) var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.item.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: var(--t-xs); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: var(--s3); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.r, th.r { text-align: right; }
td.num { font-family: var(--mono); }
tr.total td { font-weight: 600; border-top: 1px solid var(--line); }

.sum { display: grid; gap: var(--s2); }
.sum div { display: flex; justify-content: space-between; gap: var(--s3); }
.sum dd, .sum dt { margin: 0; }
.sum dd { font-family: var(--mono); }
.sum .total { padding-top: var(--s2); border-top: 1px solid var(--line); font-weight: 600; }

/* ---------- Project cards ---------- */
.proj { color: var(--text); transition: border-color .2s, transform .2s var(--ease); }
.proj:hover { color: var(--text); border-color: var(--surface-3); transform: translateY(var(--lift)); }
.proj-head { display: flex; align-items: center; gap: var(--s3); }
.proj-head > div { min-width: 0; display: grid; gap: var(--s1); }
.mark { width: var(--h-md); height: var(--h-md); flex: none; border-radius: var(--r-md); display: grid; place-items: center; font: 600 var(--t-lg) var(--mono); color: var(--accent); background: var(--surface-2); border: 1px solid var(--line); }
.mark.lg { width: var(--h-row); height: var(--h-row); font-size: var(--t-xl); }
.proj-foot { display: flex; justify-content: space-between; align-items: end; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-soft); font-size: var(--t-xs); color: var(--muted); }
.proj-meta { display: grid; gap: var(--s1); justify-items: end; text-align: right; }
.proj-foot b { display: block; color: var(--text); font: 500 var(--t-lg) var(--mono); }
.risk { display: inline-flex; gap: var(--s1); vertical-align: -1px; }
.risk i { width: var(--s1); height: var(--s3); border-radius: var(--r-xs); background: var(--surface-3); }
.risk.r1 i:nth-child(1) { background: var(--up); }
.risk.r2 i:nth-child(-n+2) { background: var(--accent); }
.risk.r3 i { background: var(--down); }

/* Filter toggles */
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; }
.seg { display: inline-flex; padding: var(--s1); border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-soft); overflow-x: auto; max-width: 100%; }
.seg button { height: var(--h-sm); border: 0; background: none; color: var(--muted); font: 500 var(--t-sm) var(--font); padding: 0 var(--s3); border-radius: var(--r-xs); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.seg a { display: inline-flex; align-items: center; justify-content: center; height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--r-xs); color: var(--muted); font: 500 var(--t-sm) var(--font); white-space: nowrap; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface-3); color: var(--text); }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--s2); font-size: var(--t-sm); color: var(--muted); }
.field > span { font-weight: 500; }
input, select, textarea { width: 100%; height: var(--h-md); padding: 0 var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: 400 var(--t-md) var(--font); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--text-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:user-invalid { border-color: var(--down); }
input[type=checkbox] { width: var(--i-sm); height: var(--i-sm); margin: 0; accent-color: var(--accent); flex: none; }
input[type=range] { height: var(--s1); padding: 0; border: 0; background: var(--line-strong); accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: var(--s2); min-height: var(--h-sm); color: var(--text); font-size: var(--t-md); cursor: pointer; }
.fieldset { display: grid; gap: var(--s2); border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: var(--s2); font-size: var(--t-sm); font-weight: 500; color: var(--muted); }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: var(--s4); bottom: 0; height: var(--h-lg); display: flex; align-items: center; color: var(--muted); font: 500 var(--t-xl) var(--mono); }
.money input { height: var(--h-lg); padding-left: var(--s6); font: 500 var(--t-xl) var(--mono); }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: grid; place-items: center; height: var(--h-md); border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--muted); font-weight: 500; }
.choice input:checked + span { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
details summary { cursor: pointer; color: var(--text-2); font-weight: 500; list-style: none; display: flex; align-items: center; gap: var(--s2); }
details summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
details[open] summary::before { transform: rotate(45deg); }
details > .stack-sm, details > form { margin-top: var(--s3); }

/* Notes */
.note { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); border-left: 2px solid var(--muted); font-size: var(--t-md); color: var(--text-2); }
.note.warn { border-left-color: var(--warn); }
.note.bad { border-left-color: var(--down); }
.note.ok { border-left-color: var(--up); }
.note > svg { width: var(--i-sm); height: var(--i-sm); flex: none; margin-top: var(--s1); color: var(--muted); }
.note.warn > svg { color: var(--warn); }
.note.bad > svg { color: var(--down); }
.note.ok > svg { color: var(--up); }
.note .btn { margin-left: var(--s2); }

/* Empty state */
.empty-state { display: grid; justify-items: center; gap: var(--s2); padding: var(--s6) var(--s4); text-align: center; }
.empty-state .ring { width: var(--h-lg); height: var(--h-lg); border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--surface-3); color: var(--muted); margin-bottom: var(--s2); }
.empty-state .ring svg { width: var(--i-md); height: var(--i-md); }
.empty-state p { color: var(--muted); max-width: 48ch; }
.empty-state .row { margin-top: var(--s2); justify-content: center; }

/* ---------- Landing ---------- */
.landing { display: grid; position: relative; overflow: hidden; }
.landing > *:not(.aurora):not(.gridlines) { position: relative; z-index: 1; }
.l-links { display: flex; gap: var(--s5); }
.l-links a { color: var(--text-2); font-size: var(--t-sm); font-weight: 500; }
.l-links a:hover { color: var(--text); }
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); width: 100%; padding-top: var(--s4); border-top: 1px solid var(--line-soft); }
.trust div { display: grid; gap: var(--s1); }
.trust b { font: 600 var(--t-2xl) var(--mono); color: var(--accent); }
.trust span { font-size: var(--t-xs); color: var(--muted); }
.l-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); height: var(--h-bar); padding: 0 var(--gutter); border-bottom: 1px solid var(--line-soft); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s7); align-items: center; max-width: var(--w-site); width: 100%; margin: 0 auto; padding: var(--s7) var(--gutter); }
.hero-copy { display: grid; gap: var(--s5); justify-items: start; }
.hero-copy > * { max-width: 100%; }
.hero h1 { font-size: clamp(var(--t-2xl), 5vw, var(--t-4xl)); line-height: var(--lh-tight); font-weight: 700; letter-spacing: -.03em; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; animation: rise .8s var(--ease) backwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: .1s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .2s; }
@keyframes rise { from { transform: translateY(100%); } }
.hero .lead { font-size: var(--t-lg); color: var(--text-2); max-width: 52ch; line-height: var(--lh-loose); }
.l-section { max-width: var(--w-site); width: 100%; margin: 0 auto; padding: var(--s7) var(--gutter); display: grid; gap: var(--s6); border-top: 1px solid var(--line-soft); }
.l-section > h2 { font-size: var(--t-2xl); letter-spacing: -.015em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.facts p { color: var(--muted); }
.l-foot { text-align: center; color: var(--muted); font-size: var(--t-sm); padding: var(--s6) var(--s4); border-top: 1px solid var(--line-soft); }

/* ---------- Dialogs and menus ---------- */
.modal-back { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--s4); background: var(--scrim); backdrop-filter: blur(4px); animation: fade .15s; }
.modal { width: min(460px, 100%); max-height: calc(100vh - var(--s6)); overflow: auto; display: grid; gap: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); animation: pop .25s var(--ease); }
.modal h3 { font-size: var(--t-lg); }
.modal h4, .panel form > h4 { margin: 0; font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.modal .actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
.wallet-opt { width: 100%; display: flex; align-items: center; gap: var(--s3); min-height: var(--h-row); padding: var(--s2) var(--s3); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 500 var(--t-md) var(--font); cursor: pointer; text-align: left; transition: border-color .15s; }
.wallet-opt:hover { border-color: var(--accent); }
.wallet-opt[aria-disabled=true] { opacity: .6; }
.wallet-opt img, .wallet-opt .wi { width: var(--h-sm); height: var(--h-sm); border-radius: var(--r-sm); flex: none; }
.wallet-opt .wi { display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.wallet-opt .wi svg { width: var(--i-md); height: var(--i-md); }
.wallet-opt small { display: block; color: var(--muted); font-weight: 400; font-size: var(--t-xs); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.menu { position: fixed; z-index: 15; min-width: 200px; padding: var(--s1); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .15s var(--ease); }
.menu button, .menu a { width: 100%; display: flex; align-items: center; height: var(--h-md); padding: 0 var(--s3); border: 0; background: none; border-radius: var(--r-sm); color: var(--text); font: 400 var(--t-md) var(--font); cursor: pointer; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-3); color: var(--text); }

.toast { position: fixed; z-index: 30; left: 50%; bottom: var(--s5); transform: translateX(-50%); max-width: calc(100% - var(--s6)); display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-md);
  font-size: var(--t-md); background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--up); box-shadow: var(--shadow); animation: toast-in .3s var(--ease); }
.toast.err { border-left-color: var(--down); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.loader { display: grid; gap: var(--s3); }
.loader i { display: block; height: calc(var(--h-row) + var(--s4)); border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.loader i:nth-child(2) { height: calc(var(--h-row) * 3); }
@keyframes shimmer { to { background-position: -200% 0; } }
.code { font: 500 var(--t-2xl) var(--mono); letter-spacing: .15em; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--accent); text-align: center; color: var(--accent); }
.progress { height: var(--bar-thin); border-radius: var(--r-xs); background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-xs); transform-origin: left; animation: grow .9s var(--ease) backwards; }
.price { display: flex; align-items: baseline; gap: var(--s2); }
.price b { font: 500 var(--t-2xl) var(--mono); }

/* ---------- Glow cards: a gradient border lights up and a soft spotlight follows the pointer ---------- */
.glow-card { position: relative; isolation: isolate; transition: transform .25s var(--ease), border-color .25s; }
.glow-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--brand-1), var(--brand-3) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s; }
.glow-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), var(--glow-soft), transparent 65%); opacity: 0; transition: opacity .25s; }
.glow-card:hover, .glow-card:focus-visible, .glow-card:focus-within { border-color: transparent; }
.glow-card:hover::before, .glow-card:hover::after, .glow-card:focus-visible::before, .glow-card:focus-visible::after, .glow-card:focus-within::before { opacity: 1; }
a.glow-card:hover, .glow-card.lift:hover { transform: translateY(var(--lift)); }

/* Glass panel with a gradient hairline */
.glass { background: var(--glass); backdrop-filter: blur(18px) saturate(140%); border: 1px solid var(--glass-line); border-radius: var(--r-lg); }

/* Aurora backdrop for the landing page */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: aurora 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 640px; height: 420px; left: 48%; top: -160px; background: radial-gradient(closest-side, var(--brand-2), transparent); }
.aurora i:nth-child(2) { width: 520px; height: 360px; left: 66%; top: 120px; background: radial-gradient(closest-side, var(--brand-3), transparent); opacity: .35; animation-duration: 28s; }
.aurora i:nth-child(3) { width: 520px; height: 380px; left: -10%; top: 260px; background: radial-gradient(closest-side, var(--cyan), transparent); opacity: .22; animation-duration: 34s; }
@keyframes aurora { 50% { transform: translate(-60px, 40px) scale(1.08); } 100% { transform: translate(40px, -20px) scale(.95); } }
.gridlines { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: var(--h-row) var(--h-row);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 20%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 60% 20%, #000 20%, transparent 75%); }

/* Pills with a live pulse */
.pill-live { display: inline-flex; align-items: center; gap: var(--s2); height: var(--h-xs); padding: 0 var(--s3); border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 500; color: var(--text-2); background: var(--glass); border: 1px solid var(--glass-line); }
.pill-live i { width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 100% { box-shadow: 0 0 0 var(--s2) transparent; } }
.text-brand { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Example plan widget */
.engine { position: relative; display: grid; gap: var(--s4); padding: var(--s5); overflow: hidden; }
.engine::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 70%, var(--brand-1) 80%, var(--brand-3) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin-border 6s linear infinite; }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-border { to { --angle: 360deg; } }
.engine-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.engine-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); align-items: center; }
.donut { width: var(--h-donut); height: var(--h-donut); position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 12; }
.donut .donut-seg { stroke-linecap: butt; transition: stroke-dasharray 1.2s var(--ease); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 0; }
.donut-center b { font: 500 var(--t-xl) var(--mono); }
.donut-center span { font-size: var(--t-xs); color: var(--muted); }
.engine-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.engine-kpis div { display: grid; gap: var(--s1); padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); }
.engine-kpis span { font-size: var(--t-xs); color: var(--muted); }
.engine-kpis b { font: 500 var(--t-lg) var(--mono); }
.engine canvas { width: 100%; height: var(--h-canvas); display: block; }
.ticker { position: relative; height: var(--h-md); overflow: hidden; border-radius: var(--r-md); background: var(--surface-2); }
.ticker p { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3); font-size: var(--t-sm); color: var(--text-2); animation: tick-in .5s var(--ease); }
.ticker p b { color: var(--text); font-family: var(--mono); font-weight: 500; margin-left: auto; }
.ticker p i { width: var(--s2); height: var(--s2); border-radius: 50%; flex: none; }
@keyframes tick-in { from { opacity: 0; transform: translateY(100%); } }

/* Highlight drops marquee */
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: var(--s4); width: max-content; animation: marquee 48s linear infinite; padding: var(--s2) 0; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.drop-card { width: var(--w-card); flex: none; }
.stars { display: inline-flex; gap: var(--s1); color: var(--warn); }
.stars svg { width: var(--i-sm); height: var(--i-sm); }
.stars .off { color: var(--muted); }

/* Bento of features */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.bento .panel { min-height: 168px; }
.bento .wide { grid-column: span 2; }
.feat-ico { width: var(--h-md); height: var(--h-md); display: grid; place-items: center; border-radius: var(--r-md); background: var(--accent-soft); color: var(--brand-1); }
.feat-ico svg { width: var(--i-md); height: var(--i-md); }

/* Reveal on scroll (only after JS marks an element; content stays visible without JS) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Catalog toolbar and follow star */
.toolbar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.toolbar .search { position: relative; flex: 1 1 var(--w-search); min-width: 0; }
.toolbar .search svg { position: absolute; left: var(--s3); top: 50%; width: var(--i-sm); height: var(--i-sm); transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: var(--s6); }
.toolbar select { width: auto; }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip { height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--text-2); font: 500 var(--t-sm) var(--font); cursor: pointer; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.follow { width: var(--h-sm); height: var(--h-sm); flex: none; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, transform .15s; }
.follow svg { width: var(--i-sm); height: var(--i-sm); }
.follow:hover { color: var(--accent); border-color: var(--accent); }
.follow[aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.follow[aria-pressed=true] svg { fill: currentColor; }
.follow.pop { animation: pop-star .4s var(--ease); }
@keyframes pop-star { 50% { transform: scale(1.25); } }
.proj .proj-head { justify-content: space-between; }
.proj .proj-head > div:first-child { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.meta-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--t-sm); color: var(--muted); }
.meta-line b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.steps-list { counter-reset: st; display: grid; gap: var(--s3); margin: 0; padding: 0; list-style: none; }
.steps-list li { counter-increment: st; display: grid; grid-template-columns: var(--h-sm) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; }
.steps-list li::before { content: counter(st); width: var(--h-sm); height: var(--h-sm); display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 500 var(--t-sm) var(--mono); }
.article { display: grid; gap: var(--s3); max-width: 68ch; line-height: var(--lh-loose); }
.article h4 { margin: var(--s2) 0 0; font-size: var(--t-md); }
.article ul { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s2); }

/* ---------- Responsive ---------- */
/* Cards that are links keep body text colour, not the link colour */
a.panel, a.panel:hover { color: var(--text); }
/* Small text inside the glass widget sits over the aurora: use the stronger secondary colour */
.engine .muted, .engine-kpis span, .donut-center span { color: var(--text-2); }
/* Motion toggle for the landing animations (WCAG 2.2.2) */
.engine-head .row { flex-wrap: nowrap; }
.landing.paused .marquee-track, .landing.paused .engine::before, .landing.paused .pill-live i { animation-play-state: paused; }
.l-section-head h2 { font-size: var(--t-2xl); letter-spacing: -.02em; }
.l-section-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; }

/* Server-rendered public pages (/airdrops, /airdrops/:slug) */
body.guest main.seo { max-width: var(--w-site); margin: 0 auto; padding: var(--s6) var(--gutter) var(--s7); }
.seo h1 { font-size: var(--t-3xl); letter-spacing: -.02em; }
.seo .seo-card-title { font-size: var(--t-md); }
.seo ul { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s2); }
.seo .proj { display: grid; gap: var(--s3); }

/* Catalog, project and guide pages opened without signing in */
body.guest-route main { max-width: var(--w-app); margin: 0 auto; padding: var(--s5) var(--gutter) var(--s7); }
.guest-title { margin: 0 0 var(--s5); font-size: var(--t-2xl); letter-spacing: -.02em; }
.guest-nav { position: sticky; top: 0; z-index: 3; background: var(--bg-glass); backdrop-filter: blur(12px); }

.grow { flex: 1 1 auto; min-width: 0; }

/* Header icon button and the notification center */
.icon-btn { position: relative; width: var(--h-sm); height: var(--h-sm); display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: var(--i-sm); height: var(--i-sm); }
.badge { position: absolute; top: calc(var(--s1) * -1); right: calc(var(--s1) * -1); min-width: var(--i-sm); height: var(--i-sm); padding: 0 var(--s1); display: grid; place-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: 600 var(--t-xs) var(--mono); }
.notif-panel { position: fixed; z-index: 15; width: min(var(--w-panel), calc(100vw - var(--s4))); padding: var(--s3); display: grid; gap: var(--s3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .15s var(--ease); }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.notif-list { display: grid; gap: var(--s1); max-height: var(--h-notif); overflow-y: auto; }
.notif { display: flex; gap: var(--s3); padding: var(--s2); border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; }
.notif:hover, .notif:focus-visible { background: var(--surface-3); color: var(--text); }
.notif.unread { color: var(--text); background: var(--accent-soft); }
.notif .ico { flex: none; width: var(--i-md); height: var(--i-md); color: var(--accent); }
.notif .ico svg { width: var(--i-sm); height: var(--i-sm); }
.notif .main { display: grid; gap: var(--s1); min-width: 0; }
.notif .t { font-size: var(--t-sm); line-height: var(--lh-body); }
.notif .d { font-size: var(--t-xs); color: var(--text-2); }

.ref-link { padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--accent); color: var(--accent); font-size: var(--t-sm); overflow-wrap: anywhere; }

/* Support chat: floating button and panel */
.chat-fab { position: fixed; z-index: 12; right: var(--s5); bottom: var(--s5); height: var(--h-md); padding: 0 var(--s4); display: inline-flex; align-items: center; gap: var(--s2); border-radius: var(--r-pill); border: 1px solid var(--glass-line); background: var(--surface-2); color: var(--text); font: 600 var(--t-sm) var(--font); cursor: pointer; box-shadow: var(--shadow); }
.chat-fab:hover { border-color: var(--accent); }
.chat-fab svg { width: var(--i-sm); height: var(--i-sm); color: var(--accent); }
.chat-fab .badge { position: static; }
.chat { position: fixed; z-index: 13; right: var(--s5); bottom: calc(var(--s5) + var(--h-md) + var(--s3)); width: min(var(--w-panel), calc(100vw - var(--s6))); height: min(var(--h-chat), calc(100vh - var(--s7) * 2)); display: flex; flex-direction: column; border-radius: var(--r-lg); border: 1px solid var(--glass-line); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; animation: pop .18s var(--ease); }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-soft); }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); }
.admin-log { max-height: var(--h-notif); border-radius: var(--r-md); background: var(--surface-2); }
.chat-empty { margin: auto 0; }
.bubble { max-width: var(--w-bubble); display: grid; gap: var(--s1); padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--surface-2); }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-sm); line-height: var(--lh-body); }
.bubble .who { font-size: var(--t-xs); color: var(--text-2); }
.bubble.user { align-self: flex-end; background: var(--accent-soft); }
.bubble.admin { border: 1px solid var(--accent); }
.bubble.pending { border: 1px dashed var(--line-strong); }
.dots { display: inline-flex; gap: var(--s1); padding: var(--s1) 0; }
.dots i { width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-form { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--line-soft); }
.chat-form textarea { min-height: auto; resize: none; }
.chat-form .row { justify-content: flex-end; }
.item-btn { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.item-btn:hover { background: linear-gradient(90deg, transparent, var(--surface-2) 12%, var(--surface-2) 88%, transparent); }
.nav-badge { margin-left: auto; min-width: var(--i-sm); height: var(--i-sm); padding: 0 var(--s1); display: grid; place-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: 600 var(--t-xs) var(--mono); }

/* ---------- Project identity: logos and network icons ---------- */
.logo { width: var(--h-md); height: var(--h-md); flex: none; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo.lg { width: var(--h-row); height: var(--h-row); }
.logo-letter { font: 600 var(--t-lg) var(--mono); color: var(--accent); }
.logo.lg .logo-letter { font-size: var(--t-xl); }
.chain-row { display: inline-flex; align-items: center; }
.chain-row > * + * { margin-left: calc(var(--s1) * -1); }
.chain-ic { width: var(--i-md); height: var(--i-md); flex: none; border-radius: 50%; border: 2px solid var(--surface); background: var(--surface-3); object-fit: cover; }
.chain-ic.letter { display: inline-grid; place-items: center; font: 600 var(--t-xs) var(--font); color: var(--text-2); }
.chain-more { height: var(--i-md); min-width: var(--i-md); padding: 0 var(--s1); display: inline-grid; place-items: center; border-radius: var(--r-pill); border: 2px solid var(--surface); background: var(--surface-3); color: var(--text-2); font: 600 var(--t-xs) var(--mono); }
.chg { font: 500 var(--t-xs) var(--mono); white-space: nowrap; color: var(--text-2); }
.chg.up { color: var(--up); }
.chg.down { color: var(--down-text); }
.nowrap { flex-wrap: nowrap; }

/* Catalog card: three key numbers under the name */
.proj-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); }
.proj-stats > div { display: grid; gap: var(--s1); align-content: start; min-width: 0; }
.proj-stats span:first-child { font-size: var(--t-xs); color: var(--muted); }
.proj-stats b { font: 500 var(--t-md) var(--mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .proj-head > .row { position: relative; z-index: 2; display: flex; flex-wrap: nowrap; gap: var(--s2); }
.follow.cmp[aria-pressed=true] svg { fill: none; }

/* Project page hero */
.hero-proj { gap: var(--s4); }
.hero-proj-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s4); align-items: start; }
.hero-actions { justify-content: flex-end; }
.lead-sm { margin: 0; color: var(--text-2); line-height: var(--lh-loose); max-width: var(--w-prose); }
.chip-link { display: inline-flex; align-items: center; gap: var(--s2); height: var(--h-sm); padding: 0 var(--s3); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: var(--t-sm); font-weight: 500; }
.chip-link:hover { color: var(--text); border-color: var(--line-strong); }
.chip-link svg { width: var(--i-sm); height: var(--i-sm); color: var(--accent); }

/* TVL chart and per-network bars */
.chart-box { display: grid; gap: var(--s3); min-height: var(--h-canvas); align-content: start; }
.chart-kpis { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: var(--t-sm); color: var(--muted); }
.chart-kpis b { color: var(--text); margin-left: var(--s1); }
.chart { height: var(--h-canvas); }
.spark { width: 100%; height: 100%; display: block; overflow: visible; }
.spark.up { color: var(--up); }
.spark.down { color: var(--down); }
.chart-axis { display: flex; justify-content: space-between; font: 400 var(--t-xs) var(--mono); color: var(--muted); }
.bars { display: grid; gap: var(--s3); }
.bar-row { display: grid; grid-template-columns: minmax(0, var(--w-bar-label)) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-size: var(--t-sm); }
.bar-label { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: var(--bar-thin); border-radius: var(--r-xs); background: var(--surface-3); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); }

/* Trending strip */
.trend { display: grid; gap: var(--s3); }
.trend h3 { display: inline-flex; align-items: center; gap: var(--s2); }
.trend h3 svg { width: var(--i-sm); height: var(--i-sm); color: var(--accent); }
.trend-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.trend-card { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--line-soft); background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s var(--ease); }
.trend-card:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(var(--lift)); }
.trend-card .stack-xs { flex: 1; min-width: 0; }
.trend-card b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Compare */
.cmp-tray { position: fixed; z-index: 12; left: 50%; bottom: var(--s5); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s4); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-pill); border: 1px solid var(--accent); background: var(--surface-2); box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.cmp-tray > span { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); color: var(--text-2); }
.cmp-tray svg { width: var(--i-sm); height: var(--i-sm); color: var(--accent); }
.cmp-table th[scope=row] { color: var(--muted); font-weight: 500; white-space: nowrap; }
.cmp-name { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); font-weight: 600; }

/* First steps on the overview */
.onboard { gap: var(--s3); border-color: var(--accent-soft); }
.onboard-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.onboard-steps li { display: grid; grid-template-columns: var(--h-sm) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); }
.onboard-steps li:last-child { border-bottom: 0; }
.onboard-steps li.done b { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--muted); }
.num-badge { width: var(--h-sm); height: var(--h-sm); display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 var(--t-sm) var(--mono); }
.num-badge svg { width: var(--i-sm); height: var(--i-sm); }
.done .num-badge { background: var(--up-soft); color: var(--up); }

/* Gas now */
.gas-grid { display: grid; gap: var(--s1); }
.gas-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) 0; font-size: var(--t-sm); }
.gas-row b { min-width: var(--w-num); text-align: right; }

/* Quick search */
.search-btn { display: inline-flex; align-items: center; gap: var(--s2); height: var(--h-sm); padding: 0 var(--s2) 0 var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 400 var(--t-sm) var(--font); cursor: pointer; }
.search-btn:hover { color: var(--text); border-color: var(--line-strong); }
.search-btn svg { width: var(--i-sm); height: var(--i-sm); }
kbd { padding: 0 var(--s1); border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font: 500 var(--t-xs) var(--mono); }
.palette { display: grid; gap: var(--s3); }
.palette .search { position: relative; }
.palette .search svg { position: absolute; left: var(--s3); top: 50%; width: var(--i-sm); height: var(--i-sm); transform: translateY(-50%); color: var(--muted); }
.palette .search input { padding-left: var(--s6); height: var(--h-lg); font-size: var(--t-lg); }
.pal-list { display: grid; gap: var(--s1); max-height: var(--h-notif); overflow-y: auto; }
.pal-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-sm); color: var(--text); }
.pal-item:hover, .pal-item.on { background: var(--surface-3); color: var(--text); }
.pal-kind { color: var(--text-2); }
.pal-item .ico { width: var(--h-md); height: var(--h-md); display: grid; place-items: center; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); }
.pal-item .ico svg { width: var(--i-sm); height: var(--i-sm); }

/* Loading skeletons */
.skel { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel-line { height: var(--s3); width: 100%; }
.skel-line.w40 { width: 40%; } .skel-line.w60 { width: 60%; }
.skel-num { height: var(--t-xl); width: 70%; }
.skel-logo { width: var(--h-md); height: var(--h-md); border-radius: var(--r-md); flex: none; }
.skel-chart { height: var(--h-canvas); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Toasts sit above the compare tray when it is open */
body:has(.cmp-tray) .toast { bottom: calc(var(--s5) + var(--h-lg) + var(--s3)); }

/* "What's being distributed" callout on editorial project pages */
.reward { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: start; border-color: var(--accent-soft); background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }

/* How it works: a numbered timeline with a connector line through the step icons */
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: calc(var(--h-lg) / 2 - 1px); left: calc(var(--h-lg) / 2); right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--surface-3) 70%, transparent); }
.tl-step { position: relative; display: grid; gap: var(--s2); align-content: start; }
.tl-dot { position: relative; z-index: 1; width: var(--h-lg); height: var(--h-lg); display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--accent); color: var(--accent); box-shadow: 0 0 0 var(--s1) var(--bg), 0 0 var(--s5) var(--glow-soft); }
.tl-dot svg { width: var(--i-md); height: var(--i-md); }
.tl-num { margin-top: var(--s2); font: 500 var(--t-xs) var(--mono); color: var(--accent); letter-spacing: .08em; }
.tl-step h3 { font-size: var(--t-lg); }
.tl-step p { margin: 0; color: var(--muted); }
.tl-visual { margin-top: var(--s2); display: grid; gap: var(--s2); padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--line-soft); background: var(--surface); min-height: calc(var(--h-row) + var(--s5)); align-content: center; }
.tl-sig { display: grid; gap: var(--s1); justify-items: start; }
.tl-sig b { font-size: var(--t-sm); }
.tl-alloc { display: grid; gap: var(--s1); font-size: var(--t-xs); color: var(--muted); }
.tl-alloc span { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--h-row) + var(--s5)); align-items: center; gap: var(--s2); white-space: nowrap; }
.tl-alloc i { display: block; height: var(--bar-thin); border-radius: var(--r-xs); }

/* News: headline rows with source, time, linked projects and an optional thumbnail */
.news-list { display: grid; gap: 0; }
.panel.news-list { padding-block: var(--s2); }
.news-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: start; padding: var(--s4) 0; border-bottom: 1px solid var(--line-soft); }
.news-item:last-child { border-bottom: 0; }
.news-item.compact { padding: var(--s3) 0; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--t-xs); color: var(--muted); }
.news-title { font-size: var(--t-lg); font-weight: 600; line-height: var(--lh-body); text-wrap: pretty; }
.compact .news-title { font-size: var(--t-md); font-weight: 500; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--accent-hi); }
.news-item p { margin: 0; }
.news-img { width: calc(var(--w-card-sm) * .6); aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); }

/* Live market: prices with sparklines and gas per network, pushed from the server */
.live-strip { position: relative; justify-self: center; width: min(calc(100% - 2 * var(--gutter)), calc(var(--w-site) - 2 * var(--gutter))); margin-bottom: var(--s6); display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-lg); border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(8px); overflow-x: auto; }
.live-coins { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; min-height: var(--h-md); }
.live-strip .live-coins { flex-wrap: nowrap; }
.live-coin { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; font-size: var(--t-sm); }
.live-sym { font: 600 var(--t-xs) var(--mono); color: var(--muted); }
.live-spark { display: inline-block; width: calc(var(--h-row) + var(--s5)); height: var(--h-sm); }
.live-gas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) var(--s5); }
.live-gas { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--t-sm); }
.live-gas .live-spark { width: calc(var(--h-row) + var(--s6)); }
.live-gas b { min-width: var(--w-num); text-align: right; }
.spark.neutral { color: var(--accent); }

/* Sign in / create account */
.auth-wrap { min-height: calc(100vh - var(--h-bar) * 2); display: grid; place-items: center; padding: var(--s6) 0; }
.auth-card { width: min(100%, calc(var(--w-panel) + var(--s7))); gap: var(--s4); }
.auth-head { display: flex; align-items: center; gap: var(--s3); }
.auth-head h1 { font-size: var(--t-xl); }
.auth-head img { border-radius: var(--r-md); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.auth-card .btn.big { width: 100%; }
.auth-card .btn svg { width: var(--i-md); height: var(--i-md); }
.pw { display: flex; gap: var(--s2); }
.pw input { flex: 1; }
.pw .btn { height: var(--h-md); }
.bot-box:empty { display: none; }
.bot-check { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); color: var(--muted); }
.bot-check svg { width: var(--i-sm); height: var(--i-sm); }
.bot-check.ok { color: var(--up); }
.bot-check.bad { color: var(--down-text); }
.spin { width: var(--i-sm); height: var(--i-sm); border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--t-sm); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Subscription: usage meters, plan cards, invoice */
.meter { display: grid; gap: var(--s2); }
.progress span.full { background: var(--warn); }
.plan-card { align-content: start; }
.plan-card.featured { border-color: var(--accent-soft); }
.plan-card .row:last-child { margin-top: auto; }
.pay-methods { display: grid; gap: var(--s3); }
.pay-group { display: grid; gap: var(--s2); }
.pay-method { display: grid; gap: var(--s1); justify-items: start; min-width: calc(var(--w-card-sm) / 2); padding: var(--s3) var(--s4); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-method:hover { border-color: var(--accent); background: var(--surface-3); }
.pay-method span { font-size: var(--t-xs); color: var(--muted); }
.invoice { display: flex; gap: var(--s4); align-items: center; }
.qr { flex: none; width: calc(var(--h-row) * 2.6); padding: var(--s2); border-radius: var(--r-md); background: var(--on-brand); }
.qr svg { display: block; width: 100%; height: auto; }
.inv-field { display: grid; gap: var(--s1); }
.inv-amount { font-size: var(--t-xl); }
.inv-addr { font-size: var(--t-sm); word-break: break-all; }
.inv-status { display: flex; align-items: center; gap: var(--s2); margin: 0; font-size: var(--t-sm); color: var(--muted); min-height: var(--h-xs); }
.inv-status svg { width: var(--i-sm); height: var(--i-sm); flex: none; }

/* Admin console */
.console .nav-ext { margin-top: var(--s4); border-top: 1px solid var(--line-soft); }
.console-login .shell { margin-left: 0; }
.info-dot { display: inline-flex; vertical-align: middle; color: var(--muted); }
.info-dot svg { width: var(--s3); height: var(--s3); }
.console .tiles .tile { border-bottom: 1px solid var(--line-soft); }
.vchart { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) var(--s2); }
.vchart svg { width: 100%; height: calc(var(--h-canvas) * .66); display: block; overflow: visible; }
.vchart .bar { fill: var(--c1); }
.vchart .bar-hit:hover .bar { fill: var(--accent-hi); }
.vchart .base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.vchart-y { display: flex; flex-direction: column; justify-content: space-between; font: 400 var(--t-xs) var(--mono); color: var(--muted); text-align: right; }
.vchart .chart-axis, .vchart details { grid-column: 2; }
.chart-tip { position: fixed; z-index: 40; pointer-events: none; padding: var(--s1) var(--s2); border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line); color: var(--text); font: 500 var(--t-xs) var(--mono); box-shadow: var(--shadow); }
.rank-cell { display: grid; gap: var(--s1); min-width: calc(var(--w-card-sm) / 2); }
.rank-bar { display: block; height: var(--s1); border-radius: var(--r-xs); background: var(--surface-3); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--c1); border-radius: inherit; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.funnel li { display: grid; grid-template-columns: minmax(0, var(--w-bar-label)) minmax(0, 1fr) var(--w-num) minmax(0, var(--w-bar-label)); gap: var(--s3); align-items: center; font-size: var(--t-sm); }
.funnel-bar { height: var(--bar-thick); border-radius: var(--r-xs); background: var(--surface-3); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--grad-brand); border-radius: inherit; }
.funnel b { text-align: right; }
.sum.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); }
.field-inline { display: inline-flex; align-items: center; gap: var(--s2); }
.field-inline input { width: auto; }
.w-num { width: calc(var(--w-num) * 1.4); }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--surface-2); }
tr.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Landing: modules, FAQ; drop calculator */
.modules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.module { gap: var(--s3); }
.module h3 { font-size: var(--t-lg); }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
.faq details p { margin: var(--s3) 0 0; color: var(--text-2); }
.calc { display: grid; gap: var(--s4); }
.calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--s4); align-items: end; }
.calc.compact .calc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.calc-out { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s4); align-items: center; padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); min-height: calc(var(--h-row) + var(--s5)); }
.calc-out > p { grid-column: 1 / -1; margin: 0; }
.calc-range { display: grid; gap: var(--s2); }
.calc-range b { font-size: var(--t-2xl); }
.range-bar { position: relative; height: var(--bar-thin); border-radius: var(--r-xs); background: var(--surface-3); }
.range-bar i { position: absolute; inset: 0 10%; border-radius: inherit; background: var(--grad-brand); }
.range-bar span { position: absolute; left: 50%; top: calc(var(--s1) * -1); bottom: calc(var(--s1) * -1); width: var(--s1); border-radius: var(--r-xs); background: var(--text); transform: translateX(-50%); }
.calc-kpis { display: grid; gap: var(--s2); font-size: var(--t-sm); color: var(--muted); }
.calc-kpis b { display: block; font-size: var(--t-lg); color: var(--text); }
.calc-kpis b.up { color: var(--up); }
.calc-kpis b.down { color: var(--down-text); }

/* Wallet security, P&L, calendar, rules */
.why { margin-top: var(--s1); font-size: var(--t-xs); }
.why summary { font-size: var(--t-xs); color: var(--muted); }
.why ul { margin: var(--s1) 0 0; padding-left: var(--s4); color: var(--text-2); max-width: calc(var(--w-card) * 1.1); }
ul.plain { margin: 0; padding-left: var(--s4); display: grid; gap: var(--s2); color: var(--text-2); }
.pnl-chart .pnl-up, .legend .pnl-up { fill: var(--up); background: var(--up); }
.pnl-chart .pnl-down, .legend .pnl-down { fill: var(--down); background: var(--down); }
.pnl-chart .bar-hit:hover rect:not([fill]) { opacity: .85; }
.pnl-chart .legend { grid-column: 2; }
.cal-title { font-size: var(--t-lg); min-width: calc(var(--w-card-sm) * .7); text-align: center; }
.cal-panel { padding: var(--s3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s1); }
.cal-row { display: contents; }
.cal-head { padding: var(--s1) var(--s2); font-size: var(--t-xs); color: var(--muted); text-align: right; }
.cal-cell { min-height: calc(var(--h-row) * 1.6); padding: var(--s1) var(--s2); border-radius: var(--r-sm); background: var(--surface-2); display: grid; align-content: start; gap: var(--s1); min-width: 0; }
.cal-cell.empty { background: transparent; }
.cal-cell.today { outline: 1px solid var(--accent); }
.cal-n { justify-self: end; font: 500 var(--t-xs) var(--mono); color: var(--muted); }
.cal-cell.today .cal-n { color: var(--accent); }
.cal-chip { display: block; pointer-events: none; padding: 0 var(--s1); border-radius: var(--r-xs); font-size: var(--t-xs); line-height: var(--lh-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-3); color: var(--text-2); }
.cal-chip.warn { background: var(--warn-soft); color: var(--warn); }
.cal-chip.ok { background: var(--up-soft); color: var(--up); }
.cal-chip.brand { background: var(--accent-soft); color: var(--accent); }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cal-item { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.cal-item:last-child { border-bottom: 0; }
.cal-date { flex: none; width: var(--w-num); font-size: var(--t-sm); color: var(--text-2); padding-top: var(--s1); }
.switch { position: relative; width: calc(var(--h-xs) * 1.8); height: var(--h-xs); flex: none; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface-3); cursor: pointer; padding: 0; transition: background .15s; }
.switch i { position: absolute; top: 2px; left: 2px; width: calc(var(--h-xs) - 6px); height: calc(var(--h-xs) - 6px); border-radius: 50%; background: var(--text-2); transition: transform .15s var(--ease); }
.switch[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.switch[aria-checked="true"] i { transform: translateX(calc(var(--h-xs) * .8)); background: var(--on-brand); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-card { display: grid; gap: var(--s2); justify-items: start; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.tpl-card:disabled { opacity: .5; cursor: not-allowed; }

/* With the demo banner on top, the sidebar and the sticky header start below it */
body.demo .side { top: var(--h-sm); }
body.demo .top { top: var(--h-sm); }

@media (max-width: 1020px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .bento .wide { grid-column: span 2; }
  .hero { grid-template-columns: 1fr; gap: var(--s6); }
  .split, .facts { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: var(--s6); }
  .modules { grid-template-columns: 1fr 1fr; }
  .calc-grid, .calc.compact .calc-grid { grid-template-columns: 1fr 1fr; }
  .timeline::before { display: none; }
  .live-gas-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .hero-proj-main { grid-template-columns: auto minmax(0, 1fr); }
  .hero-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .search-btn span, .search-btn kbd { display: none; }
  .bar-row { --w-bar-label: 7rem; }
  .cmp-tray { bottom: calc(var(--h-bar) + var(--h-md) + var(--s5) + env(safe-area-inset-bottom, 0px)); }
  .chat-fab { bottom: calc(var(--h-bar) + var(--s3) + env(safe-area-inset-bottom, 0px)); right: var(--s3); }
  .chat-fab span:not(.badge) { display: none; }
  .chat { right: var(--s2); left: var(--s2); width: auto; bottom: calc(var(--h-bar) + var(--h-md) + var(--s4) + env(safe-area-inset-bottom, 0px)); }
  .demo-banner { position: relative; }
  body.demo .top { top: env(safe-area-inset-top, 0px); }
  .trust { grid-template-columns: 1fr; }
  body:not(.guest) .shell { margin-left: 0; }
  .side { display: none; }
  /* The admin console has no tab bar: its sidebar becomes a scrollable strip above the content */
  .console .side:not([hidden]) { display: flex; position: static; width: auto; flex-direction: row; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .console .side .nav { display: flex; flex-direction: row; gap: var(--s1); }
  .console .side .nav a span { white-space: nowrap; }
  .console .side .brand span, .console .side-foot { display: none; }
  .console .nav-ext { margin-top: 0; border-top: 0; }
  .tabbar:not([hidden]) { display: flex; }
  main { padding: var(--s4) var(--s4) calc(var(--h-bar) + var(--s6)); }
  .top { padding: 0 var(--s4); height: var(--h-row); }
  .top-title { font-size: var(--t-lg); }
  #trial-pill { display: none; }
  .tile { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile.primary { grid-column: 1 / -1; }
  .hero h1 { font-size: var(--t-2xl); }
  .timeline { grid-template-columns: 1fr; row-gap: var(--s5); }
  .timeline::before { display: block; top: 0; bottom: 0; left: calc(var(--h-lg) / 2); right: auto; width: 2px; height: auto; }
  .tl-step { grid-template-columns: var(--h-lg) minmax(0, 1fr); column-gap: var(--s4); }
  .tl-step > :not(.tl-dot) { grid-column: 2; }
  .tl-dot { grid-row: 1 / span 4; }
  .news-item { grid-template-columns: minmax(0, 1fr); }
  .news-img { display: none; }
  .live-gas-grid { grid-template-columns: 1fr; }
  .invoice { flex-direction: column; align-items: stretch; }
  .cal-cell { min-height: var(--h-row); padding: var(--s1); }
  .cal-chip { font-size: 0; height: var(--s2); padding: 0; }
  .cal-chip { background: var(--muted); }
  .cal-chip.warn { background: var(--warn); }
  .cal-chip.ok { background: var(--up); }
  .cal-chip.brand { background: var(--accent); }
  .cal-head { text-align: center; padding: var(--s1) 0; }
  .modules, .faq, .calc-grid, .calc.compact .calc-grid, .calc-out { grid-template-columns: 1fr; }
  .funnel li { grid-template-columns: minmax(0, 1fr) var(--w-num); }
  .funnel li .funnel-bar { grid-column: 1 / -1; grid-row: 2; }
  .funnel li > .small { grid-column: 1 / -1; }
  .sum.two-col { grid-template-columns: 1fr; }
  .qr { align-self: center; }
  .panel { padding: var(--s4); }
  .l-nav .btn.ghost, .l-links { display: none; }
  .bento { grid-template-columns: 1fr; }
  .bento .wide { grid-column: auto; }
  .engine-top { grid-template-columns: 1fr; justify-items: center; }
  .engine-kpis { width: 100%; }
  .drop-card { width: var(--w-card-sm); }
}
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* Text area: same field look, grows by rows */
textarea { height: auto; min-height: calc(var(--h-md) * 2); padding: var(--s2) var(--s3); line-height: var(--lh-body); resize: vertical; }

/* Card with a stretched link: the whole card is clickable, the follow button stays on top */
.proj { position: relative; }
.proj-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.proj-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.proj .follow { position: relative; z-index: 2; }

/* Guide card is a button styled as a panel */
.guide-card { position: relative; display: grid; gap: var(--s2); align-content: start; color: var(--text); }
.center { justify-content: center; }

/* Visually hidden, still announced */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The hidden attribute beats any component display (.side, .top, .toast…). Kept at the end of the file. */
[hidden] { display: none !important; }
