/* Agent view (Designer's canvas, approved 16 Nov): the Human | Agent switch every twinned page carries, and the
   /agent/<path> page that shows a twin as text. A plain file under public/, linked by agent-view.ts, so the
   same rules reach the landing, the feature pages, the legal pages and the generated UX guides.
   The colours are the canvas's; the accent falls back to its value where a page does not define the token. */

/* ===== The switch ===== */
/* Always-dark pages (features, legal: body.v3-feature-page / body.bg-ink-950) keep the dark pill whatever the stored
   theme, so the focus ring keeps its contrast on the dark ground (Designer, 16 Nov). Theme-following pages use data-theme. */
.av-switch { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: inline-flex; gap: 2px; padding: 4px;
  border-radius: 999px; background: color-mix(in oklab, #0D0E12 88%, transparent); border: 1px solid #2A2D35;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif; }
.av-switch a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; min-width: 44px; padding: 0 16px;
  border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1; color: #C9CCD3; text-decoration: none; }
.av-switch a:hover { color: #F7F6F2; background: #1C1F26; }
.av-switch a[aria-current="page"] { background: #F7F6F2; color: #0D0E12; }
.av-switch .av-glyph { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: -.02em; opacity: .75; }
.av-switch a:focus-visible { outline: 2px solid var(--color-accent-500, oklch(0.89 0.19 122)); outline-offset: 2px; }
:root[data-theme="light"] body:not(.v3-feature-page):not(.bg-ink-950) > .av-switch { background: color-mix(in oklab, #FFFFFF 90%, transparent); border-color: #D8D2C2;
  box-shadow: 0 12px 32px -14px rgba(13,14,18,.35); }
:root[data-theme="light"] body:not(.v3-feature-page):not(.bg-ink-950) > .av-switch a { color: #3A3D46; }
:root[data-theme="light"] body:not(.v3-feature-page):not(.bg-ink-950) > .av-switch a:hover { color: #0D0E12; background: #ECE8DC; }
:root[data-theme="light"] body:not(.v3-feature-page):not(.bg-ink-950) > .av-switch a[aria-current="page"] { background: #15171C; color: #F7F6F2; }
:root[data-theme="light"] body:not(.v3-feature-page):not(.bg-ink-950) > .av-switch a:focus-visible { outline-color: #0D0E12; }
@media (max-width: 640px) { .av-switch { right: 16px; bottom: 16px; } .av-switch a { padding: 0 14px; } }

/* The footer keeps room under its last row, so the switch never sits on a link. The legal pages have their own footer element. */
body:has(> .av-switch) .v3-footer, body:has(> .av-switch) > footer { padding-bottom: 96px; }
@media (max-width: 640px) { body:has(> .av-switch) .v3-footer, body:has(> .av-switch) > footer { padding-bottom: 84px; } }

/* ===== The /agent/<path> page ===== */
body.av-body { margin: 0; }
.av { min-height: 100vh; background: var(--color-ink-950, #0D0E12); color: #C9CCD3; font-family: "Geist", ui-sans-serif, system-ui, sans-serif; }
:root[data-theme="light"] .av { background: var(--v3-paper, #F2EFE6); color: #3A3D46; }
.av-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px;
  border-bottom: 1px solid #22252C; background: color-mix(in oklab, var(--color-ink-950, #0D0E12) 92%, transparent); backdrop-filter: blur(8px); }
:root[data-theme="light"] .av-top { border-color: #E2DDCF; background: color-mix(in oklab, var(--v3-paper, #F2EFE6) 92%, transparent); }
.av-logo { height: 22px; display: block; }
.av-chip { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid #2A2D35; color: #C9CCD3; }
:root[data-theme="light"] .av-chip { border-color: #D8D2C2; color: #3A3D46; }
.av-top .av-sp { flex: 1; }
.av-act { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  color: inherit; text-decoration: none; border: 1px solid #2A2D35; }
:root[data-theme="light"] .av-act { border-color: #C9C4B5; color: #0D0E12; }
.av-act:hover { background: #1C1F26; } :root[data-theme="light"] .av-act:hover { background: #E8E4D8; }
.av-top a:focus-visible, .av-lede a:focus-visible { outline: 2px solid var(--color-accent-500, oklch(0.89 0.19 122)); outline-offset: 2px; }
:root[data-theme="light"] .av-top a:focus-visible, :root[data-theme="light"] .av-lede a:focus-visible { outline-color: #0D0E12; }
.av-wrap { max-width: 820px; margin: 0 auto; padding: 32px 24px 120px; }
.av-lede { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; color: #9A9EA8; }
:root[data-theme="light"] .av-lede { color: #5F626A; }
.av-lede a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.av-doc { margin: 0; padding: 28px; border-radius: 16px; background: #111318; border: 1px solid #22252C;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
:root[data-theme="light"] .av-doc { background: #FAF8F2; border-color: #E2DDCF; }
.md-fm { color: #7D828C; } :root[data-theme="light"] .md-fm { color: #6E7179; }
.md-h { color: #F7F6F2; font-weight: 600; } :root[data-theme="light"] .md-h { color: #0D0E12; }
.md-hm { color: var(--color-accent-500, oklch(0.89 0.19 122)); } :root[data-theme="light"] .md-hm { color: #4F6B00; }
.md-q { color: #F7F6F2; background: color-mix(in oklab, var(--color-accent-500, oklch(0.89 0.19 122)) 14%, transparent); border-radius: 4px; }
:root[data-theme="light"] .md-q { color: #0D0E12; background: #EEF5CF; }
.md-u { color: #7D828C; } :root[data-theme="light"] .md-u { color: #6E7179; }
.md-b { color: #E6E4DE; font-weight: 600; } :root[data-theme="light"] .md-b { color: #0D0E12; }
@media (max-width: 640px) {
  .av-top { padding: 0 16px; gap: 8px; }
  .av-wrap { padding: 20px 16px 104px; } .av-doc { padding: 18px 16px; font-size: 13px; line-height: 1.7; }
}
