/* ============================================================
   Gateway Lens — design tokens (dark glass dashboard)
   ============================================================ */
:root {
  --bg: #0f172a;
  --card: rgba(27, 35, 54, 0.6);
  --card-solid: #1b2336;
  --fg: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --accent: #22c55e;
  --accent-soft: #4ade80;
  --accent-glow: rgba(34, 197, 94, 0.35);
  --blue: #60a5fa;
  --violet: #a78bfa;
  --amber: #f59e0b;
  --red: #f87171;
  --teal: #2dd4bf;
  --font-body: "Fira Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Fira Code", ui-monospace, "Cascadia Code", Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* author styles must never override the `hidden` attribute */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { letter-spacing: -0.01em; }

/* ------------------------------------------------------------
   Background effects
   ------------------------------------------------------------ */
.bg-fx {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 88% -12%, rgba(34, 197, 94, 0.075), transparent 60%),
    radial-gradient(900px 620px at -8% 18%, rgba(96, 165, 250, 0.07), transparent 60%),
    radial-gradient(800px 500px at 55% 115%, rgba(167, 139, 250, 0.05), transparent 60%),
    var(--bg);
}
.bg-fx::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(1000px 600px at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(1000px 600px at 50% 0%, #000 30%, transparent 75%);
}

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 720px) { .wrap { padding: 0 14px; } }

/* ------------------------------------------------------------
   Top bar
   ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 62px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.35)); }
.brand h1 {
  font-family: var(--font-mono); font-size: 17px; font-weight: 600; letter-spacing: 0.02em;
}
.brand p { font-size: 11.5px; color: var(--muted); }

.topbar-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   Segmented range control
   ------------------------------------------------------------ */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.seg-btn {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--muted); background: transparent; border: 0;
  padding: 5px 12px; border-radius: 7px; cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.seg-btn:hover { color: var(--fg); }
.seg-btn.active {
  color: var(--accent-soft);
  background: rgba(34, 197, 94, 0.13);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35);
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  color: var(--muted); background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 12px; cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.btn-ghost:hover { color: var(--fg); background: rgba(148, 163, 184, 0.13); border-color: var(--border-strong); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost svg { width: 15px; height: 15px; }
.icon-btn { padding: 7px 8px; }
.btn-ghost:focus-visible, .seg-btn:focus-visible, .chip:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.6); outline-offset: 2px;
}
.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------
   Live badge
   ------------------------------------------------------------ */
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--accent-soft); background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.live-stale { color: var(--amber); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); }
.live-stale .dot { background: var(--amber); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); animation: pulse 1.6s ease infinite; }
.live-off { color: var(--red); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); }
.live-off .dot { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.4); }
.live-ok .dot { animation: pulse 2.4s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 40%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(2, 6, 23, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 18px;
  transition: border-color .25s ease;
}
.card:hover { border-color: rgba(148, 163, 184, 0.22); }

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: 0.01em; }
.card-head h3 { font-size: 13px; font-weight: 600; }
.sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.head-tools { display: flex; align-items: center; gap: 8px; }

.rule { height: 1px; background: var(--border); margin: 16px 0 14px; }

/* ------------------------------------------------------------
   Layout grids
   ------------------------------------------------------------ */
main.wrap { padding-top: 22px; padding-bottom: 10px; display: flex; flex-direction: column; gap: 18px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .kpis { grid-template-columns: repeat(2, 1fr); } }

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1080px) { .grid-main { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------
   KPI cards
   ------------------------------------------------------------ */
.kpi {
  position: relative; overflow: hidden;
  padding: 15px 16px 34px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0) 40%), var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(2, 6, 23, 0.45), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color .25s ease, transform .25s ease;
  cursor: default;
}
.kpi:hover { border-color: rgba(148, 163, 184, 0.24); transform: translateY(-2px); }
.kpi-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.kpi-label svg { width: 14px; height: 14px; }
.kpi-icon-tw { color: var(--accent-soft); }
.kpi-value { font-size: 24px; font-weight: 600; font-family: var(--font-mono); margin-top: 7px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11px; color: var(--muted-2); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.kpi-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 30px; display: block; }
.delta-up { color: var(--accent-soft); }
.delta-down { color: var(--red); }

/* delta arrow */
.delta { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-mono); font-size: 10.5px; }
.delta svg { width: 10px; height: 10px; }

.skeleton {
  position: relative; overflow: hidden;
  background: rgba(148, 163, 184, 0.08); border-radius: var(--radius-sm);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.06) 50%, transparent 80%);
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------------------------------------
   Charts
   ------------------------------------------------------------ */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 190px; }
@media (max-width: 760px) { .chart-box { height: 220px; } }

.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-inline .li { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend-inline .sw { width: 9px; height: 9px; border-radius: 3px; }

.donut-box { height: 172px; position: relative; display: flex; align-items: center; justify-content: center; }
.donut-total { position: absolute; text-align: center; pointer-events: none; }
.donut-total .v { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.donut-total .t { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.donut-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; margin-top: 8px; }
.donut-legend .li { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.donut-legend .li b { color: var(--fg); font-family: var(--font-mono); font-weight: 500; margin-left: auto; font-size: 11.5px; }
.donut-legend .sw { width: 8px; height: 8px; border-radius: 2.5px; flex: none; }

.model-list { display: flex; flex-direction: column; gap: 9px; max-height: 236px; overflow-y: auto; padding-right: 4px; }
.model-row { display: flex; flex-direction: column; gap: 3px; }
.model-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.model-name { font-size: 12px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); }
.model-meta { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.model-bar { height: 5px; border-radius: 999px; background: rgba(148, 163, 184, 0.1); overflow: hidden; }
.model-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #0ea5e9);
  transition: width .8s cubic-bezier(.22,.8,.28,1);
}

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-2);
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr[data-row]:hover, .tr-click:hover { background: rgba(148, 163, 184, 0.06); cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--muted-2); }

.key-cell { display: flex; flex-direction: column; gap: 2px; }
.key-name { font-weight: 500; color: var(--fg); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.key-prefix { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.03em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.pill-ok { color: var(--accent-soft); background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(74, 222, 128, 0.28); }
.pill-ok::before { background: var(--accent); }
.pill-off { color: var(--muted); background: rgba(148, 163, 184, 0.08); border: 1px solid var(--border); }
.pill-off::before { background: var(--muted-2); }
.pill-warn { color: var(--amber); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-warn::before { background: var(--amber); }
.pill-err { color: var(--red); background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); }
.pill-err::before { background: var(--red); }

.credit-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.credit-bar { width: 74px; height: 4px; border-radius: 999px; background: rgba(148, 163, 184, 0.12); overflow: hidden; }
.credit-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d399, #22c55e); }

.tok-mini { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.tok-mini .t { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 11.5px; }
.tok-mini .sw { width: 6px; height: 6px; border-radius: 2px; }

.empty-row td { text-align: center; color: var(--muted-2); padding: 26px 10px; }
.empty-row:hover { background: transparent; cursor: default; }

.live-logs { max-height: 430px; overflow-y: auto; }
.live-logs .table th { position: sticky; top: 0; background: var(--card-solid); z-index: 2; }
.code-chip { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 6px; }

/* ------------------------------------------------------------
   Filter chips + search
   ------------------------------------------------------------ */
.filter-row { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  background: rgba(148, 163, 184, 0.06); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.active { color: var(--accent-soft); background: rgba(34, 197, 94, 0.12); border-color: rgba(74, 222, 128, 0.4); }
.chip b { font-family: var(--font-mono); font-weight: 500; margin-left: 4px; }

.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 150px; max-width: 260px;
  background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; color: var(--muted);
}
.search:focus-within { border-color: rgba(74, 222, 128, 0.45); }
.search svg { width: 14px; height: 14px; flex: none; }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--fg); font-family: var(--font-body); font-size: 12.5px; min-width: 0; }
.search input::placeholder { color: var(--muted-2); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer { padding: 14px 24px 26px; }
.footer p { font-size: 11.5px; color: var(--muted-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.footer .mono { font-size: 10.5px; }

/* ------------------------------------------------------------
   Drawer
   ------------------------------------------------------------ */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .28s ease;
}
.scrim.open { opacity: 1; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(600px, 96vw);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 70px rgba(2, 6, 23, 0.65);
  transform: translateX(103%);
  transition: transform .32s cubic-bezier(.22,.9,.28,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
}
.drawer-title h2 { font-size: 16px; font-weight: 600; }
.drawer-title .mono { font-size: 12px; color: var(--accent-soft); margin-top: 3px; }
.drawer-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.d-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.d-kpi {
  padding: 11px 12px; border-radius: var(--radius-sm);
  background: rgba(27, 35, 54, 0.55); border: 1px solid var(--border);
}
.d-kpi .l { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.d-kpi .v { font-family: var(--font-mono); font-size: 16px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dcard { padding: 14px; }
.table.small { font-size: 11.5px; }
.table.small td { padding: 7px 10px; }

.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.meta-item { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(27, 35, 54, 0.55); border: 1px solid var(--border); }
.meta-item .l { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.meta-item .v { font-family: var(--font-mono); font-size: 13px; margin-top: 3px; color: var(--fg); word-break: break-all; }

/* ------------------------------------------------------------
   Error banner
   ------------------------------------------------------------ */
.err-banner {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 10px;
  max-width: min(640px, 92vw);
  background: rgba(127, 29, 29, 0.55);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca; font-size: 12.5px;
  border-radius: 12px; padding: 10px 14px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.6);
}
.err-banner svg { width: 16px; height: 16px; flex: none; }
.banner-retry {
  margin-left: 4px; flex: none;
  font-size: 11.5px; font-weight: 600; color: #fecaca;
  background: rgba(248, 113, 113, 0.15); border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 7px; padding: 4px 10px; cursor: pointer;
}
.banner-retry:hover { background: rgba(248, 113, 113, 0.25); }

/* ------------------------------------------------------------
   Customer: login screen
   ------------------------------------------------------------ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 40%), var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 32px 26px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 90px rgba(34, 197, 94, 0.06);
  animation: cardIn .5s cubic-bezier(.22,.9,.28,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo { margin: 0 auto 12px; display: block; filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.4)); }
.login-brand h1 { font-family: var(--font-mono); font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.login-brand p { color: var(--muted); font-size: 13px; margin-top: 3px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field-input {
  display: flex; align-items: center; gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px 0 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field-input:focus-within {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.field-input input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--fg); font-family: var(--font-mono); font-size: 13.5px;
  padding: 11px 0; letter-spacing: .02em; min-width: 0;
}
.field-input input::placeholder { color: var(--muted-2); }
.eye {
  background: transparent; border: 0; color: var(--muted-2); cursor: pointer;
  padding: 6px; border-radius: 7px; display: inline-flex; flex: none;
  transition: color .15s ease, background .15s ease;
}
.eye:hover { color: var(--fg); background: rgba(148, 163, 184, 0.1); }
.eye svg { width: 17px; height: 17px; }

.login-err {
  color: #fca5a5; font-size: 12px; margin-top: 9px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
}
.login-note { margin-top: 18px; font-size: 11px; line-height: 1.55; color: var(--muted-2); text-align: center; }

.btn-primary {
  width: 100%; margin-top: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: #06281a;
  background: linear-gradient(180deg, #4ade80, #22c55e);
  border: 1px solid rgba(74, 222, 128, 0.6);
  border-radius: var(--radius-sm);
  padding: 11px 14px; cursor: pointer;
  box-shadow: 0 8px 26px rgba(34, 197, 94, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid #4ade80; outline-offset: 2px; }
.btn-primary.loading { pointer-events: none; opacity: .75; }
.btn-primary.loading span { animation: pulse 1.2s ease infinite; }

/* ------------------------------------------------------------
   Customer: welcome + info list
   ------------------------------------------------------------ */
.welcome {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.welcome-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.welcome-title h2 { font-size: 18px; font-weight: 600; }
.welcome-left .mono { font-size: 12.5px; color: var(--accent-soft); margin-top: 4px; }
.welcome-note { font-size: 12px; color: var(--muted); margin-top: 8px; max-width: 460px; }
.welcome-right { flex: none; }
.credit-hero { text-align: right; }
.credit-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.credit-value {
  font-size: 34px; font-weight: 600; line-height: 1.15;
  background: linear-gradient(180deg, #86efac, #4ade80 60%, #22c55e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.15);
}
.credit-spent { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

.info-list { display: flex; flex-direction: column; gap: 8px; }
.info-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(27, 35, 54, 0.55); border: 1px solid var(--border);
  font-size: 12px;
}
.info-item span { color: var(--muted); }
.info-item b { font-weight: 500; color: var(--fg); }

/* ------------------------------------------------------------
   Footer link row
   ------------------------------------------------------------ */
.footer-links { display: inline-flex; gap: 14px; margin-left: auto; }
.footer-links a {
  color: var(--muted); text-decoration: none; font-size: 11.5px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.4); transition: color .15s ease;
}
.footer-links a:hover { color: var(--accent-soft); }

/* ------------------------------------------------------------
   Admin token gate
   ------------------------------------------------------------ */
.token-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.token-gate .login-card { width: min(380px, 100%); }

/* ------------------------------------------------------------
   Reduced motion + scrollbars
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.18); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(148, 163, 184, 0.32); }
*::-webkit-scrollbar-track { background: transparent; }