/* ════════════════════════════════════════════════════════════════════════
   SeekOut MCP — Docs site design system + shell
   One stylesheet shared by every docs page (rendered via docs_site.render_page).
   Light theme = SeekOut/Helix warm brand. Dark theme via [data-theme="dark"].
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand constants (theme-independent) */
  --brand-purple: #781fb3;
  --brand-purple-deep: #4f0064;
  --brand-orange: #ff7d00;
  --brand-mint: #00b58f;

  /* ── Light theme (default) ── */
  --bg: #faf8f6;            /* page / sidebar */
  --bg-content: #ffffff;    /* main content surface */
  --card: #f6f1eb;          /* cream cards */
  --card-2: #faf8f6;        /* subtle cards on white */
  --fg: #2e2e2e;            /* body */
  --fg-strong: #1a1226;     /* display headings */
  --muted: #5d5668;
  --muted-light: #837c90;
  --border: #ebe4db;
  --border-strong: #ddd4c8;
  --primary: #781fb3;
  --primary-hover: #4f0064;
  --primary-fg: #ffffff;
  --secondary: #ebdeff;     /* light purple wash */
  --secondary-fg: #2c1a45;
  --code-bg: #f3eee7;
  --code-fg: #3a3142;
  --topbar-bg: rgba(250,248,246,0.82);
  --shadow-sm: 0 1px 2px rgba(26,18,38,0.05), 0 1px 3px rgba(26,18,38,0.07);
  --shadow-md: 0 10px 26px rgba(26,18,38,0.10), 0 3px 8px rgba(26,18,38,0.06);

  /* Category tag palette (matches overview.html workflow-labels) */
  --tag-search-bg: #ebdeff; --tag-search-fg: #781fb3;
  --tag-analysis-bg: #fff3e0; --tag-analysis-fg: #bf5700;
  --tag-evaluation-bg: #bafae8; --tag-evaluation-fg: #1a4d3e;
  --tag-action-bg: #e8f5e9; --tag-action-fg: #2e7d32;

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --logo-light: inline;
  --logo-dark: none;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', ui-monospace, monospace;

  --sidebar-w: 270px;
  --toc-w: 220px;
  --topbar-h: 60px;
}

[data-theme="dark"] {
  --bg: #15101c;
  --bg-content: #1b1426;
  --card: #221a30;
  --card-2: #1f1729;
  --fg: #d9d2e6;
  --fg-strong: #f6f2ff;
  --muted: #a79db8;
  --muted-light: #837a96;
  --border: #322a40;
  --border-strong: #423751;
  --primary: #c79bff;
  --primary-hover: #d8b8ff;
  --primary-fg: #1b1426;
  --secondary: #2c2140;
  --secondary-fg: #e7dcff;
  --code-bg: #120d1a;
  --code-fg: #d9d2e6;
  --topbar-bg: rgba(21,16,28,0.82);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 12px 30px rgba(0,0,0,0.45);
  --tag-search-bg: #2c2140; --tag-search-fg: #c79bff;
  --tag-analysis-bg: #3a2410; --tag-analysis-fg: #ffb060;
  --tag-evaluation-bg: #0e3329; --tag-evaluation-fg: #5fe4c4;
  --tag-action-bg: #133318; --tag-action-fg: #79d986;
  --logo-light: none;
  --logo-dark: inline;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg-content); color: var(--fg); line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--secondary); color: var(--secondary-fg); }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 100; height: var(--topbar-h); display: flex; align-items: center; background: var(--topbar-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { width: 100%; max-width: 1680px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 1rem; }
.tb-logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.tb-logo img { height: 26px; width: auto; display: block; }
.tb-logo .light { display: var(--logo-light); }
.tb-logo .dark { display: var(--logo-dark); }
.tb-pill { font-size: 0.7rem; font-weight: 600; color: var(--primary); background: var(--secondary); border-radius: 2rem; padding: 0.2rem 0.6rem; letter-spacing: 0.02em; }
.tb-spacer { flex: 1; }
.tb-search { display: flex; align-items: center; gap: 0.5rem; background: var(--bg-content); border: 1px solid var(--border); border-radius: 2rem; padding: 0.4rem 0.8rem; min-width: 220px; color: var(--muted-light); cursor: text; }
.tb-search svg { width: 14px; height: 14px; flex: none; }
.tb-search input { border: none; background: none; outline: none; font-family: inherit; font-size: 0.85rem; color: var(--fg); width: 100%; }
.tb-search input::placeholder { color: var(--muted-light); }
.tb-search .kbd { font-size: 0.7rem; color: var(--muted-light); border: 1px solid var(--border); border-radius: 4px; padding: 0.05rem 0.3rem; }
.tb-cta { font-size: 0.85rem; font-weight: 600; color: var(--primary-fg); background: var(--primary); border-radius: 2rem; padding: 0.45rem 1rem; }
.tb-cta:hover { background: var(--primary-hover); text-decoration: none; }
.tb-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-content); color: var(--muted); cursor: pointer; }
.tb-toggle:hover { color: var(--primary); border-color: var(--primary); }
.tb-toggle svg { width: 16px; height: 16px; }
.tb-toggle .moon { display: var(--logo-light); }
.tb-toggle .sun { display: var(--logo-dark); }

/* ── Layout shell — sidebar · centered content · TOC (Mintlify-style) ──── */
.layout { max-width: 1680px; margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 1.75rem 1rem 3rem 1.5rem; border-right: 1px solid var(--border); background: var(--bg); }
.nav-group { margin-bottom: 1.5rem; }
.nav-group-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-strong); margin-bottom: 0.6rem; }
.nav-group-label svg { width: 14px; height: 14px; color: var(--muted-light); }
.nav-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.34rem 0.7rem; margin: 0.05rem 0; font-size: 0.875rem; color: var(--muted); border-radius: var(--radius-sm); border-left: 2px solid transparent; }
.nav-item:hover { color: var(--fg-strong); background: var(--card-2); text-decoration: none; }
.nav-item.active { color: var(--primary); background: var(--secondary); font-weight: 600; }
.nav-item .lock { width: 12px; height: 12px; margin-left: auto; color: var(--muted-light); flex: none; }
.nav-empty { font-size: 0.8rem; color: var(--muted-light); padding: 0.5rem 0.7rem; }

/* ── Main + content + TOC ──────────────────────────────────────────────── */
.main { min-height: calc(100vh - var(--topbar-h)); padding: 2.75rem 3.5rem 5rem; display: flex; justify-content: center; }
.content { max-width: 720px; width: 100%; min-width: 0; }
.eyebrow { font-size: 0.82rem; font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; }
.content h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--fg-strong); margin-bottom: 0.5rem; }
.content .lead { font-size: 1.18rem; color: var(--muted); margin-bottom: 1.75rem; line-height: 1.55; }
.content .lead strong { color: var(--fg); font-weight: 600; }
.content h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.015em; color: var(--fg-strong); margin: 2.75rem 0 0.85rem; scroll-margin-top: calc(var(--topbar-h) + 1.5rem); }
.content h3 { font-size: 1.12rem; font-weight: 600; color: var(--fg-strong); margin: 1.6rem 0 0.4rem; scroll-margin-top: calc(var(--topbar-h) + 1.5rem); }
.content p { margin-bottom: 0.9rem; color: var(--ink-soft, var(--fg)); }
.content strong { color: var(--fg-strong); font-weight: 600; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* anchor on hover */
.content h2 .anchor, .content h3 .anchor { opacity: 0; margin-left: 0.4rem; color: var(--muted-light); font-weight: 400; font-size: 0.7em; font-family: var(--font); }
.content h2:hover .anchor, .content h3:hover .anchor, .content h2:focus-within .anchor, .content h3:focus-within .anchor { opacity: 1; }
.content .anchor:hover { color: var(--primary); text-decoration: none; }
/* Visible keyboard focus for interactive elements. */
a:focus-visible, button:focus-visible, .copy:focus-visible, .nav-card:focus-visible, .screenshot-card:focus-visible, .install-btn:focus-visible, .tab:focus-visible, .setup-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Right TOC (3rd grid column) */
.toc { padding: 2.75rem 1.5rem 2rem 0; align-self: start; position: sticky; top: var(--topbar-h); height: fit-content; font-size: 0.82rem; }
.toc-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-light); margin-bottom: 0.7rem; }
.toc-label svg { width: 13px; height: 13px; }
.toc a { display: block; padding: 0.28rem 0 0.28rem 0.8rem; color: var(--muted); border-left: 2px solid var(--border); line-height: 1.35; }
.toc a.lvl-3 { padding-left: 1.6rem; font-size: 0.97em; }
.toc a:hover { color: var(--fg-strong); text-decoration: none; }
.toc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* ── Callout ───────────────────────────────────────────────────────────── */
.callout { display: flex; gap: 0.8rem; background: var(--secondary); color: var(--secondary-fg); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.9rem; margin: 1.25rem 0; }
.callout .ic { color: var(--primary); flex: none; margin-top: 1px; }
.callout strong { color: var(--secondary-fg); }

/* ── Prompt block (copy) ───────────────────────────────────────────────── */
.prompt { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.95rem 5.25rem 0.95rem 1.05rem; font-size: 0.88rem; color: var(--fg); font-style: italic; margin: 1rem 0; }
.prompt .plabel { display: block; font-style: normal; font-family: var(--font); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-light); margin-bottom: 0.4rem; }
.prompt .var { color: var(--primary); font-weight: 600; }
.copy { position: absolute; top: 0.65rem; right: 0.65rem; cursor: pointer; font-family: var(--font); font-style: normal; display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; font-weight: 600; color: var(--primary); background: var(--bg-content); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.28rem 0.5rem; }
.copy:hover { border-color: var(--primary); }
.copy svg { width: 12px; height: 12px; }
.outcome { font-size: 0.86rem; color: var(--muted); margin: 0.6rem 0 0; }
.outcome strong { color: var(--fg-strong); }

/* ── Steps ─────────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 1.25rem 0; }
.step { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.step-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--secondary); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.step .meta { font-size: 0.66rem; color: var(--muted-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.5rem; }
.step h3 { font-size: 0.92rem; margin: 0.1rem 0 0.2rem; }
.step p { font-size: 0.82rem; color: var(--muted); margin: 0; }

/* ── The shift compare ─────────────────────────────────────────────────── */
.compare { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0.75rem; margin: 1.25rem 0; }
.pane { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.pane.before { background: var(--card); }
.pane.after { background: var(--secondary); border-color: transparent; display: flex; flex-direction: column; }
.pane .plabel { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-light); margin-bottom: 0.6rem; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.1rem; }
.node { font-size: 0.72rem; color: var(--muted); background: var(--bg-content); border: 1px solid var(--border); border-radius: 6px; padding: 0.18rem 0.42rem; white-space: nowrap; }
.chain .sep { color: var(--border-strong); font-size: 0.7rem; }
.count-tag { display: block; margin-top: 0.7rem; font-size: 0.7rem; font-weight: 600; color: var(--muted-light); }
.count-tag.one { color: var(--primary); }
.oneline { font-size: 0.98rem; color: var(--secondary-fg); flex: 1; }
.oneline .node-one { display: inline-flex; margin-top: 0.55rem; background: var(--bg-content); border: 1px solid var(--primary); border-radius: 6px; padding: 0.28rem 0.6rem; font-size: 0.86rem; font-weight: 700; color: var(--primary); }
.wedge { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.92rem; color: var(--fg); }
.wedge strong { color: var(--primary); }

/* ── Scenario cards ────────────────────────────────────────────────────── */
.scenario { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; transition: border-color 0.15s, box-shadow 0.15s; scroll-margin-top: calc(var(--topbar-h) + 1.5rem); }
.scenario:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.sc-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.tag { display: inline-block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.12rem 0.45rem; border-radius: 4px; }
.tag-search { background: var(--tag-search-bg); color: var(--tag-search-fg); }
.tag-analysis { background: var(--tag-analysis-bg); color: var(--tag-analysis-fg); }
.tag-evaluation { background: var(--tag-evaluation-bg); color: var(--tag-evaluation-fg); }
.tag-action { background: var(--tag-action-bg); color: var(--tag-action-fg); }
.sc-num { font-size: 0.66rem; font-weight: 600; color: var(--muted-light); }
.scenario h3 { margin: 0 0 0.1rem; }
.usecase { font-size: 0.78rem; color: var(--muted-light); margin-bottom: 0.85rem; }
.followup { background: var(--secondary); color: var(--secondary-fg); border-radius: var(--radius) var(--radius) var(--radius) 4px; padding: 0.55rem 0.9rem; font-size: 0.82rem; font-style: italic; margin: 0.5rem 0 0 1.25rem; }
.followup .l { font-weight: 600; font-style: normal; }
.sc-foot { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted); }
.sc-foot .win { color: var(--primary); font-weight: 600; }
.sc-foot .best b { color: var(--fg-strong); font-weight: 600; }

/* ── Patterns ──────────────────────────────────────────────────────────── */
.pattern { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.85rem; padding: 0.9rem 0; border-top: 1px solid var(--border); }
.pattern:first-of-type { border-top: none; }
.pattern .pn { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--primary); line-height: 1.2; }
.pattern h3 { margin: 0 0 0.15rem; }
.pattern p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.pattern em { font-style: normal; color: var(--secondary-fg); background: var(--secondary); padding: 0.04rem 0.3rem; border-radius: 4px; }

/* ── Next-step cards ───────────────────────────────────────────────────── */
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
.next a { text-decoration: none; }
.next-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; height: 100%; transition: border-color 0.15s; }
.next-card:hover { border-color: var(--primary); }
.next-card .t { font-weight: 600; color: var(--fg-strong); display: flex; align-items: center; justify-content: space-between; }
.next-card .t .arr { color: var(--primary); }
.next-card p { font-size: 0.84rem; color: var(--muted); margin: 0.3rem 0 0; }

/* ── Page footer nav ───────────────────────────────────────────────────── */
.page-foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.page-foot a { color: var(--muted); font-weight: 600; }
.page-foot a:hover { color: var(--primary); text-decoration: none; }

/* ── Mobile nav controls (base; activated in the Responsive section) ─────── */
.menu-btn { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-content); color: var(--fg); cursor: pointer; flex: none; }
.menu-btn svg { width: 18px; height: 18px; }
.nav-scrim { display: none; }
body.nav-open { overflow: hidden; }

/* ════════════════════════════════════════════════════════════════════════
   Introduction page components (ported from overview.html, theme-aware).
   Category chips stay light pastels in both themes by design.
   ════════════════════════════════════════════════════════════════════════ */
:root { --surface-strong: var(--border-strong); --tag-mint: #bafae8; --brand-purple: #902be7; }

.content h4 { font-size: 0.95rem; font-weight: 600; color: var(--fg-strong); margin-bottom: 0.25rem; }

/* Recruit-license / closing banners */
.banner { background: linear-gradient(135deg, rgba(120,31,179,0.07) 0%, rgba(255,125,0,0.07) 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; text-align: center; margin: 1.25rem 0; }
.banner .t { font-size: 1rem; font-weight: 600; color: var(--fg-strong); margin-bottom: 0.3rem; }
.banner p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* Card grid + cards */
.workflow-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }
.workflow-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; transition: border-color 0.15s; }
.workflow-card:hover { border-color: var(--surface-strong); }
.workflow-card h4 { margin-bottom: 0.25rem; }
.workflow-card p { color: var(--muted); font-size: 0.84rem; margin-bottom: 0; }
.workflow-card .ex { background: var(--secondary); color: var(--secondary-fg); font-style: italic; font-size: 0.84rem; padding: 0.45rem 0.75rem; border-radius: 8px 8px 8px 2px; margin-bottom: 0.5rem; }
.workflow-label { display: inline-block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.45rem; border-radius: 3px; margin-bottom: 0.4rem; }
.label-search, .label-your-data { background: var(--secondary); color: var(--primary); }
.label-analysis { background: #fff3e0; color: #bf5700; }
.label-evaluation { background: var(--tag-mint); color: #1a4d3e; }
.label-intel { background: #e3f2fd; color: #1565c0; }
.label-action { background: #e8f5e9; color: #2e7d32; }
.label-developer { background: #e8eaf6; color: #283593; }
.label-research { background: #fce4ec; color: #880e4f; }
.label-healthcare { background: #e0f2f1; color: #004d40; }
.label-clinical { background: #fff8e1; color: #e65100; }

/* Setup tabs */
.tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.setup-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.6rem 1rem; font-size: 0.88rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: all 0.15s; margin-bottom: -1px; font-family: inherit; }
.setup-tab:hover { color: var(--fg-strong); }
.setup-tab.active { color: var(--fg-strong); font-weight: 600; border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.setup-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.setup-box h3 { margin: 0 0 0.5rem; }
.setup-box ol { padding-left: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.setup-box ol li { margin-bottom: 0.35rem; }
.setup-box code { display: block; background: var(--code-bg); color: var(--code-fg); border-radius: 6px; padding: 0.75rem; font-size: 0.8rem; margin-top: 0.75rem; white-space: pre; overflow-x: auto; line-height: 1.5; font-family: var(--font-mono); }
.inline-code { display: inline; background: var(--code-bg); color: var(--primary); padding: 0 0.35rem; border-radius: 4px; font-size: 0.85em; font-family: var(--font-mono); }

/* Info grid (limits / security) */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.info-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem; }
.info-box h3 { margin: 0 0 0.5rem; }
.info-box ul { padding-left: 1.2rem; font-size: 0.9rem; color: var(--muted); }
.info-box ul li { margin-bottom: 0.3rem; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 0.5rem; }
.faq-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; transition: border-color 0.15s; }
.faq-card:hover { border-color: var(--surface-strong); }
.faq-q { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--fg-strong); }
.faq-a { font-size: 0.82rem; color: var(--muted); margin-bottom: 0; line-height: 1.5; }

/* Screenshots + lightbox */
.screenshot-grid-2x2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.screenshot-grid-2x2 .img-wrap { height: 240px; }
.screenshot-grid-2x2 .img-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.screenshot-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); background: var(--card); cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; display: flex; flex-direction: column; }
.screenshot-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.screenshot-card .img-wrap { flex: 1; display: flex; align-items: center; justify-content: center; background: #1e1e1e; overflow: hidden; }
.screenshot-card img { width: 100%; height: auto; display: block; }
.screenshot-card .caption { padding: 0.6rem 0.75rem; font-size: 0.78rem; color: var(--muted); background: var(--card); text-align: center; font-weight: 500; line-height: 1.4; border-top: 1px solid var(--border); }
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; align-items: center; justify-content: center; cursor: zoom-out; padding: 2rem; }
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img { max-width: 95%; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.lightbox-caption { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); color: #fff; font-size: 0.9rem; font-weight: 500; background: rgba(0,0,0,0.6); padding: 0.4rem 1rem; border-radius: 6px; pointer-events: none; }

/* Collapsible */
details.collapsible { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; box-shadow: var(--shadow-sm); overflow: hidden; }
details.collapsible > summary { padding: 0.85rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--fg-strong); list-style: none; display: flex; align-items: center; gap: 0.5rem; user-select: none; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::before { content: ''; display: inline-block; width: 6px; height: 6px; border-right: 2px solid var(--muted-light); border-bottom: 2px solid var(--muted-light); transform: rotate(-45deg); transition: transform 0.2s; flex-shrink: 0; }
details.collapsible[open] > summary::before { transform: rotate(45deg); }
details.collapsible > summary:hover { color: var(--primary); }
details.collapsible .details-body { padding: 0 1rem 1rem; font-size: 0.85rem; color: var(--muted); }

/* ════════════════════════════════════════════════════════════════════════
   Technical Reference components (ported from docs_mcp.html, theme-aware).
   Gated pages: Connecting, Verticals, Workflows, Operations, Auth & Security.
   ════════════════════════════════════════════════════════════════════════ */
.content .section { margin-bottom: 2.5rem; }
.content .subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.content pre { background: var(--code-bg); color: var(--code-fg); padding: 0.75rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.8rem; margin-top: 0.5rem; border: 1px solid var(--border); font-family: var(--font-mono); }
.content pre code { color: var(--code-fg); font-family: var(--font-mono); }

/* Reference tabs (Connecting page) */
.tabs { display: flex; gap: 0; flex-wrap: wrap; background: var(--card); border-radius: var(--radius) var(--radius) 0 0; border: 1px solid var(--border); border-bottom: none; position: relative; }
.tab { padding: 0.5rem 1rem; font-size: 0.85rem; color: var(--muted-light); cursor: pointer; border: none; border-bottom: 2px solid transparent; background: none; font-family: inherit; font-weight: 500; transition: color 0.15s; }
.tab:hover { color: var(--fg-strong); }
.tab.active { color: var(--primary); }
.tab-content { display: none; padding: 1rem; background: var(--card); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-sm); }
.tab-content.active { display: block; }
.tab-content p { color: var(--muted); font-size: 0.85rem; }
.tab-indicator { position: absolute; bottom: 0; height: 2px; background: var(--primary); border-radius: 1px; transition: left 0.3s ease, width 0.3s ease; pointer-events: none; }
.install-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; font-size: 0.88rem; font-weight: 600; color: var(--primary-fg); background: var(--primary); border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; text-decoration: none; margin-bottom: 0.75rem; }
.install-btn:hover { background: var(--primary-hover); color: var(--primary-fg); text-decoration: none; }
.install-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.note { background: var(--secondary); border-left: 3px solid var(--primary); padding: 0.75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0.75rem 0; font-size: 0.82rem; color: var(--secondary-fg); }
.note strong { color: var(--fg-strong); }
.security-list { color: var(--muted); font-size: 0.85rem; padding-left: 1.25rem; margin: 0; }
.security-list li { margin-bottom: 0.25rem; }
.security-list strong { color: var(--fg-strong); }

/* Operation cards */
details.op { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; box-shadow: var(--shadow-sm); overflow: hidden; }
details.op[open] { box-shadow: var(--shadow-md); }
details.op summary { padding: 0.75rem 1rem; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem; transition: color 0.15s; user-select: none; }
details.op summary::-webkit-details-marker { display: none; }
details.op summary::before { content: ''; display: inline-block; width: 6px; height: 6px; border-right: 2px solid var(--muted-light); border-bottom: 2px solid var(--muted-light); transform: rotate(-45deg); transition: transform 0.2s; flex-shrink: 0; }
details.op[open] > summary::before { transform: rotate(45deg); }
details.op summary:hover { color: var(--primary); }
.op-name { font-family: var(--font-mono); font-weight: 600; color: var(--primary); font-size: 0.88rem; }
.op-desc { color: var(--muted); font-size: 0.82rem; margin-left: 0.25rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-annotation { display: inline-block; font-size: 0.6rem; padding: 0.1rem 0.4rem; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
.op-annotation-ro { background: var(--tag-mint); color: #1a4d3e; }
.op-annotation-idem { background: #fff3e0; color: #e65100; }
.op-annotation[class*="credits"] { background: #fce4ec; color: #880e4f; }
.op-body { padding: 0 1rem 1rem; }
details.op:not([open]) .op-body { display: none; }
.op-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.op-params, .op-params-full { font-size: 0.8rem; color: var(--muted); }
.op-params .param-group, .op-params-full .param-group { margin-bottom: 0.55rem; }
.op-params .param-group-label, .op-params-full .param-group-label { font-weight: 600; color: var(--fg-strong); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.18rem; }
.op-params code, .op-params-full code { background: var(--code-bg); padding: 0.05rem 0.3rem; border-radius: 3px; color: var(--primary); font-size: 0.82em; font-family: var(--font-mono); }
.op-params .param-note, .param-note { color: var(--muted-light); font-size: 0.78rem; }
.param-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.op-examples { display: flex; flex-direction: column; gap: 0.5rem; }
.example { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.example-header { padding: 0.35rem 0.75rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--card); }
.example-title { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.example-badge { font-size: 0.6rem; padding: 0.1rem 0.4rem; border-radius: 4px; font-weight: 600; }
.example-badge-req { background: var(--secondary); color: var(--primary); }
.example-badge-res { background: var(--tag-mint); color: #1a4d3e; }
.example-body pre { margin: 0; border-radius: 0; border: none; font-size: 0.75rem; }
.json-key { color: var(--primary); }
.json-str { color: #2e7d32; }
.json-num { color: #e65100; }
.json-null { color: var(--brand-purple); }
.json-comment { color: #8a8a8a; font-style: italic; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; color: var(--muted-light); font-weight: 600; padding: 0.5rem 0.75rem; border-bottom: 2px solid var(--border); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--fg); }
td code { background: var(--code-bg); padding: 0.1rem 0.3rem; border-radius: 4px; color: var(--primary); font-size: 0.85em; font-family: var(--font-mono); }

details.section-collapse { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; box-shadow: var(--shadow-sm); overflow: hidden; }
details.section-collapse[open] { box-shadow: var(--shadow-md); }
details.section-collapse summary { padding: 0.85rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--fg-strong); list-style: none; display: flex; align-items: center; gap: 0.5rem; user-select: none; }
details.section-collapse summary::-webkit-details-marker { display: none; }
details.section-collapse summary::before { content: ''; display: inline-block; width: 6px; height: 6px; border-right: 2px solid var(--muted-light); border-bottom: 2px solid var(--muted-light); transform: rotate(-45deg); transition: transform 0.2s; flex-shrink: 0; }
details.section-collapse[open] > summary::before { transform: rotate(45deg); }
details.section-collapse summary:hover { color: var(--primary); }
details.section-collapse summary .summary-desc { font-weight: 400; color: var(--muted-light); font-size: 0.82rem; margin-left: auto; }
.collapse-body { padding: 0 1rem 1rem; }
details.section-collapse:not([open]) .collapse-body { display: none; }

.code-wrapper { position: relative; }
.code-copy-btn { position: absolute; top: 0.4rem; right: 0.4rem; display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.45rem; font-size: 0.7rem; font-weight: 500; color: var(--muted-light); background: var(--bg-content); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-family: inherit; opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s; }
.code-wrapper:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover { color: var(--primary); border-color: var(--primary); }
.code-copy-btn.copied { color: #2e7d32; border-color: #2e7d32; opacity: 1; }
.code-copy-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Admonitions (Note / Warning / Tip) — Mintlify-style callouts ───────── */
.adm { display: flex; gap: 0.7rem; align-items: flex-start; border: 1px solid; border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1.25rem 0; font-size: 0.92rem; line-height: 1.55; color: var(--fg); }
.adm .adm-ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.adm > div { min-width: 0; }
.adm strong { color: var(--fg-strong); }
.adm p { margin: 0; }
.adm p + p { margin-top: 0.5rem; }
.adm-note { background: rgba(47,128,237,0.08); border-color: rgba(47,128,237,0.28); }
.adm-note .adm-ic { color: #3b82f6; }
.adm-warning { background: rgba(217,119,6,0.10); border-color: rgba(217,119,6,0.32); }
.adm-warning .adm-ic { color: #d97706; }
.adm-tip { background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.30); }
.adm-tip .adm-ic { color: #10b981; }

/* ── Stepper (Mintlify <Steps>) — vertical numbered setup steps ─────────── */
.stepper { margin: 1.25rem 0; }
.stepper-item { position: relative; padding-left: 2.75rem; padding-bottom: 1.5rem; }
.stepper-item:last-child { padding-bottom: 0.25rem; }
.stepper-item::before { content: ''; position: absolute; left: 0.93rem; top: 1.95rem; bottom: 0; width: 2px; background: var(--border); }
.stepper-item:last-child::before { display: none; }
.stepper-item .sn { position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--secondary); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.82rem; }
.stepper-item .stitle { font-weight: 600; color: var(--fg-strong); margin-bottom: 0.35rem; }
.stepper-item .sbody { color: var(--muted); font-size: 0.92rem; }
.stepper-item .sbody p { margin: 0 0 0.5rem; }
.stepper-item .sbody pre { margin: 0.5rem 0 0; }

/* ── Card group (Mintlify <CardGroup>/<Card>) ───────────────────────────── */
.card-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; margin: 1.25rem 0; }
.doc-card { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--card-2); color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
a.doc-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); text-decoration: none; }
.doc-card .dc-t { font-weight: 600; color: var(--fg-strong); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.45rem; }
.doc-card .dc-t svg { width: 16px; height: 16px; color: var(--primary); flex: none; }
.doc-card .dc-d { font-size: 0.88rem; color: var(--muted); }

/* ── Badges (Mintlify <Badge>) — operation annotations ──────────────────── */
.badge { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 9999px; white-space: nowrap; line-height: 1.6; }
.badge-green { background: #dcefdc; color: #2f7d4f; }
.badge-orange { background: #f7e0cd; color: #b3611c; }
.badge-red { background: #f7d8da; color: #c0392b; }
[data-theme="dark"] .badge-green { background: rgba(16,185,129,0.18); color: #5fe4b0; }
[data-theme="dark"] .badge-orange { background: rgba(224,164,88,0.18); color: #e7b06a; }
[data-theme="dark"] .badge-red { background: rgba(244,63,94,0.20); color: #fb7185; }
td .badge { font-size: 0.66rem; }

/* ════════════════════════════════════════════════════════════════════════
   Responsive — single source of truth for every breakpoint override.
   Keep ALL media queries here so the responsive behavior of the docs site is
   readable in one place. Component sections above stay layout-at-rest only.

   Breakpoint scale (mobile reached by progressively narrowing):
     lg  ≤1100px — drop the right-hand "On this page" rail; sidebar stays.
     md  ≤860px  — sidebar collapses to an off-canvas drawer (hamburger + scrim).
     sm  ≤640px  — multi-column grids collapse to one; topbar declutters;
                   wide tables scroll within the column.

   Why minmax(0, 1fr): a bare `1fr` track sizes to its content's min-content,
   so a wide child (table, <pre>, long code token) stretches the grid and forces
   horizontal PAGE scroll. minmax(0, …) lets the track shrink below that, so
   wide children scroll inside their own box instead of breaking the layout.
   ════════════════════════════════════════════════════════════════════════ */

/* ── lg ──────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  .main { padding: 2rem 2rem 4rem; }
}

/* ── md — sidebar becomes a slide-in drawer ───────────────────────────────── */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: 280px; max-width: 84vw; z-index: 95;
    transform: translateX(-100%); transition: transform 0.22s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-scrim {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.45); z-index: 90;
    opacity: 0; visibility: hidden; transition: opacity 0.22s ease;
  }
  .nav-scrim.open { opacity: 1; visibility: visible; }
  /* Search shrinks to its icon; the full field belongs on wider screens. */
  .tb-search { min-width: 0; width: 38px; }
  .tb-search input, .tb-search .kbd { display: none; }
}

/* ── sm ──────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .main { padding: 1.5rem 1.15rem 3.5rem; }
  .content h1 { font-size: 1.7rem; }
  .content .lead { font-size: 1.05rem; }
  /* Topbar declutters: the marketing CTA + pill drop, leaving brand + controls. */
  .topbar-inner { padding: 0 1rem; gap: 0.55rem; }
  .tb-cta, .tb-pill { display: none; }
  /* Every two/three-column grid stacks. NOTE: when you add a new multi-column
     grid component above, append its selector here so it collapses on phones. */
  .steps, .compare, .next, .workflow-grid, .info-grid, .faq-grid,
  .screenshot-grid-2x2, .op-columns, .card-group { grid-template-columns: 1fr; }
  /* Indented follow-up bubbles lose their left indent to reclaim width. */
  .followup { margin-left: 0; }
  /* Wide tables scroll inside their box instead of stretching the page. */
  .content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
