/* Showcraft docs theme
   Initial tokens transcribed from the Figma "Wiki" styles exploration.
   This file is the single source of CSS truth — replace tokens/rules here
   and rebuild nothing: every page links this stylesheet. */

:root {
  --bg: #000;
  --bg-panel: #0e0e10;
  --surface-hover: #1f1f22;
  --hairline: #232326;
  --text: #ececee;
  --text-dim: #c9c9cc;
  --text-faint: #8a8a90;
  --accent: #4dc4e6;
  --accent-bg: #0d3a4a;
  --radius: 8px;
  --sidebar-w: 288px;
  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo { height: 15px; aspect-ratio: 166 / 16; display: block; }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid #2e2e31;
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--text-faint);
  width: min(380px, 40vw);
}

.search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  width: 100%;
}
.search-wrap input::placeholder { color: var(--text-faint); }

.topbar-note {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- layout */

.layout { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 20px 12px 40px;
  background: var(--bg);
  border-right: 1px solid var(--hairline);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 36px 48px 96px;
}

article { max-width: 760px; }

/* --------------------------------------------------------------- sidebar */

.nav-group { margin-bottom: 22px; }

.nav-front-door {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.nav-item.nav-back { color: var(--text-faint); }
.nav-item.nav-back:hover { color: var(--text); }

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-group-title:hover { background: var(--surface-hover); }
.nav-group-title .chev { transition: transform 0.15s ease; color: var(--text-faint); }
.nav-group-title[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.nav-group-title[aria-expanded="false"] + .nav-items { display: none; }

.nav-items { list-style: none; margin: 4px 0 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px;
  text-decoration: none;
}
.nav-item .star { color: var(--text-faint); flex: none; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nav-item.active .star { color: var(--accent); }

.stub-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0 6px;
}
.nav-item.active .stub-badge { color: var(--accent); border-color: var(--accent-bg); }

.nav-group.filtered-out, .nav-items li.filtered-out { display: none; }

/* --------------------------------------------------------------- content */

h1 { font-size: 28px; line-height: 1.25; margin: 0 0 18px; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 40px 0 12px; padding-top: 10px; letter-spacing: -0.005em; }
h3 { font-size: 16.5px; margin: 28px 0 10px; }
h4 { font-size: 15px; margin: 22px 0 8px; }
h1, h2, h3, h4 { font-weight: 650; color: #fff; }

p { margin: 0 0 14px; color: var(--text-dim); }
li { color: var(--text-dim); margin: 4px 0; }
ul, ol { padding-left: 26px; margin: 0 0 14px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sidebar a:hover, .brand:hover { text-decoration: none; }

strong { color: var(--text); font-weight: 650; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #17171a;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1px 5px;
}

pre {
  background: #101013;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  line-height: 1.5;
}
pre code { background: none; border: none; padding: 0; font-size: 12.5px; color: var(--text-dim); }

blockquote {
  margin: 0 0 16px;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: #101013;
  border-radius: 0 var(--radius) var(--radius) 0;
}
blockquote p { margin: 0; }

hr { border: none; border-top: 1px solid var(--hairline); margin: 28px 0; }

figure { margin: 20px 0; }
figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

/* Tables are uniform: every table spans the same width (~900px, shrinking
   responsively on narrow viewports), and every column after the first has a
   fixed width so the numeric columns (Credits / Before / Now / Change) line
   up across consecutive tables. Headers carry the nav's selected-state teal.
   Currently only the Model Pricing page carries tables. */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
  width: min(900px, calc(100vw - var(--sidebar-w) - 96px));
}
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-panel);
}
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td {
  border: none;
  border-bottom: 1px solid #1a1a1e;
  padding: 10px 16px;
  text-align: left;
  color: var(--text-dim);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: #131317; }
tbody tr:hover td { background: #1b2a33; }
th:not(:first-child), td:not(:first-child) { width: 120px; }
td:not(:first-child) { font-variant-numeric: tabular-nums; }
th {
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 650;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

@media (max-width: 860px) {
  .table-wrap { width: 100%; }
}

/* ------------------------------------------------- pricing-page toolbar */

.pricing-toolbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  background: var(--bg);
  display: flex;
  flex-wrap: nowrap;            /* one row, always */
  overflow-x: auto;             /* scrollable chip row if squeezed */
  scrollbar-width: none;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--hairline);
  width: min(900px, calc(100vw - var(--sidebar-w) - 96px));
}
.pricing-toolbar::-webkit-scrollbar { display: none; }

.pricing-toolbar .pt-filter {
  flex: none;
  background: transparent;
  border: 1px solid #2e2e31;
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  width: 130px;
}
.pricing-toolbar .pt-filter::placeholder { color: var(--text-faint); }
.pricing-toolbar .pt-filter:focus { border-color: var(--accent-bg); }

.pill {
  flex: none;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
}
.pill:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }

@media (max-width: 860px) {
  .pricing-toolbar { width: 100%; }
}

/* --------------------------------------------- stacked card tables (mobile) */

@media (max-width: 700px) {
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr {
    border-bottom: 1px solid var(--hairline);
    padding: 12px 14px;
  }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:nth-child(even) td, tbody tr:hover td { background: none; }
  th:not(:first-child), td:not(:first-child) { width: auto; }
  td {
    border: none;
    padding: 2px 0;
    white-space: normal;
  }
  td:first-child { color: var(--text); font-weight: 600; padding-bottom: 6px; }
  td[data-label] { display: flex; gap: 12px; align-items: baseline; }
  td[data-label]::before {
    content: attr(data-label);
    color: var(--text-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 64px;
  }
}

.stub-banner {
  max-width: 760px;
  margin: 0 0 24px;
  padding: 10px 16px;
  border: 1px solid var(--accent-bg);
  border-radius: var(--radius);
  background: rgba(14, 58, 71, 0.35);
  color: var(--accent);
  font-size: 13.5px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 28px 20px 80px; }
  .topbar-note { display: none; }
}
