:root {
  color-scheme: light dark;
  --bg: #f5efe3;
  --surface: #ffffff;
  --surface-raised: #ebe3d2;
  --ink: #2a221c;
  --ink-secondary: #4a3d33;
  --muted: #80715f;
  --line: #e0d6c2;
  --line-strong: #cabfa8;
  --brand: #b06040;
  --brand-light: rgba(176, 96, 64, 0.08);
  --brand-glow: rgba(176, 96, 64, 0.18);
  --accent: #b06040;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #065f46;
  --success-bg: #d1fae5;
  --warning-bg: #fef9c3;
  --warning-ink: #854d0e;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --transition: 0.15s ease;
  --mono: "SF Mono", "Fira Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1612;
    --surface: #221c17;
    --surface-raised: #2a231d;
    --ink: #ebe3d2;
    --ink-secondary: #b8aa92;
    --muted: #80715f;
    --line: #2f261f;
    --line-strong: #443628;
    --brand: #d4845a;
    --brand-light: rgba(212, 132, 90, 0.10);
    --brand-glow: rgba(212, 132, 90, 0.18);
    --danger: #f87171;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --success: #34d399;
    --success-bg: rgba(6, 95, 70, 0.15);
    --warning-bg: rgba(133, 77, 14, 0.12);
    --warning-ink: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
  }
}

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

body {
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.shell { max-width: 800px; margin: 0 auto; padding: 40px 40px; }
.shell.wide { max-width: 1080px; padding: 8px 40px 40px; }

/* --- Header --- */
header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; flex-shrink: 0; }
.brand span { color: var(--brand); }
nav { display: flex; gap: 24px; font-size: 0.8125rem; font-weight: 500; justify-content: center; }
nav a { color: var(--muted); transition: color var(--transition); }
nav a:hover { color: var(--ink); }

/* --- Header search (results page only) --- */
body.v51-results-body header {
  grid-template-columns: auto minmax(0, 540px) auto;
}
.header-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 32px;
}
.header-search input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  font-size: 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.header-search button {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  font-size: 0.8125rem;
}


/* --- Typography --- */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
h1 { font-size: 2.75rem; line-height: 1.1; margin-bottom: 20px; }
h2 { font-size: 1.375rem; margin-bottom: 16px; }
h3 { font-size: 1rem; }

.lede { font-size: 1.125rem; color: var(--muted); margin-bottom: 32px; max-width: 560px; line-height: 1.7; }


.section { margin-bottom: 80px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* --- Inputs --- */
input, textarea, select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
textarea { min-height: 100px; resize: vertical; }
select { cursor: pointer; }

label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* --- Buttons --- */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
button:hover, .button:hover {
  background: var(--surface-raised);
  border-color: var(--line-strong);
}
button:focus-visible, .button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
button.primary, .button.primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}
button.primary:hover, .button.primary:hover {
  opacity: 0.9;
  box-shadow: 0 2px 8px var(--brand-glow);
}
button.sm { font-size: 0.75rem; padding: 4px 10px; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger-bg); }

/* --- Search box --- */
.search-box { position: relative; margin-bottom: 40px; }
.search-box input {
  width: 100%;
  padding: 14px 18px;
  padding-right: 110px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow);
}
.search-box button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  border-radius: var(--radius-sm);
}

/* --- Results --- */
.results { display: flex; flex-direction: column; gap: 4px; }
.result-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: transparent;
  animation: fadeUp 0.3s ease both;
  transition: background var(--transition);
  overflow: hidden;
  min-width: 0;
}
.result-item:hover {
  background: var(--surface-raised);
}
.result-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--brand);
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: break-word;
}
.result-title:hover { text-decoration: underline; }
.result-url {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
  font-family: var(--mono);
}
.result-snippet {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin-top: 6px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.result-matched-in {
  font-size: 0.7rem;
  color: var(--accent, #4a7);
  margin-top: 4px;
  font-style: italic;
  text-transform: lowercase;
}
.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Status messages --- */
.summary-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface-raised);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
}
.summary-caveman {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.summary-box.summary-loading {
  opacity: 0.6;
  animation: summary-pulse 1.2s ease-in-out infinite;
}
.summary-box.summary-loading .summary-caveman {
  animation: summary-bob 0.6s ease-in-out infinite;
}
@keyframes summary-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.35; }
}
@keyframes summary-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.status-msg { font-size: 0.8125rem; margin-bottom: 12px; color: var(--muted); }
.status-msg.error { color: var(--danger); }

/* --- Result status bar --- */
.result-count { font-weight: 600; color: var(--ink-secondary); }
.result-sep { margin: 0 6px; color: var(--line-strong); }
.result-time, .result-source {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Vote buttons --- */
.result-meta .vote-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.6875rem;
  color: var(--muted);
  transition: all 0.15s;
  line-height: 1;
}
.result-meta .vote-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-raised);
}

/* --- Grid / Features --- */
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.feature {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.feature:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.feature h3 { font-size: 1rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature p { font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }

/* --- Code --- */
pre, code { font-family: var(--mono); }
pre {
  background: var(--surface-raised);
  padding: 18px 20px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  overflow: auto;
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.7;
}
code {
  font-size: 0.85em;
  background: var(--surface-raised);
  padding: 2px 5px;
  border-radius: 3px;
}
pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}


/* --- Results page layout --- */
.results-page { padding-top: 0; }
.results-col { min-width: 0; }
.results-col .status-msg { margin-bottom: 12px; min-height: 18px; }

/* --- Vote buttons --- */
.result-meta .vote-btn { opacity: 0.6; }
.result-meta .vote-btn:hover,
.result-meta .vote-btn:focus-visible { opacity: 1; }
.vote-btn.vote-up   { background: #e6f4ea; color: #1a7f37; border-color: #1a7f37; font-weight: 600; opacity: 1; }
.vote-btn.vote-down { background: #fde8e8; color: #cf222e; border-color: #cf222e; font-weight: 600; opacity: 1; }


/* --- Pills / Badges --- */
.pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--surface-raised);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pill.success { background: var(--success-bg); color: var(--success); }
.pill.danger  { background: var(--danger-bg);  color: var(--danger); }
.pill.warn    { background: var(--warning-bg);  color: var(--warning-ink); }
.pill.get     { background: var(--success-bg); color: var(--success); font-family: var(--mono); font-size: 0.625rem; }
.pill.post    { background: rgba(59,130,246,0.1); color: #3b82f6; font-family: var(--mono); font-size: 0.625rem; }

/* --- Confidence bar --- */
.confidence-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
}
.confidence-bar .track {
  width: 48px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.confidence-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.conf-high  { background: var(--success); }
.conf-med   { background: #f59e0b; }
.conf-low   { background: var(--danger); }

/* --- Docs layout --- */
.docs-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: start;
}
.docs-sidebar { position: sticky; top: 72px; }
.docs-sidebar-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}
.docs-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.docs-nav a {
  display: block;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.docs-nav a:hover { color: var(--ink); background: var(--surface-raised); }
.docs-nav a.active { color: var(--brand); background: var(--brand-light); }
.docs-main h2 { padding-top: 32px; margin-top: 0; }
.docs-main h2:first-child { padding-top: 0; }
.endpoint-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0 32px;
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
}
.endpoint-body { padding: 20px; }
.endpoint-body h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 20px 0 8px;
}
.endpoint-body h3:first-child { margin-top: 0; }
.endpoint-body pre { margin: 0; }
.docs-section {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.docs-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-sidebar { position: static; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .docs-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
}

/* --- Cards --- */
.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}
.card-title { font-weight: 600; font-size: 0.875rem; word-break: break-all; }
.card-subtitle { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; word-break: break-all; }
.card-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-raised);
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}
.tab.active .tab-count {
  color: var(--brand);
  background: var(--brand-light);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.2s ease; }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 8px 12px;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.table td {
  padding: 10px 12px;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table .mono { font-family: var(--mono); font-size: 0.75rem; }

/* --- Alert / Flash --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert.error   { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }
.alert.warn    { background: var(--warning-bg); color: var(--warning-ink); }

/* --- Layout helpers --- */
.two-col { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gap-sm { gap: 8px; }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: 40px; }
.hidden { display: none; }

/* --- Settings --- */
.settings-wrap { margin-bottom: 24px; }
.settings-toggle {
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.settings-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.settings-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  white-space: nowrap;
}
.page-current {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0 8px;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: all var(--transition);
}
.page-link:hover { background: var(--surface-raised); }
.page-link.active {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  pointer-events: none;
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* --- Empty state --- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* --- Nav CTA button --- */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--brand);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8125rem;
  transition: opacity var(--transition);
}
.nav-cta:hover { opacity: 0.9; color: #fff !important; }

/* --- Home page --- */
body.home-page {
  --bg: #f5efe3;
  --surface: #ebe3d2;
  --surface-raised: #ddd3bd;
  --line: #d8cdb6;
  --line-strong: #c2b69a;
  --accent-warm: #b06040;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
body.home-page .shell {
  padding: 0;
  max-width: none;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
}
body.home-page .shell > section { flex: 1; }
body.home-page header {
  margin-bottom: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 40px;
  box-shadow: 0 1px 12px rgba(176, 96, 64, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.home-page .brand span { color: var(--accent-warm); }
@media (prefers-color-scheme: dark) {
  body.home-page {
    --bg: #131210;
    --surface: #1c1b19;
    --surface-raised: #252420;
    --line: #2c2a27;
    --line-strong: #3d3a36;
  }
}

/* --- Split hero layout (55/45) --- */
.home-hero {
  display: grid;
  grid-template-columns: 55fr 45fr;
  min-height: calc(100vh - 53px);
  margin: 0;
  padding: 0;
  width: 100%;
  overflow: hidden;
}
.home-hero-left {
  padding: 64px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 1px 1px, rgba(176, 96, 64, 0.07) 1px, transparent 0);
  background-size: 22px 22px;
}
.home-hero-right {
  background: #1a1714;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  min-height: 100%;
}

/* --- Badge row with tiny mascot --- */
.home-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.home-badge-mascot {
  width: 40px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid #d4845a;
  background: rgba(212, 132, 90, 0.06);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #b06040;
  letter-spacing: 0.02em;
}
.home-badge::before {
  content: "+";
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .home-badge { color: #d4845a; border-color: #d4845a; }
}

/* --- Headline (large) --- */
.home-headline {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: clamp(2.5rem, 4.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 16px;
}
.home-headline-accent {
  color: #b06040;
  font-style: italic;
}
@media (prefers-color-scheme: dark) {
  .home-headline-accent { color: #d4845a; }
}

/* --- Subtitle --- */
.home-sub {
  font-size: 1.0625rem;
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}

/* --- Search form (large) --- */
.home-search-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.home-search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(176, 96, 64, 0.08);
  overflow: hidden;
  max-width: 540px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.home-search-form:focus-within {
  border-color: #d4845a;
  box-shadow: 0 8px 28px rgba(176, 96, 64, 0.18), 0 0 0 4px rgba(212, 132, 90, 0.08);
}
.home-search-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-left: 18px;
  color: var(--muted);
}
.home-search-input {
  flex: 1;
  height: 56px;
  padding: 0 14px;
  border: none;
  border-radius: 0;
  font-size: 1rem;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  width: 0;
  min-width: 0;
}
.home-search-input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}
.home-search-btn {
  flex-shrink: 0;
  margin: 7px;
  height: 42px;
  padding: 0 24px;
  background: #b06040;
  color: #fef9f3;
  border: none;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.home-search-btn:hover { background: #944b2c; transform: translateY(-1px); }
.home-search-btn:active { transform: translateY(0); }

/* --- Feature tags --- */
.home-tags {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.home-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(176, 96, 64, 0.08);
  border: 1px solid rgba(176, 96, 64, 0.2);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #b06040;
}
@media (prefers-color-scheme: dark) {
  .home-tag { color: #d4845a; border-color: rgba(212, 132, 90, 0.25); background: rgba(212, 132, 90, 0.1); }
}

/* --- Code panel (right side, dark) --- */

/* Code tabs */
.home-code-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #2c2a27;
  padding-bottom: 0;
}
.home-code-tab {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #78716c;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  font-family: var(--mono);
}
.home-code-tab:hover { color: #a8a29e; }
.home-code-tab.active { color: #e7e5e4; border-bottom-color: #d4845a; }

.home-code-cta {
  margin-left: auto;
  padding: 6px 14px;
  background: #b06040;
  color: #fef9f3;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
  font-family: var(--sans);
}
.home-code-cta:hover { opacity: 0.9; color: #fef9f3; }

/* Code blocks in right panel */
pre.home-code-block {
  margin: 0 0 2px;
  padding: 14px 16px;
  background: #1c1917;
  border: 1px solid #2c2a27;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #e7e5e4;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius);
}
pre.home-code-block .c-cmt { color: #78716c; }
pre.home-code-block .c-str { color: #d4845a; }
pre.home-code-block .c-kw  { color: #e7e5e4; }
pre.home-code-block .c-flag { color: #a8a29e; }
pre.home-code-block .c-key { color: #93c5fd; }
pre.home-code-block .c-num { color: #86efac; }

.home-response-label {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #a8a29e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--sans);
}
pre.home-response-block {
  border-color: #2c2a27;
  background: #171412;
}

/* --- Stats row --- */
.home-stats-row {
  display: flex;
  gap: 32px;
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid #2c2a27;
}
.home-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #e7e5e4;
  letter-spacing: -0.02em;
  font-family: var(--sans);
}
.home-stat-label {
  font-size: 0.6875rem;
  color: #78716c;
  font-family: var(--sans);
}

/* --- Mobile responsive --- */
@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .home-hero-left {
    padding: 32px 24px;
    align-items: center;
    text-align: center;
  }
  .home-badge-row { justify-content: center; }
  .home-headline { text-align: center; }
  .home-sub { text-align: center; margin-left: auto; margin-right: auto; }
  .home-search-form { max-width: 100%; }
  .home-tags { justify-content: center; }
  .home-hero-right { padding: 24px 20px 32px; }
  .home-stats-row { gap: 20px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .home-hero-left { padding: 24px 20px; }
  .home-tags { gap: 6px; }
  .home-tag { font-size: 0.6875rem; padding: 4px 10px; }
  .home-search-btn { padding: 0 18px; font-size: 0.875rem; }
  .home-code-tabs { overflow-x: auto; }
  .home-code-tab { padding: 8px 10px; font-size: 0.75rem; }
}

/* --- Footer --- */
body.home-page .footer { margin-top: 0; }
.footer {
  margin-top: 120px;
  padding: 32px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}
.footer-eula {
  margin-top: 4px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--muted);
  opacity: 0.7;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--ink); }

[hidden] { display: none !important; }

/* --- Spinner --- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 2.25rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .grid { grid-template-columns: 1fr; }
  header {
    padding: 12px 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }
  nav {
    margin-left: auto;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-search {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
    margin: 0;
  }
  .header-search input {
    min-width: 0;
  }
  .shell { padding: 24px 20px; }
  .footer { padding: 24px 20px; }
  .tabs { overflow-x: auto; }
  .admin-overview { grid-template-columns: 1fr; }
  .code-tab { padding: 8px 10px; font-size: 0.6875rem; }
}

/* --- Admin overview --- */
.admin-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.overview-section {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.overview-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.overview-stats { display: flex; flex-wrap: wrap; gap: 20px; }
.overview-stat { display: flex; align-items: baseline; gap: 5px; }
.overview-value {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.overview-value.brand { color: var(--brand); }
.overview-value.ok    { color: var(--success); }
.overview-value.warn  { color: #f59e0b; }
.overview-value.bad   { color: var(--danger); }
.overview-label { font-size: 0.6875rem; color: var(--muted); }

/* --- Progress bar --- */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}
.progress-fill { height: 100%; transition: width 0.4s ease; }
.progress-fill.ok   { background: var(--success); }
.progress-fill.warn { background: #f59e0b; }
.progress-fill.bad  { background: var(--danger); }

.tab-hint { font-size: 0.75rem; color: var(--muted); margin-bottom: 16px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.url-mono {
  font-size: 0.6875rem;
  color: var(--muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table tr.row-processing { background: var(--warning-bg); }
.table tr.row-failed     { background: var(--danger-bg); }

.card .card-url {
  font-size: 0.6875rem;
  font-family: var(--mono);
  color: var(--muted);
  word-break: break-all;
  margin-top: 2px;
}
.card .card-time { font-size: 0.6875rem; color: var(--muted); margin-top: 8px; }
.card .fetch-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Local places --- */
.local-results { margin-bottom: 24px; }
.local-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px 0;
}
.local-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.local-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  transition: border-color var(--transition);
}
.local-card:hover { border-color: var(--line-strong); }
.local-name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.local-category { font-size: 0.75rem; color: var(--brand); margin-bottom: 4px; }
.local-address {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.local-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}
.local-meta a { color: var(--brand); text-decoration: none; }

/* ============================================================
   Override old split-hero flex-stretch for multi-section home
   ============================================================ */
body.home-page .shell > section { flex: 0 0 auto; }
body.home-page .shell { justify-content: flex-start; }

/* ============================================================
   Home page: v51 Apple color palette (white/blue/gray)
   ============================================================ */
body.home-page {
  --bg:             #FFFFFF;
  --surface:        #F5F5F7;
  --surface-raised: #EDEDF0;
  --ink:            #1D1D1F;
  --ink-secondary:  #515154;
  --muted:          #86868B;
  --line:           rgba(0,0,0,0.08);
  --line-strong:    rgba(0,0,0,0.12);
  --brand:          #0071E3;
  --brand-light:    rgba(0,113,227,0.08);
  --brand-glow:     rgba(0,113,227,0.18);
  background: #FFFFFF;
  color: #1D1D1F;
}
@media (prefers-color-scheme: dark) {
  body.home-page {
    --bg:             #FFFFFF;
    --surface:        #F5F5F7;
    --surface-raised: #EDEDF0;
    --ink:            #1D1D1F;
    --ink-secondary:  #515154;
    --muted:          #86868B;
    --line:           rgba(0,0,0,0.08);
    --line-strong:    rgba(0,0,0,0.12);
    --brand:          #0071E3;
    --brand-light:    rgba(0,113,227,0.08);
    background: #FFFFFF;
    color: #1D1D1F;
  }
}
body.home-page header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: none;
  margin-bottom: 0;
}
body.home-page .brand { color: #1D1D1F; }
body.home-page .brand span { color: #0071E3; }
body.home-page nav a { color: #86868B; }
body.home-page nav a:hover { color: #1D1D1F; }
body.home-page .nav-cta {
  background: #0071E3;
  color: #fff !important;
  border-radius: 980px;
  font-weight: 400;
}
body.home-page .nav-cta:hover { background: #0077ED; opacity: 1; }
body.home-page .footer {
  background: #FFFFFF;
  border-top: 1px solid rgba(0,0,0,0.08);
  color: #86868B;
  margin-top: 0;
}

/* ============================================================
   Brand mascot in header
   ============================================================ */
.brand-mascot {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  vertical-align: middle;
  margin-right: 6px;
}

/* ============================================================
   Nav CTA — pill style (v51)
   ============================================================ */
.nav-cta {
  border-radius: 980px !important;
  padding: 7px 16px !important;
}

/* ============================================================
   v51 Apple-style home page — exact match to v51.html
   ============================================================ */

/* Hero — white→gray1 gradient, centered */
.v51-hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px 36px;
  text-align: center;
  background:
    linear-gradient(rgba(0,113,227,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,113,227,0.028) 1px, transparent 1px),
    linear-gradient(180deg, #FFFFFF 0%, #FBFBFC 48%, #F2F6FB 100%);
  background-size: 42px 42px, 42px 42px, auto;
}
.v51-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(0,113,227,0.14);
  border-radius: 980px;
  background: rgba(0,113,227,0.055);
  font-size: 14px;
  font-weight: 600;
  color: #0071E3;
  margin-bottom: 24px;
}
/* 72px gradient headline */
.v51-headline {
  font-size: clamp(56px, 8vw, 88px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
  max-width: 940px;
  margin: 0 auto 18px;
  background: linear-gradient(180deg, #1D1D1F 0%, #555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}
.v51-headline-accent {
  background: linear-gradient(90deg, #0071E3, #64acff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.v51-sub {
  font-size: 22px;
  color: #86868B;
  max-width: 780px;
  margin: 0 auto 20px;
  font-weight: 400;
  line-height: 1.42;
}
.v51-hero-primary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 34px;
  flex-wrap: wrap;
}
.v51-hero-primary-actions .v51-dark-cta-secondary {
  color: #1D1D1F;
  border-color: rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.72);
}
.v51-hero-primary-actions .v51-dark-cta-secondary:hover {
  color: #0071E3;
  border-color: rgba(0,113,227,0.22);
}
.v51-tagline {
  font-size: 14px;
  color: #86868B;
  margin-bottom: 32px;
  letter-spacing: 0.3px;
}
/* Answer / Search / Distill mode toggle */
.v51-mode-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.v51-mode-toggle {
  display: inline-flex;
  background: rgba(245,245,247,0.86);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 980px;
  padding: 4px;
  gap: 0;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.85);
}
.v51-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #86868B;
  cursor: help;
  outline: none;
  transition: color 0.15s, background 0.15s;
}
.v51-info:hover, .v51-info:focus { color: #0071E3; background: rgba(0,113,227,0.08); }
.v51-info svg { display: block; }
.v51-info-tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: 320px;
  max-width: calc(100vw - 40px);
  padding: 14px 16px;
  border-radius: 12px;
  background: #1D1D1F;
  color: #F5F5F7;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  text-align: left;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 50;
}
.v51-info-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1D1D1F;
}
.v51-info-tip strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 6px;
}
.v51-info-tip strong + span + strong { margin-top: 10px; }
.v51-info-tip > span { display: block; color: #C7C7CC; }
.v51-info-link {
  display: inline-block;
  margin-top: 10px;
  color: #64ACFF;
  font-weight: 500;
  text-decoration: none;
  font-size: 12px;
}
.v51-info-link:hover { color: #8EC0FF; text-decoration: underline; }
.v51-info:hover .v51-info-tip,
.v51-info:focus .v51-info-tip,
.v51-info-tip:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ── Paper-style technique brief (Tom's Distillation page) ─────────────── */
.paper {
  max-width: 740px;
  margin: 0 auto;
  padding: 80px 40px 120px;
  color: #1D1D1F;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  line-height: 1.65;
}
.paper code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: #F5F5F7;
  padding: 2px 6px;
  border-radius: 6px;
  color: #1D1D1F;
}
.paper-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.paper-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: #0071E3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.paper-title {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  margin: 0 0 16px;
  background: linear-gradient(180deg, #1D1D1F 0%, #555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.paper-title-accent {
  background: linear-gradient(90deg, #0071E3, #64ACFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}
.paper-byline {
  font-size: 19px;
  color: #86868B;
  margin: 0;
  line-height: 1.4;
}
.paper-section {
  margin-bottom: 40px;
}
.paper-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  color: #1D1D1F;
}
.paper-section p { font-size: 16px; color: #1D1D1F; margin: 0 0 12px; }
.paper-section em { font-style: italic; color: #1D1D1F; }
.paper-steps,
.paper-list {
  margin: 0;
  padding-left: 22px;
}
.paper-steps li,
.paper-list li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
}
.paper-steps li strong { font-weight: 600; color: #1D1D1F; }
.paper-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}
.paper-table th,
.paper-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  vertical-align: top;
}
.paper-table th {
  font-weight: 600;
  color: #86868B;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.paper-cta-section { border-top: 1px solid rgba(0,0,0,0.08); padding-top: 32px; margin-top: 56px; }
.paper-cta {
  font-size: 17px;
  color: #1D1D1F;
}
.paper-cta a {
  color: #0071E3;
  font-weight: 500;
  text-decoration: none;
}
.paper-cta a:hover { text-decoration: underline; }
.paper-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 13px;
  color: #86868B;
}

@media (max-width: 600px) {
  .paper { padding: 48px 20px 80px; }
  .paper-title { font-size: 40px; letter-spacing: -1.4px; }
  .paper-byline { font-size: 17px; }
  .paper-section h2 { font-size: 19px; }
  .v51-info-tip { width: 280px; }
}
.v51-mode-btn {
  padding: 9px 22px;
  border-radius: 980px;
  border: none;
  background: transparent;
  color: #86868B;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
  font-family: inherit;
}
.v51-mode-btn:hover { color: #1D1D1F; background: none; }
.v51-mode-btn.active {
  background: #FFFFFF;
  color: #1D1D1F;
  box-shadow: 0 8px 22px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.06);
}
.v51-mode-btn { position: relative; }
.v51-mode-tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: 240px;
  max-width: calc(100vw - 40px);
  padding: 10px 12px;
  border-radius: 10px;
  background: #1D1D1F;
  color: #F5F5F7;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  text-align: left;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 50;
  white-space: normal;
}
.v51-mode-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1D1D1F;
}
.v51-mode-btn:hover .v51-mode-tip,
.v51-mode-btn:focus-visible .v51-mode-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Search: input + button (no icon wrapper, matches v51 layout) */
.v51-search-form {
  width: min(100%, 590px);
  max-width: 590px;
  margin: 0;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 18px 50px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.v51-search-icon { display: none; } /* hidden — v51 doesn't have icon */
.v51-search-input {
  flex: 1;
  padding: 0 16px;
  border-radius: 13px;
  border: 0;
  background: transparent;
  color: #1D1D1F;
  font-size: 17px;
  outline: none;
  box-shadow: none;
  font-family: inherit;
  height: 48px;
  width: auto;
  min-width: 0;
}
.v51-search-input:focus {
  border-color: transparent;
  box-shadow: none;
}
.v51-search-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 13px;
  background: #0071E3;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  margin: 0;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0,113,227,0.22);
}
.v51-search-form:focus-within {
  border-color: rgba(0,113,227,0.28);
  box-shadow: 0 20px 54px rgba(0,0,0,0.09), 0 0 0 4px rgba(0,113,227,0.08);
}
.v51-search-btn:hover { background: #0077ED; opacity: 1; transform: translateY(-1px); }
.v51-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 760px);
  margin: 0 auto 14px;
}
.v51-get-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 0 23px;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(0,0,0,0.08);
  color: #1D1D1F;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 18px 50px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.v51-get-code:hover {
  color: #0071E3;
  background: #FFFFFF;
  border-color: rgba(0,113,227,0.22);
  transform: translateY(-1px);
  box-shadow: 0 20px 54px rgba(0,0,0,0.10), 0 0 0 4px rgba(0,113,227,0.06);
}
.v51-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 740px;
  margin-bottom: 0;
}
.v51-badge {
  padding: 7px 14px;
  border-radius: 980px;
  font-size: 13px;
  background: rgba(255,255,255,0.64);
  border: 1px solid rgba(0,0,0,0.075);
  color: #6E6E73;
  font-weight: 600;
}
.v51-hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: min(100%, 860px);
  margin: 32px auto 0;
  align-items: start;
}
.v51-hero-col-heading {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6E6E73;
  margin: 0 0 14px;
}
.v51-hero-col-heading .v51-info { width: 18px; height: 18px; font-size: 12px; vertical-align: middle; margin-left: 4px; text-transform: none; }
.v51-hero-left .v51-mode-toggle { justify-content: flex-start; }
.v51-hero-left .v51-hero-actions { margin-top: 14px; }
.v51-hero-right {
  min-width: 0;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 20px 24px;
}
.v51-install-tabs { display: flex; gap: 0; margin-bottom: 8px; }
.v51-install-tab { padding: 4px 12px; font-size: 12px; font-weight: 600; border: none; background: none; color: #86868B; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; }
.v51-install-tab.active { color: #1D1D1F; border-bottom-color: #0071E3; }
.v51-install-tab:hover { color: #1D1D1F; }
.v51-install-cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1D1D1F;
  border-radius: 10px;
  padding: 12px 16px;
}
.v51-install-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 16px;
  color: #fff;
  user-select: all;
  flex: 1;
  min-width: 0;
}
.v51-hero-right .v51-qi-copy {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.v51-hero-right .v51-qi-copy:hover { background: rgba(255,255,255,0.25); }
.v51-install-detail {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #6E6E73;
  line-height: 1.5;
}
.v51-install-detail a {
  color: var(--brand, #0066CC);
  text-decoration: none;
  font-weight: 500;
}
.v51-install-detail a:hover { text-decoration: underline; }
@media (max-width: 680px) {
  .v51-hero-split { grid-template-columns: 1fr; gap: 24px; }
}
.v51-install-strip {
  display: grid;
  grid-template-columns: auto minmax(138px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 14px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  box-shadow: 0 14px 34px rgba(0,0,0,0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.v51-install-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #6E6E73;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.v51-install-code {
  display: block;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 9px;
  background: #1D1D1F;
  color: #F5F5F7;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v51-install-manual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0071E3;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.v51-install-manual:hover { color: #005FBF; }
.v51-install-manual span {
  color: #86868B;
  font-weight: 500;
}
.v51-live-panel {
  width: min(100%, 1040px);
  margin: 34px auto 0;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 24px 70px rgba(0,0,0,0.08);
  text-align: left;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}
.v51-live-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
.v51-live-kicker {
  font-size: 12px;
  font-weight: 700;
  color: #0071E3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  margin-bottom: 4px;
}
.v51-live-head h2 {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0;
  color: #1D1D1F;
}
.v51-live-install {
  display: inline-flex;
  flex-shrink: 0;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border-radius: 980px;
  background: #0071E3;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.v51-live-install:hover { color: #fff; background: #0077ED; }
.v51-live-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 14px;
  align-items: stretch;
}
.v51-live-card {
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  background: #F5F5F7;
  border: 1px solid rgba(0,0,0,0.055);
  overflow: hidden;
}
.v51-live-label {
  font-size: 11px;
  font-weight: 700;
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  margin-bottom: 10px;
}
.v51-live-code-card {
  padding: 0;
  background: rgba(245,245,247,0.72);
  overflow: hidden;
}
.v51-live-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.v51-live-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.v51-live-tab {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #86868B;
  font-size: 15px;
  font-weight: 600;
  min-height: 50px;
  box-shadow: none;
}
.v51-live-tab:hover {
  background: transparent;
  color: #1D1D1F;
}
.v51-live-tab.active {
  color: #1D1D1F;
  border-bottom: 2px solid #1D1D1F;
}
.v51-live-copy {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.10);
  color: #6E6E73;
  font-size: 12px;
  font-weight: 700;
}
.v51-live-copy:hover {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.18);
}
.v51-live-result {
  color: #1D1D1F;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
  overflow-y: auto;
  word-wrap: break-word;
}
.v51-live-result strong { font-weight: 700; }
.v51-live-result p { margin: 0 0 10px; }
.v51-live-result ul { margin: 8px 0 0; padding-left: 18px; }
.v51-live-result li { margin: 4px 0; }
.v51-live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 980px;
  background: rgba(0,113,227,0.08);
  color: #0071E3;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}
.v51-live-pill.miss {
  background: rgba(255,159,10,0.12);
  color: #9A5B00;
}
.v51-live-docs { margin-top: 12px; }
.v51-live-docs h4 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: #1D1D1F; }
.v51-live-docs details { margin-bottom: 6px; }
.v51-live-docs summary { cursor: pointer; font-size: 13px; font-weight: 500; color: #0071E3; }
.v51-doc-source { color: #86868B; font-weight: 400; }
.v51-doc-snippet { font-size: 12px; line-height: 1.5; max-height: 200px; overflow-y: auto; background: #F5F5F7; border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; color: #1D1D1F; margin-top: 4px; }
.v51-retry-stealth-btn {
  padding: 8px 18px;
  border: 1px solid #0071E3;
  border-radius: 8px;
  background: rgba(0,113,227,0.06);
  color: #0071E3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.v51-retry-stealth-btn:hover {
  background: #0071E3;
  color: #fff;
}
.v51-live-hint-stats {
  font-size: 13px;
  color: #0071E3;
  background: rgba(0,113,227,0.06);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  line-height: 1.5;
}
.v51-live-gated-wrap {
  position: relative;
  overflow: hidden;
}
.v51-live-gated-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to bottom, rgba(245,245,247,0) 0%, rgba(245,245,247,0.85) 40%, rgba(245,245,247,1) 70%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 18px;
  pointer-events: none;
}
.v51-live-gated-cta {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 980px;
  background: #0071E3;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0,113,227,0.25);
}
.v51-live-gated-cta:hover { background: #0077ED; color: #fff; }
.v51-live-gated {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.v51-live-gated a {
  color: var(--accent);
}
.v51-live-code {
  margin: 0;
  padding: 22px 24px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1D1D1F;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
  max-height: 420px;
  -webkit-overflow-scrolling: touch;
}

/* Stats — contrasting background */
.v51-stats {
  padding: 88px 40px;
  background: #FFFFFF;
}
.v51-stats-row {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 920px;
  margin: 0 auto;
  flex-wrap: wrap;
  border-top: 1px solid rgba(0,0,0,0.07);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.v51-stat {
  text-align: center;
  flex: 1 1 220px;
  padding: 34px 40px;
}
.v51-stat + .v51-stat { border-left: 1px solid rgba(0,0,0,0.07); }
.v51-stat-val {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.045em;
  color: #1D1D1F;
  line-height: 1;
}
.v51-stat-label {
  font-size: 14px;
  color: #86868B;
  margin-top: 10px;
  font-weight: 500;
}

/* Code showcase — gray1 background, WHITE code blocks */
.v51-showcase {
  padding: 104px 40px;
  background: #F5F5F7;
}
.v51-showcase-h2 {
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -1px;
  margin-bottom: 48px;
  color: #1D1D1F;
}
.v51-showcase-h2 span { color: #0071E3; }
.v51-showcase .v51-showcase-h2 { margin-bottom: 10px; }
.v51-showcase-sub {
  text-align: center;
  color: #86868B;
  font-size: 17px;
  margin: 0 auto 48px;
}
.v51-code-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.v51-code-block {
  background: #FFFFFF;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.05);
  min-width: 0;
}
.v51-code-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  min-height: auto;
  gap: 0;
  background: #FFFFFF;
}
.v51-ct {
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: #86868B;
  background: none;
  border: none;
  border-bottom: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
  margin-bottom: 0;
  margin-right: 16px;
}
.v51-ct:hover { color: #1D1D1F; background: none; }
.v51-ct.active { color: #0071E3; font-weight: 600; }
.v51-code-cta {
  margin-left: auto;
  padding: 6px 14px;
  background: #0071E3;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.v51-code-cta:hover { background: #0077ED; color: #fff; opacity: 1; }
.v51-code-label {
  font-size: 13px;
  font-weight: 500;
  color: #86868B;
}
.v51-code-body {
  padding: 0;
}
.v51-code-body pre {
  margin: 0;
  padding: 20px;
  background: #FFFFFF;
  border: none;
  border-radius: 0;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.9;
  color: #1D1D1F;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  max-width: 100%;
}
.v51-code-body .c-kw   { color: #0071E3; }
.v51-code-body .c-str  { color: #BF5AF2; }
.v51-code-body .c-num  { color: #30D158; }
.v51-code-body .c-cmt  { color: #86868B; }
.v51-code-body .c-key  { color: #BF5AF2; }

.v51-json-expand { display: block; }
.v51-json-expand summary {
  display: inline-block;
  cursor: pointer;
  color: #86868B;
  font-style: italic;
}
.v51-json-expand summary:hover { color: #0071E3; }

/* Features — white background, icon with blue gradient bg */
.v51-features {
  padding: 112px 40px;
  background: #FFFFFF;
}
.v51-features-h2 {
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -1px;
  margin-bottom: 12px;
  color: #1D1D1F;
}
.v51-features-sub {
  text-align: center;
  color: #86868B;
  font-size: 18px;
  margin-bottom: 60px;
}
.v51-feature-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.v51-feature-card {
  text-align: center;
  padding: 40px 30px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #FBFBFC;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.v51-feature-card:hover {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.09);
  transform: translateY(-2px);
}
.v51-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,113,227,0.08), rgba(0,113,227,0.02));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0071E3;
  font-size: 22px;
  margin: 0 auto 16px;
}
.v51-feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1D1D1F;
  letter-spacing: -0.2px;
}
.v51-feature-card p {
  font-size: 14px;
  color: #86868B;
  line-height: 1.5;
}

/* Responsive */
  @media (max-width: 768px) {
  .v51-hero { padding: 42px 20px 22px; }
  .v51-eyebrow { margin-bottom: 18px; }
  .v51-headline { font-size: 42px; letter-spacing: -0.045em; margin-bottom: 22px; }
  .v51-sub { font-size: 17px; margin-bottom: 24px; }
  .v51-hero-actions { flex-direction: column; align-items: stretch; }
  .v51-get-code { min-height: 48px; width: 100%; }
  .v51-mode-toggle { max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
  .v51-mode-btn { padding: 8px 14px; white-space: nowrap; }
  .v51-hero-actions { margin-bottom: 22px; }
  .v51-badges { gap: 8px; }
  .v51-badge { padding: 6px 12px; }
  .v51-live-panel { margin-top: 26px; padding: 16px; border-radius: 20px; }
  .v51-live-head { flex-direction: column; align-items: stretch; }
  .v51-live-install { justify-content: center; }
  .v51-live-grid { grid-template-columns: 1fr; }
  .v51-stats { padding: 64px 24px; }
  .v51-stats-row { gap: 0; }
  .v51-stat { flex-basis: 100%; padding: 26px 16px; }
  .v51-stat + .v51-stat { border-left: 0; border-top: 1px solid rgba(0,0,0,0.07); }
  .v51-stat-val { font-size: 32px; }
  .v51-showcase { padding: 72px 24px; }
  .v51-code-grid { grid-template-columns: 1fr; }
  .v51-features { padding: 76px 24px; }
  .v51-feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .v51-search-form { flex-direction: row; padding: 5px; border-radius: 16px; }
  .v51-search-input { width: 100%; }
  .v51-search-input::placeholder { font-size: 14px; }
  .v51-search-btn { width: 44px; height: 44px; border-radius: 12px; }
}

/* ============================================================
   v51 results page — white/blue palette
   ============================================================ */
body.v51-results-body {
  --bg:             #FFFFFF;
  --surface:        #F5F5F7;
  --surface-raised: #EDEDF0;
  --ink:            #1D1D1F;
  --muted:          #86868B;
  --line:           rgba(0,0,0,0.08);
  --line-strong:    rgba(0,0,0,0.12);
  --brand:          #0071E3;
  background: #FFFFFF;
  color: #1D1D1F;
}
@media (prefers-color-scheme: dark) {
  body.v51-results-body {
    --bg:             #FFFFFF;
    --surface:        #F5F5F7;
    --ink:            #1D1D1F;
    --muted:          #86868B;
    --line:           rgba(0,0,0,0.08);
    --brand:          #0071E3;
    background: #FFFFFF;
    color: #1D1D1F;
  }
}
body.v51-results-body header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: none;
}
body.v51-results-body .brand { color: #1D1D1F; }
body.v51-results-body .brand span { color: #0071E3; }
body.v51-results-body nav a { color: #86868B; }
body.v51-results-body nav a:hover { color: #1D1D1F; }
body.v51-results-body .nav-cta { background: #0071E3; border-radius: 980px; font-weight: 400; }
body.v51-results-body .nav-cta:hover { background: #0077ED; opacity: 1; }
body.v51-results-body .footer { background: #FFFFFF; border-top: 1px solid rgba(0,0,0,0.08); color: #86868B; margin-top: 0; }
body.v51-results-body .shell { max-width: none; padding: 0; }
body.v51-results-body .header-search input {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.12);
  color: #1D1D1F;
}
body.v51-results-body .header-search input:focus { border-color: #0071E3; }
body.v51-results-body .header-search button {
  background: #0071E3;
  color: #fff;
  border-color: transparent;
}

/* Search results container */
.v51-search-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px;
}
.v51-search-page:has(.v51-results-grid.json-open) { max-width: 1400px; }

.v51-search-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.v51-search-toolbar .v51-search-status { margin-bottom: 0; }

.v51-json-toggle {
  padding: 6px 14px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.12);
  color: #1D1D1F;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.v51-json-toggle:hover { background: #F5F5F7; }
.v51-json-toggle[aria-pressed="true"] {
  background: #0071E3;
  color: #FFFFFF;
  border-color: #0071E3;
}

.v51-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
.v51-results-grid.json-open { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.v51-json-panel {
  background: #1D1D1F;
  border-radius: 16px;
  overflow: hidden;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
.v51-json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #2C2C2E;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.v51-json-label {
  font-size: 12px;
  font-weight: 600;
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.v51-json-copy {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #F5F5F7;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.v51-json-copy:hover { background: rgba(255,255,255,0.14); }
.v51-json-body {
  margin: 0;
  padding: 16px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #F5F5F7;
  background: #1D1D1F;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  flex: 1;
}

@media (max-width: 900px) {
  .v51-results-grid.json-open { grid-template-columns: 1fr; }
  .v51-json-panel { position: static; max-height: 480px; }
}

/* Status bar */
.v51-search-status {
  font-size: 13px;
  color: #86868B;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}
.v51-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0071E3;
  flex-shrink: 0;
}
.v51-status-error { color: #FF453A; }

/* AI Summary */
.v51-ai-summary {
  background: #F5F5F7;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.v51-ai-summary-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.v51-ai-summary-label {
  font-size: 12px;
  color: #0071E3;
  font-weight: 600;
  margin-bottom: 4px;
}
.v51-ai-summary-text {
  font-size: 15px;
  color: #86868B;
  line-height: 1.5;
}
.v51-ai-summary.summary-loading { opacity: 0.6; animation: summary-pulse 1.2s ease-in-out infinite; }
.v51-ai-summary.summary-loading .v51-ai-summary-img { animation: summary-bob 0.6s ease-in-out infinite; }

/* Result cards */
.v51-result-card {
  padding: 20px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  animation: fadeUp 0.3s ease both;
}
.v51-result-card:last-of-type { border-bottom: none; }
.v51-result-title { font-size: 18px; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.2px; }
.v51-result-title a { color: #0071E3; text-decoration: none; }
.v51-result-title a:hover { text-decoration: underline; }
.v51-result-url { font-size: 12px; color: #86868B; margin-bottom: 4px; }
.v51-result-match {
  display: inline-block;
  font-size: 11px;
  color: #0071E3;
  background: rgba(0,113,227,0.06);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
  margin-bottom: 4px;
}
.v51-result-snippet { font-size: 15px; color: #86868B; line-height: 1.5; margin-bottom: 10px; }
.v51-result-footer { display: flex; align-items: center; gap: 12px; }

/* Confidence bar */
.v51-conf-bar { flex: 1; display: flex; align-items: center; gap: 8px; }
.v51-conf-track { flex: 1; height: 4px; background: #F5F5F7; border-radius: 2px; overflow: hidden; }
.v51-conf-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.v51-conf-fill.green  { background: #30D158; }
.v51-conf-fill.yellow { background: #FFD60A; }
.v51-conf-fill.red    { background: #FF453A; }
.v51-conf-pct { font-size: 12px; font-weight: 500; min-width: 32px; }
.v51-conf-pct.green  { color: #30D158; }
.v51-conf-pct.yellow { color: #B89600; }
.v51-conf-pct.red    { color: #FF453A; }

/* Vote buttons */
.v51-vote-btns { display: flex; gap: 4px; }
.v51-vote-btns .vote-btn {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 13px;
  cursor: pointer;
  color: #86868B;
  transition: all 0.15s;
  opacity: 1;
}
.v51-vote-btns .vote-btn:hover {
  border-color: #0071E3;
  color: #0071E3;
  background: rgba(0,113,227,0.04);
}
.v51-vote-btns .vote-btn.vote-up   { background: #e6f4ea; color: #1a7f37; border-color: #1a7f37; }
.v51-vote-btns .vote-btn.vote-down { background: #fde8e8; color: #cf222e; border-color: #cf222e; }

/* Local places */
.v51-local-section { margin: 24px 0; padding-top: 20px; }
.v51-local-section h3 { font-size: 17px; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.2px; color: #1D1D1F; }
.v51-local-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.v51-local-card { background: #F5F5F7; border-radius: 16px; padding: 16px; transition: background 0.15s; }
.v51-local-card:hover { background: #EDEDF0; }
.v51-local-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.2px; color: #1D1D1F; }
.v51-local-cat { font-size: 12px; color: #0071E3; font-weight: 500; margin-bottom: 6px; }
.v51-local-detail { font-size: 12px; color: #86868B; margin-bottom: 2px; }
.v51-local-link { font-size: 12px; color: #0071E3; margin-top: 6px; display: inline-block; text-decoration: none; }
.v51-local-link:hover { text-decoration: underline; }

/* Empty state */
.v51-empty { text-align: center; padding: 48px 20px; color: #86868B; font-size: 15px; }

/* Pagination */
body.v51-results-body .pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  font-size: 14px;
  color: #86868B;
}
body.v51-results-body .page-link {
  color: #0071E3;
  padding: 8px 18px;
  border-radius: 980px;
  border: 1px solid rgba(0,0,0,0.08);
  transition: all 0.15s;
  min-width: auto;
  height: auto;
  background: transparent;
}
body.v51-results-body .page-link:hover { background: rgba(0,113,227,0.04); border-color: #0071E3; }
body.v51-results-body .page-current { font-weight: 500; color: #1D1D1F; }

@media (max-width: 768px) {
  .v51-search-page { padding: 24px 20px; }
  .v51-local-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v31 search results (legacy sr-item — kept for reference)
   ============================================================ */

/* AI Summary box */
.ai-summary {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.ai-summary-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.ai-summary-content { flex: 1; min-width: 0; }
.ai-summary-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.ai-summary-text {
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}
.ai-summary.summary-loading {
  opacity: 0.6;
  animation: summary-pulse 1.2s ease-in-out infinite;
}
.ai-summary.summary-loading .ai-summary-img {
  animation: summary-bob 0.6s ease-in-out infinite;
}

/* Result cards */
.sr-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  animation: fadeUp 0.3s ease both;
}
.sr-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.sr-item-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.4;
  margin-bottom: 3px;
  text-decoration: none;
  word-break: break-word;
}
.sr-item-title:hover { text-decoration: underline; }
.sr-item-url {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-family: var(--mono);
  word-break: break-all;
}
.sr-item-match {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-style: italic;
}
.sr-item-snippet {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-word;
}
.sr-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Confidence bar */
.sr-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sr-bar-track {
  width: 100px;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.sr-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.sr-bar-fill.green { background: #22c55e; }
.sr-bar-fill.amber { background: #f59e0b; }
.sr-bar-fill.red   { background: #ef4444; }
.sr-pct {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 32px;
}
.sr-pct.green { color: #16a34a; }
.sr-pct.amber { color: #b45309; }
.sr-pct.red   { color: #dc2626; }

/* Vote buttons */
.sr-vote-btns { display: flex; gap: 4px; }
.sr-vote-btns .vote-btn {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted);
  transition: all 0.15s;
  opacity: 1;
}
.sr-vote-btns .vote-btn:hover {
  background: var(--line);
  color: var(--ink);
  border-color: var(--line-strong);
}
.sr-vote-btns .vote-btn.vote-up   { background: #e6f4ea; color: #1a7f37; border-color: #1a7f37; }
.sr-vote-btns .vote-btn.vote-down { background: #fde8e8; color: #cf222e; border-color: #cf222e; }

/* ============================================================
   v51-page-body — shared color palette for docs/pricing/benchmarks
   ============================================================ */
body.v51-page-body {
  --bg:             #FFFFFF;
  --surface:        #F5F5F7;
  --surface-raised: #EDEDF0;
  --ink:            #1D1D1F;
  --ink-secondary:  #515154;
  --muted:          #86868B;
  --line:           rgba(0,0,0,0.08);
  --line-strong:    rgba(0,0,0,0.12);
  --brand:          #0071E3;
  background: #FFFFFF;
  color: #1D1D1F;
}
@media (prefers-color-scheme: dark) {
  body.v51-page-body {
    background: #FFFFFF;
    color: #1D1D1F;
  }
}
body.v51-page-body header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: none;
  margin-bottom: 0;
}
body.v51-page-body .brand { color: #1D1D1F; }
body.v51-page-body .brand span { color: #0071E3; }
body.v51-page-body nav a { color: #86868B; }
body.v51-page-body nav a:hover { color: #1D1D1F; }
body.v51-page-body .nav-cta { background: #0071E3; color: #fff !important; }
body.v51-page-body .nav-cta:hover { background: #0077ED; }
body.v51-page-body .footer {
  background: #FFFFFF;
  border-top: 1px solid rgba(0,0,0,0.08);
  color: #86868B;
}
body.v51-page-body .section {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.045);
  margin-top: 48px;
  padding: 40px;
}
body.v51-page-body label {
  color: #6E6E73;
}
body.v51-page-body button.primary {
  background: #0071E3;
}
body.v51-page-body a {
  color: #0071E3;
}
.v51-terms-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.v51-terms-hero {
  text-align: center;
  margin-bottom: 48px;
}
.v51-terms-hero h1 {
  margin: 0 0 14px;
  color: #1D1D1F;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.v51-terms-hero p {
  max-width: 680px;
  margin: 0 auto;
  color: #6E6E73;
  font-size: 17px;
  line-height: 1.58;
}
.v51-terms-section {
  padding: 28px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.v51-terms-section h2 {
  margin: 0 0 10px;
  color: #1D1D1F;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.v51-terms-section p {
  margin: 0 0 12px;
  color: #424245;
  font-size: 15px;
  line-height: 1.7;
}
.v51-terms-section p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Docs page layout
   ============================================================ */
body.v51-page-body .shell.wide {
  max-width: 1320px;
}
.v51-docs-page {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 0 24px;
  max-width: 1180px;
  margin: 40px auto 80px 0;
  padding: 0 24px;
  align-items: start;
}
.v51-docs-content {
  min-width: 0;
  max-width: 960px;
}
.v51-docs-nav {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v51-docs-nav a {
  font-size: 13px;
  color: #86868B;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}
.v51-docs-nav a:hover { color: #1D1D1F; background: #F5F5F7; }
.v51-docs-nav a.active { color: #0071E3; background: rgba(0,113,227,0.06); font-weight: 500; }
.v51-docs-content h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1.5px;
  color: #1D1D1F;
  margin-bottom: 8px;
}
.v51-docs-content h1 span { color: #0071E3; }
.v51-docs-content > p { font-size: 17px; color: #86868B; margin-bottom: 48px; }
.v51-docs-section { margin-bottom: 56px; }
.v51-docs-section h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1D1D1F;
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.v51-docs-section h3 { font-size: 15px; font-weight: 600; color: #1D1D1F; margin: 20px 0 8px; }
.v51-docs-section p { font-size: 15px; color: #86868B; line-height: 1.6; margin-bottom: 12px; }
.v51-docs-section a { color: #0071E3; }
.v51-docs-section ol { padding-left: 20px; }
.v51-docs-section ol li { font-size: 15px; color: #86868B; margin-bottom: 4px; }
.v51-docs-section ol li a { color: #0071E3; }
.v51-docs-section code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: #F5F5F7;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1D1D1F;
}
.v51-endpoint-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F5F5F7;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
}
.v51-method {
  background: #0071E3;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.v51-method-post { background: #30D158; }
.v51-path { color: #1D1D1F; }
.v51-docs-section pre {
  background: #F5F5F7;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  color: #1D1D1F;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-bottom: 16px;
}
.v51-kw  { color: #0071E3; }
.v51-str { color: #30D158; }
.v51-key { color: #0071E3; }
.v51-num { color: #FF9F0A; }
.v51-cmt { color: #86868B; }
.v51-param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
}
.v51-param-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.v51-param-table td {
  padding: 10px 12px;
  color: #1D1D1F;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  vertical-align: top;
}
.v51-param-table td:first-child {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #0071E3;
}
.v51-param-table td code {
  font-size: 12px;
  background: #F5F5F7;
  padding: 1px 5px;
  border-radius: 4px;
  color: #1D1D1F;
}
@media (max-width: 700px) {
  body.v51-page-body .shell.wide { padding-left: 24px; padding-right: 24px; }
  .v51-docs-page { grid-template-columns: 1fr; padding: 0; }
  .v51-docs-nav { display: none; }
}

/* ============================================================
   Pricing page
   ============================================================ */
.v51-pricing-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 78px 60px 112px;
}
.v51-pricing-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 64px;
}
.v51-pricing-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 980px;
  background: rgba(0,113,227,0.07);
  border: 1px solid rgba(0,113,227,0.13);
  font-size: 13px;
  font-weight: 700;
  color: #0071E3;
  margin-bottom: 22px;
}
.v51-pricing-h1 {
  font-size: clamp(46px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.055em;
  color: #1D1D1F;
  line-height: 1;
  margin-bottom: 22px;
}
.v51-pricing-h1 span { color: #0071E3; }
.v51-pricing-sub {
  font-size: 19px;
  color: #6E6E73;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.55;
}

.v51-pricing-grid {
  display: flex;
  justify-content: center;
  gap: 32px;
  align-items: stretch;
  margin-bottom: 88px;
}
.v51-price-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.065);
  border-radius: 24px;
  padding: 44px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 14px 44px rgba(0,0,0,0.045);
  width: 300px;
  min-width: 300px;
}
.v51-price-featured {
  background: #FFFFFF;
  border-color: rgba(0,113,227,0.35);
  box-shadow: 0 24px 70px rgba(0,113,227,0.14), 0 0 0 1px rgba(0,113,227,0.2);
}
.v51-price-featured::before {
  content: "Most popular";
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 10px;
  border-radius: 980px;
  background: #0071E3;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.v51-price-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 10px;
  border-radius: 980px;
  background: #F5F5F7;
  color: #6E6E73;
  margin-bottom: 18px;
  align-self: flex-start;
}
.v51-price-featured .v51-price-badge {
  background: rgba(0,113,227,0.08);
  color: #0071E3;
}
.v51-price-card h3 { font-size: 28px; font-weight: 700; color: #1D1D1F; margin-bottom: 10px; letter-spacing: -0.03em; }
.v51-price-amount {
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -0.055em;
  color: #1D1D1F;
  line-height: 1;
  margin: 12px 0 8px;
}
.v51-price-amount span { font-size: 18px; font-weight: 400; color: #86868B; letter-spacing: 0; }
.v51-price-note { font-size: 13px; color: #86868B; margin-bottom: 24px; }
.v51-price-list {
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.v51-price-list li { font-size: 16px; color: #424245; display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; }
.v51-chk { color: #0071E3; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.v51-minus { color: #86868B; flex-shrink: 0; }
.v51-price-cta {
  display: block;
  text-align: center;
  padding: 15px 20px;
  border-radius: 980px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  margin-top: auto;
}
.v51-price-cta.v51-price-cta-primary { background: #0071E3; color: #fff; }
.v51-price-cta.v51-price-cta-primary:hover { background: #0077ED; color: #fff; transform: translateY(-1px); }
.v51-price-cta-outline { background: #F5F5F7; color: #1D1D1F; border: 1px solid rgba(0,0,0,0.08); }
.v51-price-cta-outline:hover { background: #FFFFFF; color: #0071E3; border-color: rgba(0,113,227,0.25); }

.v51-pricing-breakdown {
  margin-bottom: 88px;
  padding: 56px;
  border-radius: 28px;
  background: #F5F5F7;
}
.v51-pricing-breakdown h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1D1D1F;
  margin-bottom: 10px;
}
.v51-pricing-breakdown > p {
  max-width: 640px;
  font-size: 16px;
  color: #6E6E73;
  line-height: 1.6;
  margin-bottom: 28px;
}
.v51-breakdown-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.v51-breakdown-card {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.055);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.035);
}
.v51-breakdown-cost { font-size: 40px; font-weight: 700; letter-spacing: -0.045em; margin-bottom: 8px; }
.v51-breakdown-label { font-size: 15px; font-weight: 700; color: #1D1D1F; margin-bottom: 10px; }
.v51-breakdown-card p { font-size: 14px; color: #6E6E73; line-height: 1.6; margin: 0; }

.v51-pricing-payg {
  max-width: 820px;
  margin: 0 auto 48px;
}
.v51-payg-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 28px 32px;
}
.v51-payg-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.v51-payg-title {
  font-size: 18px;
  font-weight: 600;
  color: #1D1D1F;
  margin: 0 0 6px;
}
.v51-payg-sub {
  font-size: 14px;
  color: #6E6E73;
  margin: 0;
  line-height: 1.5;
}
.v51-payg-rates {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}
.v51-payg-rate {
  font-size: 13px;
  color: #1D1D1F;
  background: #F5F5F7;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.v51-payg-rate strong {
  font-weight: 700;
}
.v51-payg-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: #86868B;
}
@media (max-width: 680px) {
  .v51-payg-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .v51-payg-rates { flex-wrap: wrap; gap: 8px; }
}

/* ── Credits breakdown ───────────────────────────────────── */
.v51-pricing-credits {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 24px 0;
}
.v51-pricing-credits h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1D1D1F;
  text-align: center;
  margin-bottom: 8px;
}
.v51-pricing-credits-sub {
  text-align: center;
  color: #86868B;
  font-size: 16px;
  margin-bottom: 32px;
}
.v51-credit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.v51-credit-item {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
}
.v51-credit-cost {
  font-size: 32px;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.v51-credit-label {
  font-size: 15px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 4px;
}
.v51-credit-detail {
  font-size: 13px;
  color: #86868B;
}
.v51-credit-free .v51-credit-cost {
  color: #0071E3;
}
@media (max-width: 600px) {
  .v51-credit-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── FAQ ─────────────────────────────────────────────────── */
.v51-pricing-faq {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 80px;
}
.v51-pricing-faq h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1D1D1F;
  margin-bottom: 28px;
  text-align: center;
}
.v51-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v51-faq-item {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 20px 22px;
  background: #FFFFFF;
}
.v51-faq-item:last-child { border-bottom: 1px solid rgba(0,0,0,0.06); }
.v51-faq-q { font-size: 16px; font-weight: 700; color: #1D1D1F; margin-bottom: 8px; letter-spacing: -0.01em; }
.v51-faq-a { font-size: 14px; color: #6E6E73; line-height: 1.65; }
.v51-faq-a code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: #EDEDF0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1D1D1F;
}
.v51-faq-a a { color: #0071E3; }

.v51-pricing-trust {
  max-width: 100%;
  margin: 0 0 88px;
  padding: 56px;
  border-radius: 28px;
  background: #F5F5F7;
}
.v51-pricing-trust h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1D1D1F;
  margin-bottom: 10px;
}
.v51-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.v51-trust-item {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.055);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.035);
}
.v51-trust-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  color: #1D1D1F;
}
.v51-trust-item p {
  color: #6E6E73;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 700px) {
  body.v51-pricing-body header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 16px;
    margin-bottom: 0;
  }
  body.v51-pricing-body .brand {
    display: inline-flex;
    align-items: center;
  }
  body.v51-pricing-body nav {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
  }
  .v51-pricing-grid { flex-direction: column; align-items: center; }
  .v51-price-card { width: 100%; min-width: 0; max-width: 360px; }
  .v51-breakdown-grid { grid-template-columns: 1fr; }
  .v51-pricing-page { padding: 52px 16px 80px; }
  .v51-pricing-hero { margin-bottom: 42px; }
  .v51-pricing-h1 { font-size: 42px; }
  .v51-pricing-sub { font-size: 16px; }
  .v51-pricing-breakdown { padding: 30px 20px; border-radius: 22px; }
  .v51-pricing-trust { padding: 30px 20px; border-radius: 22px; }
  .v51-trust-grid { grid-template-columns: 1fr; }
  .v51-pricing-breakdown h2,
  .v51-pricing-trust h2,
  .v51-pricing-faq h2 { font-size: 30px; text-align: left; }
}

/* ============================================================
   Benchmarks page
   ============================================================ */
.v51-bench-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}
.v51-bench-hero { text-align: center; margin-bottom: 56px; }
.v51-bench-section {
  margin-bottom: 64px;
}
.v51-bench-section h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1D1D1F;
  margin-bottom: 8px;
}
.v51-bench-section > p { font-size: 15px; color: #86868B; margin-bottom: 20px; }
.v51-bench-section code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: #F5F5F7;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1D1D1F;
}
.v51-bench-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.v51-bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.v51-bench-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(0,0,0,0.08);
}
.v51-bench-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: #1D1D1F;
  vertical-align: middle;
}
.v51-bench-highlight td { background: rgba(0,113,227,0.03); }
.v51-bench-val { font-weight: 600; color: #1D1D1F; }
.v51-bench-val.good { color: #30D158; }
.v51-bench-note { font-size: 12px; color: #86868B; line-height: 1.5; }

.v51-bench-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.v51-bench-stat-card {
  background: #F5F5F7;
  border-radius: 16px;
  padding: 24px 20px;
}
.v51-bench-stat-val {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #0071E3;
  line-height: 1;
  margin-bottom: 6px;
}
.v51-bench-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 8px;
}
.v51-bench-stat-card p { font-size: 13px; color: #86868B; line-height: 1.5; margin: 0; }

.v51-bench-method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.v51-bench-method-card {
  background: #F5F5F7;
  border-radius: 16px;
  padding: 20px;
}
.v51-bench-method-card h3 { font-size: 15px; font-weight: 600; color: #1D1D1F; margin-bottom: 8px; }
.v51-bench-method-card p { font-size: 13px; color: #86868B; line-height: 1.5; margin: 0; }
.v51-bench-method-card a { color: #0071E3; }

@media (max-width: 600px) {
  .v51-bench-stat-grid { grid-template-columns: 1fr; }
  .v51-bench-method-grid { grid-template-columns: 1fr; }
  .v51-pricing-h1 { font-size: 32px; }
}

/* Auth pages — built on the v51 hero look (front-page palette) */
.v51-auth-hero {
  padding: 80px 40px;
  text-align: center;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F7 100%);
}
.v51-auth-eyebrow {
  font-size: 16px;
  font-weight: 500;
  color: #0071E3;
  margin-bottom: 12px;
}
.v51-auth-headline {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #1D1D1F 0%, #555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
}
.v51-auth-headline-accent {
  background: linear-gradient(90deg, #0071E3, #64acff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.v51-auth-sub {
  font-size: 19px;
  color: #86868B;
  max-width: 480px;
  margin: 0 auto 32px;
  font-weight: 400;
  line-height: 1.4;
}
.v51-auth-form {
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.v51-auth-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #1D1D1F;
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: normal;
}
.v51-auth-form input {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #FFFFFF;
  color: #1D1D1F;
  font-size: 16px;
  outline: none;
  font-family: inherit;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.v51-auth-form input:focus {
  border-color: #0071E3;
  box-shadow: 0 0 0 4px rgba(0,113,227,0.12);
}
.v51-quick-key-box { display: flex; align-items: center; gap: 10px; max-width: 480px; margin: 24px auto; background: #1D1D1F; border-radius: 12px; padding: 16px 20px; }
.v51-quick-key-value { flex: 1; font-size: 15px; font-family: 'SF Mono', 'Fira Code', monospace; color: #F5F5F7; user-select: all; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v51-quick-key-copy { padding: 8px 16px; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; background: rgba(255,255,255,0.08); color: #F5F5F7; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s; }
.v51-quick-key-copy:hover { background: rgba(255,255,255,0.15); }
.v51-auth-submit {
  margin-top: 6px;
  padding: 14px 28px;
  border-radius: 12px;
  background: #0071E3;
  color: #FFFFFF;
  border: none;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  transition: background 0.2s;
  width: 100%;
}
.v51-auth-submit:hover { background: #0077ED; }
.v51-auth-error {
  max-width: 360px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 59, 48, 0.08);
  color: #C62828;
  font-size: 14px;
  text-align: left;
}
.v51-auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #FFFFFF;
  color: #1D1D1F;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: background 0.15s, border-color 0.15s;
}
.v51-auth-google:hover { background: #F5F5F7; border-color: rgba(0,0,0,0.18); color: #1D1D1F; }
.v51-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px auto;
  max-width: 360px;
  color: #86868B;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.v51-auth-divider::before,
.v51-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.08);
}
.v51-auth-foot {
  margin-top: 28px;
  font-size: 14px;
  color: #86868B;
}
.v51-auth-foot a { color: #0071E3; font-weight: 500; text-decoration: none; }
.v51-auth-foot a:hover { text-decoration: underline; }
.v51-auth-terms {
  margin: 0;
  color: #86868B;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.v51-auth-terms a {
  color: #0071E3;
  font-weight: 500;
  text-decoration: none;
}
.v51-auth-terms a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .v51-auth-hero { padding: 48px 20px; }
  .v51-auth-headline { font-size: 36px; letter-spacing: -1.2px; }
  .v51-auth-sub { font-size: 16px; }
}

/* Locked / gated result placeholders */
.v51-result-locked {
  position: relative;
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
}
.v51-result-locked a { pointer-events: none; }
.v51-locked-cta {
  margin: 24px 0;
  padding: 28px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F7 100%);
  border: 1px solid rgba(0,113,227,0.2);
  box-shadow: 0 4px 20px rgba(0,113,227,0.06);
  text-align: center;
}
.v51-locked-cta-title {
  font-size: 18px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.v51-locked-cta-sub {
  font-size: 14px;
  color: #86868B;
  margin-bottom: 16px;
}
.v51-locked-cta-btns {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.v51-locked-cta-primary,
.v51-locked-cta-secondary {
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.v51-locked-cta-primary {
  background: #0071E3;
  color: #FFFFFF;
}
.v51-locked-cta-primary:hover { background: #0077ED; }
.v51-locked-cta-secondary {
  background: #FFFFFF;
  color: #1D1D1F;
  border: 1px solid rgba(0,0,0,0.12);
}
.v51-locked-cta-secondary:hover { background: #F5F5F7; }

/* ── Shared (ask + distillation) ────────────────────────────────────── */
.v51-sources-heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #86868B; margin: 1.5rem 0 0.5rem; font-weight: 600; }
.v51-code-inline { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; color: #1D1D1F; background: none; }
.v51-distill-hero { margin-bottom: 2rem; }
.v51-distill-h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; margin: 0 0 8px; color: #1D1D1F; }
.v51-distill-sub { font-size: 15px; color: #86868B; margin: 0 0 1.5rem; line-height: 1.5; }
.v51-distill-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v51-distill-compare-card { padding: 16px 20px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.08); }
.v51-compare-before { background: #FAFAFA; }
.v51-compare-after { background: #F0F9FF; border-color: rgba(0,113,227,0.15); }
.v51-compare-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #86868B; margin-bottom: 6px; font-weight: 600; }
.v51-compare-stat { font-size: 20px; font-weight: 700; color: #1D1D1F; margin-bottom: 8px; }
.v51-compare-after .v51-compare-stat { color: #0071E3; }
.v51-compare-detail { font-size: 13px; color: #6E6E73; line-height: 1.6; }
.v51-compare-before .v51-compare-detail { text-decoration: line-through; opacity: 0.6; }
.v51-distill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; }
.v51-distill-grid .v51-result-card { border-bottom: 1px solid rgba(0,0,0,0.06); }
.v51-distill-grid .v51-result-title { font-weight: 600; margin-bottom: 4px; }
.v51-distill-cta { display: flex; gap: 12px; margin: 2rem 0 1rem; }
.v51-distill-cta-btn { display: inline-block; padding: 10px 24px; border-radius: 980px; font-size: 14px; font-weight: 500; text-decoration: none; background: #0071E3; color: #fff; transition: background 0.15s; }
.v51-distill-cta-btn:hover { background: #0077ED; }
.v51-distill-cta-secondary { background: #fff; color: #1D1D1F; border: 1px solid rgba(0,0,0,0.12); }
.v51-distill-cta-secondary:hover { background: #F5F5F7; }
.v51-distill-form { display: flex; gap: 12px; align-items: center; margin-top: 1.5rem; }
.v51-distill-form input { padding: 12px 16px; font-size: 15px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.12); }
.v51-distill-steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 1.5rem; }
.v51-distill-step { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.v51-distill-step:last-child { border-bottom: none; }
.v51-distill-step-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: #0071E3; color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.v51-distill-step-text { font-size: 14px; line-height: 1.5; color: #1D1D1F; }
.v51-distill-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5rem; }
.v51-distill-file { display: inline-block; padding: 6px 12px; background: #F5F5F7; border-radius: 8px; font-size: 13px; color: #1D1D1F; border: 1px solid rgba(0,0,0,0.06); }
.v51-distill-constraints { display: flex; flex-direction: column; gap: 0; margin-bottom: 1.5rem; }
.v51-distill-constraint { padding: 10px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 14px; color: #424245; }
.v51-distill-constraint:before { content: "\2022"; margin-right: 10px; color: #0071E3; }
.v51-distill-constraint:last-child { border-bottom: none; }
.v51-distill-explainer { margin-bottom: 1.5rem; }
.v51-distill-explain-text { font-size: 15px; line-height: 1.6; color: #424245; margin: 0; }
.v51-distill-explain-text a { color: #0071E3; text-decoration: none; }
.v51-distill-explain-text a:hover { text-decoration: underline; }
.v51-distill-raw { margin: 1.5rem 0; }
.v51-distill-raw summary { cursor: pointer; font-size: 13px; color: #86868B; padding: 8px 0; }
.v51-distill-raw pre { margin-top: 8px; padding: 16px; background: #1D1D1F; color: #E5E5EA; border-radius: 12px; overflow-x: auto; }
.v51-distill-feedback-hint { margin-top: 1.5rem; padding: 14px 18px; background: #F5F5F7; border-radius: 12px; font-size: 14px; color: #424245; line-height: 1.5; }
.v51-distill-feedback-hint strong { color: #1D1D1F; }
.v51-distill-feedback-hint code { background: #E5E5EA; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
@media (max-width: 600px) {
  .v51-distill-comparison { grid-template-columns: 1fr; }
  .v51-distill-h1 { font-size: 22px; }
  .v51-distill-form { flex-direction: column; }
  .v51-distill-form input { width: 100%; }
}

/* ── Distillation result page ────────────────────────────────────── */
body.v51-distillation-body {
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F9 44%, #FFFFFF 100%);
}
body.v51-distillation-body .v51-search-page {
  max-width: 860px;
  padding: 56px 40px 88px;
}
body.v51-distillation-body .v51-search-toolbar {
  justify-content: center;
  margin-bottom: 22px;
}
body.v51-distillation-body .v51-search-status {
  min-height: 30px;
  padding: 0 13px;
  border-radius: 980px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  font-weight: 600;
}
.v51-distill-query-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 10px 0 22px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.v51-distill-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  margin-bottom: 16px;
  border-radius: 980px;
  background: rgba(0,113,227,0.075);
  color: #0071E3;
  font-size: 13px;
  font-weight: 700;
}
.v51-distill-query-title {
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: #1D1D1F;
}
.v51-distill-query-sub {
  max-width: 620px;
  margin: 16px 0 0;
  color: #6E6E73;
  font-size: 17px;
  line-height: 1.55;
}
.v51-distill-new-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 980px;
  border: 1px solid rgba(0,0,0,0.09);
  background: #F5F5F7;
  color: #1D1D1F;
  font-size: 14px;
  font-weight: 600;
}
.v51-distill-new-link:hover {
  background: #FFFFFF;
  color: #0071E3;
  border-color: rgba(0,113,227,0.24);
}
body.v51-distillation-body .v51-distill-explainer,
body.v51-distillation-body .v51-ask-generate,
.v51-distill-panel,
body.v51-distillation-body .v51-distill-code-card,
body.v51-distillation-body .v51-distill-raw,
body.v51-distillation-body .v51-distill-feedback-hint,
body.v51-distillation-body .v51-result-card {
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 10px 34px rgba(0,0,0,0.045);
}
body.v51-distillation-body .v51-distill-explainer {
  padding: 20px 22px;
}
.v51-distill-code-card {
  position: relative;
  padding: 22px;
  margin: 18px 0;
  overflow: hidden;
}
.v51-distill-code-card .v51-code-inline {
  display: block;
  padding: 18px;
  border-radius: 14px;
  background: #1D1D1F;
  color: #F5F5F7;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.65;
}
body.v51-distillation-body .v51-distill-explain-text code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #F5F5F7;
  color: #1D1D1F;
  font-size: 0.9em;
}
.v51-distill-locked-json .v51-code-inline {
  max-height: 420px;
  overflow: hidden;
  filter: blur(1.5px);
  opacity: 0.54;
  user-select: none;
  pointer-events: none;
}
.v51-distill-lock-cover {
  position: absolute;
  top: 52px;
  bottom: 22px;
  left: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(29,29,31,0.62), rgba(29,29,31,0.9));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: #FFFFFF;
}
.v51-distill-lock-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.v51-distill-lock-cover p {
  max-width: 430px;
  margin: 0;
  color: rgba(255,255,255,0.76);
  font-size: 14px;
  line-height: 1.5;
}
.v51-distill-lock-cover .v51-distill-cta-btn {
  margin-top: 4px;
}
body.v51-distillation-body .v51-ask-generate {
  padding: 24px;
  margin-bottom: 28px;
  text-align: center;
}
.v51-ask-generate-kicker,
.v51-distill-panel-title {
  margin-bottom: 12px;
  color: #1D1D1F;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.v51-distillation-body .v51-ask-generate p {
  margin: 0;
  color: #6E6E73;
  font-size: 15px;
  line-height: 1.6;
}
.v51-distill-auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.v51-distill-section-head {
  margin: 34px 0 16px;
  text-align: center;
}
.v51-distill-section-head h3 {
  margin: 0 0 6px;
  color: #1D1D1F;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.v51-distill-section-head p {
  margin: 0;
  color: #86868B;
  font-size: 15px;
}
.v51-distill-panel {
  padding: 22px;
  margin: 18px 0;
}
body.v51-distillation-body .v51-result-card {
  padding: 22px;
  margin: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.v51-distill-task-card {
  border-left: 4px solid #0071E3 !important;
}
body.v51-distillation-body .v51-result-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #86868B;
  margin-bottom: 8px;
}
body.v51-distillation-body .v51-result-snippet {
  color: #1D1D1F;
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
}
body.v51-distillation-body .v51-distill-steps {
  margin: 0;
}
body.v51-distillation-body .v51-distill-step {
  gap: 16px;
  padding: 16px 0;
}
body.v51-distillation-body .v51-distill-step:first-child {
  padding-top: 0;
}
body.v51-distillation-body .v51-distill-step:last-child {
  padding-bottom: 0;
}
body.v51-distillation-body .v51-distill-step-num {
  width: 30px;
  height: 30px;
  background: rgba(0,113,227,0.1);
  color: #0071E3;
}
body.v51-distillation-body .v51-distill-step-text {
  color: #424245;
  font-size: 15px;
  line-height: 1.6;
}
body.v51-distillation-body .v51-distill-files,
body.v51-distillation-body .v51-distill-constraints {
  margin-bottom: 0;
}
body.v51-distillation-body .v51-distill-file {
  padding: 8px 12px;
  background: #F5F5F7;
  border-radius: 10px;
  color: #1D1D1F;
}
body.v51-distillation-body .v51-distill-constraint {
  padding: 12px 0;
}
body.v51-distillation-body .v51-distill-constraint:first-child {
  padding-top: 0;
}
body.v51-distillation-body .v51-distill-constraint:last-child {
  padding-bottom: 0;
}
body.v51-distillation-body .v51-distill-cta {
  justify-content: center;
}
@media (max-width: 700px) {
  body.v51-distillation-body header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 20px 16px;
    margin-bottom: 0;
  }
  body.v51-distillation-body .brand {
    align-self: center;
  }
  body.v51-distillation-body .header-search {
    order: 2;
    width: 100%;
    max-width: none;
    margin: 0;
  }
  body.v51-distillation-body nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
  }
  body.v51-distillation-body .v51-search-page {
    padding: 36px 18px 72px;
  }
  .v51-distill-query-hero {
    display: block;
    padding: 0 0 20px;
  }
  .v51-distill-query-title {
    font-size: 36px;
  }
  .v51-distill-query-sub {
    font-size: 15px;
  }
  .v51-distill-new-link {
    margin-top: 20px;
  }
  .v51-distill-panel,
  body.v51-distillation-body .v51-distill-code-card,
  body.v51-distillation-body .v51-ask-generate,
  body.v51-distillation-body .v51-result-card {
    padding: 18px;
  }
  .v51-distill-lock-cover {
    top: 48px;
    bottom: 18px;
    left: 18px;
    right: 18px;
  }
  .v51-distill-section-head {
    text-align: left;
  }
}

/* ── v11 How It Works ─────────────────────────────────────── */
.v51-how-link { display: inline-block; margin-top: 1.2rem; color: var(--brand); font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.v51-how-link:hover { border-bottom-color: var(--brand); }
.v51-how { max-width: 600px; margin: 0 auto; padding: 3rem 1.5rem 2rem; }
.v51-how-steps { display: flex; flex-direction: column; gap: 0; margin-top: 1.5rem; }
.v51-how-step { display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem 0; }
.v51-how-num { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.v51-how-content h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.v51-how-content p { font-size: 14px; color: var(--ink-secondary); margin: 0 0 6px; line-height: 1.5; }
.v51-how-meta { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.v51-how-arrow { text-align: center; font-size: 18px; color: var(--muted); padding: 4px 0; margin-left: 7px; }

/* ── How We Do It ─────────────────────────────────────────── */
.v51-how-we-do-it {
  max-width: 100%;
  padding: 108px 24px;
  background: #FFFFFF;
}
.v51-how-we-do-it > * {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}
.v51-hwdi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 0;
}
.v51-hwdi-card {
  background: #FBFBFC;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 34px 28px;
}
.v51-hwdi-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,113,227,0.1);
  color: #0071E3;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.v51-hwdi-card h3 { font-size: 17px; font-weight: 600; margin: 0 0 10px; color: var(--ink); letter-spacing: -0.2px; }
.v51-hwdi-card p { font-size: 14px; color: #6E6E73; margin: 0; line-height: 1.58; }
@media (max-width: 900px) {
  .v51-hwdi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .v51-how-we-do-it { padding: 76px 24px; }
  .v51-hwdi-grid { grid-template-columns: 1fr; }
}

/* ── Comparison table ─────────────────────────────────────── */
.v51-compare { padding: 104px 24px; background: #F5F5F7; }
.v51-compare-table {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 18px 50px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}
.v51-compare-table th, .v51-compare-table td { padding: 18px 24px; text-align: center; font-size: 15px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.v51-compare-table th { font-weight: 600; font-size: 14px; padding-bottom: 16px; }
.v51-ct-without { color: var(--muted); }
.v51-ct-with { color: #0071E3; }
.v51-ct-label { text-align: left; font-weight: 500; color: var(--ink); }
.v51-ct-win { color: #0071E3; font-weight: 600; }
.v51-ct-lose { color: #86868B; }
.v51-compare-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 500px) {
  .v51-compare { padding: 76px 16px; }
  .v51-compare-table th, .v51-compare-table td { padding: 10px 12px; font-size: 13px; }
}

/* ── Final CTA ────────────────────────────────────────────── */
/* ── Benchmark teaser ─────────────────────────────────────── */
/* Hero API-card copy button (square, sits in card corner) */
.v51-api-copy {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  color: #1D1D1F;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}
.v51-api-copy:hover { background: rgba(0, 0, 0, 0.08); border-color: rgba(0, 0, 0, 0.16); }
.v51-api-copy:active { background: rgba(0, 0, 0, 0.12); }

.v51-qi-copy {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.08);
  color: #1D1D1F;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.v51-qi-copy:hover {
  background: #F5F5F7;
  border-color: rgba(0,0,0,0.14);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
@media (max-width: 768px) {
  .v51-hero { padding: 42px 20px 22px; }
  .v51-hero-install { margin: 0 auto 20px; }
  .v51-install-strip {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
  }
  .v51-install-label,
  .v51-install-manual { grid-column: 1 / -1; }
  .v51-install-label { text-align: center; }
  .v51-install-manual { justify-content: center; white-space: normal; text-align: center; }
  .v51-install-manual span { display: none; }
}

.v51-bench { padding: 112px 24px; background: #F5F5F7; }
.v51-bench-inner { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.v51-bench-eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; font-family: var(--mono); }
.v51-bench-h2 { font-size: 40px; font-weight: 700; color: var(--ink); margin: 0 0 14px; letter-spacing: -1px; line-height: 1.08; }
.v51-bench-sub { font-size: 16px; color: #6E6E73; line-height: 1.62; margin: 0 0 20px; }
.v51-bench-link { font-size: 15px; font-weight: 500; color: #0071E3; text-decoration: none; }
.v51-bench-link:hover { text-decoration: underline; }
.v51-bench-chart {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 18px 50px rgba(0,0,0,0.06);
}
.v51-bench-bar-group { display: grid; grid-template-columns: 132px 1fr 42px; gap: 12px; align-items: center; }
.v51-bench-label { font-size: 13px; font-weight: 600; color: #6E6E73; text-align: right; }
.v51-bench-track { height: 30px; background: #EDEDF0; border-radius: 980px; overflow: hidden; }
.v51-bench-fill { height: 100%; border-radius: 980px; transition: width 1s ease; }
.v51-bench-low { background: #C7C7CC; }
.v51-bench-mid { background: #8EC0FF; }
.v51-bench-high { background: #0071E3; }
.v51-bench-pct { font-size: 14px; font-weight: 600; color: var(--ink); font-family: var(--mono); }
@media (max-width: 700px) {
  .v51-bench { padding: 76px 24px; }
  .v51-bench-inner { grid-template-columns: 1fr; }
  .v51-bench-bar-group { grid-template-columns: 96px 1fr 36px; }
  .v51-bench-chart { padding: 20px; }
}

/* ── Dark CTA ─────────────────────────────────────────────── */
.v51-dark-cta { text-align: center; padding: 104px 24px; background: #1D1D1F; }
.v51-dark-cta h2 { font-size: 44px; font-weight: 700; color: #F5F5F7; margin: 0 0 10px; letter-spacing: -1px; }
.v51-dark-cta p { font-size: 17px; color: #A1A1A6; margin: 0 0 28px; }
.v51-dark-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.v51-dark-cta-primary { display: inline-block; padding: 12px 28px; border-radius: 980px; background: #0071E3; color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; transition: background 0.15s, transform 0.15s; }
.v51-dark-cta-primary:hover { background: #0077ED; }
.v51-dark-cta-secondary { display: inline-flex; align-items: center; padding: 12px 28px; border-radius: 980px; background: transparent; color: #A1A1A6; font-size: 15px; font-weight: 500; text-decoration: none; border: 1px solid #424245; transition: color 0.15s, border-color 0.15s; }
.v51-dark-cta-secondary:hover { color: #F5F5F7; border-color: #86868B; }

/* ── Ask page ─────────────────────────────────────────────── */
.v51-ask-answer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; }
.v51-ask-answer-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.v51-ask-answer-text { font-size: 15px; color: var(--ink); line-height: 1.7; white-space: pre-wrap; }
.v51-ask-hit-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 980px; background: #dcfce7; color: #166534; text-transform: uppercase; letter-spacing: 0.3px; }
.v51-ask-new-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 980px; background: #dbeafe; color: #1e40af; text-transform: uppercase; letter-spacing: 0.3px; }
.v51-ask-sources-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.v51-ask-source { font-size: 13px; color: #0071E3; text-decoration: none; padding: 4px 10px; background: rgba(0,113,227,0.06); border-radius: 6px; }
.v51-ask-source:hover { background: rgba(0,113,227,0.12); }
.v51-ask-selected { border-left: 3px solid #166534; padding-left: 17px; }
.v51-ask-meta { font-size: 12px; color: var(--muted); }
.v51-ask-generate { text-align: center; padding: 2rem 0; }
.v51-ask-generate p { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.v51-toolbar-right { display: flex; align-items: center; gap: 10px; }
.v51-usage-badge { font-size: 12px; color: var(--muted); padding: 4px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 980px; white-space: nowrap; }
.v51-usage-low { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.v51-status-searching { background: #f59e0b; }
.v51-status-hit { background: #22c55e; }
.v51-status-miss { background: #f59e0b; }

/* ── Dashboard ────────────────────────────────────────────── */
.v51-dash { max-width: 1180px; margin: 0 auto; padding: 36px 24px 56px; }
.v51-dash-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.v51-dash-h1 { font-size: 30px; font-weight: 700; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.5px; }
.v51-dash-sub { font-size: 15px; color: var(--muted); margin: 0; }
.v51-dash-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.v51-dash-ghost-link,
.v51-dash-logout { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: 13px; color: var(--muted); text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.v51-dash-ghost-link:hover,
.v51-dash-logout:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }

.v51-dash-alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.v51-dash-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.v51-dash-alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.v51-dash-alert-key { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.v51-dash-alert-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.v51-dash-key-row { display: flex; align-items: center; gap: 8px; }
.v51-dash-key-row code { font-size: 14px; font-weight: 700; font-family: var(--mono); }
.v51-dash-copy { padding: 4px 12px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.15); background: #fff; font-size: 12px; cursor: pointer; }

.v51-dash-quickstart { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 24px; overflow: hidden; }
.v51-dash-qs-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px; }
.v51-dash-qs-code { margin: 0; font-size: 13px; font-family: var(--mono); color: var(--ink); white-space: pre-wrap; overflow-x: auto; }

.v51-dash-hidden { display: none; }
.v51-dash-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.v51-dash-summary-item { padding: 16px 18px; border-right: 1px solid var(--line); min-width: 0; }
.v51-dash-summary-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.v51-dash-summary-value { font-size: 20px; font-weight: 700; color: var(--ink); font-family: var(--mono); line-height: 1.15; overflow-wrap: anywhere; }
.v51-dash-summary-sub { font-size: 13px; font-weight: 500; color: var(--muted); }
.v51-dash-summary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 18px; min-width: 160px; }
.v51-dash-summary-reset { grid-column: 1 / -1; padding: 9px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; background: var(--surface); }
.v51-dash-top-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 18px; align-items: stretch; margin-bottom: 18px; }
.v51-dash-usage-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.v51-dash-usage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.v51-dash-usage-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.v51-dash-usage-card-primary { grid-column: 1 / -1; }
.v51-dash-usage-val { font-size: 26px; font-weight: 700; color: var(--ink); font-family: var(--mono); line-height: 1.1; overflow-wrap: anywhere; }
.v51-dash-usage-of { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 5px; }
.v51-dash-usage-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.v51-dash-reset-note { font-size: 12px; color: var(--muted); text-align: right; margin-top: 0; }
.v51-dash-workspace { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.v51-dash-workspace-main,
.v51-dash-workspace-side { min-width: 0; }
.v51-dash-panel-card,
.v51-dash-guide,
.v51-dash-activity-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; overflow: hidden; }
.v51-dash-guide { margin: 0; }
.v51-dash-guide-wide { margin-bottom: 18px; }
.v51-dash-guide-steps { display: grid; gap: 14px; }
.v51-dash-guide-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.v51-dash-guide-step:last-child { border-bottom: 0; padding-bottom: 0; }
.v51-dash-guide-index { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; font-family: var(--mono); }
.v51-dash-guide-step.is-current .v51-dash-guide-index { background: #0071E3; border-color: #0071E3; color: #fff; }
.v51-dash-guide-step.is-done .v51-dash-guide-index { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.v51-dash-guide-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.v51-dash-guide-step p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.45; }
.v51-dash-guide-link { display: inline-flex; margin-top: 8px; font-size: 13px; font-weight: 600; color: #0071E3; text-decoration: none; }
.v51-dash-guide-link:hover { text-decoration: underline; }
.v51-dash-bonus-details { margin-top: 8px; }
.v51-dash-bonus-details summary { color: #0071E3; cursor: pointer; font-size: 13px; font-weight: 600; list-style-position: inside; }
.v51-dash-bonus-actions { display: grid; gap: 8px; margin-top: 10px; min-width: 0; overflow: hidden; }
.v51-dash-earn-ref { display: flex; align-items: center; gap: 8px; min-width: 0; }
.v51-dash-earn-ref code { font-size: 11px; background: var(--surface-raised); padding: 6px 10px; border-radius: 6px; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.v51-dash-earn-copy { padding: 6px 12px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: pointer; white-space: nowrap; }
.v51-dash-earn-copy:hover { background: var(--surface-raised); }
.v51-dash-bonus-actions .v51-distill-cta-btn { width: 100%; min-height: 34px; padding: 8px 12px; font-size: 13px; }
.v51-dash-guide-wide .v51-dash-guide-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.v51-dash-guide-wide .v51-dash-guide-step { border-bottom: 0; border-right: 1px solid var(--line); padding: 0 18px 0 0; }
.v51-dash-guide-wide .v51-dash-guide-step:last-child { border-right: 0; padding-right: 0; }
.v51-dash-activity-details { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.v51-dash-activity-details > summary { cursor: pointer; padding: 16px 20px; color: var(--ink); font-size: 15px; font-weight: 700; }
.v51-dash-activity-details[open] > summary { border-bottom: 1px solid var(--line); }
.v51-dash-activity-details .v51-dash-activity-card { border: 0; border-radius: 0; }
.v51-dash-activity-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 18px 0 0; }
.v51-dash-activity-card:only-child { grid-column: 1 / -1; }
.v51-dash-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.v51-dash-section-head h3 { font-size: 16px; font-weight: 600; margin: 0; color: var(--ink); }
.v51-dash-section-head span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.v51-dash-maintext { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.v51-dash-subtext { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.v51-dash-num { font-family: var(--mono); font-weight: 700; white-space: nowrap; }

.v51-dash-plan-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.v51-dash-plan-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.v51-dash-plan-eyebrow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.v51-dash-plan-name { font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 4px; line-height: 1.08; }
.v51-dash-plan-price { font-size: 16px; color: var(--ink); margin-top: 2px; font-family: var(--mono); }
.v51-dash-plan-note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.v51-dash-plan-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.v51-dash-plan-upgrade { font-size: 14px; color: var(--ink); text-decoration: none; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; transition: background 0.15s; white-space: nowrap; }
.v51-dash-plan-upgrade:hover { background: var(--surface-2, #f5f5f7); }
.v51-dash-plan-features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.v51-dash-plan-features li { font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.v51-dash-plan-features .v51-chk { color: #16a34a; font-weight: 700; }

.v51-dash-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.v51-dash-tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.v51-dash-tab:hover { color: var(--ink); }
.v51-dash-tab.active { color: #0071E3; border-bottom-color: #0071E3; }
.v51-dash-tab-count { font-size: 11px; background: var(--surface-raised); padding: 1px 7px; border-radius: 980px; }
.v51-dash-panel { display: none; }
.v51-dash-panel.active { display: block; }

.v51-dash-keys-grid { display: grid; grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.v51-dash-keys-grid h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; color: var(--muted); }
.v51-dash-create-form { display: flex; flex-direction: column; gap: 10px; }
.v51-dash-input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink); font-family: inherit; }
.v51-dash-input:focus { outline: none; border-color: #0071E3; box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }

.v51-dash-table-wrap { overflow-x: auto; }
.v51-dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.v51-dash-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.v51-dash-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
.v51-dash-table code { font-size: 13px; font-family: var(--mono); color: var(--muted); }
.v51-dash-revoke { background: none; border: 1px solid #fecaca; border-radius: 6px; padding: 4px 12px; font-size: 12px; color: #991b1b; cursor: pointer; }
.v51-dash-revoke:hover { background: #fef2f2; }
.v51-dash-empty { color: var(--muted); font-size: 14px; }
.v51-dash-empty a { color: #0071E3; text-decoration: none; }
.v51-dash-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 4px; font-size: 13px; color: var(--muted); }
.v51-dash-pagination button { padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.v51-dash-pagination button:hover:not(:disabled) { background: var(--surface-raised); border-color: var(--line-strong); }
.v51-dash-pagination button:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 700px) {
  .v51-dash { padding: 28px 16px 44px; }
  .v51-dash-header { align-items: flex-start; flex-direction: column; }
  .v51-dash-header-actions { width: 100%; justify-content: flex-start; }
  .v51-dash-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v51-dash-summary-item:nth-child(2n) { border-right: 0; }
  .v51-dash-summary-item { border-bottom: 1px solid var(--line); }
  .v51-dash-summary-actions { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; }
  .v51-dash-top-grid,
  .v51-dash-workspace { grid-template-columns: 1fr; }
  .v51-dash-guide-wide .v51-dash-guide-steps { grid-template-columns: 1fr; gap: 14px; }
  .v51-dash-guide-wide .v51-dash-guide-step { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 14px; }
  .v51-dash-guide-wide .v51-dash-guide-step:last-child { border-bottom: 0; padding-bottom: 0; }
  .v51-dash-plan-header { flex-direction: column; }
  .v51-dash-plan-actions { justify-content: flex-start; width: 100%; }
  .v51-dash-plan-features { grid-template-columns: 1fr; }
  .v51-dash-usage { grid-template-columns: 1fr; }
  .v51-dash-activity-grid { grid-template-columns: 1fr; }
  .v51-dash-keys-grid { grid-template-columns: 1fr; }
  .v51-dash-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .v51-dash-section-head span { white-space: normal; }
}
@media (max-width: 640px) {
  body.home-page header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 16px;
    margin-bottom: 0;
  }
  body.home-page .brand {
    display: inline-flex;
    align-items: center;
  }
  body.home-page nav {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
  }
}
