/* ============================================================
   OpenVideo API — console theme
   ============================================================ */
:root {
  color-scheme: dark;
  --bg: #070b11;
  --bg-2: #0a1018;
  --surface: rgba(17, 25, 36, 0.78);
  --surface-solid: #111926;
  --surface-2: #16212f;
  --border: rgba(148, 178, 205, 0.14);
  --border-strong: rgba(148, 178, 205, 0.24);
  --text: #e9f0f8;
  --muted: #8fa3b8;
  --muted-2: #6b7f94;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --radius: 18px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --font: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(34, 211, 238, 0.10), transparent 62%),
    radial-gradient(900px 520px at -12% 112%, rgba(129, 140, 248, 0.10), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

::selection { background: rgba(34, 211, 238, 0.3); }

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(143, 163, 184, 0.22); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(143, 163, 184, 0.36); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 50% 120%, rgba(79, 70, 229, 0.10), transparent 70%);
}

/* ============================ brand ============================ */
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22d3ee, #818cf8);
  box-shadow: 0 8px 24px -8px rgba(34, 211, 238, 0.65);
  flex: none;
}
.logo svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: -0.01em; font-weight: 700; }
.brand-text span { font-size: 9.5px; letter-spacing: 0.22em; color: var(--muted-2); font-weight: 600; }

/* ============================ auth ============================ */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 54px 64px 40px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: linear-gradient(155deg, #0a1c25 0%, #0a1018 55%, #101426 100%);
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at 22% 12%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 22% 12%, #000 0%, transparent 68%);
  pointer-events: none;
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -220px;
  bottom: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-brand h1 {
  margin-top: 72px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 750;
}
.auth-brand h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #67e8f9, #a5b4fc 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-lead {
  margin-top: 22px;
  max-width: 460px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.feature-list {
  list-style: none;
  margin: 42px 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
  max-width: 460px;
}
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.tick {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.feature-list strong { display: block; font-size: 14px; font-weight: 650; }
.feature-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.model-strip { margin-top: 38px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.model-strip span {
  font-size: 11.5px;
  color: #9db3c6;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  padding: 5px 10px;
  border-radius: 999px;
}
.model-strip .strip-label {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 2px;
}

.auth-brand-foot {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 12.5px;
}
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }

.auth-main {
  display: grid;
  place-items: center;
  padding: 48px 40px;
}
.auth-card {
  width: min(430px, 100%);
  padding: 36px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 24, 35, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: rise 0.4s ease-out;
}
.auth-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.auth-head p { margin-top: 6px; color: var(--muted); font-size: 13.5px; }

.segmented {
  margin: 24px 0 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}
.seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.16s;
}
.seg.active { background: rgba(255, 255, 255, 0.08); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

.demo-hint {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px dashed rgba(34, 211, 238, 0.25);
  color: #a8c8d6;
  font-size: 12.5px;
  line-height: 1.9;
}
.demo-hint code { color: #7de3f2; background: rgba(0, 0, 0, 0.25); padding: 1px 6px; border-radius: 5px; }
.auth-note { margin-top: 18px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ============================ layout ============================ */
.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 16px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(9, 14, 21, 0.66);
  backdrop-filter: blur(18px);
  z-index: 30;
}
.sidebar .brand-lockup { padding: 0 8px 22px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label {
  margin: 18px 12px 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 650;
}
.nav-label:first-child { margin-top: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  opacity: 0.9;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-item.active {
  color: #d8fbff;
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.13), rgba(129, 140, 248, 0.08));
  border-color: rgba(34, 211, 238, 0.18);
}
.nav-item.active svg { color: var(--accent); opacity: 1; }

.sidebar-bottom { margin-top: auto; padding-top: 18px; display: grid; gap: 12px; }
.env-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.env-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12);
  flex: none;
}
.env-dot.live { background: var(--success); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
.env-card strong { display: block; font-size: 12px; font-weight: 600; }
.env-card small { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: #04141b;
  background: linear-gradient(135deg, #67e8f9, #a5b4fc);
}
.user-meta { min-width: 0; flex: 1; }
.user-meta strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta span { display: block; font-size: 10.5px; color: var(--muted-2); }

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
  flex: none;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.workspace { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 34px 18px;
  background: linear-gradient(to bottom, rgba(7, 11, 17, 0.94), rgba(7, 11, 17, 0.55) 75%, transparent);
  backdrop-filter: blur(12px);
}
.topbar-title h1 { font-size: 22px; letter-spacing: -0.025em; font-weight: 700; }
.topbar-title p { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.balance-pill {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.10), rgba(129, 140, 248, 0.08));
  white-space: nowrap;
}
.balance-pill span { font-size: 11.5px; color: var(--muted); }
.balance-pill strong { font-size: 17px; font-weight: 700; color: #b7f4fb; letter-spacing: -0.01em; }
.balance-pill em { font-style: normal; font-size: 10.5px; color: var(--muted-2); }

.content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 34px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fade 0.25s ease-out;
}

/* ============================ cards / stats ============================ */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 45%), var(--surface);
  box-shadow: 0 16px 40px -30px rgba(0, 0, 0, 0.9);
  padding: 22px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.card-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-head p { margin-top: 3px; color: var(--muted); font-size: 12.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card {
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 55%), var(--surface);
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s;
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -50px;
  top: -60px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.5;
  background: var(--accent);
}
.stat-card.tone-spend::after { background: var(--accent-2); }
.stat-card.tone-requests::after { background: var(--success); }
.stat-card.tone-rate::after { background: var(--warning); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.10); }
.tone-spend .stat-dot { background: var(--accent-2); box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.10); }
.tone-requests .stat-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.10); }
.tone-rate .stat-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.10); }
.stat-value { margin-top: 10px; font-size: 29px; font-weight: 720; letter-spacing: -0.03em; line-height: 1.15; }
.stat-sub { margin-top: 3px; color: var(--muted-2); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }

/* ============================ chart ============================ */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 186px;
  padding-top: 10px;
}
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 9px; min-width: 0; }
.chart-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; padding: 0 8px; }
.chart-bar {
  width: 100%;
  min-height: 5px;
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, #67e8f9, #4f46e5 90%);
  box-shadow: 0 -4px 20px -6px rgba(34, 211, 238, 0.5);
  transition: height 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
  opacity: 0.9;
}
.chart-col:hover .chart-bar { opacity: 1; }
.chart-bar.zero { background: rgba(143, 163, 184, 0.28); box-shadow: none; }
.chart-col span { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

/* ============================ buttons / forms ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
}
.btn.primary {
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #041018;
  box-shadow: 0 10px 28px -12px rgba(34, 211, 238, 0.65);
}
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.07); text-decoration: none; }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--border); color: #cfdcea; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--border-strong); text-decoration: none; }
.btn.danger { background: rgba(251, 113, 133, 0.10); border-color: rgba(251, 113, 133, 0.28); color: #fda4af; }
.btn.danger:hover { background: rgba(251, 113, 133, 0.18); }
.btn.small { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.stack { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; font-weight: 600; color: #c3d2e1; letter-spacing: 0.01em; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #0a1320;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: #526477; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.10);
}
.field select { cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-note { color: var(--muted-2); font-size: 11.5px; }

.input {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0a1320;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
.input:focus { border-color: rgba(34, 211, 238, 0.5); }
.input.sm { width: 92px; padding: 6px 9px; }

/* ============================ badges ============================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge.success { color: #5eead4; background: rgba(52, 211, 153, 0.09); border-color: rgba(52, 211, 153, 0.22); }
.badge.danger { color: #fda4af; background: rgba(251, 113, 133, 0.09); border-color: rgba(251, 113, 133, 0.22); }
.badge.warning { color: #fcd34d; background: rgba(251, 191, 36, 0.09); border-color: rgba(251, 191, 36, 0.22); }
.badge.info { color: #7dd3fc; background: rgba(56, 189, 248, 0.09); border-color: rgba(56, 189, 248, 0.22); }
.badge.muted { color: var(--muted-2); }
.badge.lg { padding: 5px 12px; font-size: 12px; }

/* ============================ tables ============================ */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(148, 178, 205, 0.07);
  vertical-align: middle;
  color: #d5e1ee;
}
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .mono { font-family: var(--mono); font-size: 11.5px; color: #9fb4c9; }
.table .nowrap { white-space: nowrap; }
.table .num { font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ============================ code ============================ */
.code-block { position: relative; border-radius: 13px; border: 1px solid var(--border); background: #060c14; overflow: hidden; }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 12px; line-height: 1.85; color: #b7e8f2; }
.code-block code { font-family: var(--mono); }
.copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(17, 25, 36, 0.9);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.quick-links { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.quick-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.quick-steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-no {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: #67e8f9;
  font-size: 12px;
  font-weight: 700;
}
.quick-steps strong { display: block; font-size: 13px; font-weight: 600; }
.quick-steps small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.quick-steps code { color: #9fd8e6; background: rgba(255, 255, 255, 0.03); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.chart-empty {
  min-height: 186px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.chart-empty .empty-icon { margin: 0; width: 36px; height: 36px; }

/* ============================ playground ============================ */
.playground-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.cost-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.055);
  border: 1px solid rgba(34, 211, 238, 0.16);
  color: var(--muted);
  font-size: 12.5px;
}
.cost-line strong { color: #a5f3fc; font-size: 17px; font-weight: 700; }
.cost-line span { margin-left: auto; color: var(--muted-2); font-size: 11px; }

.result-card { position: sticky; top: 92px; }
.result-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 13px;
  padding: 24px;
  line-height: 1.8;
}
.video-preview { width: 100%; border-radius: 13px; background: #000; aspect-ratio: 16 / 9; display: block; border: 1px solid var(--border); }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.task-head code { font-size: 11px; color: var(--muted-2); }
.task-meta { color: var(--muted); font-size: 12px; line-height: 1.9; margin-bottom: 14px; }
.task-meta b { color: #d9e6f2; font-weight: 600; }
.task-actions { display: flex; gap: 10px; margin-top: 12px; }
.progress-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex: none;
}
.alert { padding: 12px 14px; border-radius: 11px; font-size: 12.5px; line-height: 1.7; }
.alert.danger { background: rgba(251, 113, 133, 0.08); border: 1px solid rgba(251, 113, 133, 0.22); color: #fecdd3; }
.alert.info { background: rgba(34, 211, 238, 0.06); border: 1px solid rgba(34, 211, 238, 0.18); color: #b7e8f2; }

/* ============================ misc ============================ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pagination { display: flex; justify-content: center; margin-top: 18px; }
.prompt-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.redeem-form { min-width: 0; }

/* ============================ docs ============================ */
.docs-hero {
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(34, 211, 238, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 50%),
    var(--surface);
  border-color: rgba(34, 211, 238, 0.20);
}
.docs-hero h2 { margin-top: 10px; font-size: 26px; letter-spacing: -0.03em; }
.docs-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.docs-meta-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.docs-meta code {
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #070d15;
  color: #8ff3ff;
  font-size: 12px;
}
.docs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.docs-nav {
  position: sticky;
  top: 92px;
  z-index: 15;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 7px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 16, 24, 0.88);
  backdrop-filter: blur(12px);
}
.docs-nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all 0.15s;
}
.docs-nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none; }
.doc-section { scroll-margin-top: 140px; }
.doc-section h3 { margin: 24px 0 10px; font-size: 14.5px; color: #d8f6fb; }
.docs-subcard {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.docs-subcard h3 { margin: 0 0 10px; }
.docs-subcard .code-block pre { padding: 11px 14px; }
.docs-subcard p { margin-top: 10px; line-height: 1.75; }
.docs-callout {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  background: rgba(34, 211, 238, 0.055);
  color: #b7d7e4;
  font-size: 12.5px;
  line-height: 1.8;
}
.docs-callout strong { color: #d8fbff; }
.docs-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.docs-table code { font-size: 11px; }
.status-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.status-arrow { color: var(--muted-2); font-size: 12px; }

.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.empty-panel { text-align: center; padding: 46px 24px; color: var(--muted); }
.empty-icon {
  width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  color: var(--muted); font-weight: 700;
}
.empty-panel h3 { color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty-panel p { font-size: 12.5px; margin-bottom: 16px; }

.skeleton { background: linear-gradient(90deg, #101a26 25%, #16212f 50%, #101a26 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
.skeleton-card { height: 92px; border-radius: 16px; }

/* ============================ modal ============================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 0.15s ease-out;
}
.modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: #0f1824;
  box-shadow: var(--shadow);
  animation: pop 0.18s ease-out;
}
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 0; }
.modal-head h3 { font-size: 16.5px; letter-spacing: -0.01em; }
.modal-body { padding: 18px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.key-reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #070d15;
  border: 1px solid rgba(34, 211, 238, 0.28);
  margin: 14px 0 6px;
}
.key-reveal code { flex: 1; word-break: break-all; color: #8ff3ff; font-size: 12.5px; }

.detail-grid { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 12.5px; }
.detail-grid dt { color: var(--muted-2); }
.detail-grid dd { margin: 0; color: #d7e3ef; word-break: break-all; }

/* ============================ admin ============================ */
.subtabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.subtab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s;
}
.subtab.active { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 19px; border-radius: 999px; background: #22303f; border: 1px solid var(--border); position: relative; transition: 0.16s; }
.switch .track::after { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; border-radius: 50%; background: #8fa3b8; transition: 0.16s; }
.switch input:checked + .track { background: rgba(34, 211, 238, 0.35); border-color: rgba(34, 211, 238, 0.5); }
.switch input:checked + .track::after { left: 17px; background: #a5f3fc; }

/* ============================ toasts ============================ */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 44px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(16, 25, 36, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.8);
  font-size: 12.5px;
  line-height: 1.6;
  animation: slide-in 0.22s ease-out;
}
.toast.out { animation: slide-out 0.22s ease-in forwards; }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--accent); }
.toast.success .toast-dot { background: var(--success); }
.toast.error .toast-dot { background: var(--danger); }
.toast.warning .toast-dot { background: var(--warning); }

/* ============================ docs ============================ */
.doc-list { display: grid; gap: 8px; }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); font-size: 12.5px; flex-wrap: wrap; }
.method { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.04em; }
.method.get { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; }
.method.post { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; }
.method.patch { background: rgba(251, 191, 36, 0.12); color: #fcd34d; }
.method.delete { background: rgba(251, 113, 133, 0.12); color: #fda4af; }
.endpoint code { color: #cfe3f0; }
.endpoint > span:last-child { color: var(--muted); margin-left: auto; }

/* ============================ responsive ============================ */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .playground-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
}

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { padding: 34px 32px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-brand h1 { margin-top: 30px; font-size: 34px; }
  .brand-lead { margin-top: 14px; font-size: 14px; }
  .feature-list { margin-top: 26px; gap: 14px; }
  .auth-brand-foot { display: none; }
  .auth-main { padding: 32px 24px 56px; }

  .app-layout { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar .brand-lockup { padding: 0; flex: none; }
  .sidebar .brand-text { display: none; }
  .nav { flex-direction: row; gap: 4px; overflow: visible; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 11px; }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-bottom { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 8px; }
  .env-card { display: none; }
  .user-row { border: 0; background: transparent; padding: 0; }
  .user-meta { display: none; }
  .topbar { padding: 16px 22px 12px; }
  .content { padding: 8px 22px 48px; }
  .docs-nav { position: static; }
  .docs-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .topbar-actions .btn { display: none; }
  .topbar { gap: 10px; }
  .topbar-title h1 { font-size: 19px; }
  .topbar-title p { display: none; }
  .balance-pill { padding: 7px 11px; }
  .balance-pill strong { font-size: 15px; }
  .card { padding: 17px; border-radius: 15px; }
  .content { padding: 8px 16px 42px; }
  .auth-card { padding: 26px 22px; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(18px); } }
