/* ===========================================================================
   TryOn-API console — refreshed layout system.
   Dark-first dev console. Identity = code meets garment:
   Space Grotesk display + JetBrains Mono technical labels.
   Light + dark themes via [data-theme]. Fonts + theme bootstrap in each page <head>.
   ========================================================================== */

:root {
  /* ---- design tokens (dark, default) ---- */
  --bg: #09090b;
  --bg-grid: rgba(255, 255, 255, 0.022);
  --panel: #0e0e11;
  --card: #121216;
  --card-2: #16161b;
  --hover: #1a1a20;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.13);
  --border-accent: rgba(99, 101, 241, 0.55);

  --text: #f4f4f6;
  --text-2: #a4a4ae;
  --text-3: #6c6c77;

  --accent: #6062f0;
  --accent-soft: rgba(96, 98, 240, 0.14);
  --accent-text: #9b9cf6;
  --accent-fg: #ffffff;

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.13);
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, 0.13);
  --red: #f06262;
  --red-soft: rgba(240, 98, 98, 0.13);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.65);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1200px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* ---- legacy aliases (keep older rules + inline styles working) ---- */
  --bg-2: var(--card-2);
  --bg-3: var(--hover);
  --text-dim: var(--text-2);
  --text-faint: var(--text-3);
  --accent-2: var(--accent);
  --font: var(--sans);
}

[data-theme="light"] {
  --bg: #f6f6f8;
  --bg-grid: rgba(0, 0, 0, 0.022);
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #fbfbfc;
  --hover: #f1f1f4;
  --border: rgba(17, 17, 20, 0.10);
  --border-2: rgba(17, 17, 20, 0.16);
  --border-accent: rgba(80, 69, 230, 0.5);

  --text: #18181b;
  --text-2: #55555f;
  --text-3: #8b8b95;

  --accent: #5145e6;
  --accent-soft: rgba(81, 69, 230, 0.10);
  --accent-text: #5145e6;
  --accent-fg: #ffffff;

  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.11);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.10);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.10);

  --shadow: 0 1px 2px rgba(17, 17, 26, 0.06), 0 14px 30px -16px rgba(17, 17, 26, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 { line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
code, pre, .mono { font-family: var(--mono); }

::selection { background: var(--accent-soft); }

/* faint dotted grid texture behind everything for identity */
.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--bg-grid) 1px, transparent 0);
  background-size: 28px 28px;
  z-index: -1;
}

/* ---------- shared layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.page { padding: 46px 0 80px; }
@media (prefers-reduced-motion: no-preference) {
  .page { animation: pageIn .3s ease both; }
}
@keyframes pageIn { from { transform: translateY(5px); } to { transform: none; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.eyebrow .brace { color: var(--text-3); }

.page-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-sub { color: var(--text-2); margin: 8px 0 0; font-size: 15px; }

/* legacy page header — restyled to the new title look */
.page-head { margin-bottom: 26px; }
.page-head h1 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.02em;
}
.page-head p { margin: 8px 0 0; color: var(--text-2); }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 28px;
  height: 60px; display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  height: 30px; padding: 0 7px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 1px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent-text);
}
.brand-mark .br { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: 14px; color: var(--text-2);
  padding: 7px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-ghost { font-size: 14px; color: var(--text-2); padding: 7px 10px; border-radius: 8px; }
.nav-ghost:hover { color: var(--text); text-decoration: none; }
.credits-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
}
.credits-pill:hover { text-decoration: none; color: var(--text-2); }
.credits-pill b { color: var(--green); font-weight: 600; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot.ok { background: var(--green); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); color: var(--text-2);
  transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.nav-mobile-btn { display: none; }
.nav-mobile-panel {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 20px 16px; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  animation: panelDown .18s ease;
}
@keyframes panelDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nmp-link { padding: 12px 12px; border-radius: 9px; color: var(--text-2); font-size: 15px; }
.nmp-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nmp-link.active { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nmp-divider { height: 1px; background: var(--border); margin: 8px 0; }
.nmp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--border); transition: .16s;
  white-space: nowrap;
  background: var(--card); color: var(--text);
}
.btn:hover { background: var(--hover); border-color: var(--border-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; box-shadow: 0 6px 18px -8px var(--accent); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); background: var(--accent); border-color: transparent; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--hover); border-color: var(--border-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- inputs ---------- */
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.5; }
.label { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px; font-weight: 550; }
.field { margin-bottom: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- cards / panels ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .16s, transform .16s, background .16s;
}
.card-pad { padding: 22px; }
.card-link:hover { border-color: var(--border-2); transform: translateY(-2px); text-decoration: none; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

/* ---------- badges / tags / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-2);
  color: var(--text-2);
}
.badge .sd { width: 6px; height: 6px; border-radius: 50%; }
.badge-available, .badge.green { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.badge-available .sd { background: var(--green); }
.badge-beta, .badge.amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.badge-beta .sd { background: var(--amber); }
.badge-unavailable, .badge.gray { color: var(--text-3); border-color: var(--border-2); }
.badge-unavailable .sd { background: var(--text-3); }
.badge.accent { color: var(--accent-text); border-color: var(--border-accent); background: var(--accent-soft); }

.tag, .chip {
  display: inline-flex; align-items: center;
  font-size: 12px; padding: 3px 9px; border-radius: 7px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text-2);
}
.tag-accent { color: var(--accent-text); background: var(--accent-soft); border-color: var(--border-accent); }

/* ---------- footer ---------- */
.foot, .site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  margin-top: 48px;
}
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-copy { color: var(--text-3); font-size: 13px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a, .footer-nav a { color: var(--text-3); font-size: 13px; }
.foot-links a:hover, .footer-nav a:hover { color: var(--text); text-decoration: none; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- generic helpers ---------- */
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

.section-label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); display: flex; align-items: center; gap: 9px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* ---------- states ---------- */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; color: var(--text-2); text-align: center;
}
.empty-state { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty-state h3 { color: var(--text-2); margin: 0 0 6px; font-family: var(--display); }

/* ---------- toasts ---------- */
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13.5px; color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.18s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- code blocks ---------- */
pre.code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px; overflow-x: auto;
  font-size: 13px; line-height: 1.6; color: var(--text-2);
}
pre.code .add, pre.code .c-str { color: var(--green); }
pre.code .cmt, pre.code .c-com { color: var(--text-3); }
pre.code .c-key { color: #c084fc; }
pre.code .c-fn { color: var(--accent-text); }
.collapsible summary { cursor: pointer; font-size: 13px; color: var(--text-2); padding: 8px 0; user-select: none; }
.collapsible summary:hover { color: var(--text); }

/* code-panel (home + docs code blocks) */
.code-panel {
  background: linear-gradient(180deg, var(--panel), var(--bg));
  border: 1px solid var(--border-2);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.code-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--card);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-file { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-left: 4px; }
.code-copy { margin-left: auto; }
.code-body { padding: 18px; overflow-x: auto; }
.code-body pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--text-2); white-space: pre; }
.c-com { color: var(--text-3); }
.c-key { color: #c084fc; }
.c-str { color: var(--green); }
.c-fn  { color: var(--accent-text); }

/* ---------- toolbar / search / select / view toggle ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin: 26px 0 8px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 220px; }
.search {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; height: 42px; color: var(--text-3);
}
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; font-family: inherit; }
.select {
  height: 42px; padding: 0 34px 0 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border); color: var(--text-2);
  font-size: 13.5px; font-family: inherit; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7c86' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select-full { width: 100%; }
.viewtoggle { display: flex; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.viewtoggle button { background: none; border: none; color: var(--text-3); padding: 6px 10px; border-radius: 7px; display: grid; place-items: center; transition: .15s; }
.viewtoggle button.active { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.result-meta { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin: 10px 2px 18px; }

/* ============================================================
   HOME
   ============================================================ */
.hero { position: relative; padding: 64px 0 30px; }
.hero-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 760px; height: 420px; pointer-events: none;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 62%);
  filter: blur(20px); opacity: .9;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: 52px; line-height: 1.04; letter-spacing: -0.03em; margin: 18px 0 0;
}
.hero h1 em, .hero .accent-text { font-style: normal; color: var(--accent-text); }
.hero p.lead { color: var(--text-2); font-size: 17px; line-height: 1.6; margin: 20px 0 0; max-width: 30em; }
.hero-cta, .hero .cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hstat { display: flex; flex-direction: column; gap: 2px; }
.hstat b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.hstat span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

.features, .feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.feature { padding: 20px; }
.feature .fi, .feature .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--border-accent); margin-bottom: 0; }
.feature h3 { font-family: var(--display); font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.feature p { color: var(--text-2); font-size: 13.5px; margin: 0; line-height: 1.55; }
.feature p code { font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--card-2); padding: 1px 5px; border-radius: 5px; }

.console-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.console-card { padding: 18px 20px; }
.console-card h4 { font-family: var(--display); font-size: 15px; font-weight: 600; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.console-card h4 .arr { color: var(--accent-text); transition: transform .16s; display: inline-flex; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
.console-card:hover h4 .arr { transform: translateX(3px); }
.console-card p { color: var(--text-2); font-size: 13px; margin: 0; }

/* ============================================================
   MODELS
   ============================================================ */
.models-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.model-card { position: relative; padding: 20px; padding-left: 22px; display: flex; flex-direction: column; overflow: hidden; }
.model-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--text-3); opacity: .5; }
.model-card.s-available::before { background: var(--green); opacity: .85; }
.model-card.s-beta::before { background: var(--amber); opacity: .85; }
.model-card.s-unavailable::before { background: var(--text-3); opacity: .35; }
.model-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.model-name { font-family: var(--display); font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.model-id { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 5px; }
.model-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin: 14px 0 0; }
.model-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.model-foot { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.metric { display: flex; flex-direction: column; gap: 2px; }
.metric .ml { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.metric .mv { font-size: 13px; color: var(--text); font-weight: 500; }
.metric.price { text-align: right; }
.metric .mv b { font-family: var(--display); }

/* table / list view */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mtable thead th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; padding: 12px 16px; background: var(--card-2); border-bottom: 1px solid var(--border);
}
.mtable tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mtable tbody tr { transition: background .14s; }
.mtable tbody tr:last-child td { border-bottom: none; }
.mtable tbody tr:hover { background: var(--hover); }
.mt-name { font-family: var(--display); font-weight: 600; font-size: 14px; }
.mt-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.mt-right { text-align: right; font-family: var(--mono); }
.th-right { text-align: right; }
.mt-mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.stat-card { padding: 20px; }
.stat-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.stat-label .si { color: var(--text-3); display: inline-flex; }
.stat-value { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; margin-top: 12px; line-height: 1; }
.stat-value.green { color: var(--green); }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.stat-sub .up { color: var(--green); }
.stat-sub .down { color: var(--red); }

.dash-mid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-top: 16px; }
.panel-card { padding: 20px 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.panel-title { font-family: var(--display); font-size: 16px; font-weight: 600; }
.panel-hint { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.chart-total { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
.chart-total b { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.chart-total span { font-size: 12.5px; color: var(--text-3); }
.legend { display: flex; gap: 16px; margin-top: 14px; }
.legend span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; }

.mini-list { display: flex; flex-direction: column; gap: 2px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-row:last-child { border-bottom: none; }
.mini-rank { font-family: var(--mono); font-size: 12px; color: var(--text-3); width: 18px; }
.mini-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.mini-id { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.mini-bar { width: 64px; height: 6px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.mini-val { font-family: var(--mono); font-size: 12px; color: var(--text-2); width: 46px; text-align: right; }

.runs-card { margin-top: 16px; padding: 0; overflow: hidden; }
.runs-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; }
.run-thumb {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  background: repeating-linear-gradient(135deg, var(--card-2), var(--card-2) 6px, var(--hover) 6px, var(--hover) 12px);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.run-thumb.ok { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent); }
.run-thumb.fail { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 30%, transparent); }
.run-cell { display: flex; align-items: center; gap: 12px; }
.run-model { font-weight: 500; font-size: 13.5px; }
.run-sub { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; padding: 3px 9px; border-radius: 999px; }
.status-pill .sd { width: 6px; height: 6px; border-radius: 50%; }
.sp-done { color: var(--green); background: var(--green-soft); }
.sp-done .sd { background: var(--green); }
.sp-fail { color: var(--red); background: var(--red-soft); }
.sp-fail .sd { background: var(--red); }
.sp-proc { color: var(--amber); background: var(--amber-soft); }
.sp-proc .sd { background: var(--amber); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* legacy stat grid (credits page) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat .label { margin-bottom: 8px; }
.stat .value { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.quick-card { display: block; text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.quick-card:hover { border-color: var(--border-2); transform: translateY(-2px); text-decoration: none; }
.quick-card h3 { margin: 0 0 6px; font-size: 16px; font-family: var(--display); }
.quick-card p { margin: 0; font-size: 13.5px; }

/* ============================================================
   PLAYGROUND
   ============================================================ */
.pg-grid { display: grid; grid-template-columns: 420px 1fr; gap: 20px; align-items: start; }
.config-card { padding: 22px; }
.pg-result-col { position: sticky; top: 80px; }
.field-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.field-label .fl-hint { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.field-divider { height: 1px; background: var(--border); margin: 22px 0; }
.input-row { display: flex; gap: 8px; }
.field-help { font-size: 12px; color: var(--text-3); margin-top: 9px; line-height: 1.5; }
.field-help a { color: var(--accent-text); }

/* dropzone (kept ids/classes from playground.js, restyled) */
.drop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dropzone {
  position: relative; aspect-ratio: 3 / 4; border: 1.5px dashed var(--border-2); border-radius: 12px;
  display: grid; place-items: center; text-align: center; cursor: pointer; transition: .16s;
  background: var(--card-2); overflow: hidden; color: var(--text-3);
}
.dropzone:hover, .dropzone.drag { border-color: var(--border-accent); background: var(--hover); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-hint { padding: 16px; font-size: 12px; color: var(--text-3); }
.dropzone .dz-hint b { color: var(--text-2); display: block; margin-bottom: 4px; font-family: var(--display); font-size: 15px; font-weight: 600; }
.dropzone img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; background: #000; }
.dropzone .dz-clear {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer;
}
.dropzone.has-image .dz-clear { display: flex; }
.dropzone.has-image .dz-hint { display: none; }

/* toggles (checkbox-driven switches) */
.options { display: flex; flex-direction: column; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); cursor: pointer; }
.switch-row:first-child { border-top: none; }
.sr-label b { font-weight: 500; font-size: 14px; display: block; color: var(--text); }
.sr-label span { font-size: 12px; color: var(--text-3); }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw { width: 40px; height: 23px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border-2); position: relative; transition: .16s; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--text-3); transition: .16s; }
.switch-row input:checked + .sw { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .sw::after { left: 19px; background: #fff; }

.run-cost { text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 11px; }
.progress { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; border: 1px solid var(--border); }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.shot { position: relative; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card-2); }
.shot img { width: 100%; height: auto; display: block; }
.shot-meta { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: #fff; flex-wrap: wrap; }
.shot-meta .chip { background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.16); padding: 4px 9px; border-radius: 7px; color: #fff; }
.shot-ph { position: absolute; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--card-2), var(--card-2) 9px, var(--hover) 9px, var(--hover) 18px); }
.shot-ph span { font-family: var(--mono); font-size: 12px; color: var(--text-3); background: var(--card); padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border); }
.shot.proc::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(110deg, transparent 30%, var(--accent-soft) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 220% 0; } to { background-position: -120% 0; } }
.progress-row { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.progress.indet i { width: 35%; animation: indet 1.15s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.run-log { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; max-height: 168px; overflow-y: auto; margin-top: 14px; }
.run-log .ll { padding: 1.5px 0; white-space: pre-wrap; }
.run-log .ts { color: var(--text-3); }
.run-log .ok { color: var(--green); }
.run-log .ky { color: var(--accent-text); }

/* result panel */
.result-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: #000; display: block; }
.result-empty {
  min-height: 480px; border: 1.5px dashed var(--border); border-radius: 16px;
  display: grid; place-items: center; text-align: center; padding: 40px;
}
.re-mark {
  width: 56px; height: 56px; border-radius: 14px; display: inline-grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--accent-text); margin: 0 auto 18px; gap: 1px;
}
.result-empty h3 { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 0 0 8px; }
.result-empty p { color: var(--text-2); margin: 0; max-width: 30em; }
.result-empty p b { color: var(--text); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.result-title { font-family: var(--display); font-size: 18px; font-weight: 600; }
.result-actions { display: flex; gap: 8px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* ============================================================
   RANKINGS — visual try-on leaderboard (existing feature, restyled)
   ============================================================ */
.rank-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; flex-wrap: wrap; margin: 22px 0 0; }
.rank-tab {
  font: inherit; font-size: 14px; font-weight: 550; color: var(--text-2);
  background: transparent; border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer; white-space: nowrap;
}
.rank-tab:hover { color: var(--text); }
.rank-tab.active { color: var(--accent-fg); background: var(--accent); }
.rank-subtabs { margin-top: 14px; }
.rank-subtabs .rank-tab.active { color: var(--text); background: var(--card-2); }

.badge.ns-badge { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }

/* fixed inputs strip (product + persons) */
.rank-inputs { display: flex; align-items: center; gap: 26px; padding: 16px 20px; margin: 18px 0; }
.ri-group { display: flex; align-items: center; gap: 12px; }
.ri-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.ri-thumbs { display: flex; gap: 8px; }
.ri-thumb { width: 50px; height: 62px; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; position: relative; flex-shrink: 0; background: var(--card-2); }
.ri-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ri-cap { font-family: var(--mono); font-size: 10px; color: var(--text-3); text-align: center; margin-top: 4px; white-space: nowrap; }
.ri-div { width: 1px; align-self: stretch; background: var(--border); }

/* sort row */
.sort-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.sort-row .sl { font-size: 13px; color: var(--text-3); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg button { background: none; border: none; color: var(--text-2); font-family: inherit; font-size: 13px; padding: 6px 13px; border-radius: 7px; cursor: pointer; transition: .15s; }
.seg button.active { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.sort-note { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* split: scrollable list + sticky compare */
.rank-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-col-right { position: sticky; top: 80px; }

.rank-card { padding: 18px; margin-bottom: 0; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rank-card:hover { border-color: var(--border-2); }
.rank-card.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rank-card.muted { opacity: .72; }
.rc-top { display: flex; align-items: flex-start; gap: 12px; }
.rc-num { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600; background: var(--card-2); border: 1px solid var(--border); color: var(--text-2); }
.rank-card.sel .rc-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.rc-name { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.rc-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.rc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.rc-score-wrap { margin-left: auto; text-align: right; flex-shrink: 0; }
.rc-score { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.rc-score.unrated { font-size: 13px; color: var(--text-3); font-family: var(--mono); }
.stars { color: var(--amber); font-size: 12px; letter-spacing: 1px; margin-top: 5px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 6px; margin-top: 7px; }
.delta.pos { color: var(--green); background: var(--green-soft); }
.delta.neg { color: var(--red); background: var(--red-soft); }
.delta.zero { color: var(--text-3); background: var(--card-2); }
.rc-verdict { color: var(--text-2); font-size: 13.5px; line-height: 1.5; margin: 14px 0 0; }
.mini-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mini-shots.one { grid-template-columns: 1fr; max-width: 50%; }
.ref-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--border-accent); }
.pin-btn { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; color: var(--text-3); background: var(--card-2); border: 1px solid var(--border); padding: 4px 9px; border-radius: 7px; margin-top: 12px; transition: .15s; white-space: nowrap; cursor: pointer; }
.pin-btn:hover { color: var(--text); border-color: var(--border-2); }
.pin-btn.active { color: var(--accent-text); border-color: var(--border-accent); background: var(--accent-soft); }

/* result shot (real image) */
.rk-shot { position: relative; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--card-2); display: block; cursor: zoom-in; }
.rk-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rk-shot .lab { position: absolute; left: 8px; bottom: 8px; font-family: var(--mono); font-size: 10.5px; color: #fff; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.14); padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(3px); white-space: nowrap; }
.rk-shot.fail, .rk-shot.pending { display: grid; place-items: center; background: var(--card-2); border-style: dashed; border-color: var(--border-2); cursor: default; }
.rk-shot.fail .fail-in { text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rk-shot.fail .fail-in span, .rk-shot.pending span { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }

/* compare panel */
.compare-panel { padding: 18px; }
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cmp-title { font-family: var(--display); font-size: 16px; font-weight: 600; }
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-side { display: flex; flex-direction: column; gap: 9px; }
.cmp-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cmp-role { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.cmp-role.a { color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--border-accent); }
.cmp-role.b { color: var(--text-2); background: var(--card-2); border: 1px solid var(--border); }
.cmp-side-name { font-family: var(--display); font-weight: 600; font-size: 13px; line-height: 1.2; }
.cmp-side-score { font-family: var(--display); font-weight: 600; font-size: 15px; }
.cmp-delta-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 4px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.cmp-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.85); display: none; align-items: center; justify-content: center; padding: 24px; }
.lb.open { display: flex; }
.lb-inner { display: flex; gap: 18px; max-width: 1000px; max-height: 90vh; flex-wrap: wrap; align-items: center; justify-content: center; }
.lb-fig { text-align: center; }
.lb-fig img { max-height: 78vh; max-width: 46vw; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: #000; }
.lb-fig figcaption { color: var(--text-2); font-size: 13px; margin-top: 8px; }
.lb-close { position: fixed; top: 18px; right: 22px; font-size: 26px; line-height: 1; color: #fff; background: transparent; border: 0; cursor: pointer; }

/* ============================================================
   DOCS (existing quickstart markup, restyled to design)
   ============================================================ */
.docs-layout { display: grid; grid-template-columns: 216px 1fr; gap: 52px; align-items: start; }
.docs-sidebar { position: sticky; top: 80px; align-self: start; }
.docs-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.docs-sidebar .docs-nav-title { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); margin: 0 0 10px; padding: 0 12px; }
.docs-sidebar a { display: block; color: var(--text-2); font-size: 13.5px; padding: 7px 12px; border-left: 2px solid transparent; transition: .14s; }
.docs-sidebar a:hover { color: var(--text); text-decoration: none; }
.docs-sidebar a.active { color: var(--text); border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.docs-sidebar .docs-nav-sep { height: 1px; background: var(--border); margin: 14px 8px; display: block; }

.docs-content { max-width: 800px; min-width: 0; }
.docs-content h2 { font-family: var(--display); font-size: 25px; font-weight: 600; letter-spacing: -0.02em; margin: 42px 0 16px; scroll-margin-top: 84px; }
.docs-content h2:first-child { margin-top: 0; }
.docs-content h3 { font-family: var(--display); font-size: 17px; margin: 28px 0 8px; scroll-margin-top: 84px; }
.docs-content p { color: var(--text-2); font-size: 15px; line-height: 1.72; }
.docs-content section { scroll-margin-top: 84px; }
.docs-content ul, .docs-content ol { color: var(--text-2); padding-left: 22px; }
.docs-content li { margin: 4px 0; }
.docs-content code, .ic { font-family: var(--mono); font-size: 0.86em; background: var(--card-2); padding: 1.5px 6px; border-radius: 5px; border: 1px solid var(--border); color: var(--text); }

/* callouts (legacy docs markup) */
.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 18px 0; font-size: 14px; line-height: 1.6; color: var(--text);
}
.callout p { margin: 0; color: var(--text); }
.callout p + p { margin-top: 8px; }
.callout code { font-family: var(--mono); font-size: 0.86em; background: rgba(127, 127, 140, 0.16); padding: 1px 5px; border-radius: 5px; }
.callout.warn { border-left-color: var(--amber); background: var(--amber-soft); }

/* code tabs (legacy docs markup) */
.code-tabs { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; margin: 14px 0; }
.code-tab-bar { display: flex; align-items: center; gap: 2px; background: var(--card); border-bottom: 1px solid var(--border); padding: 4px 4px 0; }
.code-tab-btn {
  font: inherit; font-family: var(--mono); font-size: 12px; color: var(--text-3);
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; cursor: pointer; border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm);
}
.code-tab-btn:hover { color: var(--text-2); }
.code-tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.code-tab-bar .code-copy {
  margin-left: auto; font: inherit; font-size: 12px; font-weight: 550; color: var(--text-2);
  background: transparent; border: 1px solid var(--border-2); border-radius: 6px; padding: 4px 9px; margin-bottom: 4px; cursor: pointer;
}
.code-tab-bar .code-copy:hover { color: var(--text); background: var(--card-2); }
.code-tab-bar .code-copy.copied { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.code-tab-panel { display: none; }
.code-tab-panel.active { display: block; }
.code-tab-panel pre.code { border: 0; border-radius: 0; margin: 0; }

.bearer { font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; margin: 0 0 18px; overflow-x: auto; }
.next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.scalar-wrap { min-height: 80vh; }

/* ---------- comparison table (compare.html) ---------- */
table.cmp { width: 100%; border-collapse: collapse; margin: 14px 0 8px; font-size: 14px; }
table.cmp th, table.cmp td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.cmp thead th { color: var(--text-2); font-weight: 650; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
table.cmp tbody th[scope="row"] { font-weight: 500; color: var(--text); }
table.cmp tbody tr:hover { background: var(--card-2); }
table.cmp td { color: var(--text-2); }

/* ---------- keys table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--mono); }
.table tr:last-child td { border-bottom: 0; }
.copybox { display: flex; gap: 8px; align-items: stretch; background: var(--card-2); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 12px; }
.copybox code { flex: 1; overflow-x: auto; white-space: nowrap; color: var(--text); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero h1 { font-size: 42px; }
  .features, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .console-grid { grid-template-columns: repeat(2, 1fr); }
  .models-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .dash-mid { grid-template-columns: 1fr; }
  .pg-grid { grid-template-columns: 1fr; }
  .pg-result-col { position: static; }
  .result-empty { min-height: 360px; }
  .docs-layout { grid-template-columns: 1fr; gap: 28px; }
  .docs-sidebar { position: static; top: auto; display: none; }
  .next-grid { grid-template-columns: 1fr; }
  .rank-split { grid-template-columns: 1fr; }
  .rank-col-right { position: static; order: -1; }
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-desktop { display: none !important; }
  .nav-mobile-btn { display: grid; }
  .features, .feature-grid, .console-grid, .models-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .table-wrap { overflow-x: auto; }
  .mtable { min-width: 720px; }
  .compare-grid { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
}
