/* ==========================================================================
   NexStudio app UI (owner 2026-10-06): user panel, admin panel, auth and
   public sub-pages. Loaded AFTER css/style.css and reuses its tokens, fonts
   and .btn classes. Same wine-black theme, crimson accent, owner palette
   (#8B0000 #DC143C #FF8C00 #FFD700 #8B4513) and sparse pixel touches.
   Remove this file + the app pages to revert; the marketing page does not use it.
   ========================================================================== */

/* Tokens (colours, radius, sizes) live in css/tokens.css */
.vox { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.pxi { display: inline-block; flex: none; vertical-align: -3px; }
.pxi.x2 { width: 32px; height: 32px; }
.btn .pxi { margin: 0 -2px; }

/* ---------- base for app pages ---------- */
body.app-body { background: var(--ink); min-height: 100vh; }
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; }
.app-content > * { min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--dust); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.coin { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.16em; image-rendering: pixelated; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 16px; background: var(--ink-2); border-right: 1px solid var(--line); overflow-y: auto;
}
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 6px; }
.side-brand img { height: 30px; width: auto; }
.side-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--p-gold); background: rgba(255,215,0,.1); border: 1px solid rgba(255,215,0,.25); padding: 2px 7px; border-radius: 999px; }
.side-group { display: grid; gap: 2px; }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); padding: 10px 10px 6px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--dust); font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s;
}
.side-link svg { width: 16px; height: 16px; flex: none; }
.side-link:hover { background: var(--panel); color: var(--bone); }
.side-link[aria-current="page"] { background: var(--panel-2); color: var(--bone); }
.side-link[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-link .count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--on-accent); background: var(--accent-fill); border-radius: 999px; padding: 1px 7px; }
.side-link .soon { margin-left: auto; font-size: 10.5px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.side-plan {
  position: relative; padding: 14px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(150deg, rgba(220,20,60,.22), rgba(139,0,0,.12) 60%, transparent), var(--panel);
  border: 1px solid var(--line-2);
}
.side-plan-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--dust); }
.side-plan-bal { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.side-plan-bal img { width: 22px; height: 22px; image-rendering: pixelated; }
.side-plan small { color: var(--dim); font-size: 12px; }
.side-plan .btn { width: 100%; margin-top: 12px; justify-content: center; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid transparent; }
.side-user:hover { border-color: var(--line); background: var(--panel); }
.avatar { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #1f0f04; background: linear-gradient(150deg, var(--p-gold), var(--p-orange)); }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.avatar.red { background: linear-gradient(150deg, var(--p-crimson), var(--p-blood)); color: #fff; }
.avatar.brown { background: linear-gradient(150deg, #b06a2c, var(--p-brown)); color: #fff; }
.avatar.grey { background: var(--panel-3); color: var(--bone); }
.side-user-meta { min-width: 0; display: grid; line-height: 1.25; }
.side-user-meta b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta span { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 3vw, 40px); background: rgba(14, 11, 12, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: grid; line-height: 1.2; min-width: 0; }
.crumbs { font-size: 12px; color: var(--dim); white-space: nowrap; }
.crumbs a:hover { color: var(--bone); }
.topbar-title h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-search { position: relative; }
.top-search input { width: 280px; height: 38px; padding: 0 12px 0 36px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--bone); font-size: 14px; }
.top-search svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--dim); }
.top-search kbd { position: absolute; right: 8px; top: 8px; font: 600 11px var(--f-body); color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-2); font-weight: 650; font-size: 14.5px;
}
.credit-pill img { width: 20px; height: 20px; image-rendering: pixelated; }
.credit-pill:hover { border-color: var(--p-gold); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--dust); position: relative; }
.icon-btn:hover { color: var(--bone); border-color: var(--line-2); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); }
.menu-toggle { display: none; }

/* ---------- headings inside content ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; color: var(--dust); max-width: 62ch; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-title h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.005em; }
.section-title .link { font-size: 13.5px; color: var(--dust); display: inline-flex; align-items: center; gap: 4px; }
.section-title .link:hover { color: var(--bone); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--card-r); padding: 20px; min-width: 0; overflow: visible; transition: border-color var(--t-fast); }
.card:hover { transform: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .section-title { padding: 18px 20px 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }

/* stepped pixel corners for hero cards */
.px-corners {
  clip-path: polygon(
    0 calc(var(--px-step) * 2), var(--px-step) calc(var(--px-step) * 2), var(--px-step) var(--px-step), calc(var(--px-step) * 2) var(--px-step), calc(var(--px-step) * 2) 0,
    calc(100% - var(--px-step) * 2) 0, calc(100% - var(--px-step) * 2) var(--px-step), calc(100% - var(--px-step)) var(--px-step), calc(100% - var(--px-step)) calc(var(--px-step) * 2), 100% calc(var(--px-step) * 2),
    100% calc(100% - var(--px-step) * 2), calc(100% - var(--px-step)) calc(100% - var(--px-step) * 2), calc(100% - var(--px-step)) calc(100% - var(--px-step)), calc(100% - var(--px-step) * 2) calc(100% - var(--px-step)), calc(100% - var(--px-step) * 2) 100%,
    calc(var(--px-step) * 2) 100%, calc(var(--px-step) * 2) calc(100% - var(--px-step)), var(--px-step) calc(100% - var(--px-step)), var(--px-step) calc(100% - var(--px-step) * 2), 0 calc(100% - var(--px-step) * 2));
}
.dither::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%23000'/%3E%3C/svg%3E");
  background-size: 6px 6px; image-rendering: pixelated; opacity: .16;
  -webkit-mask-image: linear-gradient(150deg, transparent 40%, #000); mask-image: linear-gradient(150deg, transparent 40%, #000);
}

/* hero balance card */
.hero-card {
  position: relative; isolation: isolate; overflow: hidden; padding: 26px 28px; color: #fff;
  background: linear-gradient(140deg, var(--p-crimson), var(--p-blood) 70%);
}
.hero-card.gold { background: linear-gradient(140deg, var(--p-gold), var(--p-orange)); color: #1f0f04; }
.hero-card.brown { background: linear-gradient(140deg, #a85a22, var(--p-brown) 45%, #4a2008); }
.hero-card .over { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; opacity: .85; }
.hero-bal { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; font-size: clamp(38px, 4.4vw, 56px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero-bal img { width: 46px; height: 46px; image-rendering: pixelated; filter: drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
.hero-card .worth { opacity: .85; font-size: 15px; }
.hero-card .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-card .hero-coins { position: absolute; right: 18px; bottom: 0; width: 150px; height: auto; image-rendering: pixelated; opacity: .95; pointer-events: none; filter: drop-shadow(0 8px 12px rgba(0,0,0,.35)); }
.btn-light { background: #fff4f2; color: #2a0a0d; border-color: transparent; }
.btn-light:hover { background: #fff; }
.btn-glass { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: inherit; }
.btn-glass:hover { background: rgba(255,255,255,.2); }
.btn-gold { background: var(--p-gold); color: #241203; border-color: transparent; }
.btn-gold:hover { background: #ffe14d; }
.btn-danger { background: transparent; border-color: rgba(248,49,60,.5); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn[aria-busy="true"] { opacity: 1; cursor: progress; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: nxspin .8s linear infinite; }
@keyframes nxspin { to { transform: rotate(360deg); } }

/* stat tiles */
.stat { display: grid; gap: 6px; }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dust); }
.stat-label svg { width: 16px; height: 16px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-sub { font-size: 12.5px; color: var(--dim); }
.delta { font-size: 12px; font-weight: 650; padding: 1px 7px; border-radius: 999px; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.tip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 10.5px; color: var(--dim); cursor: help; }

/* quick links */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .2s var(--ease-spring); }
.quick a:hover { border-color: var(--line-2); transform: translateY(-2px); }
.quick .qi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.quick .qi svg { width: 16px; height: 16px; }
.qi.red { background: rgba(220,20,60,.16); color: #ff6b7f; }
.qi.gold { background: rgba(255,215,0,.13); color: var(--p-gold); }
.qi.orange { background: rgba(255,140,0,.14); color: #ffa94d; }
.qi.brown { background: rgba(139,69,19,.28); color: #e09a63; }
.qi.grey { background: var(--panel-3); color: var(--bone); }
.quick b { display: block; font-size: 14.5px; font-weight: 600; }
.quick span { display: block; font-size: 12.5px; color: var(--dim); }

/* ---------- badges, pills, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { color: var(--ok); background: var(--ok-bg); }
.b-warn { color: var(--warn); background: var(--warn-bg); }
.b-bad { color: var(--bad); background: var(--bad-bg); }
.b-info { color: var(--info); background: var(--info-bg); }
.b-mute { color: var(--dust); background: var(--panel-3); }
.b-gold { color: var(--p-gold); background: rgba(255,215,0,.12); }
.b-live::before { animation: nxpulse 1.6s ease-in-out infinite; }
@keyframes nxpulse { 50% { opacity: .25; } }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--dust); background: transparent; }
.chip[aria-pressed="true"], .chip.on { color: var(--bone); border-color: var(--bone); background: var(--panel-2); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs [role="tab"] { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--dust); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs [role="tab"]:hover { color: var(--bone); }
.tabs [role="tab"][aria-selected="true"] { background: var(--panel-2); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs .count { font-size: 11.5px; color: var(--dim); }
.tab-line { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-line [role="tab"] { border: 0; background: none; padding: 10px 0 12px; font-size: 14.5px; font-weight: 550; color: var(--dust); position: relative; white-space: nowrap; }
.tab-line [role="tab"][aria-selected="true"] { color: var(--bone); }
.tab-line [role="tab"][aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }

/* ---------- tables ---------- */
.table-scroll { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.018); }
.tbl .r { text-align: right; }
.tbl .strike { text-decoration: line-through; color: var(--dim); margin-right: 6px; }
.tbl .row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tbl .row-main b { font-weight: 600; }
.tbl .row-main small { display: block; color: var(--dim); font-size: 12.5px; }
.tbl .thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--panel-3); flex: none; }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl .pos { color: var(--ok); }
.tbl .neg { color: var(--bone); }
.link-btn { border: 0; background: none; padding: 4px 8px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--dust); }
.link-btn:hover { color: var(--bone); background: var(--panel-2); }
.link-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }

/* ---------- lists ---------- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { font-weight: 600; font-size: 14.5px; }
.list-row small { display: block; font-size: 12.5px; color: var(--dim); }
.li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--bone); flex: none; }
.li-icon svg { width: 16px; height: 16px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field label, .label { font-size: 13.5px; font-weight: 600; color: var(--bone); }
.field .help { font-size: 12.5px; color: var(--dim); }
.field .err { font-size: 12.5px; color: var(--bad); display: none; }
.field.invalid .err { display: block; }
.field.invalid .input { border-color: var(--bad); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; background: var(--ink-2); border: 1px solid var(--line-2);
  color: var(--bone); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ab9c9d' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-affix { position: relative; }
.input-affix .input { padding-right: 44px; }
.input-affix button { position: absolute; right: 6px; top: 6px; height: 32px; width: 32px; border-radius: 8px; border: 0; background: none; color: var(--dim); display: grid; place-items: center; }
.input-affix button:hover { color: var(--bone); background: var(--panel-2); }
.input-affix svg { width: 16px; height: 16px; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--dust); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-fill); margin: 2px 0 0; flex: none; }

/* toggle switch */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); transition: background .2s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dust); transition: transform .2s var(--ease-spring), background .2s; }
.switch input:checked + span { background: var(--accent-fill); border-color: var(--accent-fill); }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row b { display: block; font-size: 14.5px; font-weight: 600; }
.setting-row small { display: block; font-size: 13px; color: var(--dim); max-width: 60ch; }
.setting-row .ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.setting-row .ctl .input { width: 140px; height: 38px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--ink-2); border: 1px solid var(--line-2); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--dust); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--bone); }

/* ---------- banners ---------- */
.banner { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; border-radius: 14px; border: 1px solid; font-size: 14.5px; }
.banner svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.banner .grow { flex: 1; min-width: 0; }
.banner b { display: block; color: var(--bone); font-weight: 650; }
.banner p { margin: 2px 0 0; color: var(--dust); }
.banner .btn { flex: none; align-self: center; }
.banner.bad { border-color: rgba(248,49,60,.35); background: linear-gradient(90deg, rgba(248,49,60,.12), rgba(248,49,60,.03)); color: var(--bad); }
.banner.warn { border-color: rgba(255,140,0,.35); background: linear-gradient(90deg, rgba(255,140,0,.12), rgba(255,140,0,.03)); color: var(--warn); }
.banner.ok { border-color: rgba(79,191,122,.35); background: linear-gradient(90deg, rgba(79,191,122,.12), rgba(79,191,122,.03)); color: var(--ok); }
.banner.info { border-color: rgba(154,184,200,.3); background: linear-gradient(90deg, rgba(154,184,200,.1), rgba(154,184,200,.02)); color: var(--info); }

/* ---------- progress / meter ---------- */
.meter { height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--p-crimson), var(--p-orange)); }
.meter.px > span { border-radius: 0; background: repeating-linear-gradient(90deg, var(--p-gold) 0 8px, var(--p-orange) 8px 10px); }
.meter-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); margin-top: 8px; }

/* ---------- empty / error / skeleton ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 20px; }
.empty .vox { width: 96px; height: 96px; image-rendering: pixelated; }
.empty b { font-size: 16px; }
.empty p { margin: 0; color: var(--dust); max-width: 44ch; font-size: 14px; }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: nxshimmer 1.3s linear infinite; }
@keyframes nxshimmer { to { background-position: -200% 0; } }

/* ---------- dialogs ---------- */
dialog.dlg { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--bone); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
dialog.dlg::backdrop { background: rgba(8, 5, 6, .72); backdrop-filter: blur(3px); }
dialog.dlg[open] { animation: nxpop .22s var(--ease-spring); }
@keyframes nxpop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.dlg-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 0; }
.dlg-head h3 { margin: 0; font-size: 18px; font-weight: 650; }
.dlg-head p { margin: 6px 0 0; color: var(--dust); font-size: 14.5px; }
.dlg-body { padding: 18px 22px; display: grid; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--ink-2); border-radius: 0 0 18px 18px; }
.dlg-x { margin-left: auto; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 64px; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); font-size: 14px; animation: nxpop .25s var(--ease-spring); }
.toast svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.toast.bad svg { color: var(--bad); }

/* ---------- code / copy ---------- */
.copy-field { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line-2); }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; color: var(--bone); }
.codeblock { position: relative; padding: 14px 16px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; overflow-x: auto; }
.code-chip { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; padding: 1px 7px; border-radius: 6px; background: var(--panel-3); color: var(--bone); }

/* ---------- media grid (history) ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media { position: relative; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); display: grid; }
.media .ph { aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, var(--panel-3), var(--ink-2)); display: grid; place-items: center; overflow: hidden; }
.media .ph.skel { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; }
.media .ph img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(0,0,0,.45)); transition: transform .4s var(--ease); }
.media:hover .ph img { transform: scale(1.05); }
.media .meta { padding: 12px 14px; display: grid; gap: 4px; }
.media .meta b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media .meta small { font-size: 12.5px; color: var(--dim); }
.media .top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; }
.media .star { width: 32px; height: 32px; border-radius: 9px; border: 0; background: rgba(14,11,12,.7); display: grid; place-items: center; color: var(--dust); }
.media .star svg { width: 16px; height: 16px; }
.media .star[aria-pressed="true"] { color: var(--p-gold); }

.media .acts { display: flex; gap: 6px; padding: 0 10px 12px; }
.media .acts .btn { flex: 1; justify-content: center; }
.deadline { font-size: 11.5px; font-weight: 600; color: var(--warn); background: rgba(14,11,12,.75); padding: 3px 8px; border-radius: 999px; }

/* ---------- plan cards ---------- */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan-card { position: relative; display: grid; gap: 14px; align-content: start; padding: 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.plan-card.featured { border-color: rgba(220,20,60,.6); background: linear-gradient(180deg, rgba(220,20,60,.14), transparent 45%), var(--panel); box-shadow: 0 20px 60px -30px rgba(220,20,60,.6); }
.plan-card.current { border-color: var(--p-gold); }
.plan-card .tagline { position: absolute; top: -11px; left: 22px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--accent-fill); color: #fff; }
.plan-card.current .tagline { background: var(--p-gold); color: #241203; }
.plan-name { display: flex; align-items: center; justify-content: space-between; }
.plan-name b { font-size: 18px; font-weight: 700; }
.plan-name img { width: 48px; height: auto; image-rendering: pixelated; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price strong { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.plan-price span { color: var(--dim); font-size: 14px; }
.plan-credits { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.plan-credits img { width: 18px; height: 18px; image-rendering: pixelated; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; color: var(--dust); }
.plan-feats li { display: flex; gap: 9px; align-items: flex-start; }
.plan-feats li::before { content: ''; width: 14px; height: 14px; flex: none; margin-top: 3px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8313c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / contain; }
.plan-card .btn { justify-content: center; }
.save-tag { font-size: 12px; font-weight: 700; color: var(--ok); }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pack { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.pack.best { border-color: rgba(255,215,0,.5); }
.pack img { width: 56px; height: auto; image-rendering: pixelated; flex: none; }
.pack .grow { flex: 1; min-width: 0; }
.pack b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.pack small { display: block; color: var(--dim); font-size: 12.5px; }

/* ---------- charts (svg) ---------- */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--dim); font-size: 11px; font-family: var(--f-body); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--dust); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 70px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row .track { height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: inherit; }
.bar-row .v { text-align: right; color: var(--dust); font-variant-numeric: tabular-nums; }
.funnel { display: grid; gap: 8px; }
.funnel-step { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 10px; background: var(--panel-2); overflow: hidden; font-size: 14px; }
.funnel-step i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(220,20,60,.35), rgba(220,20,60,.12)); z-index: 0; }
.funnel-step > * { position: relative; z-index: 1; }
.funnel-step b { font-weight: 650; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 220px; }
.search .input { height: 38px; padding-left: 36px; font-size: 14px; }
.search svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--dim); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }

/* ---------- prototype state switcher (remove when wired to real data) ---------- */
.proto { position: fixed; z-index: 90; right: 16px; bottom: 16px; }
.proto > button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed rgba(255,215,0,.5); background: rgba(14,11,12,.9); color: var(--p-gold); font-size: 12.5px; font-weight: 600; }
.proto-panel { position: absolute; right: 0; bottom: 44px; width: 250px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -15px rgba(0,0,0,.7); display: grid; gap: 4px; }
.proto-panel b { font-size: 12px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px 6px; }
.proto-panel button { text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; color: var(--dust); }
.proto-panel button:hover { background: var(--panel-2); color: var(--bone); }
.proto-panel button[aria-pressed="true"] { color: var(--bone); background: var(--panel-3); }
[data-state-show] { display: none !important; }
[data-state-show].state-on { display: revert !important; }
.state-flex.state-on { display: flex !important; }

/* ---------- auth layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form-side { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-form-side .brand img { height: 34px; width: auto; }
.auth-box { width: 100%; max-width: 420px; margin: auto; display: grid; gap: 20px; padding: 40px 0; }
.auth-box h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.auth-box .sub { margin: 8px 0 0; color: var(--dust); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border-radius: 999px; background: #fff; color: #1d1d1f; font-weight: 600; border: 0; width: 100%; }
.btn-google:hover { background: #f1f1f1; }
.btn-google svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-foot { font-size: 14px; color: var(--dust); text-align: center; }
.auth-foot a, .text-link { color: var(--bone); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.auth-foot a:hover, .text-link:hover { text-decoration-color: var(--accent); }
.auth-legal { font-size: 12.5px; color: var(--dim); text-align: center; }
.auth-art { position: relative; overflow: hidden; display: grid; align-content: end; padding: clamp(28px, 4vw, 56px); background: radial-gradient(80% 60% at 70% 30%, rgba(220,20,60,.35), transparent 60%), radial-gradient(60% 50% at 20% 90%, rgba(255,140,0,.18), transparent 60%), var(--ink-2); border-left: 1px solid var(--line); }
.auth-art .vox-stage { position: absolute; inset: 6% 8% 34%; }
.auth-art .vox-stage canvas { width: 100%; height: 100%; }
.auth-facts { position: relative; display: grid; gap: 12px; }
.auth-fact { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(14,11,12,.6); border: 1px solid var(--line); backdrop-filter: blur(6px); font-size: 14px; color: var(--dust); }
.auth-fact b { color: var(--bone); display: block; font-weight: 600; }
.auth-fact img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.code-boxes { display: flex; gap: 8px; justify-content: center; }
.code-boxes { flex-wrap: nowrap; }
.code-boxes span { display: grid; place-items: center; width: clamp(30px, 9vw, 44px); height: clamp(42px, 12vw, 54px); border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line-2); font-size: 26px; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.code-boxes .dash { width: 14px; border: 0; background: none; color: var(--dim); }

/* ---------- public sub-pages ---------- */
.page-hero { padding-block: clamp(56px, 8vw, 104px) clamp(32px, 4vw, 48px); text-align: center; }
.page-hero .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dust); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); }
.page-hero h1 { margin: 18px auto 0; max-width: 18ch; font-size: clamp(38px, 5.6vw, 72px); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; }
.page-hero h1 em { font-style: normal; color: var(--accent); }
.page-hero p { margin: 18px auto 0; max-width: 58ch; color: var(--dust); font-size: clamp(16px, 1.3vw, 19px); }
.page-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(48px, 6vw, 88px); padding-bottom: clamp(64px, 8vw, 120px); }
.prose { max-width: 72ch; font-size: 16.5px; line-height: 1.7; color: var(--dust); }
.prose h2 { color: var(--bone); font-size: 24px; letter-spacing: -.015em; margin: 40px 0 10px; }
.prose h3 { color: var(--bone); font-size: 18px; margin: 28px 0 8px; }
.prose a { color: var(--bone); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 40px; align-items: start; }
.docs-nav { position: sticky; top: 90px; display: grid; gap: 2px; font-size: 14px; }
.docs-nav b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 16px 0 6px; }
.docs-nav a { padding: 6px 10px; border-radius: 8px; color: var(--dust); }
.docs-nav a:hover { color: var(--bone); background: var(--panel); }
.docs-nav a[aria-current] { color: var(--bone); background: var(--panel-2); }
.toc { position: sticky; top: 90px; font-size: 13px; display: grid; gap: 6px; color: var(--dim); }
.toc a:hover { color: var(--bone); }
.timeline { display: grid; gap: 0; }
.release { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; padding: 32px 0; border-top: 1px solid var(--line); }
.release .when { display: grid; gap: 6px; align-content: start; }
.release .when b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.op-table td:last-child { white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
  .top-search input { width: 200px; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: 30px 0 60px -20px rgba(0,0,0,.6); }
  .side.open { transform: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(8,5,6,.6); }
  .menu-toggle { display: inline-grid; }
  .grid-main, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .packs { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .docs-nav b { width: 100%; margin: 8px 0 2px; }
  .release { grid-template-columns: 1fr; gap: 12px; }
  .top-search { display: none; }
}
@media (max-width: 640px) {
  .grid-4, .plans, .quick { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar .hide-sm { display: none; }
  .hero-card .hero-coins { width: 100px; opacity: .5; }
  .tbl [data-drop="2"] { display: none; }
  .bar-row { grid-template-columns: 100px 1fr 56px; }
  .setting-row { flex-wrap: wrap; }
}
@media (max-width: 480px) { .tbl [data-drop="1"] { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- motion: staggered reveal (no overshoot on data) ---------- */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease), transform .5s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.lift { transition: transform var(--t-med) var(--ease-spring), border-color var(--t-fast), box-shadow var(--t-med); }
.lift:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.shine { position: relative; overflow: hidden; }
.shine::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 45%, transparent 60%); transform: translateX(-120%); transition: transform .9s var(--ease); pointer-events: none; }
.shine:hover::before { transform: translateX(120%); }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* tables become stacked rows on phones */
@media (max-width: 640px) {
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .tbl.cards tr:last-child { border-bottom: 0; }
  .tbl.cards td { padding: 0; border: 0; }
  .tbl.cards td:first-child { grid-column: 1 / -1; }
  .tbl.cards td[data-drop] { display: block !important; font-size: 12.5px; color: var(--dim); text-align: left; }
  .tbl.cards td[data-unit]::after { content: ' ' attr(data-unit); }
  .tbl.cards td:last-child { grid-column: 3; grid-row: 2; }
  .proto > button span { display: none; }
}

.input.mono { font-family: var(--f-mono); font-size: 14px; }
