/* RepoLens web UI, following the Mintlify DESIGN.md tokens:
   Inter for prose, Geist Mono for code, black pill actions, hairline borders,
   and mint green reserved for focus, active and verified states. */

:root {
  /* Colour */
  --primary: #0a0a0a;
  --on-primary: #ffffff;
  --brand-green: #00d4a4;
  --brand-green-deep: #00b48a;
  --brand-green-soft: #7cebcb;
  --brand-warn: #c37d0d;
  --brand-error: #d45656;
  --hero-sky-from: #87a8c8;
  --hero-sky-to: #f5e9d8;
  --canvas: #ffffff;
  --surface: #f7f7f7;
  --surface-soft: #fafafa;
  --surface-code: #1c1c1e;
  --hairline: #e5e5e5;
  --hairline-soft: #ededed;
  --hairline-dark: #2c2c2e;
  --ink: #0a0a0a;
  --charcoal: #1c1c1e;
  --slate: #3a3a3c;
  --steel: #5a5a5c;
  --stone: #888888;
  --muted: #a8a8aa;
  --on-dark: #ffffff;
  --on-dark-muted: #b3b3b3;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Elevation */
  --shadow-subtle: rgba(0, 0, 0, 0.04) 0 1px 2px 0;
  --shadow-card: rgba(0, 0, 0, 0.08) 0 4px 12px 0;
  --shadow-mockup: rgba(0, 0, 0, 0.12) 0 24px 48px -8px;

  --topbar-h: 56px;
  --ease: 180ms ease;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--charcoal);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 20;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  padding: 10px 20px;
  font: 500 14px/1.3 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}
.btn:disabled { cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:active { background: var(--charcoal); }
.btn-primary:disabled { background: var(--hairline); color: var(--muted); }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-secondary:hover { border-color: var(--stone); }
.btn-secondary:disabled { color: var(--muted); border-color: var(--hairline-soft); }

.btn-ghost { border-radius: var(--r-md); padding: 8px 12px; color: var(--steel); }
.btn-ghost:hover { color: var(--ink); background: var(--surface); }

/* ---------------------------------------------------------------- Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--hairline-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.2px;
  text-decoration: none;
}
.brand-mark { width: 22px; height: 22px; }
.brand-mark-dot { fill: var(--brand-green); }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--steel);
  font: 400 13px/1.4 var(--font-mono);
}
.crumb::before { content: "/"; color: var(--muted); font-family: var(--font-sans); }
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-links { margin-left: auto; }

/* ---------------------------------------------------------------- Layout */

.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 224px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ---------------------------------------------------------------- Sidebar */

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 8px 16px 32px;
  border-right: 1px solid var(--hairline-soft);
}

.sidebar-section + .sidebar-section { margin-top: 8px; }

/* The DESIGN.md sidebar-section-header: the only uppercase label in the UI. */
.sidebar-heading {
  margin: 0;
  padding: 16px 12px 8px;
  color: var(--steel);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.repo { padding: 4px 12px 0; }
.repo-name {
  display: block;
  color: var(--ink);
  font: 500 14px/1.4 var(--font-mono);
  overflow-wrap: anywhere;
  text-decoration: none;
}
a.repo-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.repo-meta, .repo-empty {
  margin: 4px 0 0;
  color: var(--steel);
  font-size: 13px;
  line-height: 1.4;
}

.index-form {
  display: grid;
  gap: 8px;
  margin: 20px 12px 0;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-soft);
}
.index-form .btn { justify-self: start; padding: 8px 16px; }

.field-label { color: var(--slate); font-size: 13px; font-weight: 500; }
.field-help { margin: 0; color: var(--steel); font-size: 13px; line-height: 1.4; }
.field-help.is-error { color: var(--brand-error); }

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--brand-green); box-shadow: 0 0 0 1px var(--brand-green); }

.history { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--steel);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.history-item:hover { color: var(--ink); }
.history-item[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 500; }
.history-empty { margin: 0; padding: 4px 12px; color: var(--stone); font-size: 13px; }

/* ---------------------------------------------------------------- Content column */

.content {
  min-width: 0;
  padding: 32px 48px 96px;
}
.content:focus { outline: none; }
.content > * { max-width: 760px; margin-left: auto; margin-right: auto; }

/* Hero: Mintlify's sky gradient, used only before the first question. */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 48px 48px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(ellipse 38% 22% at 18% 26%, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(ellipse 30% 16% at 82% 18%, rgba(255, 255, 255, 0.45), transparent 70%),
    radial-gradient(ellipse 60% 30% at 60% 100%, rgba(255, 255, 255, 0.5), transparent 70%),
    linear-gradient(180deg, var(--hero-sky-from) 0%, var(--hero-sky-to) 100%);
}
.hero-title {
  margin: 0;
  max-width: 18ch;
  color: var(--ink);
  font-size: 44px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -1.2px;
  text-wrap: balance;
}
.hero-sub {
  margin: 16px 0 32px;
  max-width: 56ch;
  color: var(--slate);
  font-size: 18px;
  line-height: 1.5;
}

/* After the first question the hero collapses to a plain composer bar. */
.hero.is-compact {
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: none;
}
.hero.is-compact .hero-text { display: none; }

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-mockup);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.hero.is-compact .composer { box-shadow: var(--shadow-subtle); }
.composer:focus-within { border-color: var(--brand-green); box-shadow: 0 0 0 1px var(--brand-green), var(--shadow-card); }

.composer-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.composer-input:focus { outline: none; }
.composer-input::placeholder { color: var(--muted); }

.composer-kbd {
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  color: var(--stone);
  font: 500 12px/1.4 var(--font-sans);
}

.composer-status { margin: 12px 0 0; color: var(--slate); font-size: 14px; min-height: 0; }
.composer-status:empty { display: none; }
.composer-status.is-error { color: var(--brand-error); }

/* ---------------------------------------------------------------- Answer */

.answer { margin-top: 40px; }

.answer-head { padding-bottom: 20px; border-bottom: 1px solid var(--hairline-soft); }
.answer-title {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.4px;
  text-wrap: pretty;
}
.answer-meta { margin: 8px 0 0; color: var(--steel); font-size: 14px; }
.answer-meta code { font: 500 13px/1.3 var(--font-mono); color: var(--slate); }

.section { margin-top: 48px; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.section-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.section-lead { margin: 6px 0 20px; color: var(--steel); font-size: 14px; max-width: 64ch; }

/* Prose */
.prose { margin-top: 24px; color: var(--charcoal); font-size: 16px; line-height: 1.6; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; max-width: 70ch; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--stone); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 28px 0 12px; color: var(--ink); font-size: 18px; font-weight: 600; }
.prose :not(pre) > code {
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--charcoal);
  font: 500 13px/1.3 var(--font-mono);
}
.prose pre {
  margin: 0 0 16px;
  padding: 16px;
  overflow-x: auto;
  border-radius: var(--r-md);
  background: var(--surface-code);
  color: var(--on-dark);
  font: 400 14px/1.5 var(--font-mono);
}

/* Citation chips: the link between a claim and the code behind it. */
.cite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 1px;
  padding: 1px 7px 1px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--slate);
  font: 500 12.5px/1.45 var(--font-mono);
  text-decoration: none;
  vertical-align: 1px;
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease);
}
.cite::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: var(--brand-green);
}
a.cite:hover { border-color: var(--brand-green); color: var(--ink); }
.cite--unverified { border-style: dashed; border-color: rgba(195, 125, 13, 0.55); background: transparent; color: var(--steel); cursor: help; }
.cite--unverified::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--brand-warn); }

/* Callouts (not found, errors) */
.callout {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid rgba(195, 125, 13, 0.25);
  border-radius: var(--r-md);
  background: rgba(195, 125, 13, 0.06);
}
.callout--error { border-color: rgba(212, 86, 86, 0.3); background: rgba(212, 86, 86, 0.06); }
.callout-title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; }
.callout-body { margin: 4px 0 0; color: var(--slate); font-size: 14px; max-width: 70ch; }

/* Loading */
.thinking { margin-top: 24px; }
.thinking-bar {
  position: relative;
  height: 2px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--hairline-soft);
}
.thinking-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  background: var(--brand-green);
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.thinking-text { margin: 12px 0 0; color: var(--steel); font-size: 14px; }

/* ---------------------------------------------------------------- Source code blocks */

.source { margin: 0 0 16px; border-radius: var(--r-md); background: var(--surface-code); overflow: hidden; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.source.is-flashing { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--brand-green); } 100% { box-shadow: 0 0 0 2px transparent; } }

.source-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--hairline-dark);
  color: var(--on-dark-muted);
  font-size: 13px;
}
.source-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-dark); font: 400 13px/1.4 var(--font-mono); }
.source-lines { color: var(--on-dark-muted); white-space: nowrap; }
.copy-button {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid var(--hairline-dark);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--on-dark-muted);
  font-size: 13px;
  cursor: pointer;
}
.copy-button:hover { color: var(--on-dark); border-color: #48484a; }

.source-body { display: flex; overflow-x: auto; font: 400 14px/1.5 var(--font-mono); }
.source-gutter {
  flex: none;
  margin: 0;
  padding: 16px 12px 16px 16px;
  font: inherit;
  color: #6e6e73;
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.source-code { margin: 0; padding: 16px 16px 16px 4px; color: var(--on-dark); font: inherit; white-space: pre; }

/* Syntax colours drawn from the brand palette: soft mint, sky and cream on the dark code surface. */
.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-selector-tag { color: var(--brand-green-soft); }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section { color: #a9c4e0; }
.hljs-string, .hljs-number, .hljs-regexp, .hljs-symbol { color: var(--hero-sky-to); }
.hljs-comment, .hljs-quote { color: #7c7c80; }
.hljs-meta, .hljs-attr, .hljs-attribute, .hljs-params, .hljs-variable, .hljs-type { color: #d6d6d8; }
.hljs-subst { color: var(--on-dark); }

/* ---------------------------------------------------------------- Retrieval details */

.facts { display: grid; gap: 0; margin: 0 0 24px; }
.fact {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 14px;
}
.fact dt { color: var(--steel); }
.fact dd { margin: 0; color: var(--ink); }

.meter { position: relative; height: 6px; margin-top: 10px; max-width: 320px; border-radius: var(--r-full); background: var(--hairline-soft); }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand-green); }
.meter.is-below .meter-fill { background: var(--brand-warn); }
.meter-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink); }

.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); }
.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank-table th {
  padding: 10px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--hairline);
  color: var(--steel);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
.rank-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table th:nth-child(2), .rank-table td:nth-child(2) { text-align: left; }
.rank-table td:nth-child(2) { font: 400 13px/1.4 var(--font-mono); color: var(--slate); }
.rank-table td.is-missing { color: var(--muted); }
.rank-table tr.is-sent td:first-child { box-shadow: inset 2px 0 0 var(--brand-green); font-weight: 600; }
.rank-table tr.is-cut td { color: var(--stone); }
.rank-table tr.is-cut td:nth-child(2) { color: var(--stone); }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 4px;
}
.link-button:hover { text-decoration-color: var(--ink); }
.table-toggle { margin-top: 12px; }
.table-note { margin: 12px 0 0; color: var(--steel); font-size: 13px; max-width: 70ch; }

/* ---------------------------------------------------------------- Table of contents */

.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 40px 24px 32px 8px;
}
.toc-title { margin: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hairline-soft); }
.toc-list a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid transparent;
  color: var(--steel);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-list a:hover { color: var(--ink); }
.toc-list a.is-active { border-left-color: var(--brand-green); color: var(--ink); font-weight: 500; }
.toc-list .toc-sub a { padding-left: 24px; font: 400 12.5px/1.5 var(--font-mono); }

/* ---------------------------------------------------------------- Indexing screen */

.indexing {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 16px;
  padding: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--surface-soft);
}

/* A small source file being read by the lens: line groups become chunks, then turn mint as they're embedded. */
.scan-file {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  box-shadow: var(--shadow-card);
}
.scan-group {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  border-radius: 2px;
  transition: border-color 300ms ease, background-color 300ms ease;
}
.scan-line { display: block; height: 6px; border-radius: var(--r-full); background: var(--hairline); transition: background-color 400ms ease; }
.scan-group.is-chunked { border-left-color: var(--muted); }
.scan-group.is-embedded { border-left-color: var(--brand-green); background: rgba(0, 212, 164, 0.06); }
.scan-group.is-embedded .scan-line { background: var(--brand-green-soft); }
.scan-beam {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 44px;
  border-bottom: 2px solid var(--brand-green);
  background: linear-gradient(180deg, rgba(0, 212, 164, 0), rgba(0, 212, 164, 0.16));
  animation: scan 2.6s ease-in-out infinite alternate;
}
@keyframes scan { from { transform: translateY(-44px); } to { transform: translateY(190px); } }
.scan.is-done .scan-beam { display: none; }
.scan.is-stopped .scan-beam { animation-play-state: paused; border-bottom-color: var(--muted); background: none; }

.indexing-title { margin: 0; color: var(--ink); font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.indexing-sub { margin: 8px 0 28px; color: var(--steel); font-size: 15px; max-width: 56ch; }

.stages { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.stage { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 14px; align-items: start; }
.stage-icon {
  position: relative;
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-full);
}
.stage.is-active .stage-icon { border-color: var(--hairline); border-top-color: var(--brand-green); animation: spin 0.8s linear infinite; }
.stage.is-done .stage-icon { border-color: var(--ink); background: var(--ink); }
.stage.is-done .stage-icon::after {
  content: "";
  position: absolute;
  left: 5.5px; top: 2.5px;
  width: 5px; height: 9px;
  border: solid var(--on-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.stage.is-failed .stage-icon { border-color: var(--brand-error); }
@keyframes spin { to { transform: rotate(360deg); } }

.stage-text { display: grid; gap: 2px; }
.stage-label { color: var(--steel); font-size: 15px; font-weight: 500; }
.stage.is-active .stage-label, .stage.is-done .stage-label { color: var(--ink); }
.stage-detail { color: var(--steel); font-size: 13px; font-variant-numeric: tabular-nums; }
.stage-detail:empty { display: none; }
.stage-bar { display: none; height: 4px; margin-top: 6px; max-width: 320px; overflow: hidden; border-radius: var(--r-full); background: var(--hairline-soft); }
.stage.is-active .stage-bar, .stage.is-done .stage-bar { display: block; }
.stage-bar-fill { display: block; width: 0; height: 100%; background: var(--brand-green); transition: width 300ms ease; }

.callout-action { margin-top: 12px; padding: 8px 16px; }
.indexing .callout { margin-top: 28px; }

/* ---------------------------------------------------------------- Answer tabs */

.tabs { display: flex; gap: 4px; margin-top: 8px; border-bottom: 1px solid var(--hairline-soft); }
.tab {
  margin-bottom: -1px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--steel);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.answer-head { border-bottom: 0; padding-bottom: 8px; }

/* ---------------------------------------------------------------- Simple view */

.simple-summary {
  margin: 28px 0 0;
  max-width: 60ch;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.55;
  letter-spacing: -0.1px;
  text-wrap: pretty;
}

.simple-loading { display: grid; gap: 12px; margin-top: 32px; }
.skeleton { display: block; height: 14px; border-radius: var(--r-full); background: var(--surface); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.flow-wrap { margin-top: 40px; }
.flow-wrap .section-title { scroll-margin-top: calc(var(--topbar-h) + 24px); }

.route { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 24px; }
.route-file {
  padding: 4px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--canvas);
  color: var(--slate);
  font: 400 13px/1.4 var(--font-mono);
}
.route-arrow { position: relative; width: 24px; height: 1.5px; background: var(--stone); }
.route-arrow::after {
  content: "";
  position: absolute;
  right: -1px; top: -3.5px;
  border: 4px solid transparent;
  border-left: 6px solid var(--stone);
  border-right: 0;
}

.flow { margin: 20px 0 0; padding: 0; list-style: none; }
.flow-step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding-bottom: 20px; }
.flow-step:last-child { padding-bottom: 0; }
/* Connector with an arrowhead from each step to the next. */
.flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px; top: 36px; bottom: 6px;
  width: 2px;
  background: var(--hairline);
}
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 11px; bottom: 2px;
  border: 5px solid transparent;
  border-top: 6px solid var(--muted);
  border-bottom: 0;
}
.flow-marker {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.flow-card { padding: 14px 18px; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--canvas); }
.flow-title { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.4; }
.flow-detail { margin: 4px 0 0; color: var(--steel); font-size: 15px; line-height: 1.5; max-width: 62ch; }
button.cite { cursor: pointer; }
button.cite:hover { border-color: var(--brand-green); color: var(--ink); }
.flow-source { margin: 10px 0 0; }

.simple-foot { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--hairline-soft); color: var(--steel); font-size: 14px; }

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 1180px) {
  .layout { grid-template-columns: 248px minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    height: auto;
    padding: 8px 4px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
  }
  .content { padding: 24px 16px 64px; }
  .hero { padding: 40px 20px 24px; }
  .hero-title { font-size: 32px; letter-spacing: -0.8px; }
  .hero-sub { font-size: 16px; margin-bottom: 24px; }
  .composer { flex-wrap: wrap; padding: 8px; }
  .composer-input { flex-basis: 100%; padding: 0 8px; }
  .composer .btn { width: 100%; padding: 12px 20px; }
  .composer-kbd { display: none; }
  .fact { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .crumb { display: none; }
  .topbar { padding: 0 16px; }
  .indexing { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 24px 20px; }
  .scan { max-width: 220px; }
  .indexing-title { font-size: 24px; }
  .simple-summary { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
