/* Fennick docs. The app's own look: its colour tokens (apps/web/src/style.css :root), Geist, the Tana/Embernote
   pastels for tags (apps/web/src/tones.js). Light by default; the header's switch turns dark on (data-theme="dark").
   Layout, after the docs study (10/12): header with search; nav · article · "On this page". */
:root {
  /* the app's own greys, copied exactly from apps/web/src/style.css (her option-6 pick; never warm grey with orange) */
  --bg: #ffffff; --paper: #ffffff; --fg: #37352f; --muted: #6c6b68; --faint: #9b9a97;
  --line: #e9e9e7; --soft: #efefed; --hover: rgba(55, 53, 47, .08); --side: #ffffff;
  --accent: #2383e2; --accent-solid: #0e76d4; --accent-soft: #e0eefb; --link: var(--accent);   /* Fennick's blue, as in the app (her 10/14 pick); the peach stays in the logo only */
  --shadow: 0 10px 28px rgba(15, 15, 15, .14); --scrim: rgba(0, 0, 0, .3);   /* the app's shadow ink and scrim */
  --ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --top: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #191919; --paper: #191919; --fg: #d4d4d4; --muted: #9b9b9b; --faint: #5a5a5a;
  --line: #2f2f2f; --soft: #2c2c2c; --hover: rgba(255, 255, 255, .07); --side: #1e1e1e;
  --accent: #2383e2; --accent-solid: #2383e2; --accent-soft: #1c3751; --link: var(--accent);
  --shadow: 0 10px 28px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* header */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; font-size: 16px; color: var(--fg); white-space: nowrap; margin-right: 18px; }
.brand span { font-weight: 400; color: var(--muted); }
.brand:hover { text-decoration: none; }
.searchbtn { display: flex; align-items: center; gap: 8px; width: min(320px, 40vw); height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 14px; background: var(--bg); }
.searchbtn:hover { border-color: var(--faint); }
.searchbtn span { flex: 1; text-align: left; }
.searchbtn kbd { font-size: 11.5px; padding: 2px 5px; }
.topgap { flex: 1; }
.themebtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.themebtn:hover { background: var(--hover); color: var(--fg); }
.themebtn .sun { display: none; }
:root[data-theme="dark"] .themebtn .sun { display: block; }
:root[data-theme="dark"] .themebtn .moon { display: none; }
.openapp { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; }
.openapp .ico { width: 14px; height: 14px; }
.openapp:hover { text-decoration: none; opacity: .9; }
.navtoggle { display: none; }

/* three columns */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 240px; }
.side { background: var(--side); position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 18px 12px 40px 16px; font-size: 14px; border-right: 1px solid var(--line); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav .grp { padding: 16px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.nav .grp:first-child { padding-top: 2px; }
.nav a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--fg); font-weight: 500; }
main { min-width: 0; }
.page { max-width: 740px; margin: 0 auto; padding: 36px 40px 96px; }
.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 36px 16px 40px 8px; font-size: 13px; }
.tochead { font-weight: 600; color: var(--fg); margin-bottom: 8px; }
/* the section she is on: a soft fill, as in the side list (her 10/18 rule: never a stripe down one side) */
.toc nav { display: flex; flex-direction: column; gap: 1px; }
.toc a { color: var(--muted); padding: 3px 8px; border-radius: 6px; line-height: 1.4; }
.toc a:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.toc a.on { background: var(--accent-soft); color: var(--fg); }

/* type */
.titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h1 { font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; margin: 0 0 10px; }
.copypage { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-top: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); }
.copypage:hover { color: var(--fg); border-color: var(--faint); }
.copypage .ico { width: 14px; height: 14px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; margin: 44px 0 8px; }
h3 { font-size: 17px; font-weight: 600; margin: 28px 0 6px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0 0; }
/* list marks: a plain 4 px dot, no ring (her 10/15: "no glowing circle around a plain bullet. At all.") */
.page ul:not([class]) { list-style: none; }
.page ul:not([class]) > li { position: relative; }
.page ul:not([class]) > li::before { content: ""; position: absolute; left: -13px; top: .66em; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
strong { font-weight: 600; }
code { font-family: var(--mono); font-size: .88em; background: var(--soft); border-radius: 4px; padding: 1px 5px; }
kbd { font-family: var(--ui); font-size: 13px; line-height: 1; display: inline-block; min-width: 22px; text-align: center; padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--bg); color: var(--fg); white-space: nowrap; }
.note { background: var(--soft); border-radius: 8px; padding: 12px 14px; margin: 18px 0; font-size: 15px; }
.coming { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; vertical-align: 2px; margin-left: 4px; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 36px; margin: 12px 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--fg); font-size: 12.5px; font-weight: 600; display: grid; place-items: center; }

/* tables */
.tablewrap { overflow-x: auto; margin: 10px 0 20px; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--soft); }
tr:last-child td { border-bottom: 0; }
td:first-child { width: 42%; }
table.keys td:not(:first-child) { white-space: nowrap; }

/* screenshots: taken at 2x, drawn at their own size, never wider than the column */
figure { margin: 18px 0 26px; }
figure.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 3px rgba(15, 15, 15, .05); }
figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 14px; margin: 18px 0 24px; }
.pair figure { margin: 0; }

/* the home page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.cards a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--fg); }
.cards a:hover { background: var(--hover); text-decoration: none; }
.cards b { display: block; font-weight: 600; margin-bottom: 2px; }
.cards span { font-size: 14px; color: var(--muted); }
.agentbox { border: 1px solid var(--line); border-radius: 10px; margin: 18px 0 8px; overflow: hidden; }
.agentbox .abar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 14px; font-weight: 600; }
.agentbox .copyprompt { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 500; color: var(--fg); }
.agentbox .copyprompt .ico { width: 14px; height: 14px; }
.agentbox .prompt { margin: 0; padding: 12px 14px; font: 13.5px/1.6 var(--mono); white-space: pre-wrap; color: var(--fg); }
.agentbox .ahint { margin: 0; padding: 0 14px 12px; font-size: 13.5px; color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; }
.pager a { display: block; flex: 1; max-width: 50%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--fg); font-weight: 500; }
.pager a:hover { border-color: var(--faint); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.pager .next { text-align: right; margin-left: auto; }

/* search */
.sdlg { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.sbox { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.sbox input { border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); font: 16px var(--ui); padding: 14px 16px; outline: none; }
.sres { overflow-y: auto; padding: 6px; }
.sr { display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); }
.sr:hover, .sr.on { background: var(--hover); text-decoration: none; }
.sr b { font-weight: 600; font-size: 14.5px; }
.sr small { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.sr span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.sr mark { background: var(--accent-soft); color: var(--fg); border-radius: 3px; padding: 0 1px; }
.snone { padding: 12px 10px; margin: 0; color: var(--muted); font-size: 14px; }
body.searching { overflow: hidden; }

/* narrower: no "On this page" column */
@media (max-width: 1180px) { .layout { grid-template-columns: 240px minmax(0, 1fr); } .toc { display: none; } }
/* phones: the nav folds into a menu in the header */
@media (max-width: 800px) {
  .top { padding: 0 12px; gap: 6px; }
  .layout { display: block; }
  .side { display: none; }
  .navtoggle { display: block; position: static; }
  .navtoggle summary { list-style: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--fg); }
  .navtoggle summary::-webkit-details-marker { display: none; }
  .navtoggle .nav { position: absolute; left: 0; right: 0; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: var(--shadow); }
  .brand { margin-right: 4px; }
  .brand span { display: none; }
  .searchbtn { width: auto; flex: 1; min-width: 0; }
  .searchbtn kbd { display: none; }
  .topgap { display: none; }
  .openapp { padding: 0 10px; }
  .openapp .ico { display: none; }
  .page { padding: 24px 16px 72px; }
  h1 { font-size: 28px; }
  .titlerow { flex-direction: column; gap: 0; }
  .copypage { margin: 0 0 12px; }
  td:first-child { width: auto; }
}
@media (max-width: 420px) { .pair { grid-template-columns: minmax(0, 1fr); } .openapp { font-size: 13px; } }
.gone { color: var(--faint); }
/* the head mark (10/22, #650): black on light, white on dark */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand .mark { display: block; width: auto; height: 22px; }   /* the head mark (Sarah 10/22), black; white in dark */
.brand .mark-d { display: none; }
:root[data-theme="dark"] .brand .mark-l { display: none; }
:root[data-theme="dark"] .brand .mark-d { display: block; }
/* small phones: search becomes an icon, so the header never crowds */
@media (max-width: 480px) {
  .searchbtn { flex: none; width: 34px; padding: 0; justify-content: center; border-color: transparent; }
  .searchbtn span { display: none; }
  .topgap { display: block; flex: 1; }
}
/* each screenshot has a dark twin, shown when the docs are dark */
figure.shot img.sd { display: none; }
:root[data-theme="dark"] figure.shot img.sl { display: none; }
:root[data-theme="dark"] figure.shot img.sd { display: block; }
