/* Access Guide styles. shadcn/ui look (zinc palette), plain CSS, no build step. */

:root {
  --background: #ffffff;
  --foreground: #09090b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --accent: #f4f4f5;
  --ring: #a1a1aa;
  --brand: #4d79d8;
  --warn-fg: #b45309;
  --warn-border: #fde68a;
  --warn-bg: #fffbeb;
  --radius: 0.625rem;
  --header-h: 56px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root.dark {
  --background: #09090b;
  --foreground: #fafafa;
  --muted: #18181b;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
  --input: #27272a;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --accent: #27272a;
  --ring: #52525b;
  --warn-fg: #fbbf24;
  --warn-border: #78350f;
  --warn-bg: #1c1408;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: var(--font); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--background) 85%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 24px; max-width: 1440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.logo img { border-radius: 6px; }
.logo-sub { color: var(--muted-foreground); font-weight: 400; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-links { display: flex; gap: 4px; }
.header-links a { font-size: 14px; color: var(--muted-foreground); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.header-links a:hover { color: var(--foreground); }
.search-trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; width: 240px; padding: 0 8px 0 12px;
  font: inherit; font-size: 14px; color: var(--muted-foreground); background: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.search-trigger span { flex: 1; text-align: left; }
.search-trigger svg, .input-icon svg, .cmdk-input svg { width: 16px; height: 16px; flex-shrink: 0; }
kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--background); border: 1px solid var(--border); color: var(--muted-foreground);
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  background: transparent; border: 0; border-radius: 8px; color: var(--foreground); cursor: pointer;
}
.icon-btn:hover { background: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .i-moon { display: none; }
:root.dark .theme-btn .i-sun { display: none; }
:root.dark .theme-btn .i-moon { display: block; }
.menu-btn { display: none; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.layout { display: flex; max-width: 1440px; margin: 0 auto; }
.sidebar {
  width: 256px; flex-shrink: 0; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: 24px 12px 48px 24px; border-right: 1px solid var(--border);
}
.nav-group { margin-bottom: 20px; }
.nav-title { font-size: 13px; font-weight: 600; margin: 0 0 4px; padding: 0 8px; }
.nav-item {
  display: block; font-size: 14px; line-height: 1.4; padding: 6px 8px; border-radius: 6px;
  color: var(--muted-foreground); text-decoration: none;
}
.nav-item:hover { color: var(--foreground); background: var(--accent); }
.nav-item.active { color: var(--foreground); background: var(--accent); font-weight: 500; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 48px; padding: 40px 32px 80px; }
.doc { width: 100%; max-width: 720px; min-width: 0; }
.toc { width: 200px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 40px); align-self: flex-start; font-size: 13px; }
.toc-title { font-weight: 600; margin: 0 0 8px; }
.toc a { display: block; color: var(--muted-foreground); text-decoration: none; padding: 4px 0; line-height: 1.4; }
.toc a:hover, .toc a.active { color: var(--foreground); }
@media (max-width: 1200px) { .toc { display: none; } }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .header-inner { padding: 0 12px; }
  .header-links, .logo-sub { display: none; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .sidebar {
    position: fixed; z-index: 50; top: 0; left: 0; height: 100vh; width: 280px; max-width: 85vw;
    background: var(--background); transform: translateX(-100%); transition: transform 200ms ease;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(0 0 0 / .4); }
  .main { padding: 24px 16px 64px; }
}

/* ── doc header ─────────────────────────────────────────────────────────── */
.doc-header { margin-bottom: 32px; }
.crumb { font-size: 14px; color: var(--muted-foreground); margin: 0 0 8px; }
h1 { font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.lead { font-size: 17px; color: var(--muted-foreground); margin: 12px 0 0; }
.page-actions { margin-top: 20px; }

/* ── prose ──────────────────────────────────────────────────────────────── */
.prose h2 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3;
  margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.prose h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ring); font-weight: 500; }
.prose a:hover { text-decoration-color: var(--foreground); }
.prose strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--muted); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
pre {
  font-family: var(--mono); font-size: 13px; line-height: 1.6; background: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; margin: 0 0 16px; white-space: pre-wrap; word-break: break-word;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose sub { display: block; font-size: 12px; color: var(--muted-foreground); margin-top: 40px; }
.prose sub a { font-weight: 400; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* tables */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; margin: 8px 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted-foreground); background: var(--muted); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

/* steps: numbered, with a rail (shadcn docs style) */
ol.steps { list-style: none; counter-reset: step; padding: 0 0 0 36px; margin: 16px 0 24px; border-left: 1px solid var(--border); margin-left: 14px; }
.step { counter-increment: step; position: relative; padding-bottom: 8px; margin: 0; }
.step::before {
  content: counter(step); position: absolute; left: -51px; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; font-family: var(--mono);
  background: var(--muted); border: 1px solid var(--border); box-shadow: 0 0 0 4px var(--background);
}
.prose .step h3 { margin: 3px 0 6px; }

/* alerts */
.alert { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; font-size: 14px; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert-title { font-weight: 600; margin: 0 0 4px !important; }
.alert-warning { border-color: var(--warn-border); background: var(--warn-bg); }
.alert-warning .alert-title { color: var(--warn-fg); }

/* facts (was the "Good to know" box) */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0 0 24px; }
.facts > div { background: var(--background); padding: 12px 16px; }
.facts dt { font-size: 12px; color: var(--muted-foreground); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 14px; line-height: 1.5; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.card { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none !important; font-weight: 400 !important; margin: 16px 0; transition: background-color 120ms ease; }
.card-grid .card { margin: 0; }
a.card:hover { background: var(--accent); }
.card h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px !important; }
.card p { font-size: 14px; color: var(--muted-foreground); margin: 0; line-height: 1.5; }

/* accordion */
.accordion { border-top: 1px solid var(--border); margin: 8px 0 24px; }
details { border-bottom: 1px solid var(--border); }
summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; font-weight: 500; font-size: 15px;
}
summary::-webkit-details-marker { display: none; }
summary:hover { text-decoration: underline; text-underline-offset: 3px; }
summary p { margin: 0; }
.chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted-foreground); transition: transform 200ms ease; }
details[open] .chev { transform: rotate(180deg); }
.details-body { padding: 0 0 16px; font-size: 14px; color: var(--muted-foreground); }
.details-body p:last-child { margin-bottom: 0; }

/* tabs (stacked) */
.tabs { display: grid; gap: 12px; margin: 16px 0; }
.tab { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tab-title { font-weight: 600; margin: 0 0 8px !important; }
.tab > :last-child { margin-bottom: 0; }

figure { margin: 12px 0 16px; }
figure img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); display: block; }
figcaption { font-size: 13px; color: var(--muted-foreground); margin-top: 6px; }

/* ── buttons & inputs ───────────────────────────────────────────────────── */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px;
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important; transition: background-color 120ms ease, opacity 120ms ease;
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: .9; }
.btn-outline { background: var(--background); border-color: var(--border); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.btn-outline:hover, .btn-ghost:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.input {
  width: 100%; font: inherit; font-size: 14px; color: var(--foreground); background: var(--background);
  border: 1px solid var(--input); border-radius: 8px; padding: 8px 12px; box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
.input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent); }
.input-icon { position: relative; flex: 1; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); }
.input-icon .input { padding-left: 36px; height: 40px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; margin: 0 0 12px; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--warn-border); color: var(--warn-fg); background: var(--warn-bg); vertical-align: 2px; margin-left: 6px;
}

/* inline AI prompt */
.prompt { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin: 16px 0 24px; }
.prompt pre { margin: 0 0 12px; }

/* ── prompt builder ─────────────────────────────────────────────────────── */
.pb { margin: 0 0 40px; }
.pb-search-row { display: flex; gap: 8px; position: sticky; top: var(--header-h); z-index: 5; background: var(--background); padding: 8px 0 12px; }
.pb-group { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.pb-group[hidden] { display: none; }
.pb-group legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.pb-rows { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pb-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background-color 120ms ease; }
.pb-item:last-child { border-bottom: 0; }
.pb-item:hover { background: var(--accent); }
.pb-item:has(input:checked) { background: var(--muted); }
.pb-item[hidden] { display: none; }
.pb-text { display: flex; flex-direction: column; min-width: 0; }
.pb-name { font-weight: 500; font-size: 14px; }
.pb-meta { font-size: 13px; color: var(--muted-foreground); line-height: 1.45; }
.pb-output { margin-top: 32px; }
.pb-output h2 { margin-top: 0 !important; }
.pb-prompt { font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; margin-bottom: 12px; background: var(--muted); }
.pb-bar {
  position: sticky; bottom: 16px; z-index: 6; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 16px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .08);
}
.pb-bar[hidden] { display: none; }
.pb-count { font-size: 14px; font-weight: 500; }

/* ── search dialog (command palette) ────────────────────────────────────── */
.cmdk {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 12px;
  background: var(--background); color: var(--foreground); box-shadow: 0 20px 50px rgb(0 0 0 / .2); margin-top: 12vh;
}
.cmdk::backdrop { background: rgb(0 0 0 / .4); }
.cmdk-input { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
.cmdk-input input { flex: 1; height: 48px; border: 0; outline: none; background: transparent; font: inherit; font-size: 15px; color: var(--foreground); }
.cmdk-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.cmdk-item .t { font-size: 14px; font-weight: 500; }
.cmdk-item .g { font-size: 12px; color: var(--muted-foreground); }
.cmdk-item.sel { background: var(--accent); }
.cmdk-empty { padding: 24px; text-align: center; font-size: 14px; color: var(--muted-foreground); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.doc-footer {
  margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted-foreground);
}
.doc-footer a { color: inherit; }

/* ── agent one-liner (home) ─────────────────────────────────────────────── */
.oneliner { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0 0 8px; background: var(--muted); }
.oneliner-title { font-size: 14px; font-weight: 600; margin: 0 0 10px !important; }
.oneliner-row { display: flex; align-items: center; gap: 8px; background: var(--background); border: 1px solid var(--border); border-radius: 8px; padding: 6px 6px 6px 12px; }
.oneliner-row code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.oneliner-foot { font-size: 13px; color: var(--muted-foreground); margin: 10px 0 0 !important; }
.copy-ai { margin-left: 4px; }
@media (max-width: 1100px) { .copy-ai { display: none; } }

/* ── tool picker tabs + plan ────────────────────────────────────────────── */
.tabs-bar { display: inline-flex; gap: 4px; padding: 4px; background: var(--muted); border-radius: 10px; margin: 0 0 16px; }
.tab-btn { font: inherit; font-size: 14px; font-weight: 500; height: 32px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-foreground); cursor: pointer; }
.tab-btn[aria-selected="true"] { background: var(--background); color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.pb-panel[hidden], .pb-none[hidden] { display: none; }
.pb-share-row { margin-top: 16px; }
.plan { list-style: none; padding: 0 !important; margin: 0 0 16px !important; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.plan-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); margin: 0 !important; }
.plan-item:last-child { border-bottom: 0; }
.plan-check { padding-top: 2px; cursor: pointer; }
.plan-body { flex: 1; min-width: 0; }
.plan-body p { margin: 2px 0 0 !important; }
.plan-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan-head a { font-weight: 600; font-size: 15px; }
.plan-warn { color: var(--warn-fg); }
.plan-item.is-done .plan-body { opacity: .55; }
.plan-item.is-done .plan-head a { text-decoration: line-through; }
.plan-final { font-size: 14px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── sidebar show/hide (desktop) ────────────────────────────────────────── */
.sidebar-btn { display: inline-flex; margin-left: -6px; }
:root.nav-hidden .sidebar { display: none; }
@media (max-width: 860px) {
  .sidebar-btn { display: none; }
  :root.nav-hidden .sidebar { display: block; }
}

/* ── drawer (shadcn "sheet") ────────────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100vh; max-height: 100vh;
  width: min(680px, 100vw); max-width: 100vw; padding: 0; border: 0; border-left: 1px solid var(--border);
  background: var(--background); color: var(--foreground); box-shadow: -20px 0 50px rgb(0 0 0 / .15);
  display: none; flex-direction: column;
}
.sheet[open] { display: flex; animation: sheet-in 200ms ease-out; }
.sheet::backdrop { background: rgb(0 0 0 / .45); }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
body:has(.sheet[open]) { overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 24px; border-bottom: 1px solid var(--border); }
.sheet-body { flex: 1; overflow-y: auto; padding: 24px 28px 32px; }
.sheet-body .doc-header { margin-bottom: 24px; }
.sheet-body h1 { font-size: 26px; }
.sheet-body .lead { font-size: 15px; }
.sheet-body .crumb { display: none; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--background); }
.sheet-done-wrap { margin: 0; font-weight: 500; }
.sheet-next[hidden] { display: none; }
@media (max-width: 560px) { .sheet-body { padding: 20px 16px 24px; } .sheet-foot { padding: 12px 16px; } }

figure.frame img { cursor: zoom-in; }
