:root {
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --clip: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

*, :before, :after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; font-family: var(--font); line-height: 1.45; }
button, input, select, a { font: inherit; }
button { border: 0; background: none; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .62; transform: none !important; box-shadow: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { color: #07111d; background: rgba(94, 187, 217, .42); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(204, 227, 241, .28); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #5ebbd9, #cf79b9); border: 2px solid transparent; background-clip: content-box; }

.app {
  min-height: 100vh;
  --bg: #e8eef7;
  --page: #f7fbff;
  --card: #ffffff;
  --card2: #edf3fb;
  --line: #cce3f1;
  --line-strong: #afd4eb;
  --line2: #e8bce3;
  --text: #111827;
  --muted: #63708a;
  --soft: #8ba0bd;
  --cyan: #5ebbd9;
  --cyan2: #14c7df;
  --violet: #8a68ff;
  --pink: #cf79b9;
  --green: #28d17c;
  --gold: #d6a452;
  --danger: #be123c;
  --shadow: 0 24px 58px rgba(87, 113, 145, .16);
  --shadow-low: 0 12px 28px rgba(87, 113, 145, .12);
  --grad: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(94, 187, 217, .18), rgba(255, 255, 255, .46) 48%, rgba(207, 121, 185, .12)),
    url("/assets/surface-grid-light.svg"),
    var(--bg);
  background-repeat: no-repeat, repeat, no-repeat;
  background-size: auto, 40px 40px, auto;
}

.app.dark {
  --bg: #777c82;
  --page: #777c82;
  --card: #303338;
  --card2: #3a3e44;
  --line: #8f98a3;
  --line-strong: #b4bec9;
  --line2: #a283a0;
  --text: #f4f6f8;
  --muted: #c9d0d8;
  --soft: #aeb7c2;
  --shadow: 0 22px 54px rgba(0, 0, 0, .30);
  --shadow-low: 0 12px 28px rgba(0, 0, 0, .22);
  background: url("/assets/surface-grid-dark.svg") repeat #777c82;
  background-size: 40px 40px;
}

.page-enter { animation: pageIn .34s cubic-bezier(.2, .8, .2, 1) both; }
.clipped { clip-path: var(--clip); }
.tech-label, .panel-title span, .panel-title b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--cyan);
}
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-title b { color: var(--soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-weight: 850;
  font-size: 13px;
  letter-spacing: 0;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease, filter .18s ease;
}
.btn:hover, .ghost-square:hover, .dash-tabs button:hover, .mini-action:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-low);
}
.btn:active, .ghost-square:active, .mini-action:active { transform: translateY(0) scale(.99); }
.btn-primary { color: #08111d; border-color: transparent; background: var(--grad); position: relative; overflow: hidden; }
.btn-primary:after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
  transition: transform .42s ease;
}
.btn-primary:hover:after, .btn-primary[aria-busy="true"]:after { transform: translateX(120%); }
.btn-secondary { color: var(--text); background: rgba(255, 255, 255, .58); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 14px; }
.btn-wide { width: 100%; height: 54px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.ghost-square {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .62);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 850;
  color: var(--muted);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.icon-button svg { width: 17px; height: 17px; }

.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-align: left; }
.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  clip-path: var(--clip);
  background: var(--grad);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 12px 28px rgba(94, 187, 217, .22);
}
.logo b { display: block; font-size: 15px; font-weight: 900; letter-spacing: 0; }
.logo small { display: block; margin-top: 1px; font-family: var(--mono); font-size: 10px; letter-spacing: 0; color: var(--soft); text-transform: uppercase; }

.landing-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 20px 0 80px; }
.site-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 42px;
  padding: 12px;
  border: 1px solid rgba(175, 212, 235, .72);
  background: rgba(247, 251, 255, .78);
  backdrop-filter: blur(18px);
  clip-path: var(--clip);
  box-shadow: 0 18px 42px rgba(87, 113, 145, .1);
}
.app.dark .site-header { background: rgba(48, 51, 56, .88); }
.main-nav { display: flex; gap: 6px; margin-left: auto; }
.main-nav a { padding: 10px 14px; border: 1px solid transparent; font-size: 13px; font-weight: 800; color: var(--muted); }
.main-nav a:hover { border-color: var(--line); background: rgba(255, 255, 255, .55); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.hero-panel { display: grid; grid-template-columns: minmax(0, .82fr) minmax(560px, 1.18fr); gap: 42px; align-items: center; min-height: 620px; }
.hero-copy h1 { max-width: 780px; margin: 18px 0; font-size: 72px; line-height: .98; font-weight: 900; letter-spacing: 0; text-wrap: balance; }
.hero-copy p { max-width: 620px; margin-bottom: 30px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.hero-actions, .mini-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.mini-badges { margin-top: 26px; }
.mini-badges span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .52);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  clip-path: var(--clip);
}

.router-preview {
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .68));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: var(--clip);
  overflow: hidden;
  animation: floatPanel 7s ease-in-out infinite;
}
.media-router { position: relative; isolation: isolate; }
.media-router:after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 84px;
  background: linear-gradient(180deg, transparent, rgba(94, 187, 217, .12));
  pointer-events: none;
  z-index: 0;
}
.window-bar { height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 18px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.window-bar span:nth-child(2) { background: #eab308; }
.window-bar span:nth-child(3) { background: #22c55e; }
.window-bar code { margin-left: 10px; }
.window-bar b { margin-left: auto; color: var(--green); font-size: 11px; }
.router-stage { position: relative; z-index: 1; }
.router-art {
  position: relative;
  height: 306px;
  overflow: hidden;
  background: #0d1420;
}
.router-art img { width: 100%; height: 100%; object-fit: cover; opacity: .96; filter: saturate(1.08) contrast(1.02); }
.router-art:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(247, 251, 255, .92)), linear-gradient(90deg, rgba(94, 187, 217, .22), transparent 34%, rgba(207, 121, 185, .18));
}
.app.dark .router-art:after { background: linear-gradient(180deg, transparent 58%, rgba(48, 51, 56, .94)), linear-gradient(90deg, rgba(94, 187, 217, .16), transparent 34%, rgba(207, 121, 185, .12)); }
.router-console {
  position: relative;
  z-index: 2;
  margin: -54px 24px 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px);
  clip-path: var(--clip);
  box-shadow: 0 18px 44px rgba(87, 113, 145, .18);
  animation: consoleLift .58s cubic-bezier(.16, 1, .3, 1) both;
}
.app.dark .router-console { background: rgba(48, 51, 56, .9); }
.route-map { display: grid; grid-template-columns: 1fr 52px 1fr 52px 1.25fr; align-items: center; gap: 0; padding: 30px 24px 22px; }
.node-card { padding: 24px; border: 1px solid var(--line); background: rgba(255, 255, 255, .76); clip-path: var(--clip); }
.node-card small { display: block; margin-bottom: 8px; font-family: var(--mono); color: var(--muted); letter-spacing: 0; }
.node-card strong { font-family: var(--mono); font-size: 17px; }
.node-card.center { border-color: var(--line2); background: linear-gradient(135deg, rgba(138, 104, 255, .08), rgba(207, 121, 185, .12)); }
.route-line { height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); background-size: 180% 100%; animation: routeFlow 2.6s linear infinite; }
.model-stack { display: grid; gap: 12px; }
.model-stack span { padding: 13px 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .82); font-family: var(--mono); font-weight: 750; clip-path: var(--clip); }
.terminal-line { margin: 0; padding: 18px 20px; border-top: 1px solid rgba(139, 160, 189, .2); background: #1b2433; color: #eef6ff; font-family: var(--mono); font-size: 13px; }

.model-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 44px; }
.model-badge { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .64); clip-path: var(--clip); font-family: var(--mono); font-weight: 800; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.model-badge:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-low); }
.model-badge b { margin-left: auto; font-size: 10px; color: var(--green); text-transform: uppercase; }
.provider-icon { width: 28px; height: 28px; display: inline-grid; place-items: center; flex: 0 0 auto; clip-path: var(--clip); font-style: normal; font-family: var(--mono); font-size: 12px; font-weight: 900; color: #fff; background: var(--cyan); }
.provider-icon.claude { background: linear-gradient(135deg, #e9874f, #d6a452); }
.provider-icon.codex { background: linear-gradient(135deg, #58bdf3, #8b6dff); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 54px; }
.feature-card { min-height: 210px; padding: 28px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(237, 243, 251, .7)); clip-path: var(--clip); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.feature-card span { display: block; margin-bottom: 40px; font-family: var(--mono); color: var(--cyan); font-weight: 900; }
.feature-card h2 { margin-bottom: 12px; font-size: 22px; }
.feature-card p { color: var(--muted); line-height: 1.75; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 34px; }
.auth-card { width: min(480px, 100%); padding: 30px; border: 1px solid var(--line); background: rgba(255, 255, 255, .8); clip-path: var(--clip); box-shadow: var(--shadow); }
.app.dark .auth-card, .app.dark .router-preview, .app.dark .node-card, .app.dark .model-stack span, .app.dark .model-badge, .app.dark .feature-card, .app.dark .ghost-square, .app.dark .btn-secondary { background: rgba(48, 51, 56, .88); }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.auth-header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 26px; }
.auth-tabs button { height: 44px; border: 1px solid var(--line); background: rgba(255, 255, 255, .54); font-weight: 900; color: var(--muted); }
.auth-tabs button.active { color: #111827; background: var(--grad); border-color: transparent; }
.auth-card h1 { margin: 8px 0; font-size: 34px; }
.auth-card p { color: var(--muted); margin-bottom: 22px; }
.notice { margin-bottom: 18px; padding: 13px 16px; border: 1px solid var(--line); background: rgba(94, 187, 217, .12); clip-path: var(--clip); font-weight: 800; color: var(--text); animation: noticeIn .24s ease both; }
.notice.error { border-color: #fecaca; background: #fff1f2; color: var(--danger); }
.notice.compact { margin-top: 18px; margin-bottom: 0; font-size: 13px; }
.auth-card form, .profile-form { display: grid; gap: 14px; }
.auth-card label, .profile-form label, .amount-card label, .filter-row label { display: grid; gap: 7px; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0; color: var(--muted); text-transform: uppercase; }
.oauth-stack { display: grid; gap: 9px; margin: 18px 0; }
.oauth-stack > span { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; }
.verify-form { display: grid; gap: 14px; margin-top: 20px; }
.verify-form input[name="code"] {
  height: 58px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 8px;
  text-align: center;
}
.verify-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-google { justify-content: center; color: var(--text); background: rgba(255, 255, 255, .82); border-color: var(--line-strong); }
.google-mark { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #111827; font-weight: 900; font-family: var(--font); }
input, select { height: 46px; padding: 0 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .76); color: var(--text); outline: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(94, 187, 217, .25); outline-offset: 2px; border-color: var(--cyan); }
.app.dark input, .app.dark select { background: #34373d; }
.auth-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.auth-plans div { padding: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, .46); clip-path: var(--clip); }
.auth-plans span { font-family: var(--mono); font-size: 11px; color: var(--cyan); font-weight: 900; }
.auth-plans strong { display: block; margin: 8px 0 2px; font-size: 26px; }
.auth-plans small { color: var(--muted); }

.dash-shell { min-height: 100vh; display: block; background: rgba(247, 251, 255, .42); }
.dash-shell .clipped { clip-path: none; border-radius: 8px; }
.dash-shell .logo-mark, .dash-shell .provider-icon, .dash-shell .state-pill, .dash-shell .group-pill { clip-path: var(--clip); border-radius: 0; }
.dash-shell .platform-card,
.dash-shell .split-metric span,
.dash-shell .perf-grid span,
.dash-shell .profile-metrics span,
.dash-shell .endpoint-strip button,
.dash-shell .route-ribbon span,
.dash-shell .policy-preview span,
.dash-shell .model-line,
.dash-shell .model-line-meta span,
.dash-shell .provider-summary span,
.dash-shell .amount-grid button,
.dash-shell .binding-row,
.dash-shell .empty-state,
.dash-shell .data-table code,
.dash-shell .mono {
  clip-path: none;
  border-radius: 8px;
}
.dash-main { min-width: 0; border-left: 0; overflow: hidden; }
.dash-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(22px);
}
.app.dark .dash-sidebar { background: rgba(48, 51, 56, .88); }
.sidebar-brand { min-height: 54px; display: flex; align-items: center; }
.sidebar-nav { display: grid; align-content: start; gap: 10px; padding-top: 12px; }
.sidebar-nav button, .support-card, .user-card {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.sidebar-nav button:hover, .support-card:hover, .user-card:hover { transform: translateY(-1px); border-color: var(--line); background: rgba(255, 255, 255, .62); box-shadow: var(--shadow-low); }
.sidebar-nav button.active { color: var(--violet); background: linear-gradient(90deg, rgba(138, 104, 255, .14), rgba(207, 121, 185, .08)); border-color: rgba(216, 204, 255, .7); }
.nav-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { display: grid; gap: 12px; }
.support-card, .user-card { min-height: 54px; border-color: var(--line); background: rgba(255, 255, 255, .58); }
.user-card { min-height: 66px; padding: 8px; }
.user-card b, .user-card small { display: block; }
.user-card small { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(204, 227, 241, .72);
  background: rgba(247, 251, 255, .88);
  backdrop-filter: blur(18px);
}
.app.dark .dash-topbar { background: rgba(48, 51, 56, .92); }
.dash-topbar-brand { flex: 0 0 auto; }
.dash-topbar-brand .logo-mark { width: 36px; height: 36px; font-size: 11px; }
.dash-topbar-brand .logo b { font-size: 13px; }
.dash-topbar-brand .logo small { font-size: 9px; }
.dash-tabs { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; padding: 8px 0; scrollbar-width: thin; }
.dash-tabs button { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 2px; color: var(--muted); font-weight: 900; white-space: nowrap; transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease; }
.dash-tabs button small { font-family: var(--mono); font-size: 10px; color: var(--soft); }
.dash-tabs button.active { color: var(--violet); border-color: rgba(216, 204, 255, .8); background: rgba(138, 104, 255, .12); }
.dash-tools { display: flex; align-items: center; gap: 8px; }
.credit-chip, .status-row span { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .48); font-family: var(--mono); font-size: 11px; font-weight: 900; color: var(--muted); }
button.credit-chip { cursor: pointer; border-radius: 7px; transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease; }
button.credit-chip:hover { transform: translateY(-1px); border-color: var(--line-strong); color: var(--text); }
.status-row span b { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(40, 209, 124, .34); animation: statusPulse 1.8s ease-out infinite; }
.avatar-btn { width: 42px; height: 42px; border: 1px solid var(--line2); background: rgba(207, 121, 185, .18); font-weight: 900; color: var(--pink); }
.dash-page { width: min(1540px, calc(100% - 76px)); max-width: none; margin: 0 auto; padding: 38px 0 90px; overflow-x: hidden; }
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.app.dark .dash-hero { background: transparent; }
.dash-hero h1 { margin: 8px 0 4px; font-size: 34px; font-weight: 900; letter-spacing: 0; }
.dash-hero p { color: var(--muted); }
.dash-title-block { max-width: 660px; }
.dash-telemetry { display: grid; gap: 10px; justify-items: end; min-width: min(620px, 48vw); }
.status-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.route-ribbon { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.route-ribbon span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(175, 212, 235, .72);
  background: rgba(255, 255, 255, .5);
  clip-path: var(--clip);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.route-ribbon b { color: var(--cyan); text-transform: uppercase; }
.app.dark .route-ribbon span { background: rgba(48, 51, 56, .72); }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .8fr); gap: 16px; align-items: start; }
.balance-card, .dash-card, .mini-stat, .action-bar, .key-create-panel, .table-shell, .segmented { border: 1px solid rgba(204, 227, 241, .82); background: rgba(255, 255, 255, .8); box-shadow: 0 16px 48px rgba(87, 113, 145, .08); }
.app.dark .balance-card, .app.dark .dash-card, .app.dark .mini-stat, .app.dark .action-bar, .app.dark .key-create-panel, .app.dark .table-shell, .app.dark .segmented, .app.dark .provider-column { background: rgba(48, 51, 56, .88); }
.balance-card { min-height: 220px; padding: 26px 28px; position: relative; overflow: hidden; }
.big-money, .token-total { display: block; margin: 14px 0 8px; font-family: var(--mono); font-size: 56px; line-height: 1; color: var(--violet); }
.balance-card small, .balance-card em { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); font-style: normal; text-transform: uppercase; }
.meter { height: 8px; margin: 22px 0 10px; background: var(--card2); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--grad); animation: meterIn .8s ease both; }
.stat-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-stat { min-height: 112px; padding: 18px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.mini-stat:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.mini-stat small { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; }
.mini-stat strong { font-family: var(--mono); font-size: 24px; }
.mini-stat.pink { border-color: var(--line2); }
.mini-stat.violet { border-color: #d8ccff; }
.mini-stat.gold { border-color: #ead9b5; }
.platforms { grid-column: 1 / 2; padding: 24px; min-height: 260px; }
.side-column { display: grid; gap: 14px; }
.dash-card { padding: 24px; }
.platform-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.platform-card { padding: 18px; border: 1px solid var(--line); background: var(--card2); clip-path: var(--clip); transition: transform .18s ease, border-color .18s ease; }
.platform-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.platform-card > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.platform-card strong { color: var(--cyan); }
.platform-card b { font-family: var(--mono); color: var(--pink); }
.platform-card span { display: flex; justify-content: space-between; gap: 14px; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.platform-card em { font-style: normal; color: var(--text); font-weight: 900; }
.split-metric, .perf-grid, .profile-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-metric span, .perf-grid span, .profile-metrics span { padding: 14px; border: 1px solid var(--line); background: var(--card2); clip-path: var(--clip); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.split-metric b, .perf-grid b, .profile-metrics b { display: block; margin-top: 6px; color: var(--cyan); font-size: 20px; }
.query-card { grid-column: 1 / -1; }
.filter-row { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.filter-row input { width: 260px; }
.filter-row select { min-width: 180px; }
.chart-card { min-height: 300px; position: relative; }
.donut-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: center; }
.donut { width: 180px; height: 180px; border-radius: 50%; background: conic-gradient(var(--donut)); position: relative; box-shadow: var(--shadow-low); animation: spinIn .72s ease both; }
.donut.small { width: 150px; height: 150px; }
.donut:after { content: ""; position: absolute; inset: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.clean-table, .data-table { width: 100%; border-collapse: collapse; }
.clean-table th, .clean-table td, .data-table th, .data-table td { text-align: left; border-bottom: 1px solid rgba(139, 160, 189, .22); padding: 12px 10px; color: var(--muted); font-size: 13px; vertical-align: middle; }
.clean-table th, .data-table th { font-family: var(--mono); font-size: 10px; letter-spacing: 0; text-transform: uppercase; color: var(--soft); }
.clean-table td:first-child, .data-table td:first-child { color: var(--text); font-weight: 800; }
.clean-table i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.copy-api-key { margin-top: 8px; width: max-content; }
.line-chart { width: 100%; height: 250px; }
.line-chart path { stroke: rgba(139, 160, 189, .25); stroke-width: 1; fill: none; }
.line-chart polyline { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 800; stroke-dashoffset: 800; animation: traceLine .9s ease forwards; }
.line-chart .req { stroke: var(--violet); }
.line-chart .tok { stroke: var(--cyan2); animation-delay: .12s; }
.line-chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.empty-chart .line-chart { opacity: .48; }
.empty-state { min-height: 180px; display: grid; place-content: center; gap: 8px; text-align: center; border: 1px dashed var(--line-strong); background: rgba(237, 243, 251, .55); clip-path: var(--clip); padding: 26px; }
.empty-state h2 { font-size: 20px; }
.empty-state p { max-width: 520px; color: var(--muted); line-height: 1.7; }
.empty-code { justify-self: center; padding: 6px 10px; background: rgba(94, 187, 217, .13); color: var(--cyan); font-family: var(--mono); font-size: 11px; font-weight: 900; clip-path: var(--clip); }
.empty-row td { padding: 18px !important; }

.keys-page, .usage-page, .models-page, .billing-page, .profile-page, .admin-page { display: grid; gap: 18px; min-width: 0; }
.action-bar { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; }
.bar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.key-create-panel { width: 100%; min-width: 0; padding: 20px; animation: menuOpen .28s cubic-bezier(.16, 1, .3, 1) both; }
.key-menu-copy { max-width: 760px; margin: -6px 0 18px; color: var(--muted); line-height: 1.65; }
.key-guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(9, 13, 24, .72);
  backdrop-filter: blur(18px);
}
.key-guide-modal {
  width: min(960px, 100%);
  max-height: min(90vh, 940px);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(244, 249, 253, .92));
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: menuOpen .28s cubic-bezier(.16, 1, .3, 1) both;
}
.key-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.key-guide-head h2 { margin: 6px 0 6px; font-size: 28px; }
.key-guide-head p { max-width: 720px; color: var(--muted); line-height: 1.65; }
.key-guide-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.key-guide-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  clip-path: var(--clip);
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.key-guide-tabs button:hover { transform: translateY(-1px); border-color: var(--cyan); }
.key-guide-tabs button.active { color: var(--cyan); border-color: rgba(94, 187, 217, .7); background: rgba(94, 187, 217, .12); }
.key-guide-tabs.platform { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.key-guide-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}
.guide-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  clip-path: var(--clip);
}
.guide-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.guide-block pre {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: #d7f7ff;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}
.guide-note {
  padding: 12px 14px;
  border: 1px solid rgba(94, 187, 217, .36);
  background: rgba(94, 187, 217, .08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  clip-path: var(--clip);
}
.guide-mode-card {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  clip-path: var(--clip);
}
.guide-mode-copy {
  display: grid;
  gap: 6px;
}
.guide-mode-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 0;
}
.guide-mode-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.guide-mode-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.guide-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.guide-mode-switch button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(20, 24, 38, .94);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  clip-path: var(--clip);
}
.guide-mode-switch button.active {
  color: var(--cyan);
  border-color: rgba(94, 187, 217, .72);
  background: rgba(94, 187, 217, .14);
}
.guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 170, 84, .36);
  background: rgba(216, 170, 84, .08);
  color: #e6cf94;
  clip-path: var(--clip);
}
.guide-tip-mark {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(216, 170, 84, .14);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}
.guide-tip p {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  color: inherit;
}
.key-policy-grid { display: grid; grid-template-columns: minmax(210px, 1.1fr) 150px 170px minmax(240px, .9fr) auto; gap: 12px; align-items: end; }
.key-policy-grid label { display: grid; gap: 7px; min-width: 0; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0; color: var(--muted); text-transform: uppercase; }
.policy-preview {
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.policy-preview span, .policy-stack, .limit-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.policy-preview span {
  align-content: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: rgba(237, 243, 251, .72);
  clip-path: var(--clip);
}
.policy-preview b, .policy-stack b, .limit-cell span { color: var(--text); font-size: 12px; font-weight: 900; }
.policy-preview em { color: var(--muted); font-style: normal; }
.app.dark .policy-preview span { background: #3a3e44; }
.endpoint-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.endpoint-strip > span { font-family: var(--mono); font-size: 11px; font-weight: 900; color: var(--muted); }
.endpoint-strip button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; max-width: 420px; padding: 0 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .56); clip-path: var(--clip); font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .18s ease, border-color .18s ease; }
.endpoint-strip button b { color: var(--cyan); font-size: 10px; text-transform: uppercase; }
.endpoint-strip button:hover { border-color: var(--cyan); transform: translateY(-1px); }
.table-shell { width: 100%; min-width: 0; max-width: 100%; overflow: auto; }
.data-table { min-width: 1280px; }
.data-table td { height: 64px; }
.data-table tr { animation: rowIn .22s ease both; }
.data-table code, .mono { font-family: var(--mono); font-size: 12px; color: var(--cyan); background: rgba(94, 187, 217, .12); padding: 4px 7px; }
.data-table small { display: block; margin-top: 4px; color: var(--muted); }
.group-pill, .state-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; font-family: var(--mono); font-size: 10px; font-weight: 900; text-transform: uppercase; background: rgba(94, 187, 217, .12); color: var(--cyan); clip-path: var(--clip); }
.group-pill.codex, .state-pill.active { background: rgba(40, 209, 124, .13); color: var(--green); }
.group-pill.universal { background: rgba(138, 104, 255, .13); color: var(--violet); }
.state-pill.inactive { background: rgba(139, 160, 189, .18); color: var(--muted); }
.state-pill.expired { background: rgba(190, 18, 60, .12); color: var(--danger); }
.state-pill.limit-reached { background: rgba(214, 164, 82, .16); color: var(--gold); }
.limit-cell.open span { color: var(--cyan); }
.limit-meter { width: 122px; height: 7px; border: 1px solid var(--line); background: var(--card2); overflow: hidden; }
.limit-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); animation: meterIn .48s ease both; }
.mini-action { margin: 3px 6px 3px 0; padding: 7px 9px; border: 1px solid var(--line); font-family: var(--mono); font-size: 10px; font-weight: 900; color: var(--muted); background: rgba(255, 255, 255, .38); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.usage-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.usage-grid .chart-card:last-child { grid-column: 1 / -1; }

.two-column-models { grid-template-columns: 1fr 1fr; align-items: start; }
.provider-column {
  padding: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .68));
  box-shadow: var(--shadow);
  min-height: 720px;
  position: relative;
  overflow: hidden;
}
.provider-column:before { content: ""; position: absolute; inset: 0; background: url("/assets/surface-grid-light.svg") repeat; background-size: 32px 32px; opacity: .22; pointer-events: none; }
.app.dark .provider-column:before { background-image: url("/assets/surface-grid-dark.svg"); }
.provider-column > * { position: relative; z-index: 1; }
.provider-column.claude { border-color: #efd2ad; }
.provider-column.codex { border-color: #bde9ef; }
.provider-visual { display: grid; grid-template-columns: 132px 1fr; gap: 22px; align-items: center; margin-bottom: 22px; }
.provider-visual img { width: 132px; height: 132px; object-fit: cover; border: 1px solid var(--line); clip-path: var(--clip); box-shadow: var(--shadow-low); }
.provider-visual h2 { margin: 8px 0; font-size: 44px; line-height: 1; font-weight: 900; }
.provider-visual p { max-width: 520px; color: var(--muted); line-height: 1.65; }
.provider-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 18px; }
.provider-summary span { padding: 12px; border: 1px solid var(--line); background: var(--card2); clip-path: var(--clip); font-family: var(--mono); font-size: 10px; font-weight: 900; color: var(--muted); }
.provider-summary b { display: block; margin-top: 5px; font-size: 16px; color: var(--text); }
.model-table-list { display: grid; gap: 10px; }
.model-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .95fr); gap: 10px 12px; align-items: center; padding: 14px; border: 1px solid rgba(139, 160, 189, .28); background: rgba(255, 255, 255, .58); clip-path: var(--clip); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.app.dark .model-line { background: rgba(58, 62, 68, .72); }
.model-line:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: var(--shadow-low); }
.model-line-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.model-line-main strong { display: block; font-size: 17px; }
.model-line-main small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: 0; text-transform: uppercase; color: var(--muted); }
.model-line-meta { display: grid; grid-template-columns: 52px 52px minmax(140px, 1fr); gap: 8px; }
.model-line-meta span { padding: 9px; border: 1px solid var(--line); background: var(--card2); font-family: var(--mono); font-size: 9px; color: var(--muted); clip-path: var(--clip); }
.model-line-meta b { display: block; margin-top: 4px; color: var(--text); font-size: 10px; white-space: nowrap; }
.model-line code { grid-column: 1 / -1; justify-self: end; max-width: 100%; font-family: var(--mono); font-size: 10px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-layout { display: grid; grid-template-columns: 1fr 420px; gap: 18px; }
.chat-window { display: grid; align-content: start; gap: 12px; min-height: 360px; max-height: 520px; padding: 18px; border: 1px solid var(--line); background: var(--card2); overflow: auto; }
.msg { max-width: 78%; padding: 13px 15px; border: 1px solid var(--line); background: var(--card); clip-path: var(--clip); color: var(--muted); animation: messageIn .22s ease both; }
.msg.user { justify-self: end; background: linear-gradient(90deg, rgba(94, 187, 217, .16), rgba(207, 121, 185, .12)); color: var(--text); }
.msg.router { justify-self: start; }
.chat-form { display: grid; grid-template-columns: 230px 210px 1fr auto; gap: 10px; margin-top: 14px; }
.provider-state-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.provider-state { min-height: 30px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 10px; font-weight: 900; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, .54); }
.provider-state b { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.provider-state.online { color: var(--green); background: rgba(40, 209, 124, .09); }
.provider-state.online b { background: var(--green); }
.provider-state.offline { color: var(--danger); background: rgba(190, 18, 60, .07); }
.provider-state.offline b { background: var(--danger); }
pre { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--muted); }

.billing-page { width: min(980px, 100%); margin: 0 auto; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 8px; }
.segmented button { height: 46px; font-family: var(--mono); letter-spacing: 0; text-transform: uppercase; font-weight: 900; color: var(--muted); }
.segmented .active { background: rgba(94, 187, 217, .18); color: var(--cyan); clip-path: var(--clip); }
.wallet-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.wallet-card h2 { margin-top: 8px; font-size: 24px; }
.wallet-card strong { font-family: var(--mono); font-size: 34px; color: var(--cyan); }
.amount-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 10px; margin: 18px 0; }
.amount-grid button { height: 50px; border: 1px solid var(--line); background: var(--card2); font-family: var(--mono); font-weight: 900; color: var(--muted); clip-path: var(--clip); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.amount-grid button:hover { transform: translateY(-2px); border-color: var(--cyan); }
.amount-grid button.active { background: rgba(94, 187, 217, .2); color: var(--cyan); border-color: var(--cyan); }
.stripe-row { display: flex; align-items: center; gap: 16px; }
.stripe-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--violet); background: rgba(124, 92, 255, .15); clip-path: var(--clip); font-weight: 900; color: var(--violet); }
.stripe-row .state-pill { margin-left: auto; }
.invoice-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.invoice-card strong { font-size: 22px; }

.profile-page { width: min(980px, 100%); }
.profile-identity { display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 88px; height: 88px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(94, 187, 217, .22), rgba(207, 121, 185, .2)); border: 1px solid var(--line); clip-path: var(--clip); font-size: 38px; }
.profile-identity h2 { font-size: 30px; }
.profile-identity p { color: var(--muted); }
.profile-metrics { grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.profile-form { grid-template-columns: 1fr 1fr; }
.profile-form .panel-title, .profile-form button { grid-column: 1 / -1; }
.binding-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); background: var(--card2); clip-path: var(--clip); margin-top: 12px; }
.binding-row span:first-child { font-weight: 900; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.admin-toolbar { align-items: flex-end; }
.admin-provider-strip { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.admin-control-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 18px; align-items: stretch; }
.admin-adjust-form { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 150px minmax(220px, 1fr) auto; gap: 12px; align-items: end; }
.admin-adjust-form .panel-title { grid-column: 1 / -1; margin-bottom: 2px; }
.admin-adjust-form label { display: grid; gap: 7px; font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.quick-grants { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: -2px; }
.admin-events { min-height: 210px; }
.admin-event-list { display: grid; gap: 10px; }
.admin-event { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); background: var(--card2); clip-path: var(--clip); }
.admin-event span { font-family: var(--mono); font-size: 11px; font-weight: 900; color: var(--cyan); text-transform: uppercase; }
.admin-event b { font-size: 13px; }
.admin-event small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table { min-width: 1180px; }
.admin-table td:first-child strong { display: block; color: var(--text); }
.admin-balance { font-family: var(--mono); font-size: 16px; font-weight: 900; color: var(--cyan); }
.admin-key-list { display: grid; gap: 8px; min-width: 280px; }
.admin-key-chip { display: grid; grid-template-columns: minmax(110px, auto) minmax(130px, 1fr) auto; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); background: var(--card2); clip-path: var(--clip); }
.admin-key-chip.active { border-color: rgba(40, 209, 124, .42); }
.admin-key-chip.inactive { opacity: .82; }
.admin-key-chip small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted-cell { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.app.dark {
  --bg: #777c82;
  --page: #777c82;
  --card: #303338;
  --card2: #3a3e44;
  --line: #8f98a3;
  --line-strong: #b4bec9;
  --line2: #a283a0;
  --text: #f4f6f8;
  --muted: #c9d0d8;
  --soft: #aeb7c2;
  --cyan: #58bdf3;
  --cyan2: #21d0ee;
  --violet: #8b6dff;
  --pink: #d95bc8;
  --green: #20c878;
  --gold: #d8aa54;
  --danger: #ff6f91;
  --shadow: 0 22px 54px rgba(0, 0, 0, .30);
  --shadow-low: 0 12px 28px rgba(0, 0, 0, .22);
  background: url("/assets/surface-grid-dark.svg") repeat #777c82;
  background-size: 40px 40px;
}

.app.dark .dash-shell {
  background: url("/assets/surface-grid-dark.svg") repeat #777c82;
  background-size: 40px 40px;
}

.app.dark .dash-main {
  border-left-color: transparent;
  background: url("/assets/surface-grid-dark.svg") repeat #777c82;
  background-size: 40px 40px;
}
.app.dark .dash-sidebar {
  background: rgba(48, 51, 56, .88);
  border-right: 1px solid rgba(143, 152, 163, .84);
  box-shadow: 16px 0 44px rgba(0, 0, 0, .18);
}

.app.dark .dash-topbar {
  background: rgba(48, 51, 56, .92);
  border-bottom-color: rgba(143, 152, 163, .84);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .16);
}

.app.dark .dash-hero {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  animation: heroSettle .46s cubic-bezier(.16, 1, .3, 1) both;
}

.app.dark .balance-card,
.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .action-bar,
.app.dark .key-create-panel,
.app.dark .table-shell,
.app.dark .segmented,
.app.dark .provider-column {
  border-color: rgba(143, 152, 163, .88);
  background: rgba(48, 51, 56, .94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .20);
}

.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .balance-card,
.app.dark .provider-column {
  animation: cardRise .32s cubic-bezier(.16, 1, .3, 1) both;
}

.app.dark .key-guide-modal {
  border-color: rgba(143, 152, 163, .88);
  background: linear-gradient(180deg, rgba(36, 39, 45, .98), rgba(28, 31, 36, .98));
  box-shadow: 0 26px 88px rgba(0, 0, 0, .46);
}

.app.dark .key-guide-head,
.app.dark .key-guide-tabs.platform {
  border-color: rgba(143, 152, 163, .78);
}

.app.dark .key-guide-tabs button,
.app.dark .guide-block {
  border-color: rgba(143, 152, 163, .78);
  background: #3a3e44;
}

.app.dark .guide-block pre {
  background: #111827;
  color: #d8f8ff;
}

.app.dark .guide-note {
  border-color: rgba(94, 187, 217, .42);
  background: rgba(24, 52, 72, .78);
  color: #b8d9ee;
}

.app.dark .guide-mode-card {
  border-color: rgba(143, 152, 163, .78);
  background: #3a3e44;
}

.app.dark .guide-mode-copy strong,
.app.dark .guide-mode-copy p {
  color: #e8edf4;
}

.app.dark .guide-mode-switch button {
  border-color: rgba(143, 152, 163, .78);
  background: #24272c;
  color: #c9d0d8;
}

.app.dark .guide-mode-switch button.active {
  border-color: rgba(94, 187, 217, .72);
  background: rgba(24, 52, 72, .78);
  color: #9fe8ff;
}

.app.dark .guide-tip {
  border-color: rgba(216, 170, 84, .42);
  background: rgba(52, 40, 18, .68);
  color: #e6cf94;
}

.app.dark .guide-tip-mark {
  background: rgba(216, 170, 84, .12);
  color: #f2d08a;
}

.app.dark .platform-card,
.app.dark .split-metric span,
.app.dark .perf-grid span,
.app.dark .profile-metrics span,
.app.dark .policy-preview span,
.app.dark .model-line,
.app.dark .model-line-meta span,
.app.dark .provider-summary span,
.app.dark .admin-event,
.app.dark .admin-key-chip,
.app.dark .amount-grid button,
.app.dark .binding-row,
.app.dark .empty-state {
  border-color: rgba(143, 152, 163, .78);
  background: #3a3e44;
}

.app.dark .empty-state {
  border-style: solid;
  background: #3f434a;
}

.app.dark .provider-column:before { opacity: 0; }

.app.dark .balance-card:before {
  content: none;
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.app.dark .balance-card > * { position: relative; z-index: 1; }

.app.dark .sidebar-nav button:hover,
.app.dark .support-card:hover,
.app.dark .user-card:hover,
.app.dark .dash-tabs button:hover,
.app.dark .mini-action:hover {
  background: rgba(63, 67, 74, .96);
  border-color: rgba(94, 187, 217, .62);
}

.app.dark .sidebar-nav button.active,
.app.dark .dash-tabs button.active {
  color: #72cff0;
  border-color: rgba(158, 212, 238, .64);
  background: rgba(63, 67, 74, .96);
  box-shadow: inset 0 -2px 0 rgba(217, 91, 200, .46), 0 8px 18px rgba(0, 0, 0, .16);
}

.app.dark .credit-chip,
.app.dark .status-row span,
.app.dark .route-ribbon span,
.app.dark .endpoint-strip button,
.app.dark .ghost-square,
.app.dark .btn-secondary,
.app.dark .auth-tabs button,
.app.dark .support-card,
.app.dark .user-card {
  border-color: rgba(143, 152, 163, .82);
  background: rgba(48, 51, 56, .86);
  color: var(--muted);
}

.app.dark input,
.app.dark select,
.app.dark textarea {
  border-color: rgba(143, 152, 163, .82);
  background: #34373d;
  color: var(--text);
}

.app.dark .btn-google {
  border-color: rgba(143, 152, 163, .82);
  background: rgba(63, 67, 74, .96);
  color: var(--text);
}

.app.dark input::placeholder { color: #aeb7c2; }

.app.dark input:focus,
.app.dark select:focus,
.app.dark button:focus-visible,
.app.dark a:focus-visible {
  outline-color: rgba(88, 189, 243, .34);
  border-color: rgba(88, 189, 243, .8);
}

.app.dark .chat-window {
  background: #3a3e44;
  border-color: rgba(143, 152, 163, .82);
}

.app.dark .msg {
  background: rgba(48, 51, 56, .96);
  border-color: rgba(143, 152, 163, .78);
  color: var(--text);
}

.app.dark .msg.user {
  background: rgba(64, 72, 78, .96);
  border-color: rgba(88, 189, 243, .38);
}

.app.dark .provider-state {
  border-color: rgba(143, 152, 163, .78);
  background: rgba(48, 51, 56, .86);
}

.app.dark .provider-state.online {
  border-color: rgba(50, 227, 154, .32);
  background: rgba(50, 227, 154, .09);
}

.app.dark .provider-state.offline,
.app.dark .notice.error {
  border-color: rgba(255, 107, 138, .42);
  background: rgba(255, 107, 138, .1);
  color: #ff9bae;
}

.app.dark .notice {
  border-color: rgba(88, 189, 243, .36);
  background: rgba(64, 72, 78, .94);
}

.app.dark .clean-table th,
.app.dark .data-table th,
.app.dark .clean-table td,
.app.dark .data-table td {
  border-bottom-color: rgba(127, 142, 170, .18);
}

.app.dark .data-table tbody tr:hover {
  background: rgba(64, 72, 78, .58);
}

.app.dark .data-table code,
.app.dark .mono,
.app.dark .empty-code {
  background: rgba(88, 189, 243, .12);
  color: #72cff0;
}

.app.dark .donut:after { background: #303338; border-color: rgba(143, 152, 163, .78); }
.app.dark .meter,
.app.dark .limit-meter { background: #3a3e44; border-color: rgba(143, 152, 163, .78); }
.app.dark .model-line:hover,
.app.dark .platform-card:hover,
.app.dark .mini-stat:hover {
  border-color: rgba(88, 189, 243, .62);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .24);
}

@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes floatPanel { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes routeFlow { from { background-position: 0 0; } to { background-position: 180% 0; } }
@keyframes meterIn { from { width: 0; } }
@keyframes consoleLift { from { opacity: .75; transform: translateY(18px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes menuOpen { from { opacity: 0; transform: translateY(-8px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes spinIn { from { transform: rotate(-18deg) scale(.94); opacity: .45; } to { transform: none; opacity: 1; } }
@keyframes traceLine { to { stroke-dashoffset: 0; } }
@keyframes statusPulse { 0% { box-shadow: 0 0 0 0 rgba(40, 209, 124, .34); } 70% { box-shadow: 0 0 0 8px rgba(40, 209, 124, 0); } 100% { box-shadow: 0 0 0 0 rgba(40, 209, 124, 0); } }
@keyframes messageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes cardRise { from { opacity: .78; transform: translateY(8px); filter: saturate(.9); } to { opacity: 1; transform: none; filter: none; } }
@keyframes heroSettle { from { opacity: .84; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1240px) {
  .hero-panel, .overview-layout, .chat-layout, .two-column-models, .admin-control-grid { grid-template-columns: 1fr; }
  .dash-shell { display: block; }
  .sidebar-brand .logo b, .sidebar-brand .logo small, .sidebar-nav button span, .support-card span, .user-card > span:not(.avatar-btn) { display: none; }
  .sidebar-nav button, .support-card, .user-card { justify-content: center; padding: 0; }
  .model-strip { grid-template-columns: repeat(3, 1fr); }
  .side-column { grid-template-columns: 1fr 1fr; }
  .dash-tools { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .landing-shell, .dash-page { width: calc(100% - 24px); margin-left: 12px; margin-right: 12px; }
  .dash-shell { display: block; }
  .dash-main { border-left: 0; }
  .dash-sidebar { position: relative; height: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .sidebar-brand .logo b, .sidebar-brand .logo small, .sidebar-nav button span { display: block; }
  .sidebar-nav { display: flex; gap: 8px; padding: 0; overflow-x: auto; }
  .sidebar-nav button { width: auto; min-width: max-content; justify-content: flex-start; padding: 0 12px; }
  .sidebar-foot { display: none; }
  .dash-topbar { position: sticky; min-height: 60px; padding: 10px 12px; align-items: stretch; flex-wrap: wrap; }
  .dash-tabs { order: 3; width: 100%; }
  .site-header, .dash-hero, .action-bar, .wallet-card, .invoice-card { align-items: stretch; flex-direction: column; }
  .dash-telemetry { justify-items: stretch; min-width: 0; }
  .route-ribbon, .status-row { justify-content: flex-start; }
  .main-nav { display: none; }
  .header-actions, .dash-tools, .status-row { flex-wrap: wrap; }
  .hero-panel { min-height: 0; }
  .hero-copy h1 { font-size: 44px; }
  .hero-copy p { font-size: 16px; }
  .route-map { grid-template-columns: 1fr; gap: 12px; padding: 24px; }
  .route-line { height: 28px; width: 2px; margin: auto; }
  .model-strip, .feature-grid, .stat-stack, .usage-stats, .usage-grid, .platform-grid, .side-column, .profile-metrics, .profile-form, .provider-visual, .provider-summary, .model-line, .model-line-meta, .split-metric, .perf-grid, .key-policy-grid, .policy-preview, .admin-stat-grid, .admin-adjust-form, .admin-key-chip { grid-template-columns: 1fr; }
  .provider-visual img { width: 112px; height: 112px; }
  .provider-visual h2 { font-size: 34px; }
  .donut-layout { grid-template-columns: 1fr; }
  .amount-grid { grid-template-columns: repeat(3, 1fr); }
  .big-money, .token-total { font-size: 42px; }
  .chat-form { grid-template-columns: 1fr; }
  .filter-row input, .filter-row select { width: 100%; min-width: 0; }
  .credit-chip { display: none; }
  .binding-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .auth-screen { padding: 18px; }
  .auth-header { align-items: flex-start; }
  .auth-card { padding: 22px; }
  .auth-plans { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 38px; }
  .dash-page { padding-top: 28px; }
  .dash-hero h1 { font-size: 30px; }
  .model-strip { grid-template-columns: 1fr; }
  .terminal-line { margin: 0 18px 22px; font-size: 12px; }
}

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

/* Kimi K3 console redesign: dense grey operations UI */
:root {
  --clip: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.app,
.app.dark {
  --bg: #171717;
  --page: #1c1c1c;
  --card: #242424;
  --card2: #1a1a1a;
  --line: #343434;
  --line-strong: #55504a;
  --line2: #6b6256;
  --text: #f1f1ef;
  --muted: #aaa7a1;
  --soft: #79766f;
  --cyan: #e8a33d;
  --cyan2: #f3bd62;
  --violet: #b9b4aa;
  --pink: #d4655a;
  --green: #7ac98f;
  --gold: #e8a33d;
  --danger: #d4655a;
  --shadow: 0 22px 60px rgba(0, 0, 0, .34);
  --shadow-low: 0 12px 30px rgba(0, 0, 0, .22);
  --grad: linear-gradient(90deg, #e8a33d, #7ac98f);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 340px),
    radial-gradient(circle at 50% 0, rgba(232, 163, 61, .10), transparent 340px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 78px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 78px),
    var(--bg);
  background-size: auto;
}

body { background: #171717; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #161616; }
::-webkit-scrollbar-thumb {
  border: 2px solid #161616;
  border-radius: 999px;
  background: #4a4640;
}
::-webkit-scrollbar-thumb:hover { background: #6a5b41; }

.dash-tabs::-webkit-scrollbar,
.chat-window::-webkit-scrollbar,
.table-shell::-webkit-scrollbar {
  height: 8px;
}

.page-enter { animation: kimiPageIn .34s cubic-bezier(.2, .8, .2, 1) both; }

.tech-label,
.panel-title span,
.panel-title b {
  color: var(--gold);
  letter-spacing: .08em;
}

.panel-title {
  min-height: 26px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  padding-bottom: 10px;
}

.panel-title b { color: var(--soft); }

.logo {
  align-items: center;
  gap: 11px;
}

.logo-mark {
  border: 1px solid rgba(232, 163, 61, .55);
  background: linear-gradient(180deg, #2c2a26, #171717);
  color: #ffd58a;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 0 0 3px rgba(232, 163, 61, .06);
}

.logo b { color: var(--text); letter-spacing: .02em; }
.logo small { color: var(--soft); }

.btn,
.ghost-square,
.mini-action,
input,
select,
textarea {
  border-radius: 6px;
}

input,
select,
textarea,
.auth-card input,
.auth-card select,
.profile-form input,
.profile-form select,
.amount-card input,
.filter-row input,
.filter-row select {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #151515;
  color: var(--text);
  box-shadow: inset 0 1px rgba(255, 255, 255, .035);
  outline: none;
  transition: border-color .12s linear, background .12s linear, box-shadow .12s linear;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(232, 163, 61, .72);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 0 0 3px rgba(232, 163, 61, .12);
}

.btn {
  border-color: #3a3a3a;
  background: #242424;
  color: var(--text);
  box-shadow: inset 0 1px rgba(255, 255, 255, .045);
  transition: transform .12s linear, border-color .12s linear, background .12s linear, box-shadow .12s linear;
}

.btn:hover,
.ghost-square:hover,
.dash-tabs button:hover,
.mini-action:hover {
  transform: translateY(-1px);
  border-color: #5a5247;
  background: #2a2825;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
}

.btn-primary {
  color: #15110a;
  border-color: #e8a33d;
  background: linear-gradient(90deg, #e8a33d, #f0c36e);
  font-weight: 900;
}

.btn-primary:hover { background: linear-gradient(90deg, #f0b653, #f6d186); }
.btn-primary:after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent); }

.btn-secondary,
.ghost-square,
.mini-action {
  background: #202020;
  border-color: #383838;
  color: var(--text);
}

.ghost-square {
  min-width: 42px;
  height: 42px;
  font-weight: 900;
}

.landing-shell {
  width: min(1500px, calc(100% - 56px));
  padding-bottom: 54px;
}

.site-header {
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
}

.main-nav a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.main-nav a:hover { color: var(--gold); }

.hero-panel {
  min-height: clamp(560px, 74vh, 780px);
  grid-template-columns: minmax(360px, .78fr) minmax(520px, 1.22fr);
  gap: 26px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  max-width: 780px;
  color: #f8f6ef;
  font-size: clamp(46px, 6vw, 92px);
  line-height: .92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 610px;
  color: #c8c4ba;
}

.mini-badges span,
.model-badge,
.feature-card,
.router-preview,
.node-card,
.model-stack span {
  border-color: #363636;
  background: rgba(35, 35, 35, .78);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.mini-badges span {
  border: 1px solid #343434;
  border-radius: 999px;
  padding: 7px 11px;
  color: #c9c5bc;
}

.router-preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.router-preview:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(232, 163, 61, .10), transparent 32%, rgba(122, 201, 143, .08)),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(255, 255, 255, .025) 9px 10px);
  mix-blend-mode: screen;
}

.window-bar {
  min-height: 44px;
  border-bottom-color: #343434;
  background: #1b1b1b;
}

.window-bar code,
.terminal-line,
pre,
code,
.data-table code {
  color: #d8d2c5;
}

.window-bar b,
.provider-state.online,
.state-pill.active {
  color: #9ee2ad;
}

.router-art img {
  filter: saturate(.78) contrast(1.08) brightness(.82);
}

.route-line {
  background: linear-gradient(90deg, transparent, #e8a33d, #7ac98f, transparent);
  background-size: 220% 100%;
  animation: kimiRoute 2.8s linear infinite;
}

.terminal-line {
  border-color: #343434;
  background: #151515;
}

.model-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 26px;
}

.model-badge {
  min-height: 52px;
  border-radius: 6px;
}

.model-badge b { color: var(--green); }

.provider-icon {
  border-color: rgba(232, 163, 61, .55);
  background: #171717;
  color: #ffd58a;
}

.provider-icon.claude {
  border-color: rgba(122, 201, 143, .55);
  color: #a8e7b6;
}

.feature-grid {
  gap: 14px;
  margin-top: 18px;
}

.feature-card {
  border-radius: 8px;
  padding: 22px;
}

.feature-card span { color: var(--gold); }

.auth-screen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 300px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 72px),
    #171717;
}

.auth-card {
  width: min(520px, 100%);
  border-radius: 8px;
  border-color: #3a3a3a;
  background: rgba(34, 34, 34, .92);
  box-shadow: var(--shadow);
}

.auth-tabs button {
  border-radius: 6px;
  background: #191919;
  color: var(--muted);
}

.auth-tabs button.active {
  color: #15110a;
  background: linear-gradient(90deg, #e8a33d, #f0c36e);
}

.btn-google {
  border-color: #47433d;
  background: #191919;
}

.google-mark {
  background: #f2f0ea;
  color: #171717;
}

.auth-plans div {
  border-radius: 8px;
  border-color: #343434;
  background: #1c1c1c;
}

.dash-shell,
.app.dark .dash-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 260px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 74px),
    #171717;
}

.dash-main,
.app.dark .dash-main {
  background: transparent;
}

.dash-topbar,
.app.dark .dash-topbar {
  min-height: 66px;
  border-bottom: 1px solid #303030;
  background: rgba(23, 23, 23, .92);
  backdrop-filter: blur(18px);
}

.dash-tabs {
  gap: 6px;
}

.dash-tabs button {
  height: 36px;
  border-radius: 6px;
  color: #96928a;
  font-family: var(--mono);
  font-size: 11px;
}

.dash-tabs button small {
  color: #6e6a62;
}

.dash-tabs button.active,
.app.dark .dash-tabs button.active {
  color: #ffd58a;
  border-color: rgba(232, 163, 61, .42);
  background: rgba(232, 163, 61, .12);
  box-shadow: inset 0 -1px rgba(232, 163, 61, .35);
}

.credit-chip {
  border: 1px solid rgba(232, 163, 61, .32);
  background: #1b1710;
  color: #ffd58a;
}

.dash-page {
  width: min(1560px, calc(100% - 48px));
  padding-top: 28px;
}

.dash-hero,
.app.dark .dash-hero {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  border: 1px solid #343434;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(232, 163, 61, .10), transparent 36%, rgba(122, 201, 143, .07)),
    #202020;
  box-shadow: var(--shadow-low);
}

.dash-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 10px);
}

.dash-hero > * {
  position: relative;
  z-index: 1;
}

.dash-hero h1 {
  color: #f7f4ed;
  font-size: clamp(28px, 3vw, 42px);
}

.dash-hero p {
  max-width: 720px;
  color: #bdb8ad;
}

.status-row span,
.route-ribbon span {
  border: 1px solid #343434;
  border-radius: 999px;
  background: rgba(20, 20, 20, .72);
  color: #d3cec3;
}

.status-row span b {
  background: var(--green);
  animation: statusPulse 1.8s ease infinite;
}

.route-ribbon span b { color: var(--gold); }

.balance-card,
.dash-card,
.mini-stat,
.action-bar,
.key-create-panel,
.table-shell,
.segmented,
.provider-column,
.app.dark .balance-card,
.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .action-bar,
.app.dark .key-create-panel,
.app.dark .table-shell,
.app.dark .segmented,
.app.dark .provider-column {
  border: 1px solid #343434;
  border-radius: 8px;
  background: rgba(34, 34, 34, .86);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.balance-card:hover,
.dash-card:hover,
.mini-stat:hover,
.model-line:hover,
.platform-card:hover,
.data-table tbody tr:hover {
  border-color: #5a5247;
  background-color: rgba(40, 38, 34, .92);
}

.dash-card,
.balance-card {
  animation: kimiPanelIn .28s ease both;
}

.big-money,
.token-total,
.wallet-card strong,
.invoice-card strong,
.admin-balance {
  color: #ffd58a;
  text-shadow: 0 0 20px rgba(232, 163, 61, .10);
}

.meter,
.limit-meter {
  height: 7px;
  border: 1px solid #343434;
  border-radius: 999px;
  background: #151515;
}

.meter i,
.limit-meter i {
  border-radius: 999px;
  background: linear-gradient(90deg, #e8a33d, #7ac98f);
  animation: meterIn .55s ease both;
}

.mini-stat {
  min-height: 128px;
}

.mini-stat strong {
  color: #f2efe7;
}

.mini-stat small {
  border-color: #3a3a3a;
  background: #171717;
  color: var(--gold);
}

.platform-card,
.split-metric span,
.perf-grid span,
.profile-metrics span,
.endpoint-strip button,
.route-ribbon span,
.policy-preview span,
.model-line,
.model-line-meta span,
.provider-summary span,
.amount-grid button,
.binding-row,
.empty-state,
.data-table code,
.mono {
  border-radius: 6px;
  border-color: #343434;
  background: #1b1b1b;
}

.model-line,
.app.dark .model-line {
  grid-template-columns: minmax(0, 1fr) minmax(250px, .82fr);
  border-color: #343434;
  background: rgba(28, 28, 28, .9);
}

.model-line:hover,
.app.dark .model-line:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 163, 61, .55);
  box-shadow: inset 3px 0 #e8a33d;
}

.model-line-main strong {
  color: #f3efe6;
}

.model-line-main small,
.model-line code {
  color: #8f8a80;
}

.model-line-meta span,
.app.dark .model-line-meta span {
  background: #171717;
  border-color: #343434;
}

.provider-column {
  overflow: hidden;
}

.provider-column:has(.provider-icon.claude) {
  border-color: rgba(122, 201, 143, .28);
}

.provider-column:has(.provider-icon.codex) {
  border-color: rgba(232, 163, 61, .28);
}

.chat-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
}

.chat-window,
.app.dark .chat-window {
  min-height: 430px;
  border-color: #343434;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .018), transparent),
    #151515;
}

.msg {
  max-width: 86%;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #202020;
  color: #dedad0;
  animation: messageIn .18s linear both;
}

.msg.user {
  margin-left: auto;
  border-color: rgba(232, 163, 61, .46);
  background: #2a2419;
  color: #ffe0a1;
}

.msg.assistant {
  border-color: rgba(122, 201, 143, .36);
  background: #1c241e;
}

.msg.router {
  color: #aaa7a1;
  background: #191919;
}

.chat-form {
  grid-template-columns: minmax(160px, 230px) minmax(170px, 220px) minmax(220px, 1fr) auto;
}

pre {
  border: 1px solid #343434;
  border-radius: 8px;
  background: #151515;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  height: 38px;
  border-bottom: 1px solid #343434;
  background: #1a1a1a;
  color: #8f8a80;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.data-table td {
  height: 52px;
  border-bottom-color: #303030;
}

.data-table tbody tr {
  animation: rowIn .18s linear both;
}

.state-pill,
.group-pill,
.provider-state {
  border-radius: 999px;
  border-color: #3b3b3b;
  background: #191919;
}

.state-pill.inactive,
.provider-state.offline {
  color: #c67870;
}

.admin-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-toolbar,
.admin-control-grid {
  gap: 14px;
}

.admin-adjust-form {
  grid-template-columns: minmax(230px, 1fr) minmax(145px, .55fr) minmax(145px, .55fr) minmax(220px, .9fr);
}

.admin-adjust-form .quick-grants,
.admin-adjust-form > .btn {
  grid-column: 1 / -1;
}

.quick-grants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-hint {
  margin: -6px 0 14px;
  color: var(--soft, #9aa0a6);
  font-size: 12px;
  line-height: 1.5;
}

.admin-system-prompts {
  margin-top: 16px;
}

.system-prompt-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.system-prompt-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--soft, #9aa0a6);
  letter-spacing: .04em;
}

.system-prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.system-prompt-row label { flex: 1 1 220px; }

.system-prompt-row .check-toggle {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.system-prompt-row .check-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #e8a33d;
}

.system-prompt-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.system-prompt-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-event,
.app.dark .admin-event,
.admin-key-chip,
.app.dark .admin-key-chip {
  border-radius: 6px;
  border-color: #343434;
  background: #191919;
}

.admin-key-chip.active {
  border-color: rgba(122, 201, 143, .38);
}

.admin-table td:first-child strong {
  color: #f0ede5;
}

.usage-stats,
.admin-stat-grid,
.stat-stack {
  gap: 10px;
}

.notice {
  border-radius: 8px;
  border: 1px solid rgba(232, 163, 61, .35);
  background: #241d12;
  color: #ffd58a;
}

.notice.error {
  border-color: rgba(212, 101, 90, .45);
  background: #261817;
  color: #ffaaa2;
}

.amount-grid button {
  min-height: 44px;
}

.amount-grid button.active,
.segmented button.active,
.endpoint-strip button.active {
  color: #15110a;
  border-color: #e8a33d;
  background: linear-gradient(90deg, #e8a33d, #f0c36e);
}

.profile-avatar,
.avatar-btn {
  border-color: rgba(232, 163, 61, .45);
  background: #1c1710;
  color: #ffd58a;
}

@keyframes kimiPageIn {
  from { opacity: 0; transform: translateY(8px); filter: saturate(.92); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes kimiPanelIn {
  from { opacity: .72; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

@keyframes kimiRoute {
  from { background-position: 0 0; }
  to { background-position: 220% 0; }
}

@media (max-width: 1240px) {
  .hero-panel,
  .chat-layout,
  .admin-control-grid {
    grid-template-columns: 1fr;
  }

  .model-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .landing-shell,
  .dash-page {
    width: calc(100% - 24px);
  }

  .hero-panel {
    gap: 20px;
    padding-top: 26px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .dash-topbar {
    gap: 10px;
  }

  .dash-tabs {
    padding-bottom: 4px;
  }

  .dash-hero {
    min-height: 0;
    padding: 20px;
  }

  .chat-form,
  .admin-adjust-form,
  .model-line,
  .model-line-meta,
  .admin-key-chip {
    grid-template-columns: 1fr;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .hero-actions,
  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .btn,
  .header-actions .btn,
  .header-actions .ghost-square {
    width: 100%;
  }

  .dash-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .dash-tools .ghost-square,
  .dash-tools .avatar-btn {
    width: 100%;
  }
}

.two-column-models {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-matrix {
  grid-column: 1 / -1;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pricing-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 116px;
  padding: 16px;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #191919;
}

.pricing-cell small,
.pricing-cell em,
.pricing-cell b {
  font-family: var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pricing-cell small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.pricing-cell strong {
  color: #f6f1e6;
  font-size: 24px;
  line-height: 1.05;
}

.pricing-cell em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.pricing-cell b {
  color: var(--soft);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.pricing-cell.kimi {
  border-color: rgba(212, 101, 90, .42);
  background: linear-gradient(180deg, rgba(212, 101, 90, .08), transparent), #191919;
}

.provider-icon.kimi {
  border-color: rgba(212, 101, 90, .58);
  color: #ffaaa2;
}

.provider-column:has(.provider-icon.kimi) {
  border-color: rgba(212, 101, 90, .30);
}

.group-pill.kimi,
.model-badge.kimi {
  border-color: rgba(212, 101, 90, .38);
}

@media (max-width: 1240px) {
  .two-column-models,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* Kimi K3 polish pass: softer premium grey console */
.app,
.app.dark {
  --bg: #0e0f11;
  --page: #121316;
  --card: #181a1e;
  --card2: #101114;
  --line: rgba(255, 255, 255, .065);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #f5f3ee;
  --muted: #a4a19a;
  --soft: #75726b;
  --cyan: #f2b544;
  --cyan2: #ffd074;
  --gold: #f2b544;
  --green: #3ecf8e;
  --pink: #e5484d;
  --danger: #e5484d;
  --shadow: 0 18px 42px rgba(0, 0, 0, .34);
  --shadow-low: 0 8px 24px rgba(0, 0, 0, .24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 280px),
    linear-gradient(90deg, rgba(255, 255, 255, .026) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    #0e0f11;
  background-size: auto, 72px 72px, 72px 72px, auto;
}

.landing-shell {
  width: min(1480px, calc(100% - 48px));
}

.site-header,
.dash-topbar,
.app.dark .dash-topbar {
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(14, 15, 17, .84);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025);
  backdrop-filter: blur(16px);
}

.hero-panel {
  gap: 30px;
}

.hero-copy h1 {
  max-width: 840px;
  text-wrap: balance;
}

.hero-copy p,
.feature-card p,
.provider-visual p,
.pricing-copy {
  color: #b8b3aa;
}

.router-preview,
.auth-card,
.dash-hero,
.app.dark .dash-hero,
.balance-card,
.dash-card,
.mini-stat,
.action-bar,
.key-create-panel,
.table-shell,
.segmented,
.provider-column,
.feature-card,
.model-badge,
.model-stack span,
.node-card,
.app.dark .balance-card,
.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .action-bar,
.app.dark .key-create-panel,
.app.dark .table-shell,
.app.dark .segmented,
.app.dark .provider-column {
  border: 1px solid rgba(255, 255, 255, .065);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015)), rgba(22, 24, 27, .92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 10px 30px rgba(0, 0, 0, .26);
}

.dash-card:hover,
.balance-card:hover,
.mini-stat:hover,
.feature-card:hover,
.model-line:hover,
.platform-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, .12);
  background-color: rgba(28, 31, 35, .94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .045) inset, 0 14px 38px rgba(0, 0, 0, .34);
}

.dash-tabs button {
  border: 1px solid transparent;
  color: #8e8b84;
  background: transparent;
}

.dash-tabs button:hover {
  color: #ded9cf;
  border-color: rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .035);
}

.dash-tabs button.active,
.app.dark .dash-tabs button.active {
  color: #f8e2b0;
  border-color: rgba(242, 181, 68, .36);
  background: rgba(242, 181, 68, .10);
  box-shadow: 0 0 0 1px rgba(242, 181, 68, .05) inset;
}

.btn,
.ghost-square,
.mini-action,
.btn-secondary {
  border-color: rgba(255, 255, 255, .08);
  background: #1e2126;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset;
}

.btn:hover,
.ghost-square:hover,
.mini-action:hover {
  border-color: rgba(255, 255, 255, .15);
  background: #262a30;
}

.btn-primary,
.amount-grid button.active,
.segmented button.active,
.endpoint-strip button.active {
  color: #12100b;
  border-color: #f2b544;
  background: linear-gradient(180deg, #ffd074, #f2b544);
}

.dash-hero,
.app.dark .dash-hero {
  background:
    linear-gradient(90deg, rgba(242, 181, 68, .10), rgba(255, 255, 255, .025) 38%, rgba(62, 207, 142, .07)),
    rgba(22, 24, 27, .94);
}

.status-row span,
.route-ribbon span,
.state-pill,
.group-pill,
.provider-state,
.mini-badges span {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .045);
}

.state-pill.active,
.provider-state.online {
  border-color: rgba(62, 207, 142, .24);
  background: rgba(62, 207, 142, .10);
  color: #9ee8bd;
}

.state-pill.inactive,
.provider-state.offline {
  border-color: rgba(242, 181, 68, .22);
  background: rgba(242, 181, 68, .08);
  color: #f3c66d;
}

.big-money,
.token-total,
.wallet-card strong,
.invoice-card strong {
  color: #f5f3ee;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-shadow: none;
}

.mini-stat strong,
.data-table td,
.model-line-main strong {
  color: #eeeae1;
}

.mini-stat small,
.panel-title span,
.tech-label {
  color: #f2b544;
}

.data-table th {
  border-bottom-color: rgba(255, 255, 255, .065);
  background: rgba(16, 17, 20, .94);
  color: #8b8880;
}

.data-table td {
  border-bottom-color: rgba(255, 255, 255, .045);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .028);
}

.model-line,
.app.dark .model-line,
.endpoint-strip button,
.platform-card,
.binding-row,
.admin-event,
.app.dark .admin-event,
.admin-key-chip,
.app.dark .admin-key-chip,
.pricing-cell {
  border-color: rgba(255, 255, 255, .065);
  background: rgba(255, 255, 255, .035);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025) inset;
}

.model-line {
  border-left: 2px solid transparent;
}

.model-line:has(.provider-icon.claude) { border-left-color: rgba(62, 207, 142, .74); }
.model-line:has(.provider-icon.codex) { border-left-color: rgba(242, 181, 68, .74); }
.model-line:has(.provider-icon.kimi) { border-left-color: rgba(229, 72, 77, .72); }

.pricing-copy {
  max-width: 780px;
  margin: -6px 0 14px;
  font-size: 14px;
}

.pricing-cell {
  min-height: 128px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .018));
}

.pricing-cell strong {
  font-size: clamp(22px, 2.1vw, 30px);
  color: #f8f4ea;
}

.pricing-cell.codex {
  border-color: rgba(242, 181, 68, .22);
}

.pricing-cell.claude {
  border-color: rgba(62, 207, 142, .20);
}

.pricing-cell.kimi {
  border-color: rgba(229, 72, 77, .24);
  background: linear-gradient(180deg, rgba(229, 72, 77, .07), rgba(255, 255, 255, .018));
}

.provider-visual {
  gap: 18px;
}

.provider-visual img {
  border-radius: 8px;
  opacity: .86;
  filter: grayscale(.18) saturate(.82) contrast(1.06);
}

.chat-window,
.app.dark .chat-window,
pre {
  background: #0f1012;
}

.msg {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025) inset;
}

.msg.user {
  border-color: rgba(242, 181, 68, .28);
  background: rgba(242, 181, 68, .08);
}

.msg.assistant {
  border-color: rgba(62, 207, 142, .22);
  background: rgba(62, 207, 142, .06);
}

.meter,
.limit-meter {
  border: 0;
  background: #24272c;
}

.meter i,
.limit-meter i {
  background: linear-gradient(90deg, #3ecf8e, #f2b544);
}

@media (max-width: 820px) {
  .dash-page {
    padding-top: 18px;
  }

  .dash-hero {
    padding: 16px;
  }

  .pricing-grid {
    gap: 8px;
  }

  .pricing-cell {
    min-height: 104px;
    padding: 14px;
  }

  .pricing-cell strong {
    font-size: 22px;
  }

  .data-table {
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  .model-badge {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    min-width: 0;
    height: auto;
    padding: 11px 12px;
  }

  .model-badge b {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: 0;
    font-size: 9px;
  }
}

/* v20: Kimi-guided premium grey pass */
:root {
  color-scheme: dark light;
}

.app.dark {
  --bg: #242424;
  --page: #272727;
  --card: #303032;
  --card2: #202021;
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #fffaf0;
  --muted: #cbc5ba;
  --soft: #a19a90;
  --cyan: #e7ad4b;
  --cyan2: #f4c66d;
  --gold: #e7ad4b;
  --green: #65d08d;
  --pink: #e36b63;
  --danger: #ff8a82;
  --shadow: 0 18px 46px rgba(0, 0, 0, .36);
  --shadow-low: 0 10px 28px rgba(0, 0, 0, .28);
  --grad: linear-gradient(180deg, #f2c76c, #df9f34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 280px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .022) 1px, transparent 1px),
    #242424;
  background-size: auto, 68px 68px, 68px 68px, auto;
}

.app.light {
  --bg: #d9d7d1;
  --page: #e6e3dc;
  --card: #f2efe8;
  --card2: #dedbd3;
  --line: rgba(43, 41, 37, .16);
  --line-strong: rgba(43, 41, 37, .28);
  --text: #171613;
  --muted: #5c5750;
  --soft: #7d776e;
  --cyan: #9a671f;
  --cyan2: #b17a2c;
  --gold: #9a671f;
  --green: #28784c;
  --pink: #a7433d;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(70, 66, 56, .18);
  --shadow-low: 0 10px 24px rgba(70, 66, 56, .12);
  --grad: linear-gradient(180deg, #c8913b, #a86b1f);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .52), rgba(255, 255, 255, 0) 300px),
    linear-gradient(90deg, rgba(48, 45, 39, .06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(48, 45, 39, .045) 1px, transparent 1px),
    #d9d7d1;
  background-size: auto, 68px 68px, 68px 68px, auto;
}

.app.dark .site-header,
.app.dark .dash-topbar {
  background: rgba(36, 36, 36, .92);
}

.app.light .site-header,
.app.light .dash-topbar {
  background: rgba(235, 232, 224, .88);
  border-color: rgba(43, 41, 37, .14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .52) inset, var(--shadow-low);
}

.site-header,
.dash-topbar,
.router-preview,
.auth-card,
.dash-hero,
.balance-card,
.dash-card,
.mini-stat,
.action-bar,
.key-create-panel,
.table-shell,
.segmented,
.provider-column,
.feature-card,
.model-badge,
.model-stack span,
.node-card {
  border-radius: 8px;
}

.app.dark .router-preview,
.app.dark .auth-card,
.app.dark .dash-hero,
.app.dark .balance-card,
.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .action-bar,
.app.dark .key-create-panel,
.app.dark .table-shell,
.app.dark .segmented,
.app.dark .provider-column,
.app.dark .feature-card,
.app.dark .model-badge,
.app.dark .model-stack span,
.app.dark .node-card {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .018)), var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, var(--shadow-low);
}

.app.light .router-preview,
.app.light .auth-card,
.app.light .dash-hero,
.app.light .balance-card,
.app.light .dash-card,
.app.light .mini-stat,
.app.light .action-bar,
.app.light .key-create-panel,
.app.light .table-shell,
.app.light .segmented,
.app.light .provider-column,
.app.light .feature-card,
.app.light .model-badge,
.app.light .model-stack span,
.app.light .node-card {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .24)), var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .72) inset, var(--shadow-low);
}

.hero-copy h1,
.dash-hero h1,
.auth-card h1,
.provider-visual h2 {
  color: var(--text);
}

.hero-copy p,
.dash-hero p,
.feature-card p,
.provider-visual p,
.pricing-copy,
.key-menu-copy,
.empty-state p {
  color: var(--muted);
}

.logo-mark,
.provider-icon {
  border: 1px solid rgba(231, 173, 75, .42);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), #171615;
  color: #f6c66d;
  box-shadow: 0 0 0 3px rgba(231, 173, 75, .07);
}

.app.light .logo-mark,
.app.light .provider-icon {
  background: #211d17;
  color: #ffd684;
}

.btn,
.ghost-square,
.mini-action,
.btn-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
}

.app.light .btn,
.app.light .ghost-square,
.app.light .mini-action,
.app.light .btn-secondary {
  background: rgba(255, 255, 255, .42);
}

.btn-primary,
.amount-grid button.active,
.segmented button.active,
.endpoint-strip button.active,
.auth-tabs button.active {
  color: #17130d;
  border-color: rgba(223, 159, 52, .92);
  background: var(--grad);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 10px 24px rgba(156, 103, 31, .24);
}

.btn:hover,
.ghost-square:hover,
.mini-action:hover,
.dash-tabs button:hover,
.model-badge:hover,
.dash-card:hover,
.balance-card:hover,
.mini-stat:hover,
.feature-card:hover,
.platform-card:hover,
.model-line:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-low);
}

:is(.btn, .ghost-square, .mini-action, .dash-tabs button, .main-nav a, .avatar-btn, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.hero-panel {
  min-height: clamp(540px, 70vh, 760px);
}

.router-preview {
  isolation: isolate;
}

.router-preview:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 36%, rgba(255, 255, 255, .11) 44%, transparent 52%);
  transform: translateX(-120%);
  animation: sheenPass 7s ease-in-out infinite;
  z-index: 3;
}

.route-map {
  grid-template-columns: minmax(150px, 1fr) 46px minmax(150px, 1fr) 46px minmax(180px, 1.14fr);
}

.terminal-line {
  color: #d8d1c4;
}

.model-badge,
.platform-card {
  position: relative;
  overflow: hidden;
}

.model-badge:before,
.pricing-cell:before,
.platform-card:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold);
  opacity: .85;
}

.model-badge.claude:before,
.pricing-cell.claude:before,
.platform-card.claude:before {
  background: var(--green);
}

.model-badge.kimi:before,
.pricing-cell.kimi:before,
.platform-card.kimi:before {
  background: var(--pink);
}

.model-badge b,
.state-pill.active,
.provider-state.online {
  color: var(--green);
}

.provider-icon.claude {
  border-color: rgba(101, 208, 141, .5);
  color: #a8e9b9;
}

.provider-icon.kimi {
  border-color: rgba(227, 107, 99, .56);
  color: #ffaaa2;
}

.provider-visual img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
}

.pricing-grid {
  gap: 12px;
}

.pricing-cell {
  position: relative;
  overflow: hidden;
  padding-left: 18px;
}

.pricing-cell strong,
.big-money,
.token-total,
.data-table td,
.platform-card b,
.split-metric b,
.perf-grid b,
.credit-chip {
  font-variant-numeric: tabular-nums;
}

.chat-window,
.app.dark .chat-window,
pre {
  border: 1px solid var(--line);
  background: var(--card2);
}

.msg {
  border-color: var(--line);
  color: var(--text);
}

.msg.user {
  border-color: rgba(231, 173, 75, .36);
  background: rgba(231, 173, 75, .10);
}

.msg.assistant {
  border-color: rgba(101, 208, 141, .28);
  background: rgba(101, 208, 141, .08);
}

.msg.router {
  color: var(--muted);
}

.data-table th {
  color: var(--soft);
}

.data-table td,
.model-line-main strong,
.mini-stat strong {
  color: var(--text);
}

.empty-state {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .04);
}

.app.light .empty-state {
  background: rgba(255, 255, 255, .38);
}

input,
select,
textarea {
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  border-color: var(--line);
}

.app.light input,
.app.light select,
.app.light textarea {
  background: rgba(255, 255, 255, .52);
}

@keyframes sheenPass {
  0%, 62% { transform: translateX(-120%); opacity: 0; }
  70% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

@media (max-width: 820px) {
  .site-header {
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .main-nav {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main-nav a {
    display: grid;
    place-items: center;
    min-height: 36px;
    padding: 0 8px;
    border-color: var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, .035);
  }

  .header-actions {
    display: grid;
    grid-template-columns: 44px 44px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .header-actions .ghost-square,
  .header-actions .btn {
    width: auto;
    min-width: 0;
  }

  .hero-panel {
    min-height: 0;
    padding-top: 18px;
  }

  .router-console {
    margin: -38px 14px 16px;
  }

  .route-map {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px;
  }

  .route-line {
    width: 2px;
    height: 22px;
    margin: 0 auto;
  }

  .dash-topbar {
    padding: 10px 12px;
  }
}

@media (max-width: 520px) {
  .landing-shell {
    width: calc(100% - 24px);
    padding-top: 10px;
  }

  .site-header {
    top: 8px;
  }

  .site-header .logo {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 14vw, 48px);
    line-height: .96;
  }

  .hero-copy p {
    font-size: 15px;
    line-height: 1.62;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .model-strip {
    grid-template-columns: 1fr;
  }

  .dash-tools {
    grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
  }

  .dash-tools .credit-chip {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pricing-cell strong,
  .mini-stat strong {
    font-size: 21px;
  }
}

/* v21: restore fixed dark grey theme, polish UI elements only */
:root { color-scheme: dark; }
body { background: #121314; }

.app,
.app.dark,
.app.light {
  --bg: #121314;
  --page: #161718;
  --card: #1d1f21;
  --card2: #17191b;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f1eee7;
  --muted: #aaa49a;
  --soft: #7e776d;
  --cyan: #d8a445;
  --cyan2: #ecc15d;
  --gold: #d8a445;
  --green: #58c286;
  --pink: #d66b63;
  --danger: #ee756c;
  --shadow: 0 20px 50px rgba(0, 0, 0, .32);
  --shadow-low: 0 10px 26px rgba(0, 0, 0, .22);
  --grad: linear-gradient(180deg, #efc35f, #d59b33);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 260px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    #121314;
  background-size: auto, 68px 68px, 68px 68px, auto;
}

.app.light .site-header,
.app.light .dash-topbar,
.app.dark .site-header,
.app.dark .dash-topbar,
.site-header,
.dash-topbar {
  border-color: var(--line);
  background: rgba(18, 19, 20, .92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 32px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}

.dash-topbar {
  min-height: 62px;
  padding: 0 22px;
}

.dash-tabs {
  gap: 6px;
}

.dash-tabs button {
  height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.dash-tabs button small {
  color: var(--soft);
}

.dash-tabs button.active,
.app.dark .dash-tabs button.active,
.app.light .dash-tabs button.active {
  color: #f5d38a;
  border-color: rgba(216, 164, 69, .42);
  background: rgba(216, 164, 69, .12);
  box-shadow: inset 0 -1px rgba(216, 164, 69, .35);
}

.dash-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.credit-chip {
  height: 38px;
  border-color: rgba(216, 164, 69, .32);
  background: rgba(216, 164, 69, .12);
  color: #f4ce82;
}

.avatar-btn,
.profile-avatar {
  border-color: rgba(216, 164, 69, .42);
  background: #241c10;
  color: #f4ce82;
}

.site-header {
  min-height: 70px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav a {
  border-radius: 7px;
}

.router-preview,
.auth-card,
.dash-hero,
.balance-card,
.dash-card,
.mini-stat,
.action-bar,
.key-create-panel,
.table-shell,
.segmented,
.provider-column,
.feature-card,
.model-badge,
.model-stack span,
.node-card,
.pricing-cell,
.platform-card,
.binding-row,
.admin-event,
.admin-key-chip,
.empty-state,
.endpoint-strip button,
.amount-grid button,
.policy-preview span,
.split-metric span,
.perf-grid span,
.profile-metrics span {
  border-radius: 8px;
}

.app.light .router-preview,
.app.light .auth-card,
.app.light .dash-hero,
.app.light .balance-card,
.app.light .dash-card,
.app.light .mini-stat,
.app.light .action-bar,
.app.light .key-create-panel,
.app.light .table-shell,
.app.light .segmented,
.app.light .provider-column,
.app.light .feature-card,
.app.light .model-badge,
.app.light .model-stack span,
.app.light .node-card,
.app.dark .router-preview,
.app.dark .auth-card,
.app.dark .dash-hero,
.app.dark .balance-card,
.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .action-bar,
.app.dark .key-create-panel,
.app.dark .table-shell,
.app.dark .segmented,
.app.dark .provider-column,
.app.dark .feature-card,
.app.dark .model-badge,
.app.dark .model-stack span,
.app.dark .node-card,
.router-preview,
.auth-card,
.dash-hero,
.balance-card,
.dash-card,
.mini-stat,
.action-bar,
.key-create-panel,
.table-shell,
.segmented,
.provider-column,
.feature-card,
.model-badge,
.model-stack span,
.node-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)), var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, var(--shadow-low);
}

.dash-hero,
.app.dark .dash-hero,
.app.light .dash-hero {
  min-height: 150px;
  padding: 22px 24px;
  background:
    linear-gradient(90deg, rgba(216, 164, 69, .09), rgba(255, 255, 255, .02) 42%, rgba(88, 194, 134, .055)),
    var(--card);
}

.dash-hero h1 {
  color: var(--text);
  font-size: clamp(30px, 3vw, 44px);
}

.dash-hero p,
.hero-copy p,
.feature-card p,
.provider-visual p,
.pricing-copy,
.key-menu-copy,
.empty-state p {
  color: var(--muted);
}

.panel-title {
  align-items: center;
  min-height: 28px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.panel-title span,
.tech-label {
  color: var(--gold);
}

.panel-title b {
  color: var(--soft);
}

.balance-card {
  min-height: 220px;
}

.big-money {
  color: #f0c66b;
  opacity: 1;
  text-shadow: 0 0 28px rgba(216, 164, 69, .12);
}

.token-total {
  color: #f1eee7;
  opacity: 1;
}

.balance-card small,
.balance-card em {
  color: var(--muted);
}

.meter,
.limit-meter {
  border: 0;
  background: #111214;
}

.meter i,
.limit-meter i {
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.mini-stat {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.mini-stat:before,
.platform-card:before,
.pricing-cell:before,
.model-badge:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold);
  opacity: .9;
}

.mini-stat.pink:before,
.platform-card.kimi:before,
.pricing-cell.kimi:before,
.model-badge.kimi:before {
  background: var(--pink);
}

.mini-stat.cyan:before,
.platform-card.claude:before,
.pricing-cell.claude:before,
.model-badge.claude:before {
  background: var(--green);
}

.mini-stat small {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
}

.mini-stat strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1.05;
}

.platform-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.platform-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 18px 20px;
  border-color: var(--line);
  background: var(--card2);
}

.platform-card strong {
  color: var(--text);
}

.platform-card b {
  color: #f0c66b;
}

.platform-card span {
  color: var(--muted);
}

.platform-card em {
  color: var(--text);
}

.split-metric span,
.perf-grid span,
.profile-metrics span,
.provider-summary span,
.model-line-meta span,
.policy-preview span,
.endpoint-strip button,
.amount-grid button {
  border-color: var(--line);
  background: var(--card2);
}

.split-metric b,
.perf-grid b,
.profile-metrics b,
.provider-summary b,
.model-line-meta b {
  color: #f0c66b;
}

.btn,
.ghost-square,
.mini-action,
.btn-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  border-radius: 7px;
}

.btn-primary,
.amount-grid button.active,
.segmented button.active,
.endpoint-strip button.active,
.auth-tabs button.active {
  color: #16120b;
  border-color: rgba(216, 164, 69, .9);
  background: var(--grad);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .28) inset, 0 12px 28px rgba(116, 74, 18, .22);
}

.btn:hover,
.ghost-square:hover,
.mini-action:hover,
.dash-tabs button:hover,
.model-badge:hover,
.dash-card:hover,
.balance-card:hover,
.mini-stat:hover,
.feature-card:hover,
.platform-card:hover,
.model-line:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background-color: rgba(255, 255, 255, .065);
  box-shadow: var(--shadow-low);
}

input,
select,
textarea,
.app.light input,
.app.light select,
.app.light textarea,
.app.dark input,
.app.dark select,
.app.dark textarea {
  border-color: var(--line);
  background: #121315;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
:is(.btn, .ghost-square, .mini-action, .dash-tabs button, .main-nav a, .avatar-btn):focus-visible {
  outline: 2px solid rgba(216, 164, 69, .72);
  outline-offset: 2px;
  border-color: rgba(216, 164, 69, .72);
}

.table-shell {
  background: var(--card);
}

.data-table th {
  background: #161719;
  color: var(--soft);
  border-bottom-color: var(--line);
}

.data-table td {
  color: var(--muted);
  border-bottom-color: rgba(255, 255, 255, .055);
}

.data-table td:first-child,
.data-table td strong,
.model-line-main strong {
  color: var(--text);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .035);
}

.data-table code,
.mono,
.model-line code {
  background: rgba(216, 164, 69, .10);
  color: #f0c66b;
}

.model-line,
.pricing-cell,
.admin-event,
.admin-key-chip {
  border-color: var(--line);
  background: var(--card2);
}

.pricing-cell {
  position: relative;
  overflow: hidden;
  padding-left: 18px;
}

.pricing-cell strong {
  color: var(--text);
}

.chat-window,
.app.dark .chat-window,
.app.light .chat-window,
pre {
  border-color: var(--line);
  background: #111214;
}

.msg {
  border-color: var(--line);
  background: var(--card);
  color: var(--text);
}

.msg.user {
  border-color: rgba(216, 164, 69, .34);
  background: rgba(216, 164, 69, .10);
}

.msg.assistant {
  border-color: rgba(88, 194, 134, .28);
  background: rgba(88, 194, 134, .075);
}

.notice {
  border-color: rgba(216, 164, 69, .32);
  background: rgba(216, 164, 69, .10);
  color: #f4ce82;
}

.notice.error {
  border-color: rgba(214, 107, 99, .42);
  background: rgba(214, 107, 99, .12);
  color: #ffaaa2;
}

.empty-state {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .035);
}

.state-pill,
.group-pill,
.provider-state {
  border-color: var(--line);
  background: rgba(255, 255, 255, .045);
}

.state-pill.active,
.provider-state.online {
  border-color: rgba(88, 194, 134, .28);
  background: rgba(88, 194, 134, .10);
  color: #9be6b8;
}

.provider-icon {
  background: #171411;
  color: #f0c66b;
}

.provider-icon.claude {
  color: #9be6b8;
}

.provider-icon.kimi {
  color: #ffaaa2;
}

.hero-copy h1 {
  color: var(--text);
}

.router-art img,
.provider-visual img {
  filter: grayscale(.08) saturate(.9) contrast(1.04) brightness(.88);
}

@media (max-width: 1160px) {
  .platform-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .header-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    width: 100%;
  }

  .dash-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    width: 100%;
  }

  .dash-hero {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .dash-tools {
    grid-template-columns: minmax(0, 1fr) 42px 42px;
  }

  .credit-chip {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* v22: Models page cleanup, no internal multipliers in UI */
.models-page.two-column-models,
.two-column-models {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: start;
}

.pricing-matrix {
  grid-column: 1 / -1;
}

.pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.pricing-cell {
  min-height: 118px;
  gap: 7px;
}

.pricing-cell em {
  color: var(--muted);
}

.provider-column {
  min-height: 0;
  padding: 24px;
}

.provider-column:before {
  opacity: .04;
}

.provider-visual {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.provider-visual img {
  width: 108px;
  height: 108px;
  border-radius: 8px;
}

.provider-visual h2 {
  font-size: clamp(32px, 3vw, 42px);
}

.provider-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.provider-summary span,
.model-line-meta span {
  min-width: 0;
  border-color: var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
}

.provider-summary b,
.model-line-meta b {
  color: var(--text);
  overflow-wrap: anywhere;
}

.model-table-list {
  gap: 12px;
}

.model-line,
.app.dark .model-line,
.app.light .model-line {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  border-color: var(--line);
  background: rgba(255, 255, 255, .035);
  overflow: hidden;
}

.model-line-main {
  align-items: flex-start;
}

.model-line-main strong {
  font-size: 18px;
  line-height: 1.18;
}

.model-line-main small {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.model-line-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.model-line-meta span {
  min-height: 48px;
  padding: 9px 10px;
  border-radius: 7px;
  clip-path: none;
}

.model-line-meta b {
  display: block;
  margin-top: 4px;
  white-space: normal;
  line-height: 1.25;
}

.model-line code {
  justify-self: start;
  max-width: 100%;
  padding: 0;
  background: transparent;
  color: var(--soft);
}

.provider-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  clip-path: none;
}

@media (max-width: 820px) {
  .models-page.two-column-models,
  .two-column-models,
  .pricing-grid,
  .provider-summary,
  .model-line-meta {
    grid-template-columns: 1fr;
  }

  .provider-visual {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .provider-visual img {
    width: 86px;
    height: 86px;
  }
}

/* v23: reference dashboard recreation, dark navy */
:root {
  color-scheme: dark;
}

body {
  background: #030817;
}

.app,
.app.dark,
.app.light {
  --bg: #030817;
  --page: #061021;
  --card: #0a1426;
  --card2: #081224;
  --line: rgba(92, 132, 191, .18);
  --line-strong: rgba(108, 152, 218, .34);
  --line2: rgba(139, 92, 246, .38);
  --text: #eef5ff;
  --muted: #93a4bd;
  --soft: #64748b;
  --cyan: #38bdf8;
  --cyan2: #5b8cff;
  --violet: #8b5cf6;
  --pink: #d946ef;
  --green: #20e087;
  --gold: #f59e0b;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --shadow-low: 0 14px 42px rgba(0, 0, 0, .24);
  --grad: linear-gradient(135deg, #6d5cff 0%, #a855f7 56%, #38bdf8 100%);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(22, 41, 82, .46) 0, rgba(5, 11, 25, .1) 260px, rgba(3, 8, 23, 0) 100%),
    linear-gradient(90deg, rgba(99, 132, 199, .055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(99, 132, 199, .04) 1px, transparent 1px),
    #030817;
  background-size: auto, 64px 64px, 64px 64px, auto;
}

::-webkit-scrollbar-track { background: #050b18; }
::-webkit-scrollbar-thumb {
  border: 2px solid #050b18;
  border-radius: 999px;
  background: #1b3156;
}
::-webkit-scrollbar-thumb:hover { background: #284879; }

.dash-shell,
.app.dark .dash-shell,
.app.light .dash-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(16, 34, 71, .5), rgba(3, 8, 23, 0) 300px),
    linear-gradient(90deg, rgba(89, 130, 200, .045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(89, 130, 200, .035) 1px, transparent 1px),
    #030817;
  background-size: auto, 72px 72px, 72px 72px, auto;
}

.dash-shell .clipped,
.dash-shell .platform-card,
.dash-shell .split-metric span,
.dash-shell .perf-grid span,
.dash-shell .profile-metrics span,
.dash-shell .endpoint-strip button,
.dash-shell .route-ribbon span,
.dash-shell .policy-preview span,
.dash-shell .model-line,
.dash-shell .model-line-meta span,
.dash-shell .provider-summary span,
.dash-shell .amount-grid button,
.dash-shell .binding-row,
.dash-shell .empty-state,
.dash-shell .data-table code,
.dash-shell .mono {
  clip-path: none;
  border-radius: 8px;
}

.dash-main,
.app.dark .dash-main,
.app.light .dash-main {
  min-width: 0;
  overflow-x: hidden;
  background: transparent;
}

.dash-sidebar,
.app.dark .dash-sidebar,
.app.light .dash-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 224px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 20px 14px 24px;
  border-right: 1px solid rgba(86, 119, 178, .18);
  background: rgba(4, 10, 24, .86);
  box-shadow: 18px 0 44px rgba(0, 0, 0, .2);
  backdrop-filter: blur(22px);
}

.sidebar-brand {
  min-height: 34px;
  display: flex;
  align-items: center;
}

.logo {
  gap: 9px;
}

.logo-mark,
.dash-shell .logo-mark,
.dash-shell .provider-icon,
.dash-shell .state-pill,
.dash-shell .group-pill {
  clip-path: none;
}

.logo-mark {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(from 35deg, #38bdf8 0 32%, #8b5cf6 32% 72%, #ec4899 72% 100%);
  color: #f8fbff;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 0 22px rgba(139, 92, 246, .28);
}

.dash-shell .logo-mark {
  border-radius: 50%;
}

.logo b {
  display: block;
  color: #f7fbff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.logo small {
  display: none;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 7px;
  padding-top: 16px;
}

.sidebar-nav button,
.support-card,
.user-card {
  min-height: 36px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #93a4bd;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  box-shadow: none;
  transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.sidebar-nav button:hover,
.support-card:hover,
.user-card:hover {
  transform: translateY(-1px);
  border-color: rgba(90, 132, 205, .24);
  background: rgba(38, 58, 104, .36);
  box-shadow: none;
}

.sidebar-nav button.active,
.app.dark .sidebar-nav button.active,
.app.light .sidebar-nav button.active {
  color: #c084fc;
  border-color: rgba(139, 92, 246, .25);
  background: linear-gradient(90deg, rgba(92, 40, 177, .48), rgba(46, 28, 89, .52));
  box-shadow: inset 3px 0 0 #a855f7, 0 10px 26px rgba(64, 31, 150, .18);
}

.nav-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.85;
}

.sidebar-foot {
  display: grid;
  gap: 11px;
}

.support-card,
.user-card,
.app.dark .support-card,
.app.dark .user-card {
  min-height: 58px;
  padding: 11px 12px;
  border-color: rgba(83, 118, 181, .16);
  background: rgba(8, 17, 35, .68);
}

.user-card {
  min-height: 62px;
}

.user-card b,
.user-card small {
  display: block;
}

.user-card b {
  max-width: 118px;
  overflow: hidden;
  color: #e7f0ff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card small {
  color: #60728d;
  font-size: 11px;
}

.dash-topbar,
.app.dark .dash-topbar,
.app.light .dash-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 23px;
  border: 0;
  border-bottom: 1px solid rgba(84, 122, 186, .13);
  background: rgba(3, 8, 23, .72);
  box-shadow: none;
  backdrop-filter: blur(22px);
}

.dash-topbar-brand,
.dash-tabs,
.credit-chip {
  display: none !important;
}

.dash-top-title h1 {
  margin: 0;
  color: #f8fbff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.dash-top-title p {
  margin-top: 4px;
  color: #93a4bd;
  font-size: 12px;
}

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

.btn,
.ghost-square,
.mini-action,
.row-menu {
  border-radius: 6px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}

.btn {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(92, 132, 191, .2);
  background: rgba(10, 20, 38, .72);
  color: #e8f1ff;
  font-size: 12px;
  font-weight: 800;
}

.btn-primary,
.amount-grid button.active,
.segmented button.active,
.endpoint-strip button.active,
.auth-tabs button.active {
  border-color: rgba(139, 92, 246, .55);
  color: #fff;
  background: linear-gradient(135deg, #5b4dff, #9b35f5 62%, #d946ef);
  box-shadow: 0 10px 28px rgba(123, 76, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6b5cff, #a855f7 62%, #ec4899);
}

.ghost-square,
.nav-mode-indicator,
.avatar-btn,
.profile-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 1px solid rgba(82, 117, 177, .18);
  border-radius: 50%;
  background: rgba(9, 19, 38, .82);
  color: #c8d6ea;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.avatar-btn,
.profile-avatar {
  border-color: rgba(73, 101, 159, .2);
  background: rgba(15, 29, 56, .86);
}

.btn:hover,
.ghost-square:hover,
.mini-action:hover,
.row-menu:hover,
.model-badge:hover,
.dash-card:hover,
.balance-card:hover,
.mini-stat:hover,
.feature-card:hover,
.platform-card:hover,
.model-line:hover {
  transform: translateY(-1px);
  border-color: rgba(94, 148, 236, .36);
  background-color: rgba(19, 36, 69, .82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}

.dash-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 22px 24px;
  overflow-x: hidden;
}

.reference-overview {
  display: grid;
  gap: 15px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ref-stat-card {
  min-height: 106px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 16px;
  border: 1px solid rgba(88, 126, 190, .16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .012)),
    rgba(9, 19, 38, .82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
  animation: refCardIn .34s cubic-bezier(.16, 1, .3, 1) both;
}

.ref-stat-card:after,
.ref-panel:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.ref-stat-card span {
  display: block;
  color: #a5b4c9;
  font-size: 12px;
  font-weight: 600;
}

.ref-stat-card strong {
  display: block;
  margin-top: 9px;
  color: #edf5ff;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
}

.ref-stat-card small {
  display: block;
  margin-top: 8px;
  color: #8796ad;
  font-size: 11px;
}

.ref-stat-card small b {
  color: var(--green);
  font-weight: 800;
}

.sparkline {
  width: 76px;
  height: 48px;
  flex: 0 0 76px;
  overflow: visible;
}

.sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px currentColor);
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: refTrace .74s ease forwards;
}

.sparkline.violet { color: #a855f7; }
.sparkline.blue { color: #4f8cff; }
.sparkline.orange { color: #f97316; }
.sparkline.gold { color: #f59e0b; }

.reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.ref-panel {
  position: relative;
  overflow: hidden;
  min-height: 326px;
  padding: 17px 16px 16px;
  border: 1px solid rgba(88, 126, 190, .16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)),
    rgba(8, 18, 36, .84);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
  animation: refCardIn .34s cubic-bezier(.16, 1, .3, 1) both;
}

.usage-overview-panel,
.recent-activity-panel {
  min-height: 284px;
}

.ref-panel-head {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ref-panel-head h2 {
  margin: 0;
  color: #edf5ff;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.ref-panel-head p {
  margin-top: 6px;
  color: #93a4bd;
  font-size: 12px;
  line-height: 1.35;
}

.mini-action,
.row-menu {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(82, 117, 177, .16);
  background: rgba(6, 15, 31, .7);
  color: #c4d1e5;
  font-size: 11px;
  font-weight: 700;
}

.row-menu {
  min-width: 30px;
  padding: 0 8px;
  color: #6f80a0;
}

.ref-table-wrap {
  overflow-x: auto;
}

.ref-table,
.clean-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.ref-table th,
.ref-table td,
.clean-table th,
.clean-table td,
.data-table th,
.data-table td {
  height: 40px;
  padding: 9px 8px;
  border-bottom: 1px solid rgba(87, 119, 177, .12);
  color: #9fb0c7;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.ref-table th,
.clean-table th,
.data-table th {
  height: 34px;
  color: #64748b;
  background: transparent;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ref-table td:first-child,
.data-table td:first-child,
.clean-table td:first-child {
  color: #edf5ff;
}

.ref-table strong {
  display: block;
  color: #e9f2ff;
  font-size: 12px;
  font-weight: 700;
}

.ref-table small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.ref-table code,
.data-table code,
.mono,
.model-line code {
  border: 0;
  border-radius: 5px;
  background: rgba(59, 130, 246, .08);
  color: #b8c7de;
  font-family: var(--mono);
  font-size: 11px;
}

.state-pill,
.group-pill,
.provider-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(88, 126, 190, .16);
  border-radius: 6px;
  background: rgba(12, 25, 48, .72);
  color: #91a1bb;
  font-size: 10px;
  font-weight: 800;
}

.state-pill.active,
.provider-state.online {
  border-color: rgba(32, 224, 135, .18);
  background: rgba(18, 110, 75, .18);
  color: #20e087;
}

.state-pill.inactive,
.state-pill.expired,
.state-pill.limit-reached,
.provider-state.offline {
  border-color: rgba(251, 113, 133, .24);
  background: rgba(137, 38, 58, .14);
  color: #fb7185;
}

.ref-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 0 7px;
  color: #c084fc;
  font-size: 12px;
  font-weight: 800;
}

.ref-link.centered {
  width: 100%;
  justify-content: center;
  color: #5b8cff;
}

.model-list {
  display: grid;
}

.model-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(110px, auto);
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(87, 119, 177, .12);
}

.model-row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.provider-icon {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 27px;
  border: 1px solid rgba(79, 140, 255, .3);
  border-radius: 7px;
  background: rgba(31, 73, 154, .22);
  color: #65b7ff;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.provider-icon.claude {
  border-color: rgba(32, 224, 135, .3);
  background: rgba(18, 110, 75, .18);
  color: #47e6a1;
}

.provider-icon.kimi {
  border-color: rgba(217, 70, 239, .34);
  background: rgba(118, 39, 144, .2);
  color: #e879f9;
}

.model-row strong {
  display: block;
  overflow: hidden;
  color: #ecf4ff;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-row small {
  display: block;
  margin-top: 1px;
  color: #7b8ca8;
  font-size: 11px;
}

.model-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.model-tags span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(37, 72, 132, .28);
  color: #8fb6f2;
  font-size: 10px;
  font-weight: 700;
}

.model-row b {
  color: #c6d4e8;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 5px;
  color: #8796ad;
  font-size: 11px;
}

.chart-legend span {
  width: 13px;
  height: 3px;
  border-radius: 999px;
}

.chart-legend .req { background: #a855f7; }
.chart-legend .tok { background: #4f8cff; }

.line-chart {
  width: 100%;
  height: 214px;
}

.line-chart path {
  stroke: rgba(120, 148, 190, .12);
  stroke-width: 1;
}

.line-chart polyline {
  stroke-width: 3.2;
  filter: drop-shadow(0 0 8px currentColor);
}

.line-chart .req {
  stroke: #a855f7;
  color: #a855f7;
}

.line-chart .tok {
  stroke: #4f8cff;
  color: #4f8cff;
}

.line-chart text {
  fill: #73839b;
  font-family: var(--font);
  font-size: 10px;
}

.activity-list {
  display: grid;
}

.activity-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 34px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(87, 119, 177, .12);
}

.activity-row strong {
  color: #d946ef;
  font-size: 11px;
  font-weight: 900;
}

.activity-row span {
  color: #e9f2ff;
  font-size: 12px;
  font-weight: 750;
}

.activity-row small {
  display: block;
  margin-top: 3px;
  color: #7f8fa8;
  font-size: 11px;
}

.activity-row time {
  color: #8da0bc;
  font-size: 11px;
  text-align: right;
}

.activity-row b {
  color: #20e087;
  font-size: 11px;
  text-align: right;
}

.empty-state {
  min-height: 150px;
  border: 1px dashed rgba(92, 132, 191, .22);
  border-radius: 8px;
  background: rgba(9, 19, 38, .52);
  color: #95a8c2;
}

.dash-shell .empty-state,
.app.dark .empty-state,
.app.light .empty-state {
  border-color: rgba(92, 132, 191, .24);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .06), rgba(139, 92, 246, .035)),
    rgba(7, 17, 34, .72);
  box-shadow: none;
}

.empty-state h2 {
  color: #e8f1ff;
  font-size: 15px;
}

.empty-state p {
  color: #8497b1;
  font-size: 12px;
}

.empty-code {
  border-radius: 5px;
  background: rgba(79, 140, 255, .1);
  color: #76b7ff;
}

.balance-card,
.dash-card,
.mini-stat,
.action-bar,
.key-create-panel,
.table-shell,
.segmented,
.provider-column,
.pricing-cell,
.platform-card,
.admin-event,
.admin-key-chip,
.app.dark .balance-card,
.app.dark .dash-card,
.app.dark .mini-stat,
.app.dark .action-bar,
.app.dark .key-create-panel,
.app.dark .table-shell,
.app.dark .segmented,
.app.dark .provider-column {
  border: 1px solid rgba(88, 126, 190, .16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)),
    rgba(8, 18, 36, .84);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}

input,
select,
textarea,
.app.light input,
.app.light select,
.app.light textarea,
.app.dark input,
.app.dark select,
.app.dark textarea {
  min-height: 38px;
  border: 1px solid rgba(88, 126, 190, .2);
  border-radius: 6px;
  background: rgba(5, 12, 26, .88);
  color: #edf5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

input::placeholder,
textarea::placeholder {
  color: #667891;
}

input:focus,
select:focus,
textarea:focus,
:is(.btn, .ghost-square, .mini-action, .row-menu, .main-nav a, .avatar-btn):focus-visible {
  outline: 2px solid rgba(56, 189, 248, .35);
  outline-offset: 2px;
  border-color: rgba(56, 189, 248, .55);
}

.data-table th {
  background: rgba(6, 15, 31, .72);
}

.data-table tbody tr:hover {
  background: rgba(30, 58, 108, .18);
}

.notice {
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, .28);
  background: rgba(14, 47, 75, .42);
  color: #bdeaff;
}

.notice.error {
  border-color: rgba(251, 113, 133, .34);
  background: rgba(92, 31, 50, .28);
  color: #fecdd3;
}

@keyframes refCardIn {
  from { opacity: .7; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes refTrace {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 1180px) {
  .dash-shell,
  .app.dark .dash-shell,
  .app.light .dash-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .dash-sidebar,
  .app.dark .dash-sidebar,
  .app.light .dash-sidebar {
    width: 76px;
    padding: 18px 10px;
  }

  .sidebar-brand .logo b,
  .sidebar-brand .logo small,
  .sidebar-nav button span,
  .support-card span,
  .user-card > span:not(.avatar-btn) {
    display: none;
  }

  .sidebar-nav button,
  .support-card,
  .user-card {
    justify-content: center;
    padding: 0;
  }

  .kpi-grid,
  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dash-shell,
  .app.dark .dash-shell,
  .app.light .dash-shell {
    display: block;
  }

  .dash-sidebar,
  .app.dark .dash-sidebar,
  .app.light .dash-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 12px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(86, 119, 178, .18);
  }

  .sidebar-brand .logo b,
  .sidebar-nav button span {
    display: block;
  }

  .sidebar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    overflow-x: auto;
  }

  .sidebar-nav button {
    width: auto;
    min-width: max-content;
    padding: 0 12px;
    justify-content: flex-start;
  }

  .sidebar-foot {
    display: none;
  }

  .dash-topbar,
  .app.dark .dash-topbar,
  .app.light .dash-topbar {
    min-height: auto;
    align-items: stretch;
    padding: 14px 14px;
    flex-direction: column;
  }

  .dash-tools {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 10px;
  }

  .dash-tools .btn {
    width: 100%;
    min-width: 0;
  }

  .dash-tools .ghost-square,
  .dash-tools .avatar-btn {
    width: 38px;
    min-width: 38px;
    justify-self: center;
  }

  .dash-page {
    padding: 14px 12px 28px;
  }

  .kpi-grid,
  .reference-grid,
  .model-row {
    grid-template-columns: 1fr;
  }

  .model-tags {
    justify-content: flex-start;
  }

  .model-row b {
    text-align: left;
  }

  .activity-row {
    grid-template-columns: 1fr auto;
  }

  .activity-row b {
    display: none;
  }

  .key-guide-backdrop {
    padding: 12px;
  }

  .key-guide-modal {
    width: min(100%, 100%);
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .key-guide-head {
    flex-direction: column;
  }

  .key-guide-tabs {
    gap: 6px;
  }

  .guide-mode-card {
    padding: 12px;
  }

  .guide-mode-switch {
    grid-template-columns: 1fr;
  }

  .guide-block pre {
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .dash-top-title h1 {
    font-size: 19px;
  }

  .ref-stat-card,
  .ref-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ref-stat-card {
    min-height: 100px;
  }

  .sparkline {
    width: 64px;
    flex-basis: 64px;
  }

  .verify-actions {
    grid-template-columns: 1fr;
  }
}

.billing-page {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.billing-hero-card {
  display: grid;
  gap: 12px;
}

.billing-hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.billing-hero-top h2 {
  margin-top: 8px;
  font-size: 28px;
}

.billing-hero-top strong {
  font-family: var(--mono);
  font-size: 34px;
  color: var(--cyan);
}

.billing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 18px;
}

.billing-grid.split {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
}

.billing-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.provider-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.provider-choice {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  clip-path: var(--clip);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.provider-choice:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
}

.provider-choice.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(88, 189, 243, .18) inset, var(--shadow-low);
}

.provider-choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.provider-choice-head em {
  font-style: normal;
  color: var(--cyan);
}

.provider-choice.offline .provider-choice-head em {
  color: var(--danger);
}

.provider-choice small,
.provider-choice b,
.provider-choice span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.provider-choice b {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--soft);
}

.billing-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--card2);
  clip-path: var(--clip);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-list,
.promo-code-list {
  display: grid;
  gap: 10px;
}

.payment-row,
.promo-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--card2);
  clip-path: var(--clip);
}

.payment-row strong,
.promo-code-row strong {
  display: block;
  margin: 3px 0;
  font-size: 16px;
}

.payment-meta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--cyan);
}

.payment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-side-column {
  display: grid;
  gap: 18px;
}

.admin-promo-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-promo-form label {
  display: grid;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.inline-copy {
  border: 0;
  background: none;
  color: var(--cyan);
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.admin-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-control-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
}

.app.dark .provider-choice,
.app.dark .billing-summary-row,
.app.dark .payment-row,
.app.dark .promo-code-row {
  background: rgba(48, 51, 56, .94);
  border-color: rgba(143, 152, 163, .88);
}

.app.dark .provider-choice.active {
  border-color: var(--cyan);
}

@media (max-width: 980px) {
  .billing-grid,
  .billing-grid.split,
  .admin-control-grid {
    grid-template-columns: 1fr;
  }

  .provider-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .billing-hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .payment-row,
  .promo-code-row {
    grid-template-columns: 1fr;
  }

  .payment-actions {
    justify-content: flex-start;
  }
}
