/* The aitodo docs site (#186), from the owner-approved mock of #185
   (docs/features/ai-ticketing/docs-site-mock/docs.css). The tokens are the landing's
   (selfdoc/landing.css), unchanged; this file adds only the docs layout. System font stacks, no
   web font. Light and dark follow prefers-color-scheme; the toggle sets data-theme on <html>.
   Served once per version as /docs/docs.css?v=<version>. */

.aitodo {
  --fg1: #110B42;
  --fg2: #4A4670;
  --fg3: #6B6788;
  --muted: #807CA0;
  --bg1: #FFFFFF;
  --bg2: #F8F8FC;
  --bg3: #F2F1F6;
  --border: #E8E7EE;
  --border-strong: #C8C6D8;
  --accent: #6C50F3;
  --accent-hover: #5B3FDF;
  --accent-soft: #E8E4FD;
  --accent-ink: #5B3FDF;
  --on-accent: #FFFFFF;
  --ok-ink: #0A6B4A;
  --ok-soft: #DDF8EC;
  --warn-ink: #8A5A00;
  --warn-soft: #FFF3D1;
  --stop-ink: #A32A25;
  --stop-soft: #FBE3E1;
  --term-bg: #110B42;
  --term-border: #110B42;
  --term-fg: #F2F1F6;
  --term-dim: rgba(255, 255, 255, 0.64);
  --term-flag: #C9BEFF;
  --term-bar: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(17, 11, 66, 0.06);
  --shadow-md: 0 6px 20px rgba(17, 11, 66, 0.08);
  --shadow-lg: 0 24px 64px rgba(17, 11, 66, 0.22);
  --focus: 0 0 0 4px rgba(108, 80, 243, 0.35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 60px;
  --sidebar-w: 272px;
  --toc-w: 232px;
  --scrim: rgba(17, 11, 66, 0.4);
  color-scheme: light;
}
/* Dark tokens: twice, once for the system setting and once for the toggle. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .aitodo {
    --fg1: #FFFFFF; --fg2: rgba(255, 255, 255, 0.80); --fg3: rgba(255, 255, 255, 0.66);
    --muted: rgba(255, 255, 255, 0.45); --bg1: #110B42; --bg2: #0C0833; --bg3: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.12); --border-strong: rgba(255, 255, 255, 0.24);
    --accent-hover: #7D63FF; --accent-soft: rgba(108, 80, 243, 0.24); --accent-ink: #B3A6FF;
    --ok-ink: #6BF0C0; --ok-soft: rgba(29, 217, 149, 0.16); --warn-ink: #FFCB57; --warn-soft: rgba(232, 164, 0, 0.18);
    --stop-ink: #FF9E97; --stop-soft: rgba(192, 52, 47, 0.24); --term-bg: #08052A; --term-border: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35); --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
    --focus: 0 0 0 4px rgba(255, 237, 0, 0.5); --scrim: rgba(3, 1, 20, 0.6);
    color-scheme: dark;
  }
}
html[data-theme="dark"] .aitodo {
  --fg1: #FFFFFF; --fg2: rgba(255, 255, 255, 0.80); --fg3: rgba(255, 255, 255, 0.66);
  --muted: rgba(255, 255, 255, 0.45); --bg1: #110B42; --bg2: #0C0833; --bg3: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12); --border-strong: rgba(255, 255, 255, 0.24);
  --accent-hover: #7D63FF; --accent-soft: rgba(108, 80, 243, 0.24); --accent-ink: #B3A6FF;
  --ok-ink: #6BF0C0; --ok-soft: rgba(29, 217, 149, 0.16); --warn-ink: #FFCB57; --warn-soft: rgba(232, 164, 0, 0.18);
  --stop-ink: #FF9E97; --stop-soft: rgba(192, 52, 47, 0.24); --term-bg: #08052A; --term-border: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35); --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --focus: 0 0 0 4px rgba(255, 237, 0, 0.5); --scrim: rgba(3, 1, 20, 0.6);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
html { background: var(--bg1, #fff); }
body.aitodo {
  margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.65; color: var(--fg1);
  background: var(--bg1); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.aitodo *, .aitodo *::before, .aitodo *::after { box-sizing: border-box; }
.aitodo a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.aitodo a:hover { color: var(--fg1); }
.aitodo :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--focus); border-radius: 6px; }
:where(.aitodo) :where(h1, h2, h3, p, ul, ol, dl, dd, figure) { margin: 0; }
.aitodo [id] { scroll-margin-top: calc(var(--header-h) + 24px); }
.aitodo code, .aitodo kbd { font-family: var(--mono); font-size: 0.86em; }
.aitodo :not(pre) > code {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px;
  color: var(--fg1); overflow-wrap: anywhere;
}
.aitodo .nw { white-space: nowrap; }
.aitodo svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #fff !important; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
button { font: inherit; color: inherit; }

/* ------------------------------------------------------------------ header */
.dh {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg1) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.dh-in { height: 100%; display: flex; align-items: center; gap: 16px; padding: 0 20px 0 20px; max-width: 1600px; margin: 0 auto; }
.icon-btn.dh-menu { display: none; }
.at-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg1) !important; flex: none; }
.at-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.at-logo svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.at-wordmark { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.dh-docs { font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; letter-spacing: 0.01em; }
.dh-search {
  flex: 1 1 auto; max-width: 420px; margin-left: 28px; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 8px 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg2); color: var(--muted); cursor: pointer; text-align: left; font-size: 14px;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.dh-search:hover { border-color: var(--accent); background: var(--bg1); color: var(--fg3); }
.dh-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { display: inline-flex; align-items: center; gap: 2px; font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--fg3); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; height: 22px; background: var(--bg1); }
.dh-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dh-links { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.dh-links a { font-size: 14px; font-weight: 500; color: var(--fg2); text-decoration: none; padding: 7px 10px; border-radius: 8px; }
.dh-links a:hover { background: var(--bg3); color: var(--fg1); }
.at-lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid var(--border-strong); }
.at-lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 28px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--fg2); text-decoration: none; }
.at-lang a:hover { background: var(--bg3); color: var(--fg1); }
.at-lang a[aria-current="true"] { background: var(--fg1); color: var(--bg1); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--fg2); cursor: pointer; }
.icon-btn:hover { background: var(--bg3); color: var(--fg1); }
.at-badge { font-family: var(--mono); font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 999px; background: var(--bg3); color: var(--fg2); border: 1px solid var(--border); }
.theme-ic-dark, .theme-ic-auto { display: none; }
html[data-theme="dark"] .theme-ic-light { display: none; }
html[data-theme="dark"] .theme-ic-dark { display: block; }
html:not([data-theme]) .theme-ic-light { display: none; }
html:not([data-theme]) .theme-ic-auto { display: block; }

/* ------------------------------------------------------------------ layout */
.dl {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1600px; margin: 0 auto; min-height: calc(100vh - var(--header-h));
}
.dl.no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* ------------------------------------------------------------------ sidebar */
.ds {
  position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--border);
  padding: 22px 14px 48px 18px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.sb { font-size: 14px; }
.sb ul { list-style: none; padding: 0; margin: 0; }
.sb-top { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 10px; border-radius: 8px; color: var(--fg1) !important; font-weight: 600; text-decoration: none; }
.sb-top:hover { background: var(--bg3); }
.sb-top[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink) !important; }
.sb-g { margin: 2px 0 6px; }
.sb-g > summary, .sb-sg > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; user-select: none; }
.sb-g > summary::-webkit-details-marker, .sb-sg > summary::-webkit-details-marker { display: none; }
.sb-g > summary { padding: 8px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg3); }
.sb-g > summary:hover { color: var(--fg1); }
.sb-sg > summary { padding: 6px 10px; font-weight: 600; color: var(--fg1); }
.sb-sg > summary:hover { background: var(--bg3); }
.chev { width: 14px !important; height: 14px !important; color: var(--muted); transition: transform 200ms var(--ease); }
details[open] > summary .chev { transform: rotate(90deg); }
.sb-sg { margin: 1px 0; }
.sb-sg > ul { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid var(--border); }
.sb-g > ul { margin-bottom: 4px; }
.sb a.sb-l {
  display: block; padding: 5px 10px; border-radius: 7px; color: var(--fg2); text-decoration: none;
  line-height: 1.45; position: relative;
}
.sb a.sb-l:hover { background: var(--bg3); color: var(--fg1); }
.sb a.sb-l[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sb-sg > ul a.sb-l[aria-current="page"]::before { content: ""; position: absolute; left: -9px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }
.sb .tag { font-family: var(--mono); font-size: 12.5px; }
.sb-new { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--ok-ink); background: var(--ok-soft); padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.sb-foot { margin-top: 22px; padding: 14px 10px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--fg3); display: flex; flex-direction: column; gap: 6px; }
.sb-foot a { color: var(--fg2); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.sb-foot a:hover { color: var(--accent-ink); }
.sb-foot code { font-size: 12px; }

/* ------------------------------------------------------------------ main */
.dm { min-width: 0; padding: 36px 56px 96px; }
.dm > article { max-width: 760px; margin: 0 auto; }
.dm.wide > article { max-width: 980px; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--fg3); margin-bottom: 14px; }
.crumb a { color: var(--fg3); text-decoration: none; }
.crumb a:hover { color: var(--accent-ink); }
.crumb svg.ic { width: 13px; height: 13px; color: var(--muted); }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dm h1 { font-size: 36px; line-height: 1.15; font-weight: 750; letter-spacing: -0.022em; }
.page-actions { display: flex; gap: 6px; flex: none; padding-top: 6px; }
.btn-s {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg1); color: var(--fg2) !important; font-size: 13px; font-weight: 550;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: border-color 140ms, color 140ms, background 140ms;
}
.btn-s:hover { border-color: var(--accent); color: var(--accent-ink) !important; }
.btn-s svg.ic { width: 15px; height: 15px; }
.lead { margin-top: 14px; font-size: 19px; line-height: 1.55; color: var(--fg2); max-width: 68ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg3); color: var(--fg2); border: 1px solid var(--border); }
.pill svg.ic { width: 13px; height: 13px; }
.pill.kind { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

.prose { margin-top: 30px; color: var(--fg2); font-size: 16.5px; }
.prose > * + * { margin-top: 16px; }
.prose h2 {
  margin-top: 48px; padding-top: 4px; font-size: 23px; line-height: 1.3; font-weight: 700; letter-spacing: -0.012em; color: var(--fg1);
  display: flex; align-items: center; gap: 8px;
}
.prose h2 + * { margin-top: 12px; }
.prose h3 { margin-top: 32px; font-size: 18px; font-weight: 650; color: var(--fg1); }
.prose strong { color: var(--fg1); font-weight: 650; }
.prose ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before { content: ""; position: absolute; left: 6px; top: 0.72em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); opacity: 0.7; }
.hlink { opacity: 0; color: var(--muted) !important; text-decoration: none; font-weight: 500; transition: opacity 120ms; }
h2:hover .hlink, .hlink:focus { opacity: 1; }

/* step kinds, a definition list rendered from the bullets */
.kinds { display: grid; grid-template-columns: max-content 1fr; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.kinds > div { display: contents; }
.kinds dt, .kinds dd { margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); }
.kinds > div:first-child dt, .kinds > div:first-child dd { border-top: 0; }
.kinds dt { background: var(--bg2); font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--fg1); display: flex; align-items: flex-start; }
.kinds dt code { background: none !important; border: 0 !important; padding: 0 !important; }
.kinds dd { font-size: 15.5px; }

/* terminal blocks (the landing's .at-term) */
.term { background: var(--term-bg); border: 1px solid var(--term-border); border-radius: 12px; color: var(--term-fg); overflow: hidden; }
.term-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 14px; background: var(--term-bar); font-size: 12px; color: var(--term-dim); font-family: var(--mono); min-height: 38px; }
.term-bar .dots { display: inline-flex; gap: 6px; margin-right: 10px; }
.term-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.term pre { margin: 0; padding: 14px 18px 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.term .p { color: var(--term-dim); user-select: none; }
.term .f { color: var(--term-flag); }
.term .o { color: var(--term-dim); }
.term .ok { color: #6BF0C0; }
.term .w { color: #FFCB57; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 7px; border: 0;
  background: transparent; color: var(--term-dim); font: 600 12px var(--sans); cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.copy svg.ic { width: 14px; height: 14px; }
.copy.done { color: #6BF0C0; }

/* callouts */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: 15px; }
.callout svg.ic { margin-top: 2px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn-ink) 22%, transparent); color: var(--fg1); }
.callout.warn svg.ic { color: var(--warn-ink); }
.callout.info { background: var(--accent-soft); border-color: transparent; color: var(--fg1); }
.callout.info svg.ic { color: var(--accent-ink); }
.callout b { color: var(--fg1); }
.callout .src { font-family: var(--mono); font-size: 12px; color: var(--fg3); white-space: nowrap; }

/* `more` as details */
details.more { border: 1px solid var(--border); border-radius: 12px; background: var(--bg1); overflow: hidden; }
details.more > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  font-weight: 650; color: var(--fg1); background: var(--bg2);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { background: var(--bg3); }
details.more > summary .count { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--fg3); }
details.more[open] > summary { border-bottom: 1px solid var(--border); }
details.more > .more-body { padding: 16px 18px 18px; font-size: 15.5px; }
details.more > .more-body ul { gap: 12px; }

/* commands on this page */
.cmd-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cmd-list a { display: grid; grid-template-columns: minmax(170px, max-content) 1fr auto; gap: 16px; align-items: baseline; padding: 11px 16px; border-top: 1px solid var(--border); text-decoration: none; color: var(--fg2) !important; font-size: 14.5px; }
.cmd-list a:first-child { border-top: 0; }
.cmd-list a:hover { background: var(--bg2); }
.cmd-list a code { background: none !important; border: 0 !important; padding: 0 !important; font-weight: 600; color: var(--fg1); white-space: nowrap; }
.cmd-list .arr { color: var(--muted); }
.cmd-list a:hover .arr { color: var(--accent-ink); }

/* related cards */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rel {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border);
  text-decoration: none; color: var(--fg2) !important; background: var(--bg1); transition: border-color 140ms, box-shadow 140ms, transform 140ms var(--ease);
}
.rel:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.rel .k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg3); }
.rel .t { font-weight: 650; color: var(--fg1); font-size: 15px; }
.rel .t code { font-size: 12.5px; }
.rel .d { font-size: 13.5px; line-height: 1.5; }

/* prev / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pn a {
  display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border);
  text-decoration: none; color: var(--fg3) !important; font-size: 13px; transition: border-color 140ms, box-shadow 140ms;
}
.pn a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.pn a b { color: var(--fg1); font-size: 16px; font-weight: 650; }
.pn a.next { text-align: right; grid-column: 2; }
.pn .lbl { display: inline-flex; align-items: center; gap: 4px; }
.pn a.next .lbl { justify-content: flex-end; }
.pn svg.ic { width: 14px; height: 14px; }

.page-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--fg3); }
.page-foot code { font-size: 12px; }

/* ------------------------------------------------------------------ right TOC */
.dt { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 38px 20px 40px 8px; }
.dt h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg3); margin-bottom: 10px; }
.toc { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); font-size: 13.5px; }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--fg3); text-decoration: none; line-height: 1.45; }
.toc a:hover { color: var(--fg1); }
.toc a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.toc .sub a { padding-left: 26px; font-size: 13px; }
.dt-extra { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.dt-extra a { color: var(--fg3); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.dt-extra a:hover { color: var(--accent-ink); }
.dt-extra svg.ic { width: 15px; height: 15px; }
.toc-m { display: none; }

/* ------------------------------------------------------------------ reference: command blocks */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--fg3); margin-top: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.cls { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: 0.02em; }
.cls.read { background: var(--ok-soft); color: var(--ok-ink); }
.cls.write { background: var(--accent-soft); color: var(--accent-ink); }
.cls.admin { background: var(--warn-soft); color: var(--warn-ink); }
.cls.local { background: var(--bg3); color: var(--fg2); }
.cmds { margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.cmd { border: 1px solid var(--border); border-radius: 14px; background: var(--bg1); transition: border-color 160ms, box-shadow 160ms; }
.cmd:target, .cmd.flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cmd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 18px 0; }
.cmd-sig { font-family: var(--mono); font-size: 15px; font-weight: 650; color: var(--fg1); text-decoration: none !important; }
.cmd-sig .a { color: var(--fg3); font-weight: 500; }
.cmd-sig:hover { color: var(--accent-ink); }
.cmd-head .sp { flex: 1; }
.cmd-rest { font-family: var(--mono); font-size: 11.5px; color: var(--fg3); background: var(--bg3); border-radius: 6px; padding: 2px 8px; }
.cmd-body { padding: 8px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.cmd-sum { color: var(--fg2); font-size: 15px; }
.cmd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { font-family: var(--mono); font-size: 12px; color: var(--fg2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; background: var(--bg2); }
.home { font-size: 13.5px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.home svg.ic { width: 14px; height: 14px; }
.subhead { margin-top: 44px; display: flex; align-items: baseline; gap: 10px; }
.subhead h2 { margin: 0; font-size: 20px; }
.subhead span { font-size: 13px; color: var(--fg3); }

/* ------------------------------------------------------------------ overview */
.hero { position: relative; padding: 8px 0 8px; }
.hero h1 { font-size: 44px; letter-spacing: -0.03em; line-height: 1.08; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), #9C7BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.claim { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.claim-text { padding: 22px 24px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; color: var(--fg2); font-size: 15.5px; }
.claim-text strong { color: var(--fg1); }
.claim .term pre { font-size: 12.8px; line-height: 1.75; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.cards { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg1); text-decoration: none; color: var(--fg2) !important; transition: border-color 160ms, box-shadow 160ms, transform 160ms var(--ease);
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .ci { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.card .ci svg.ic { width: 19px; height: 19px; }
.card h3 { font-size: 16.5px; font-weight: 700; color: var(--fg1); }
.card p { font-size: 14px; line-height: 1.55; }
.card ul { list-style: none; padding: 0; margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--fg3); padding-top: 6px; }
.card ul li + li::before { content: "·"; margin-right: 10px; color: var(--muted); }
.agent-box {
  margin-top: 40px; border-radius: 18px; padding: 26px 26px 24px; color: var(--term-fg);
  background: radial-gradient(120% 140% at 100% 0%, rgba(108, 80, 243, 0.55) 0%, rgba(108, 80, 243, 0) 55%), var(--term-bg);
  border: 1px solid var(--term-border); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px;
}
.agent-box h2 { font-size: 22px; color: #fff; letter-spacing: -0.01em; }
.agent-box p { color: rgba(255, 255, 255, 0.78); font-size: 15px; margin-top: 8px; }
.agent-box .eyebrow { color: #C9BEFF; }
.agent-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.agent-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); color: #fff !important; text-decoration: none; font-size: 14px; }
.agent-links a:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(201, 190, 255, 0.6); }
.agent-links code { background: none !important; border: 0 !important; color: #C9BEFF !important; padding: 0 !important; font-size: 13px; }
.agent-links span { color: rgba(255, 255, 255, 0.62); font-size: 12.5px; }
.agent-box .term { margin-top: 14px; background: rgba(0, 0, 0, 0.28); border-color: rgba(255, 255, 255, 0.12); }
.section-title { margin-top: 48px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.section-title a { font-size: 14px; font-weight: 600; text-decoration: none; }
.start-row { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.start-row a { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: var(--fg2) !important; font-size: 14px; transition: border-color 140ms, background 140ms; }
.start-row a:hover { border-color: var(--accent); background: var(--bg2); }
.start-row b { display: block; color: var(--fg1); font-size: 15px; margin-bottom: 2px; }
.start-row .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--fg1); color: var(--bg1); }

/* ------------------------------------------------------------------ search dialog */
.sd { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: var(--scrim); backdrop-filter: blur(3px); }
.sd.open { display: flex; animation: fade 140ms var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.sd-panel { width: 100%; max-width: 640px; max-height: 72vh; display: flex; flex-direction: column; border-radius: 16px; background: var(--bg1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise 180ms var(--ease); }
.sd-top { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.sd-top svg.ic { color: var(--accent-ink); }
.sd-top input { flex: 1; height: 56px; border: 0; outline: none; background: transparent; color: var(--fg1); font: 500 17px var(--sans); }
.sd-top input::placeholder { color: var(--muted); }
.aitodo .sd-top input:focus-visible { outline: none; box-shadow: none; }
.sd-res { overflow-y: auto; padding: 6px 8px 10px; }
.sd-grp { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg3); }
.sd-hit { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--fg2) !important; cursor: pointer; }
.sd-hit .hi { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg3); color: var(--fg3); }
.sd-hit .hi svg.ic { width: 15px; height: 15px; }
.sd-hit .ht { font-weight: 650; color: var(--fg1); font-size: 14.5px; }
.sd-hit .ht.code { font-family: var(--mono); font-size: 13.5px; }
.sd-hit .hb { font-size: 12.5px; color: var(--fg3); }
.sd-hit .hs { font-size: 13px; color: var(--fg2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.sd-hit mark { background: none; color: var(--accent-ink); font-weight: 700; }
.sd-hit[aria-selected="true"] { background: var(--accent-soft); }
.sd-hit[aria-selected="true"] .hi { background: var(--accent); color: #fff; }
.sd-empty { padding: 28px 16px; text-align: center; color: var(--fg3); font-size: 14px; }
.sd-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--fg3); background: var(--bg2); }
.sd-foot span { display: inline-flex; align-items: center; gap: 5px; }
.sd-foot .note { margin-left: auto; }

/* ------------------------------------------------------------------ site additions (#186) */
.ds-head .at-wordmark { font-size: 16px; }
.claim-text ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.claim-text ul > li { position: relative; padding-left: 18px; }
.claim-text ul > li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); opacity: 0.7; }
html:not(.js) .dh-search, html:not(.js) [data-search] { visibility: hidden; }
.dm h1 .h1-code { font-family: var(--mono); font-size: 0.86em; background: none; border: 0; padding: 0; }
.prose ol { padding-left: 0; list-style: none; counter-reset: li; display: flex; flex-direction: column; gap: 10px; }
.prose ol > li { position: relative; padding-left: 30px; counter-increment: li; }
.prose ol > li::before { content: counter(li); position: absolute; left: 0; top: 0.1em; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bg3); color: var(--fg2); }
.prose ol.steps { gap: 22px; }
.prose ol.steps > li { padding-left: 40px; display: flex; flex-direction: column; gap: 12px; }
.prose ol.steps > li::before { width: 28px; height: 28px; font-size: 13px; background: var(--fg1); color: var(--bg1); top: -2px; }
.term .fname { color: var(--term-fg); }
.callout > div { min-width: 0; }
.callout p + p, .callout p + pre, .callout pre + p { margin-top: 10px; }
.callout pre { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--term-bg); color: var(--term-fg); font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.callout pre code { background: none !important; border: 0 !important; color: inherit !important; padding: 0 !important; }
.more-body > * + * { margin-top: 14px; }
.tbl { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.ref { border-collapse: collapse; width: 100%; font-size: 14px; }
table.ref th, table.ref td { text-align: left; vertical-align: top; padding: 9px 12px; border-top: 1px solid var(--border); }
table.ref thead th { border-top: 0; background: var(--bg2); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg3); white-space: nowrap; }
table.ref td code { white-space: nowrap; }
table.ref tr:target td, table.ref tr.flash td { background: var(--accent-soft); }
table.ref td a { white-space: nowrap; }
.cmd-index { font-size: 15px; }
.cmd-index a code { font-weight: 600; }
.subhead span.n { font-size: 13px; color: var(--fg3); }
.section-title h2 { scroll-margin-top: calc(var(--header-h) + 24px); }
noscript p { margin-top: 24px; font-size: 14px; color: var(--fg3); }
.dm > article > h1 + .lead { margin-bottom: 18px; }

/* ------------------------------------------------------------------ responsive */
.scrim { display: none; }
@media (max-width: 1200px) {
  .dl { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .dt { display: none; }
  .toc-m { display: block; margin-top: 22px; border: 1px solid var(--border); border-radius: 12px; }
  .toc-m > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-size: 13.5px; font-weight: 650; color: var(--fg1); display: flex; align-items: center; justify-content: space-between; }
  .toc-m > summary::-webkit-details-marker { display: none; }
  .toc-m .toc { margin: 0 14px 12px; }
}
@media (max-width: 900px) {
  .dl, .dl.no-toc { grid-template-columns: minmax(0, 1fr); }
  .icon-btn.dh-menu { display: inline-grid; margin-left: -6px; }
  .dh-in { gap: 8px; padding: 0 12px; }
  .dh-links, .at-badge, .dh-docs { display: none; }
  .dh-search { flex: 0 0 auto; width: 36px; height: 36px; margin-left: auto; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .dh-search span, .dh-search .kbd { display: none; }
  .dh-right { margin-left: 0; }
  .ds {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; height: 100vh; width: min(320px, 86vw);
    background: var(--bg1); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateX(-104%); transition: transform 240ms var(--ease); padding-top: 18px;
  }
  .ds.open { transform: none; }
  .ds-head { display: flex !important; }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
  .dm { padding: 24px 16px 72px; }
  .dm h1 { font-size: 29px; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 17px; }
  .title-row { flex-direction: column; gap: 10px; }
  .page-actions { padding-top: 0; }
  .claim, .agent-box { grid-template-columns: minmax(0, 1fr); }
  .start-row { grid-template-columns: minmax(0, 1fr); }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn a.next { grid-column: 1; }
  .kinds { grid-template-columns: minmax(0, 1fr); }
  .kinds dt { border-top: 1px solid var(--border); padding-bottom: 4px; }
  .kinds dd { border-top: 0; padding-top: 4px; }
  .cmd-list a { grid-template-columns: minmax(0, 1fr) auto; }
  .cmd-list a span:not(.arr) { grid-column: 1; }
  .cmd-list a .arr { grid-row: 1; grid-column: 2; }
  .prose ol.steps > li { padding-left: 0; padding-top: 38px; }
  .sd { padding: 0; align-items: stretch; }
  .sd-panel { max-width: none; max-height: none; border-radius: 0; }
}
.ds-head { display: none; align-items: center; justify-content: space-between; margin: 0 0 14px 4px; }
@media (prefers-reduced-motion: reduce) {
  .aitodo *, .aitodo *::before, .aitodo *::after { transition: none !important; animation: none !important; }
}
.agent-box .page-actions { margin-top: 14px; }
.agent-box .btn-s { background: #fff; border-color: #fff; color: #1E1450 !important; }
.agent-box .btn-s:hover { background: #EDE9FF; border-color: #EDE9FF; color: #1E1450 !important; }

/* "Coming soon" pill in the header (#184): the one loud element of the header, on purpose */
.at-soon { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--accent); color: #fff !important; text-decoration: none !important; font-size: 13px; font-weight: 600; line-height: 1.1; white-space: nowrap; box-shadow: 0 0 0 3px var(--accent-soft); }
.at-soon:hover { filter: brightness(1.08); }
.at-soon:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.at-soon-tag { text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; background: rgba(255, 255, 255, 0.22); padding: 3px 7px; border-radius: 999px; }
.at-soon-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: at-soon-pulse 1.8s ease-in-out infinite; }
@keyframes at-soon-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .at-soon-dot { animation: none; } }
@media (max-width: 560px) { .at-soon-txt, .at-soon-arrow { display: none; } }
@media (max-width: 480px) { .dh .at-wordmark { display: none; } .dh .at-soon { padding: 5px 9px; gap: 6px; } }
