/* ==========================================================================
   NEXUS_AI — Modern Neutral Theme (style.css)
   Aesthetic: Warm Off-White / Beige-White / Charcoal / Slate / Soft Amber
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Canvas & Surfaces (Warm Beige / Cream / Off-White) */
  --bg-canvas: #F9F8F5;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F3F0EA;
  --bg-card: #FFFFFF;
  --bg-hover: #EFECE4;
  --bg-active: #E8E4DA;

  /* Charcoal & Deep Contrast */
  --charcoal-900: #141517;
  --charcoal-800: #1B1C1F;
  --charcoal-700: #25272B;
  --charcoal-600: #34373D;
  --charcoal-subtle: #2C2E34;

  /* Typography */
  --text-main: #18191B;
  --text-secondary: #575B64;
  --text-muted: #878C97;
  --text-inverse: #FAF9F6;
  --text-inverse-muted: #A3A8B3;

  /* Borders & Dividers */
  --border: #C8C3B5;
  --border-subtle: #D9D4C7;
  --border-strong: #A8A18E;
  --border-focus: #18191B;

  /* Soft Accent Palette */
  --accent-warm: #D97746;       /* Terracotta / Amber (Claude/Warm) */
  --accent-warm-subtle: #FBF2EC;
  --accent-green: #2B7A58;      /* Sage / Emerald (Success / Unlimited) */
  --accent-green-subtle: #ECF5F0;
  --accent-blue: #2B6295;       /* Slate Blue (OpenAI / Info) */
  --accent-blue-subtle: #ECF3F9;
  --accent-purple: #6B49A8;     /* Lavender / Plum (Gemini / Reasoning) */
  --accent-purple-subtle: #F3EEFA;
  --accent-red: #C53D3D;
  --accent-red-subtle: #FDF0F0;

  /* Buttons */
  --btn-primary-bg: #18191B;
  --btn-primary-text: #FBFBFA;
  --btn-primary-hover: #2B2C31;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(24, 25, 27, 0.08), 0 1px 2px rgba(24, 25, 27, 0.04);
  --shadow-md: 0 4px 14px rgba(24, 25, 27, 0.10), 0 1px 3px rgba(24, 25, 27, 0.05);
  --shadow-lg: 0 12px 30px rgba(24, 25, 27, 0.12), 0 2px 6px rgba(24, 25, 27, 0.05);
  --shadow-hover: 0 8px 24px rgba(24, 25, 27, 0.14), 0 2px 4px rgba(24, 25, 27, 0.04);
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Canvas & Surfaces (Deep Slate & Charcoal) */
  --bg-canvas: #0E0F12;
  --bg-surface: #16171D;
  --bg-subtle: #1F2128;
  --bg-card: #16171D;
  --bg-hover: #262933;
  --bg-active: #2F3340;

  /* High contrast elements */
  --charcoal-900: #F3F1EC;
  --charcoal-800: #E4E1D8;
  --charcoal-700: #C7C3B7;
  --charcoal-600: #9B988E;
  --charcoal-subtle: #2A2D37;

  /* Typography */
  --text-main: #EDEDEC;
  --text-secondary: #A0A5B2;
  --text-muted: #6E7382;
  --text-inverse: #121316;
  --text-inverse-muted: #6E7382;

  /* Borders & Dividers */
  --border: #2C2F3A;
  --border-subtle: #22242E;
  --border-strong: #404556;
  --border-focus: #E28A5B;

  /* Soft Accent Palette (Dark Mode Vibrancy) */
  --accent-warm: #E28A5B;
  --accent-warm-subtle: rgba(226, 138, 91, 0.15);
  --accent-green: #38B278;
  --accent-green-subtle: rgba(56, 178, 120, 0.15);
  --accent-blue: #4D8FD6;
  --accent-blue-subtle: rgba(77, 143, 214, 0.15);
  --accent-purple: #9A77E6;
  --accent-purple-subtle: rgba(154, 119, 230, 0.15);
  --accent-red: #E25858;
  --accent-red-subtle: rgba(226, 88, 88, 0.15);

  /* Buttons */
  --btn-primary-bg: #F3F1EC;
  --btn-primary-text: #111215;
  --btn-primary-hover: #FFFFFF;

  /* Shadows for Dark Mode */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* ================= BASE STYLES ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle background grain & warm aura */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; height: 500px;
  background: radial-gradient(circle at 50% -100px, rgba(217, 119, 70, 0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

.wrap {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

img {
  max-width: 100%;
  display: block;
}

code, pre {
  font-family: var(--font-mono);
}

/* ================= HEADER / NAVBAR ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 248, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  height: 68px;
  display: flex;
  align-items: center;
}

.header .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #18191B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

[data-theme="dark"] .brand-icon {
  background: #232631;
  color: var(--accent-warm);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.brand-text .accent {
  color: var(--accent-warm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.nav-links a.active {
  color: var(--text-main);
  background: var(--bg-subtle);
  font-weight: 600;
}

.nav-links a.accent-link {
  color: var(--accent-warm);
  font-weight: 600;
}

.nav-links a.accent-link:hover {
  background: var(--accent-warm-subtle);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
  margin-left: 8px;
  margin-right: 8px;
}

.lang-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Theme Switcher */
.theme-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
  margin-right: 8px;
}

.theme-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  color: var(--text-main);
}

.theme-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-signin {
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  font-family: var(--font-mono);
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-full) !important;
  transition: background 0.15s ease, transform 0.15s ease !important;
}

.btn-signin:hover {
  background: var(--btn-primary-hover) !important;
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 18px;
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.mobile-menu.open {
  display: flex;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-sm);
}

.btn.primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn.warm {
  background: var(--accent-warm);
  color: #FFFFFF;
}

.btn.warm:hover {
  background: #C76233;
  transform: translateY(-1px);
}

.btn.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ================= TYPOGRAPHY & HEADERS ================= */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-warm);
  background: var(--accent-warm-subtle);
  border: 1px solid rgba(217, 119, 70, 0.2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.blink-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-warm);
  border-radius: 50%;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

h1.page-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 16px;
}

p.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 28px;
}

.section-header {
  margin: 56px 0 24px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.section-header h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--text-main);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ================= CARDS & GRIDS ================= */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

/* Model & Pack Card */
.model-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.model-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.model-card.featured {
  border-color: rgba(217, 119, 70, 0.4);
  box-shadow: 0 4px 20px rgba(217, 119, 70, 0.08);
}

.model-card.featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-warm);
}

.model-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.model-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.model-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.model-proto {
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: auto;
  margin-bottom: 16px;
  line-height: 1.5;
}

.model-card .btn {
  margin-top: auto;
  width: 100%;
}

/* Grids */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0 48px;
}

.packs-grid.wide {
  grid-template-columns: repeat(2, 1fr);
  max-width: 860px;
  margin-inline: auto;
}

.packs-grid.flash {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 960px) {
  .packs-grid,
  .packs-grid.flash {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .packs-grid,
  .packs-grid.wide,
  .packs-grid.flash {
    grid-template-columns: 1fr;
  }
}

/* ================= 12-HOUR DROP LIVE MONITOR ================= */
.drop-monitor-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 48px;
  width: 100%;
}

.drop-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.drop-timer-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.drop-timer-value {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 800;
  color: var(--charcoal-900);
  line-height: 1.1;
  margin-top: 4px;
}

.drop-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  width: 100%;
}

.pool-item-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.15s ease;
}

.pool-item-card:hover {
  background: var(--bg-surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.pool-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pool-item-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.pool-item-tokens {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.pool-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.pool-progress-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ================= QUOTA CALCULATOR ================= */
.calc-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
  margin-bottom: 56px;
  width: 100%;
}

.calc-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.calc-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  outline: none;
  cursor: pointer;
  margin: 18px 0 30px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-warm);
  border: 3.5px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--charcoal-900), 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 2.5px var(--charcoal-900), 0 6px 18px rgba(217, 119, 70, 0.5);
}

.calc-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-warm);
  border: 3.5px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--charcoal-900), 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.calc-slider::-moz-range-track {
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
}

.calc-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.calc-stat {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.calc-stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.calc-stat .c-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.calc-stat .c-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--charcoal-900);
}

@media (max-width: 960px) {
  .calc-breakdown {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .calc-breakdown {
    grid-template-columns: 1fr;
  }
}

/* ================= MODERN MODELS CATALOG ================= */
.catalog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 60px;
}

.catalog-toolbar {
  padding: 20px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  min-width: 280px;
}

.catalog-search input {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.filter-btn.active {
  background: #18191B;
  color: #FFFFFF;
  border-color: #18191B;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table thead th {
  background: var(--bg-subtle);
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: rgba(243, 240, 234, 0.4);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  line-height: 1;
}

.badge.ok {
  background: var(--accent-green-subtle);
  color: var(--accent-green);
  border: 1px solid rgba(43, 122, 88, 0.2);
}

.badge.warn {
  background: var(--accent-warm-subtle);
  color: var(--accent-warm);
  border: 1px solid rgba(217, 119, 70, 0.2);
}

.badge.blue {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  border: 1px solid rgba(43, 98, 149, 0.2);
}

.badge.purple {
  background: var(--accent-purple-subtle);
  color: var(--accent-purple);
  border: 1px solid rgba(107, 73, 168, 0.2);
}

/* Brand Pills in Table */
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.brand-pill.anthropic { background: #FDF1EA; color: #BD5324; }
.brand-pill.openai { background: #EEF4EE; color: #2C6D45; }
.brand-pill.deepseek { background: #EDF3F8; color: #205988; }
.brand-pill.google { background: #F3EDFA; color: #6B43A6; }
.brand-pill.alibaba { background: #FBF0F0; color: #B52F2F; }

/* ================= DOCUMENTATION LAYOUT (about.html) ================= */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 40px 0 80px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-group {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 12px 12px 6px;
}

.docs-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.docs-sidebar a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.docs-sidebar a.active {
  color: var(--charcoal-900);
  background: var(--bg-subtle);
  font-weight: 700;
}

.docs-sidebar a .em {
  font-size: 12px;
  opacity: 0.7;
}

.docs-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel .kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-warm);
  margin-bottom: 8px;
}

.panel h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-main);
  margin-bottom: 12px;
}

.panel h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-main);
  margin: 32px 0 14px;
}

.panel h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.panel p.desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}

/* Steps */
ol.steps {
  list-style: none;
  counter-reset: step-counter;
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

ol.steps li {
  position: relative;
  padding-left: 48px;
}

ol.steps li::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--charcoal-900);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

ol.steps li p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* Code Blocks & Terminal Windows */
.codep {
  background: #111319;
  border: 1px solid #2B2F3D;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.codep .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #181A23;
  border-bottom: 1px solid #2B2F3D;
  color: #94A3B8;
  font-size: 12px;
  font-family: var(--font-mono);
}

.codep button.cp {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.codep button.cp:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.codep pre {
  padding: 18px 20px;
  color: #F1F5F9;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

[data-theme="dark"] .codep {
  background: #0B0D12;
  border-color: #2F3342;
}

[data-theme="dark"] .codep .bar {
  background: #141720;
  border-color: #2F3342;
  color: #A0AEC0;
}

[data-theme="dark"] .codep pre {
  color: #F8FAFC;
}

code.i {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--charcoal-900);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.note {
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent-warm);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.note.warn {
  border-left-color: var(--accent-red);
}

/* FAQ Details */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--bg-surface);
  transition: all 0.15s ease;
}

details[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

summary {
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

details .body {
  padding: 0 20px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Pager */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 40px;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  transition: all 0.15s ease;
}

.pager a:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.pager a b {
  font-size: 14px;
  color: var(--text-main);
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
  }
}

/* ================= FOOTER ================= */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text-main);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= DOCS TABLES & EXTRA STYLES ================= */
.params, .models {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0 24px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
}

.params th, .models th {
  background: var(--bg-subtle);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.params td, .models td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: top;
  line-height: 1.6;
}

.params tr:last-child td, .models tr:last-child td {
  border-bottom: none;
}

.params td:first-child {
  font-weight: 600;
  color: var(--charcoal-900);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
  width: 220px;
  background: rgba(243, 240, 234, 0.3);
}

.models td:first-child code {
  color: var(--accent-warm);
  font-weight: 700;
}

.pool-unl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-green);
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-mono);
}

.pool-batch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-warm);
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ================= CHAT INTERFACE (chat.html) ================= */
.chat-main-wrap {
  position: relative;
  z-index: 1;
  padding: 24px 0 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 82vh;
  min-height: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-header {
  padding: 14px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.model-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.model-select:focus {
  border-color: var(--accent-warm);
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-canvas);
}

.msg {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.msg-user {
  align-self: flex-end;
  background: var(--charcoal-900);
  border: 1px solid var(--charcoal-800);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.msg-ai {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.msg-ai pre {
  background: var(--charcoal-900);
  color: #ECEAE4;
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.chat-input-bar {
  padding: 14px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input-bar textarea {
  flex: 1;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  resize: none;
  height: 52px;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-input-bar textarea:focus {
  border-color: var(--accent-warm);
  background: #FFFFFF;
}

.thinking-control, .websearch-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
}

.tier-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--accent-warm);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  outline: none;
  cursor: pointer;
}

.thinking-box {
  background: #FCF9F5;
  border: 1px solid rgba(217, 119, 70, 0.25);
  border-left: 3px solid var(--accent-warm);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #F8F1EB;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-warm);
  cursor: pointer;
  user-select: none;
}

.thinking-header:hover {
  background: #F3E7DC;
}

.thinking-body {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px dashed rgba(217, 119, 70, 0.2);
}

.thinking-body.collapsed {
  display: none;
}

/* ================= CABINET & STATS (stats.html) ================= */
.stats-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--charcoal-900);
  margin-top: 4px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.progress-bar {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  height: 100%;
  background: var(--accent-warm);
  width: 0%;
  transition: width 0.4s ease;
}

.key-input-box {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin-top: 16px;
}

.key-input-box input {
  flex: 1;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  color: var(--charcoal-900);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.key-input-box input::placeholder {
  color: var(--text-muted);
}

.key-input-box input:focus {
  outline: none;
  border-color: var(--accent-warm);
  background: var(--bg-surface);
  color: var(--charcoal-900);
  box-shadow: 0 0 0 3px var(--accent-warm-subtle);
}

.quick-setup-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

.quick-setup-box pre {
  background: #111319;
  border: 1px solid #2B2F3D;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #F1F5F9;
  overflow-x: auto;
  margin-top: 12px;
}

/* ================= LEADERBOARD (rankings.html) ================= */
.rankings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.rankings-table th {
  background: var(--bg-subtle);
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.rankings-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-main);
  vertical-align: middle;
}

.rank-1 td { background: rgba(217, 167, 70, 0.08); }
.rank-2 td { background: rgba(160, 165, 178, 0.08); }
.rank-3 td { background: rgba(217, 119, 70, 0.08); }

[data-theme="dark"] .rank-1 td { background: rgba(217, 167, 70, 0.14) !important; }
[data-theme="dark"] .rank-2 td { background: rgba(160, 165, 178, 0.12) !important; }
[data-theme="dark"] .rank-3 td { background: rgba(217, 119, 70, 0.12) !important; }

.rank-num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  color: var(--charcoal-900);
}

.rank-user {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.rank-tokens {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--charcoal-900);
}

.rank-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-bar {
  flex: 1;
  max-width: 120px;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  background: var(--accent-warm);
}

.rank-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.rank-1 .rank-badge {
  background: #FFF8E7;
  color: #B48208;
  border: 1px solid rgba(180, 130, 8, 0.25);
}

.rank-2 .rank-badge {
  background: #F1F3F5;
  color: #555E68;
  border: 1px solid rgba(85, 94, 104, 0.25);
}

.rank-3 .rank-badge {
  background: #FAF0E6;
  color: #9A6324;
  border: 1px solid rgba(154, 99, 36, 0.25);
}

[data-theme="dark"] .rank-1 .rank-badge {
  background: rgba(217, 167, 70, 0.22);
  color: #F6C870;
  border: 1px solid rgba(217, 167, 70, 0.45);
}

[data-theme="dark"] .rank-2 .rank-badge {
  background: rgba(160, 165, 178, 0.22);
  color: #D2D6E0;
  border: 1px solid rgba(160, 165, 178, 0.45);
}

[data-theme="dark"] .rank-3 .rank-badge {
  background: rgba(217, 119, 70, 0.22);
  color: #F8A578;
  border: 1px solid rgba(217, 119, 70, 0.45);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.filter-tab.active {
  background: #18191B;
  color: #FFFFFF;
  border-color: #18191B;
}

[data-theme="dark"] .filter-tab.active {
  background: var(--accent-warm) !important;
  color: #FFFFFF !important;
  border-color: var(--accent-warm) !important;
  box-shadow: 0 0 12px rgba(217, 119, 70, 0.4) !important;
}

[data-theme="dark"] .filter-tab:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* ================= ADMIN DASHBOARD (dashboard.html) ================= */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-box .val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--charcoal-900);
}

.stat-box .lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--charcoal-900);
  border-color: var(--charcoal-900);
  color: #FFFFFF;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-row input, .form-row select {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  min-width: 160px;
}

.form-row input:focus, .form-row select:focus {
  outline: none;
  border-color: var(--accent-warm);
  background: var(--bg-surface);
  color: var(--charcoal-900);
  box-shadow: 0 0 0 3px var(--accent-warm-subtle);
}

.form-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(20, 21, 23, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius-xl);
  min-width: 320px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.modal-box h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--charcoal-900);
  margin-bottom: 24px;
}

.modal-box input {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-mono);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  outline: none;
  box-sizing: border-box;
}

.modal-box input:focus {
  outline: none;
  border-color: var(--accent-warm);
  background: var(--bg-surface);
  color: var(--charcoal-900);
  box-shadow: 0 0 0 3px var(--accent-warm-subtle);
}

.token-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--charcoal-900);
  background: var(--bg-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  border: 1px solid var(--border);
  margin: 8px 0;
}

/* ================= DARK MODE COMPONENT REFINEMENTS ================= */
[data-theme="dark"] body::before {
  background: radial-gradient(circle at 50% -100px, rgba(226, 138, 91, 0.09), transparent 70%);
}

[data-theme="dark"] .header {
  background: rgba(14, 15, 18, 0.88);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .mobile-menu {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .model-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
}

[data-theme="dark"] .model-card:hover {
  border-color: var(--border-strong);
}

[data-theme="dark"] .model-card.featured {
  border-color: var(--accent-warm);
}

[data-theme="dark"] .drop-monitor-box,
[data-theme="dark"] .catalog-card,
[data-theme="dark"] .calc-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
}

[data-theme="dark"] .calc-stat {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
}

[data-theme="dark"] .brand-pill {
  border: 1px solid var(--border);
}

[data-theme="dark"] .brand-pill.anthropic {
  background: rgba(226, 138, 91, 0.15);
  color: #E28A5B;
  border-color: rgba(226, 138, 91, 0.3);
}

[data-theme="dark"] .brand-pill.openai {
  background: rgba(56, 178, 120, 0.15);
  color: #38B278;
  border-color: rgba(56, 178, 120, 0.3);
}

[data-theme="dark"] .brand-pill.deepseek {
  background: rgba(77, 143, 214, 0.15);
  color: #4D8FD6;
  border-color: rgba(77, 143, 214, 0.3);
}

[data-theme="dark"] .brand-pill.google {
  background: rgba(154, 119, 230, 0.15);
  color: #9A77E6;
  border-color: rgba(154, 119, 230, 0.3);
}

[data-theme="dark"] .brand-pill.alibaba {
  background: rgba(226, 88, 88, 0.15);
  color: #E25858;
  border-color: rgba(226, 88, 88, 0.3);
}

[data-theme="dark"] .data-table th {
  background: var(--bg-subtle);
  border-bottom: 1.5px solid var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .data-table td {
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="dark"] .data-table tr:hover td {
  background: var(--bg-hover);
}

[data-theme="dark"] code.i {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--charcoal-900);
}

[data-theme="dark"] .chat-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
}

[data-theme="dark"] .chat-sidebar {
  background: var(--bg-subtle);
  border-right: 1.5px solid var(--border);
}

[data-theme="dark"] .chat-messages {
  background: var(--bg-canvas);
}

[data-theme="dark"] .chat-input-bar {
  background: var(--bg-surface);
  border-top: 1.5px solid var(--border);
}

[data-theme="dark"] .chat-input-bar textarea {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .chat-input-bar textarea:focus {
  background: var(--bg-surface);
  border-color: var(--accent-warm);
}

[data-theme="dark"] .msg-user {
  background: #242732;
  border-color: #383D4E;
  color: #FFFFFF;
}

[data-theme="dark"] .msg-ai {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .modal-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
}

[data-theme="dark"] .modal-box input {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .modal-box input:focus {
  background: var(--bg-surface);
  border-color: var(--accent-warm);
}

[data-theme="dark"] .stat-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
}

[data-theme="dark"] .filter-tabs {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

[data-theme="dark"] .filter-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .key-input-box input {
  background: #141720;
  border-color: #2F3547;
  color: #F1F5F9;
}

[data-theme="dark"] .key-input-box input::placeholder {
  color: #64748B;
}

[data-theme="dark"] .key-input-box input:focus {
  background: #1A1E29;
  border-color: var(--accent-warm);
  color: #F1F5F9;
  box-shadow: 0 0 0 3px rgba(217, 119, 70, 0.25);
}

[data-theme="dark"] .form-row input,
[data-theme="dark"] .form-row select {
  background: #141720;
  border-color: #2F3547;
  color: #F1F5F9;
}

[data-theme="dark"] .form-row input:focus,
[data-theme="dark"] .form-row select:focus {
  background: #1A1E29;
  border-color: var(--accent-warm);
  color: #F1F5F9;
  box-shadow: 0 0 0 3px rgba(217, 119, 70, 0.25);
}

[data-theme="dark"] .modal-box input {
  background: #141720;
  border-color: #2F3547;
  color: #F1F5F9;
}

[data-theme="dark"] .modal-box input:focus {
  background: #1A1E29;
  border-color: var(--accent-warm);
  color: #F1F5F9;
  box-shadow: 0 0 0 3px rgba(217, 119, 70, 0.25);
}

#quick-key-input {
  color: var(--charcoal-900);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#quick-key-input:focus {
  border-color: var(--accent-warm) !important;
  box-shadow: 0 0 0 3px var(--accent-warm-subtle);
}

[data-theme="dark"] #quick-key-input {
  background: #141720 !important;
  border-color: #2F3547 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] #quick-key-input:focus {
  background: #1A1E29 !important;
  border-color: var(--accent-warm) !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 70, 0.25);
}


