/* ==========================================================================
   Enterprise AI Gateway - Master Design System
   Developer-grade Dark Theme (Vercel, Linear, Modern Gateway inspired)
   ========================================================================== */

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

:root {
  --bg-app: #08090c;
  --bg-main: #08090c;
  --bg-card: #0d1117;
  --bg-card-hover: #131720;
  --bg-surface: #161b22;
  --bg-surface-1: #0d1117;
  --bg-surface-2: #161b22;
  --bg-surface-3: #21262d;

  --border-color: rgba(240, 246, 252, 0.1);
  --border-subtle: rgba(240, 246, 252, 0.08);
  --border-muted: rgba(240, 246, 252, 0.14);
  --border-hover: rgba(56, 139, 253, 0.4);

  --primary: #ffffff;
  --primary-hover: #e6e6e6;
  --primary-light: rgba(255, 255, 255, 0.06);

  --text-main: #f0f6fc;
  --text-primary: #f0f6fc;
  --text-muted: #8b949e;
  --text-secondary: #8b949e;
  --text-dim: #6e7681;
  --text-tertiary: #6e7681;

  --accent-blue: #2f81f7;
  --accent-blue-hover: #58a6ff;
  --accent-blue-bg: rgba(56, 139, 253, 0.12);
  --accent-green: #238636;
  --accent-green-bright: #3fb950;
  --accent-green-bg: rgba(46, 160, 67, 0.14);
  --accent-amber: #d29922;
  --accent-amber-bg: rgba(210, 153, 34, 0.14);
  --accent-red: #f85149;
  --accent-red-bg: rgba(248, 81, 73, 0.14);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
}

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

html, body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background grid */
.bg-grid {
  background-size: 24px 24px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

.bg-radial {
  background: radial-gradient(circle at 50% 0%, rgba(56, 139, 253, 0.12) 0%, transparent 70%);
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  font-weight: 700;
  color: #fff;
}

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

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--accent-blue-hover);
}

/* --------------------------------------------------------------------------
   PUBLIC SITE: Header & Navigation
   -------------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 12, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.logo-brand:hover {
  color: #fff;
}

.logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--font-mono);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

nav.main-nav a:hover, nav.main-nav a.active {
  color: #fff;
}

/* Currency Switcher Pill */
.currency-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
}

.currency-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.currency-btn.active {
  background: var(--bg-surface-3);
  color: #fff;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
}

.balance-amount {
  color: var(--accent-green-bright);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Desktop header action controls row */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Buttons & Form Controls
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: #ffffff;
  color: #000000 !important;
}

.btn-primary:hover {
  background: #e6e6e6;
  color: #000000 !important;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main) !important;
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-3);
  border-color: rgba(240, 246, 252, 0.25);
  color: #fff !important;
}

.btn-outline {
  border-color: rgba(240, 246, 252, 0.2);
  color: #fff !important;
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(240, 246, 252, 0.4);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-bg);
}

/* --------------------------------------------------------------------------
   Page Layout & Sections
   -------------------------------------------------------------------------- */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  min-height: calc(100vh - 120px);
}

/* Hero Section */
.hero-box {
  padding: 70px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  max-width: 840px;
  margin: 0 auto 16px;
  color: #fff;
}

.hero-title span {
  color: var(--text-muted);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Divider band */
.section-band {
  height: 8px;
  border-bottom: 1px solid var(--border-color);
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.015),
    rgba(255, 255, 255, 0.015) 6px,
    transparent 6px,
    transparent 12px
  );
}

/* Code Viewer Box */
.code-box {
  background: #05070a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 8px;
}

.code-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.code-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.code-tab-btn.active {
  background: var(--bg-surface-3);
  color: #fff;
}

.code-snippet {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-snippet pre,
pre.code-content {
  padding: 16px;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  max-width: 100%;
  color: #e6edf3;
  margin: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   Tables (Public & Dashboard)
   -------------------------------------------------------------------------- */
.table-container, .table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

table.model-table, table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.model-table th, table.data-table th {
  padding: 10px 16px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}

table.model-table td, table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  vertical-align: middle;
}

table.model-table tr:last-child td, table.data-table tr:last-child td {
  border-bottom: none;
}

table.model-table tr:hover td, table.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Provider Badges & Category Filter Pills */
.provider-badge, .tag-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 8.5px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.provider-badge span, .tag-provider span {
  display: inline-block;
  line-height: 1;
}

.vendor-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.filter-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 6px 13px !important;
  border-radius: 9999px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  background: var(--bg-surface-2) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-muted) !important;
  user-select: none;
}

.filter-pill span {
  display: inline-block;
  line-height: 1;
}

.filter-pill .vendor-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.filter-pill:hover {
  background: var(--bg-surface-3) !important;
  border-color: rgba(240, 246, 252, 0.25) !important;
  color: #fff !important;
}

.filter-pill:hover .vendor-icon {
  opacity: 1;
  transform: scale(1.1);
}

.filter-pill.active {
  background: rgba(56, 139, 253, 0.18) !important;
  border-color: var(--accent-blue) !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(56, 139, 253, 0.22);
}

.filter-pill.active .vendor-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* Distinct Provider Color Accents */
.provider-openai { color: #10a37f; border-color: rgba(16, 163, 127, 0.35); background: rgba(16, 163, 127, 0.08); }
.provider-anthropic { color: #d97706; border-color: rgba(217, 119, 6, 0.35); background: rgba(217, 119, 6, 0.08); }
.provider-google, .provider-gemini { color: #4285f4; border-color: rgba(66, 133, 244, 0.35); background: rgba(66, 133, 244, 0.08); }
.provider-deepseek { color: #4e80ee; border-color: rgba(78, 128, 238, 0.35); background: rgba(78, 128, 238, 0.08); }
.provider-qwen { color: #818cf8; border-color: rgba(129, 140, 248, 0.35); background: rgba(129, 140, 248, 0.08); }
.provider-moonshot, .provider-kimi { color: #06b6d4; border-color: rgba(6, 182, 212, 0.35); background: rgba(6, 182, 212, 0.08); }
.provider-minimax { color: #f43f5e; border-color: rgba(244, 63, 94, 0.35); background: rgba(244, 63, 94, 0.08); }
.provider-xai, .provider-grok { color: #f472b6; border-color: rgba(244, 114, 182, 0.35); background: rgba(244, 114, 182, 0.08); }
.provider-zhipu, .provider-glm { color: #38bdf8; border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.08); }
.provider-nvidia { color: #76b900; border-color: rgba(118, 185, 0, 0.35); background: rgba(118, 185, 0, 0.08); }
.provider-xiaomi, .provider-mimo { color: #ff6900; border-color: rgba(255, 105, 0, 0.35); background: rgba(255, 105, 0, 0.08); }
.provider-cursor { color: #c084fc; border-color: rgba(192, 132, 252, 0.35); background: rgba(192, 132, 252, 0.08); }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-green {
  background: var(--accent-green-bg);
  color: var(--accent-green-bright);
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.badge-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue-hover);
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.badge-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.badge-red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.badge-neutral {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   Cards & Metrics (Dashboard & Admin)
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card, .stat-box {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label, .stat-box .title {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value, .stat-box .value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: #fff;
}

.stat-box .subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

/* VietQR Card */
.vietqr-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}

.qr-img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  margin: 16px auto;
  border: 1px solid var(--border-color);
  background: #fff;
  padding: 8px;
}

/* --------------------------------------------------------------------------
   Chat Playground
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Enterprise AI Workbench & Chat Playground
   -------------------------------------------------------------------------- */
.wb-top-bar {
  position: relative;
  z-index: 1000;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  overflow: visible !important;
}

.playground-workbench {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 170px);
  min-height: 680px;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .playground-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 600px;
  }
  .wb-sidebar-left {
    display: none !important;
  }
  .wb-sidebar-left.mobile-open {
    display: flex !important;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  }
}

.wb-panel {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
}

.wb-panel-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.wb-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
}

/* Sidebar Left: Sessions & Templates */
.wb-session-item {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-dim);
  transition: all 0.15s ease;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.wb-session-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.wb-session-item.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: #fff;
  font-weight: 500;
}
.wb-session-item .session-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.wb-session-item .session-del-btn {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.wb-session-item:hover .session-del-btn {
  opacity: 1;
}
.wb-session-item .session-del-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.wb-template-item {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.775rem;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
}
.wb-template-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
  color: #fff;
  transform: translateY(-1px);
}
.wb-template-item strong {
  display: block;
  color: #fff;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

/* Chat Center Console */
.wb-chat-center {
  background: var(--bg-surface-1);
}

.wb-chat-scroll {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

.wb-msg {
  display: flex;
  gap: 12px;
  max-width: 90%;
  animation: fadeInMsg 0.25s ease-out;
}
@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wb-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.wb-msg.assistant {
  align-self: flex-start;
}
.wb-msg.system {
  align-self: center;
  max-width: 95%;
  width: 100%;
}

.wb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.wb-msg.user .wb-avatar {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}
.wb-msg.assistant .wb-avatar {
  background: #1e293b;
  border: 1px solid var(--border-color);
  padding: 5px;
}
.wb-msg.assistant .wb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wb-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 44px);
}
.wb-msg.user .wb-bubble-wrapper {
  align-items: flex-end;
}

.wb-bubble {
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  font-size: 0.885rem;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}
.wb-msg.user .wb-bubble {
  background: var(--accent-blue);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.wb-msg.assistant .wb-bubble {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
  min-width: 120px;
}
.wb-msg.system .wb-bubble {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  color: var(--text-dim);
  font-size: 0.8rem;
  width: 100%;
  text-align: center;
  padding: 0.5rem 1rem;
}

/* Streaming Blinking Cursor */
.streaming-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent-blue);
  vertical-align: middle;
  margin-left: 3px;
  border-radius: 1px;
  animation: blinkCursor 0.8s infinite;
}
@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Markdown styling inside bubbles */
.wb-markdown {
  color: var(--text-main);
}
.wb-markdown p {
  margin-bottom: 0.75rem;
}
.wb-markdown p:last-child {
  margin-bottom: 0;
}
.wb-markdown h1, .wb-markdown h2, .wb-markdown h3, .wb-markdown h4 {
  color: #fff;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  line-height: 1.3;
}
.wb-markdown h1 { font-size: 1.3rem; }
.wb-markdown h2 { font-size: 1.15rem; }
.wb-markdown h3 { font-size: 1.025rem; }
.wb-markdown ul, .wb-markdown ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.wb-markdown li {
  margin-bottom: 0.25rem;
}
.wb-markdown blockquote {
  border-left: 3px solid var(--accent-blue);
  padding-left: 0.75rem;
  margin: 0.75rem 0;
  color: var(--text-dim);
  background: rgba(56, 189, 248, 0.03);
  border-radius: 0 4px 4px 0;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.wb-markdown code:not(pre code) {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.825em;
  color: #38bdf8;
}
.wb-markdown pre {
  margin: 0.75rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: #090d16 !important;
  border: 1px solid var(--border-color);
}
.wb-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-dim);
}
.wb-code-header button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.725rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  padding: 2px 6px;
  border-radius: 4px;
}
.wb-code-header button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.wb-markdown pre code {
  display: block;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.55;
  overflow-x: auto;
  color: #e2e8f0;
}
.wb-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.825rem;
}
.wb-markdown th, .wb-markdown td {
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.75rem;
  text-align: left;
}
.wb-markdown th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: #fff;
}

/* Metrics Bar under assistant response */
.wb-msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 4px;
}
.wb-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.wb-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.675rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.wb-metric-chip.cost {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}
.wb-msg-actions {
  display: flex;
  gap: 4px;
}
.wb-icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wb-icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* Input Area */
.wb-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.wb-textarea-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wb-textarea-container:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}
.wb-textarea {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.885rem;
  resize: none;
  min-height: 48px;
  max-height: 180px;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}
.wb-textarea::placeholder {
  color: var(--text-dim);
}
.wb-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Inspector Controls */
.wb-control-group {
  margin-bottom: 1.15rem;
}
.wb-control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.wb-control-val {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-size: 0.775rem;
  font-weight: 700;
}
.wb-range {
  width: 100%;
  accent-color: var(--accent-blue);
  cursor: pointer;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Switch Toggle */
.wb-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.wb-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.wb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.wb-slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 20px;
}
.wb-slider-toggle:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.wb-switch input:checked + .wb-slider-toggle {
  background-color: var(--accent-blue);
}
.wb-switch input:checked + .wb-slider-toggle:before {
  transform: translateX(16px);
}

/* Model Spec Card */
.wb-spec-card {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.wb-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.75rem;
  margin-top: 6px;
}
.wb-spec-item {
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.wb-spec-item .label {
  color: var(--text-dim);
  font-size: 0.675rem;
  display: block;
}
.wb-spec-item .value {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Code Modal */
.wb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.wb-modal-overlay.active {
  display: flex;
}
.wb-modal-box {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.wb-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
}
.wb-tab-btn {
  padding: 0.65rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.825rem;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.wb-tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.04);
}
.wb-tab-btn:hover:not(.active) {
  color: #fff;
}

/* Custom Searchable Model Picker Dropdown Popover (Exact match with user reference) */
.model-picker-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1005;
}

.model-picker-btn {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  justify-content: space-between;
  transition: all 0.2s ease;
  user-select: none;
}
.model-picker-btn:hover, .model-picker-btn.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.model-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-width: 92vw;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 8px 8px;
  animation: dropdownFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.model-picker-popover.show {
  display: flex;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.model-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.model-search-bar svg {
  color: #64748b;
  flex-shrink: 0;
}
.model-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.885rem;
  width: 100%;
  font-family: inherit;
}
.model-search-input::placeholder {
  color: #64748b;
}

.model-picker-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.model-picker-list::-webkit-scrollbar {
  width: 5px;
}
.model-picker-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.model-picker-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.885rem;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.4;
}
.model-picker-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.model-picker-item.selected {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-weight: 600;
}
.model-picker-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Backward compatibility for basic chat-window */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}
.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-msg.assistant {
  align-self: flex-start;
}
.chat-bubble {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.55;
}
.chat-msg.user .chat-bubble {
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 500;
}
.chat-msg.assistant .chat-bubble {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  white-space: pre-wrap;
}
.chat-input-bar {
  display: flex;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  gap: 10px;
}

/* --------------------------------------------------------------------------
   DEDICATED ADMIN PORTAL LAYOUT
   -------------------------------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-app);
  position: relative;
}

.admin-sidebar {
  width: 250px;
  background: var(--bg-surface-1);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  overflow: hidden;
}

.admin-sidebar-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.brand-symbol {
  width: 24px;
  height: 24px;
  background: #ffffff;
  color: #000000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  font-family: var(--font-mono);
}

.admin-nav-group {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-nav-group::-webkit-scrollbar {
  width: 4px;
}
.admin-nav-group::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.admin-nav-item:hover {
  background: var(--bg-surface-2);
  color: #fff;
}

.admin-nav-item.active {
  background: var(--bg-surface-2);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.admin-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--bg-surface-1);
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99998;
}

.admin-sidebar-backdrop.active {
  display: block;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 250px;
  width: calc(100% - 250px);
  min-height: 100vh;
}

.admin-topbar {
  height: 60px;
  padding: 0 24px;
  background: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.admin-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  color: var(--text-dim);
  font-size: 13px;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

/* --------------------------------------------------------------------------
   ENTERPRISE DESIGN SYSTEM & ADVANCED EFFECTS
   -------------------------------------------------------------------------- */

/* Header Scroll Transition */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

header.scrolled {
  background: rgba(8, 9, 12, 0.85) !important;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(240, 246, 252, 0.12) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

/* Radar Pulse Indicator */
.radar-pulse-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  margin-right: 6px;
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  z-index: 2;
}

.radar-wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(63, 185, 80, 0.5);
  animation: radar-pulse 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  z-index: 1;
}

@keyframes radar-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Shimmer Buttons */
.btn-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(110deg, #ffffff 30%, #bfdbfe 50%, #ffffff 70%);
  background-size: 200% 100%;
  color: #08090c !important;
  font-weight: 700;
  animation: shimmer-sweep 4s ease-in-out infinite;
  box-shadow: 0 0 25px rgba(56, 139, 253, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-shimmer:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 35px rgba(56, 139, 253, 0.45);
}

@keyframes shimmer-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Interactive Mouse Spotlight Cards (Linear/Vercel Effect) */
.spotlight-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
}

.spotlight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 139, 253, 0.35);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(56, 139, 253, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card > * {
  position: relative;
  z-index: 2;
}

/* Infinite Marquee */
.marquee-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 1.5rem 0;
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marquee-scroll 32s linear infinite;
  will-change: transform;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(240, 246, 252, 0.07);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.marquee-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 139, 253, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Architecture & Traffic Visualizer */
.arch-visualizer {
  background: radial-gradient(circle at 50% 50%, rgba(13, 17, 23, 0.95), rgba(8, 9, 12, 0.98));
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.arch-visualizer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  pointer-events: none;
}

.arch-flow-grid {
  display: grid;
  grid-template-columns: 1.1fr auto 1.4fr auto 1.2fr;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .arch-flow-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.arch-node {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.arch-node:hover {
  border-color: rgba(56, 139, 253, 0.5);
  box-shadow: 0 8px 30px rgba(56, 139, 253, 0.15);
}

.arch-node-core {
  background: linear-gradient(145deg, #131720 0%, #161b22 100%);
  border: 1px solid rgba(56, 139, 253, 0.4);
  box-shadow: 0 0 35px rgba(56, 139, 253, 0.12);
}

.arch-pipe {
  position: relative;
  height: 2px;
  background: rgba(240, 246, 252, 0.12);
  min-width: 60px;
  overflow: visible;
}

@media (max-width: 900px) {
  .arch-pipe {
    height: 35px;
    width: 2px;
    margin: 0 auto;
    min-width: unset;
  }
}

.arch-packet {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58a6ff;
  box-shadow: 0 0 10px #58a6ff, 0 0 18px #2f81f7;
  animation: flow-packet 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.arch-packet-reverse {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 10px #3fb950, 0 0 18px #238636;
  animation: flow-packet-reverse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 1.2s;
}

@keyframes flow-packet {
  0% { left: 0%; opacity: 0; }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes flow-packet-reverse {
  0% { left: 100%; opacity: 0; }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { left: 0%; opacity: 0; }
}

/* Enterprise Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.bento-col-8 { grid-column: span 8; }
.bento-col-4 { grid-column: span 4; }
.bento-col-6 { grid-column: span 6; }
.bento-col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .bento-col-8, .bento-col-4, .bento-col-6 {
    grid-column: span 12;
  }
}

.bento-item {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: #fff;
}

/* Scroll Reveal Animations (IntersectionObserver) */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }
.reveal-delay-4 { transition-delay: 0.48s; }

/* Animated Counter Numbers */
.counter-num {
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  font-weight: 800;
}

/* Table Row Interactive Elevation */
.model-table tbody tr {
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.model-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

/* High-tech Form Focus Rings */
.form-control {
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control:focus {
  border-color: rgba(56, 139, 253, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15), 0 0 20px rgba(56, 139, 253, 0.1) !important;
}

/* Minimalist Enterprise Tabs */
.enterprise-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.enterprise-tab {
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: -0.01em;
}

.enterprise-tab:hover {
  color: #fff;
}

.enterprise-tab.active {
  color: #fff;
  border-bottom-color: #ffffff;
}

/* Chat Message Entrance Animation */
@keyframes message-appear {
  0% { opacity: 0; transform: translateY(8px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg {
  animation: message-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Clean Animated Arrow Link */
.arrow-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.arrow-btn span.arr {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

.arrow-btn:hover span.arr {
  transform: translateX(4px);
}

/* ==========================================================================
   Model Detail Page Styling (RelayModels Specification)
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.back-link:hover {
  color: #fff;
  transform: translateX(-3px);
}

.model-detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.model-hero-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.model-vendor-logo-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.model-vendor-logo-box .vendor-icon {
  width: 28px;
  height: 28px;
}

.model-hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 5px 0;
  word-break: break-word;
}

@media (max-width: 600px) {
  .model-hero-title {
    font-size: 1.4rem;
  }
}

.model-hero-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
  word-break: break-word;
}

.model-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-playground-green {
  background: #10b981 !important;
  color: #032b1d !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  font-size: 0.88rem !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
}

.btn-playground-green:hover {
  background: #059669 !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

/* 4 KPI Cards Bar */
.stats-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 960px) {
  .stats-bar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

.stats-card-mini {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.2s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.stats-card-mini:hover {
  border-color: rgba(240, 246, 252, 0.25);
}

.stats-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modality Tag */
.modality-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #e6edf3;
}

/* Main 2-Column Section Layout */
.model-main-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 860px) {
  .model-main-layout {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    max-width: 100%;
  }
  .model-sidebar {
    flex-direction: row !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    position: sticky !important;
    top: 56px !important;
    background: rgba(8, 9, 12, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    z-index: 50 !important;
    padding: 8px 4px !important;
    margin-bottom: 1.25rem !important;
    -webkit-overflow-scrolling: touch !important;
    border-bottom: 1px solid var(--border-color);
  }
  .model-sidebar .model-nav-item {
    width: auto !important;
    flex-shrink: 0 !important;
    padding: 7px 14px !important;
    font-size: 0.82rem !important;
  }
}

.model-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  width: 100%;
  text-align: left;
}

.model-nav-item:hover {
  color: #fff;
  background: var(--bg-surface-2);
}

.model-nav-item.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.model-content-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.model-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  scroll-margin-top: 100px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .model-section-card {
    padding: 1.25rem 1rem;
  }
}

.model-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-section-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
  word-break: break-word;
}

.spec-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 580px) {
  .spec-grid-4 { grid-template-columns: minmax(0, 1fr); }
}

.spec-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.spec-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.spec-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.tag-pill-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Pricing Section Boxes */
.pricing-boxes-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 600px) {
  .pricing-boxes-2 { grid-template-columns: minmax(0, 1fr); }
}

.pricing-big-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.pricing-big-box .box-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.pricing-big-box .main-price {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.pricing-big-box .sub-pricing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.perf-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 720px) {
  .perf-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .perf-grid-4 { grid-template-columns: minmax(0, 1fr); }
}

.perf-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.perf-box .perf-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.perf-box .perf-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

/* ==========================================================================
   TOP PROGRESS LOADER (App Navigation Effect)
   ========================================================================== */
#topProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #10b981 50%, #8b5cf6 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9), 0 0 6px rgba(16, 185, 129, 0.7);
  z-index: 999999;
  pointer-events: none;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

#topProgressBar.is-loading {
  opacity: 1;
}

/* ==========================================================================
   INTERACTIVE MODEL ROWS & HOVER / CLICK EFFECTS
   ========================================================================== */
.model-row.interactive-row {
  cursor: pointer;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.18s ease, 
              box-shadow 0.18s ease,
              border-color 0.18s ease;
  border-left: 3px solid transparent !important;
}

/* Provider Left Accent Colors */
.model-row.interactive-row[data-provider="anthropic"] { border-left-color: #d97706 !important; }
.model-row.interactive-row[data-provider="openai"]    { border-left-color: #10b981 !important; }
.model-row.interactive-row[data-provider="google"],
.model-row.interactive-row[data-provider="gemini"]    { border-left-color: #38bdf8 !important; }
.model-row.interactive-row[data-provider="deepseek"]  { border-left-color: #3b82f6 !important; }
.model-row.interactive-row[data-provider="qwen"]      { border-left-color: #8b5cf6 !important; }
.model-row.interactive-row[data-provider="moonshot"]  { border-left-color: #06b6d4 !important; }
.model-row.interactive-row[data-provider="nvidia"]    { border-left-color: #84cc16 !important; }
.model-row.interactive-row[data-provider="grok"]      { border-left-color: #ec4899 !important; }
.model-row.interactive-row[data-provider="meta"]      { border-left-color: #2563eb !important; }
.model-row.interactive-row[data-provider="mistral"]   { border-left-color: #f97316 !important; }
.model-row.interactive-row[data-provider="cursor"]    { border-left-color: #14b8a6 !important; }
.model-row.interactive-row[data-provider="xiaomi"],
.model-row.interactive-row[data-provider="mimo"]      { border-left-color: #ef4444 !important; }
.model-row.interactive-row[data-provider="zhipu"]     { border-left-color: #6366f1 !important; }
.model-row.interactive-row[data-provider="minimax"]   { border-left-color: #eab308 !important; }

.model-row.interactive-row:hover {
  background: rgba(255, 255, 255, 0.045) !important;
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.model-row.interactive-row:hover .model-link-title {
  color: var(--accent-blue) !important;
}

.model-row.interactive-row:hover .btn-detail-arrow {
  transform: translateX(3px);
  color: #38bdf8;
}

/* Clicking / Squeeze feedback */
.model-row.row-navigating {
  background: rgba(56, 189, 248, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.4), 0 0 25px rgba(56, 189, 248, 0.25) !important;
  transform: scale(0.994) !important;
  transition: all 0.1s ease !important;
}

/* Capability Pills in Table */
.cap-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.cap-pill.cap-reasoning {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
}
.cap-pill.cap-vision {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}
.cap-pill.cap-fast {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

/* ==========================================================================
   MODEL DETAIL PAGE KEYFRAME ANIMATIONS & POLISH
   ========================================================================== */
@keyframes fadeInUpSmooth {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes badgeShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseRadarDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-fade-in-up {
  animation: fadeInUpSmooth 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stagger-1 { animation-delay: 0.03s; }
.stagger-2 { animation-delay: 0.07s; }
.stagger-3 { animation-delay: 0.11s; }
.stagger-4 { animation-delay: 0.15s; }
.stagger-5 { animation-delay: 0.20s; }

/* Shimmer discount badge */
.discount-pill.shimmer {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.38) 50%, rgba(16, 185, 129, 0.15) 100%);
  background-size: 200% 100%;
  animation: badgeShimmer 2.4s infinite;
}

/* Ambient glow container on detail page */
.vendor-ambient-hero {
  position: relative;
  border-radius: 16px;
  padding: 1.75rem;
  background: radial-gradient(circle at top left, var(--ambient-glow, rgba(56, 189, 248, 0.14)), transparent 60%),
              var(--bg-surface);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.pulse-dot-green {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseRadarDot 2s infinite ease-in-out;
}

/* KPI Cards Micro-interaction */
.stats-card-mini {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.2s ease, 
              box-shadow 0.2s ease;
}

.stats-card-mini:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 15px rgba(56, 189, 248, 0.08);
}

/* Sticky Sidebar Active Bar Indicator */
.model-nav-item {
  position: relative;
  overflow: hidden;
}

.model-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #10b981;
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.model-nav-item.active::before {
  transform: scaleY(1);
}

/* Mini visual meters in performance */
.perf-meter-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.perf-meter-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  transition: width 0.8s ease;
}

/* ==========================================================================
   QUICK VIEW DRAWER MODAL & TOAST
   ========================================================================== */
.quick-view-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.quick-view-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.quick-view-drawer {
  width: 100%;
  max-width: 580px;
  height: 100%;
  background: var(--bg-surface-1);
  border-left: 1px solid var(--border-muted);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.7);
  padding: 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.quick-view-overlay.is-open .quick-view-drawer {
  transform: translateX(0);
}

.app-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.app-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE DESIGN SYSTEM & MOBILE NAVIGATION DRAWER
   ========================================================================== */

/* Universal Overflow Lock */
.marquee-container {
  overflow: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

/* Universal Table Responsive Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  background: var(--bg-surface-1);
}

.table-responsive table {
  margin-bottom: 0 !important;
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
}

.lang-btn {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: var(--bg-surface-3);
  color: #fff;
}

/* Mobile Header Controls */
.mobile-header-controls {
  display: none;
  align-items: center;
  gap: 10px;
}

.mobile-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mobile-toggle-btn:hover {
  background: var(--bg-surface-3);
  border-color: var(--accent-blue);
}

.mobile-balance-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green-bright);
  text-decoration: none;
}

/* Mobile Navigation Off-canvas Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 310px;
  max-width: 86vw;
  background: #090c13;
  border-left: 1px solid var(--border-muted);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.85);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.mobile-drawer-close {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.mobile-drawer-close:hover {
  color: #fff;
  background: var(--bg-surface-2);
  border-color: rgba(255, 255, 255, 0.2);
}

.mobile-user-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  text-decoration: none;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-item.active {
  color: var(--accent-blue-hover);
  background: rgba(56, 139, 253, 0.12);
  font-weight: 600;
}

.mobile-drawer-settings {
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}

.mobile-drawer-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Footer Responsive Styles */
.app-footer {
  border-top: 1px solid var(--border-color);
  background: rgba(8, 9, 12, 0.95);
  padding: 3rem 1.5rem 1.5rem;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-brand-col {
  flex: 1 1 320px;
}

.footer-links-grid {
  display: flex;
  gap: 3.5rem;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-col {
  min-width: 130px;
}

.footer-col-title {
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 13px;
}

.footer-col p {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-sub-bar {
  max-width: 1280px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   BREAKPOINT: TABLET & MOBILE (< 900px)
   ========================================================================== */
.admin-mobile-toggle {
  display: none;
}

@media (max-width: 900px) {
  .desktop-nav, .desktop-actions {
    display: none !important;
  }
  .mobile-header-controls {
    display: flex !important;
  }
  .header-container {
    padding: 0 16px;
    height: 56px;
  }

  /* Admin Responsive Drawer */
  .admin-layout {
    display: block;
    position: relative;
  }

  .admin-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 99999;
    width: 270px !important;
    max-width: 85vw !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85);
  }

  .admin-sidebar.mobile-open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 1rem !important;
  }

  .admin-topbar {
    padding: 0.75rem 1rem !important;
  }

  .admin-mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
  }

  /* Bento Grid Responsive */
  .bento-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  .bento-col-8, .bento-col-4 {
    width: 100% !important;
  }

  /* Architecture Visualizer Responsive */
  .arch-flow-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .arch-pipe {
    height: 35px !important;
    width: 2px !important;
    margin: 0 auto !important;
    min-width: unset !important;
  }
}

/* ==========================================================================
   BREAKPOINT: MOBILE PHONES (< 600px)
   ========================================================================== */
@media (max-width: 600px) {
  /* Hero Box */
  .hero-box {
    padding: 2.5rem 1rem 2rem !important;
  }

  .hero-title {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
  }

  .hero-subtitle {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
  }

  .hero-cta {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-cta .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 18px !important;
  }

  /* Playground Mobile Tuning */
  .wb-top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 0.75rem 1rem !important;
  }

  .wb-top-bar > div {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .model-picker-popover {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 75vh !important;
    z-index: 999999 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85) !important;
    padding: 1.25rem !important;
  }

  .wb-input-area {
    padding: 0.65rem !important;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Dashboard Tuning */
  .enterprise-tabs-bar {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
  }

  .enterprise-tab {
    flex-shrink: 0 !important;
  }

  /* Footer Tuning */
  .footer-links-grid {
    gap: 1.5rem !important;
    width: 100% !important;
  }

  .footer-col {
    flex: 1 1 130px !important;
  }

  .footer-sub-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .footer-endpoint {
    word-break: break-all !important;
  }
}

.model-page-container {
  padding: 2rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .model-page-container {
    padding: 1.25rem 0.85rem 3rem !important;
  }
}

/* ── Usage Dashboard ──────────────────────────────────────── */
.usage-range-btn,
.usage-metric-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1.4;
}
.usage-range-btn:hover,
.usage-metric-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}
.usage-range-btn.active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
.usage-metric-btn.active {
  background: #1a4a2a;
  border-color: #2d7a3a;
  color: #4caf50;
}

/* Heatmap boxes in legend */
.hmap-box {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

/* Responsive: stack chart+models on small screens */
@media (max-width: 860px) {
  .usage-chart-wrapper {
    grid-template-columns: 1fr !important;
  }
  .usage-chart-wrapper > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Remove number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* ── Page Transition ──────────────────────────────────────── */
#page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: #08090c;          /* matches --bg-app */
  opacity: 1;                   /* starts fully opaque */
  transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page has loaded → fade overlay OUT */
#page-transition-overlay.pt-leaving {
  opacity: 0;
  pointer-events: none;
}

/* Link clicked → fade overlay IN */
#page-transition-overlay.pt-entering {
  opacity: 1;
  pointer-events: all;
}

/* Content slides up + fades in on load */
@keyframes pt-slide-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-container,
.page-content,
.playground-layout,
.models-page-container,
.model-page-container,
.docs-container {
  animation: pt-slide-up 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.08s;
}

/* Header slides down */
.app-header {
  animation: pt-header-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pt-header-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Universal In-App Modal & Popup Dialog System
   ========================================================================== */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}

.app-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.app-modal-box {
  background: #0c1220;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(56, 139, 253, 0.15);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-modal-overlay.active .app-modal-box {
  transform: scale(1) translateY(0);
}

.app-modal-header {
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.app-modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-modal-icon-badge.info {
  background: rgba(56, 139, 253, 0.15);
  border: 1px solid rgba(56, 139, 253, 0.3);
  color: #38bdf8;
}

.app-modal-icon-badge.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.app-modal-icon-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.app-modal-icon-badge.danger,
.app-modal-icon-badge.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.app-modal-title-group {
  flex: 1;
}

.app-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.app-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.app-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.app-modal-body {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
  word-break: break-word;
}

.app-modal-body p {
  margin: 0 0 0.75rem;
}
.app-modal-body p:last-child {
  margin-bottom: 0;
}

.app-modal-key-box {
  background: #070b13;
  border: 1px solid rgba(56, 139, 253, 0.35);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 0.75rem;
}

.app-modal-key-input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8;
  background: transparent;
  border: none;
  width: 100%;
  outline: none;
  padding: 0;
}

.app-modal-callout {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.825rem;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.app-modal-callout.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.app-modal-callout.info {
  background: rgba(56, 139, 253, 0.1);
  border: 1px solid rgba(56, 139, 253, 0.25);
  color: #93c5fd;
}

.app-modal-footer {
  padding: 0.875rem 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

