/* The console's design system: tokens and the components every surface
 * shares (the landing page, the console, /superadmin).
 *
 * Dark first. The reels are watched in the dark, on a phone; the tool that
 * makes them sits in the same world: deep ink, warm off-white type, and
 * the brand's ramp -- aqua to blue to violet to magenta to pink -- as the
 * only colour that moves. It moves on purpose: the wordmark and the
 * hairline under the bar drift, the button that spends money carries a
 * sheen, the state dot breathes while a run works, the gate and the
 * preview well wear the ramp on their edge. Everything else is still.
 *
 * One text face covers Latin and Devanagari alike (Mukta, shipped with
 * the page); the brand's display face carries the headings; mono is for
 * ids and times only. The light theme is a choice, not the default, and
 * is defined in full under [data-theme="light"].
 */
@import url('/static/mukta.css');
@import url('/static/baloo.css');

:root {
  --paper: #0C0C11;
  --panel: #14141A;
  --panel-2: #1A1A21;
  --sunk: #1E1E26;
  --ink: #EEECE6;
  --ink-2: #C9C7C0;
  --muted: #9A99A3;
  --faint: #66656F;
  --rule: #26262E;
  --rule-2: #34343E;
  --accent: #9B85FF;
  --accent-ink: #0C0C11;
  --accent-soft: #262040;
  --signal: #FFD24A;
  --ok: #6FD3A2;
  --ok-soft: #143024;
  --warn: #F0BF57;
  --warn-soft: #302610;
  --bad: #FF6B7F;
  --bad-soft: #3D1820;
  --well: #08080B;
  --well-ink: #E7E4DE;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 10px 30px -14px rgba(0, 0, 0, .8), 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-3: 0 30px 70px -24px rgba(0, 0, 0, .9), 0 2px 8px rgba(0, 0, 0, .5);
  --aqua: #1FD1E8; --blue: #3B82F6; --violet: #7C5CFF; --magenta: #D946EF;
  --pink: #FF5C9E; --sun: #FF9A6C;
  --ramp: linear-gradient(115deg, var(--aqua), var(--blue) 25%, var(--violet) 50%, var(--magenta) 75%, var(--pink));
  --ramp-glow: 0 0 0 1px rgba(124, 92, 255, .35), 0 12px 40px -14px rgba(124, 92, 255, .6);
  --fmt-scroll: #6B8BB5;
  --fmt-verse: #A78BFF;
  --fmt-story: #3FBF9A;
  --fmt-cards: #F0A94A;
  --fmt-footage: #FF9A6C;
  --fmt-montage: #d8a23a;
  --font-ui: 'Mukta', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  --font-display: 'Baloo 2', 'Mukta', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --topbar: 60px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #FAFAF7; --panel: #FFFFFF; --panel-2: #FFFFFF; --sunk: #F1F0EA; --ink: #131316; --ink-2: #3D3D45;
  --muted: #6E6E78; --faint: #9C9CA5; --rule: #E5E4DE; --rule-2: #D6D5CE;
  --accent: #6F52F5; --accent-ink: #FFFFFF; --accent-soft: #EEEAFF;
  --ok: #2E7D5B; --ok-soft: #E4F3EB; --warn: #9A6B00; --warn-soft: #FFF3D6;
  --bad: #C8102E; --bad-soft: #FDE8EB;
  --shadow-1: 0 1px 2px rgba(20, 20, 30, .06), 0 1px 1px rgba(20, 20, 30, .04);
  --shadow-2: 0 4px 16px -8px rgba(20, 20, 30, .18), 0 1px 2px rgba(20, 20, 30, .06);
  --shadow-3: 0 18px 48px -18px rgba(20, 20, 30, .32), 0 2px 6px rgba(20, 20, 30, .08);
  --ramp-glow: 0 0 0 1px rgba(124, 92, 255, .25), 0 12px 36px -14px rgba(124, 92, 255, .45);
  --fmt-scroll: #4B6281; --fmt-verse: #7C5CFF; --fmt-story: #1F8A70; --fmt-cards: #C9832B;
  --fmt-footage: #C4623A;
  --fmt-montage: #d8a23a;
  color-scheme: light;
}

/* --- motion ------------------------------------------------------------ */
@keyframes drift { to { background-position: 300% 0; } }
@keyframes sheen { 0% { left: -40%; } 55%, 100% { left: 120%; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes halo { 0%, 100% { transform: translate(-50%, 0) scale(1); opacity: .55; } 50% { transform: translate(-50%, -6px) scale(1.06); opacity: .75; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--sunk); padding: 1px 6px; border-radius: 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--violet) 45%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- text roles ------------------------------------------------------- */
.kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.lede { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
/* a word set in the ramp, drifting: the brand's one flourish in a heading */
.shine, h1 em, h2 em { font-style: normal; background: var(--ramp); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: drift 14s linear infinite; }

/* --- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--rule-2); background: var(--panel-2); color: var(--ink);
  font-family: var(--font-display); font-size: 14px; font-weight: 600; white-space: nowrap;
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: background .15s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.btn:hover:not(:disabled) { border-color: var(--violet); transform: translateY(-1px); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
/* The brand on the buttons that matter: the ramp drifting, and a sheen
 * crossing every few seconds so a gate you should notice is noticed. */
.btn.primary, .btn.spend {
  position: relative; overflow: hidden; border: 0; color: #fff; font-weight: 700;
  background: var(--ramp); background-size: 200% 100%;
  animation: drift 9s linear infinite;
  box-shadow: 0 6px 18px -8px rgba(124, 92, 255, .8);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
}
.btn.primary::after, .btn.spend::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 32%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .42), transparent);
  animation: sheen 4.5s ease-in-out infinite;
}
.btn.spend { box-shadow: 0 8px 26px -8px rgba(124, 92, 255, .95), 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.btn.primary:disabled, .btn.spend:disabled { animation: none; filter: grayscale(.65); }
.btn.primary:disabled::after, .btn.spend:disabled::after { display: none; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--sunk); border-color: transparent; transform: none; }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
.btn.small { min-height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { min-height: 46px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn .spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; transition: background .15s ease, color .15s ease; }
.iconbtn:hover { background: var(--sunk); color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }

/* --- inputs ---------------------------------------------------------------- */
.inp, .field input, .field textarea, .field select {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--rule-2); background: var(--sunk); color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.4;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.inp:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: transparent; box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 65%, transparent);
}
.inp::placeholder { color: var(--faint); }
textarea.inp { resize: vertical; min-height: 84px; }
.inp.small { min-height: 30px; padding: 4px 8px; font-size: 13px; border-radius: 8px; width: auto; }
.field { display: grid; gap: 6px; }
.field > span:first-child, .field > label:first-child, label.lab { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-weight: 400; color: var(--muted); }
.formerr { color: var(--bad); font-size: 13px; }
.okmsg { color: var(--ok); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; color: var(--ink-2); }
.check input { accent-color: var(--violet); width: 16px; height: 16px; margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .knob { width: 40px; height: 22px; border-radius: 11px; background: var(--rule-2); position: relative; transition: background .18s ease; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); box-shadow: var(--shadow-1); }
.switch input:checked + .knob { background: var(--ramp); background-size: 200% 100%; }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--signal); outline-offset: 2px; }
.switch .state { font-size: 13px; color: var(--muted); min-width: 24px; }

/* --- chips and pills ---------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--rule-2); background: var(--panel-2);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; line-height: 1.2;
}
.chip b { font-weight: 700; color: var(--ink); }
.chip.soft { background: var(--sunk); border-color: transparent; }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.loop { border-color: var(--warn); color: var(--warn); }
.chip.changed { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.missing { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.kind { color: var(--ink-2); }
.chip.kind::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fmt, var(--fmt-scroll)); box-shadow: 0 0 10px var(--fmt, var(--fmt-scroll)); }
.chip.kind[data-fmt="scroll"] { --fmt: var(--fmt-scroll); }
.chip.kind[data-fmt="verse"] { --fmt: var(--fmt-verse); }
.chip.kind[data-fmt="story"] { --fmt: var(--fmt-story); }
.chip.kind[data-fmt="cards"] { --fmt: var(--fmt-cards); }
.chip.kind[data-fmt="footage"] { --fmt: var(--fmt-footage); }
.chip.kind[data-fmt="montage"] { --fmt: var(--fmt-montage); }
.phase {
  display: inline-flex; align-items: center; gap: 7px; min-height: 24px; padding: 2px 10px;
  border-radius: 999px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  background: var(--sunk); color: var(--muted); white-space: nowrap; text-decoration: none;
}
.phase.working { background: var(--warn-soft); color: var(--warn); }
.phase.done { background: var(--ok-soft); color: var(--ok); }
.phase.failed { background: var(--bad-soft); color: var(--bad); }
.phase.ready { background: var(--accent-soft); color: var(--accent); }
.phase.paused { background: var(--warn-soft); color: var(--warn); }
.phase.off { background: var(--sunk); color: var(--muted); }
.phase .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.phase.working .dot { animation: pulse 1.2s ease-in-out infinite; }

/* --- surfaces ------------------------------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 20px; }
/* a card that wears the ramp on its edge: the gate, the panel before the
 * run, the research bar -- the places where a decision is made */
.card.ramp, .rampbox {
  border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--ramp) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: drift 14s linear infinite;
  box-shadow: var(--ramp-glow);
}
.sunkbox { background: var(--sunk); border-radius: var(--r-md); padding: 14px 16px; }
.notice { padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--rule); background: var(--sunk); font-size: 14px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.sechead { display: grid; gap: 4px; margin-bottom: 14px; }
.sechead p { color: var(--muted); font-size: 14px; max-width: 64ch; }

/* --- tabs ------------------------------------------------------------------ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on, .tab[aria-selected="true"] { color: var(--ink); border-image: var(--ramp) 1; border-bottom: 2px solid; }
/* A tab's count: a small pill beside its name, lit with the tab. */
.tab .n { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--muted); background: var(--panel-2); border: 1px solid var(--rule); vertical-align: 1px; transition: color .15s ease, border-color .15s ease; }
.tab .n:empty { display: none; }
.tab.on .n, .tab[aria-selected="true"] .n { color: var(--ink); border-color: transparent; background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box, var(--ramp) border-box; }
.tab:focus-visible { outline: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink-2); }

/* --- tables ------------------------------------------------------------------ */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--rule); background: var(--sunk); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.tbl .n { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }

/* --- toasts ------------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-md); background: var(--panel-2); color: var(--ink); border: 1px solid var(--rule-2); box-shadow: var(--shadow-3); font-size: 13.5px; line-height: 1.4; animation: rise .18s ease-out; }
.toast.ok { border-left: 3px solid var(--ok); }
.toast.bad { border-left: 3px solid var(--bad); }
.toast .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.toast .x:hover { opacity: 1; }

/* --- the bottom sheet (the preview on a phone) --------------------------- */
.sheet { position: fixed; inset: 0; z-index: 80; background: rgba(4, 4, 8, .7); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet .sheet-body { width: 100%; max-height: 92vh; overflow: auto; background: var(--panel); border-radius: 20px 20px 0 0; padding: 12px 16px 24px; box-shadow: var(--shadow-3); animation: up .2s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--rule-2); margin: 0 auto 12px; }

/* --- empty states, skeletons ------------------------------------------------ */
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--rule-2); border-radius: var(--r-lg); display: grid; gap: 8px; justify-items: center; }
.empty-state b { color: var(--ink); font-size: 15px; }
.skeleton { background: linear-gradient(90deg, var(--sunk), var(--rule), var(--sunk)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }

/* --- the top bar (shared by the console and /superadmin) -------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
/* A hairline of the ramp under the bar, drifting slowly: the one always-
 * moving thing on the page, enough to feel alive, not enough to compete
 * with a paragraph of Nepali. */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--ramp); background-size: 300% 100%;
  animation: drift 14s linear infinite; opacity: .85;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; }
.brand .word { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; line-height: 1; background: var(--ramp); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: drift 14s linear infinite; }
.brand .suffix { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--muted); }
/* On a narrow phone the links are more than the bar is wide: the bar
 * keeps the window's width and the links swipe inside it, rather than
 * pushing every page sideways. */
.nav { display: flex; gap: 2px; margin-left: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: 14px; text-decoration: none; transition: color .15s ease, background .15s ease; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--sunk); text-decoration: none; }
.nav a.on { color: var(--ink); }
.nav a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--ramp); background-size: 300% 100%; animation: drift 14s linear infinite; }
.topbar .spacer { flex: 1; }
.topbar .role { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #fff; background: var(--ramp); background-size: 200% 100%; animation: drift 9s linear infinite; padding: 3px 10px; border-radius: 999px; }
/* the balance: a ramp border, because every read and every render spends from it */
.credits { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--ramp) border-box; background-size: 100% 100%, 300% 100%; animation: drift 14s linear infinite; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.credits b { color: var(--ink); font-weight: 700; }
.credits.empty { background: linear-gradient(var(--bad-soft), var(--bad-soft)) padding-box, var(--bad) border-box; animation: none; color: var(--bad); }
.credits.empty b { color: var(--bad); }
/* below zero on the overdraft, with room still left: a warning, not yet a refusal */
.credits.low { background: linear-gradient(var(--warn-soft), var(--warn-soft)) padding-box, var(--warn) border-box; animation: none; }
.credits.low b { color: var(--warn); }
.credits .held { color: var(--faint); }
.menu { position: relative; }
.menu .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; background: var(--panel); border: 1px solid var(--rule-2); border-radius: var(--r-md); box-shadow: var(--shadow-3); z-index: 50; display: grid; animation: rise .14s ease-out; }
.menu .menu-pop a, .menu .menu-pop button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink); text-align: left; font-size: 14px; cursor: pointer; text-decoration: none; }
.menu .menu-pop a:hover, .menu .menu-pop button:hover { background: var(--sunk); text-decoration: none; }
.menu .menu-pop .who { padding: 8px 10px 10px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.menu .menu-pop .who b { display: block; color: var(--ink); font-size: 13.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ramp); background-size: 200% 100%; animation: drift 14s linear infinite; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--rule-2); }
.avatar:hover { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--violet); }
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand .suffix { display: none; }
  .nav a { padding: 0 9px; font-size: 13px; }
  .credits span { display: none; }
}

/* --- layout helpers --------------------------------------------------------- */
.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; }
.wrap.narrow { width: min(760px, 100% - 40px); }
@media (max-width: 640px) { .wrap, .wrap.narrow { width: calc(100% - 32px); } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
/* the soft wash of the ramp behind a hero, breathing */
.halo { position: relative; }
.halo::before {
  content: ""; position: absolute; left: 50%; top: -40px; width: min(640px, 90vw); height: 320px;
  transform: translate(-50%, 0);
  background: radial-gradient(closest-side, rgba(124, 92, 255, .38), rgba(31, 209, 232, .14) 45%, transparent 70%);
  filter: blur(30px); z-index: -1; pointer-events: none;
  animation: halo 9s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
