/* Peyton Calm (P6-D2): design tokens + shared components for every ai.peyton page.
   Colours come from design/icons/icon-sheet.html and design/ICON_SPEC.md (signed off
   2026-10-24). Pages load this file first, then their own stylesheet, and use only these
   tokens: no raw colours outside this file (tests/test_ui_tokens.py checks it).
   Fonts are vendored in ui/fonts/ (the CSP allows no other host): @fontsource 5.2.8 latin
   woff2, SIL OFL 1.1 (licences next to them). System fonts are the fallback. */

/* ------------------------------------------------------------------- fonts -- */
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap;
  src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap;
  src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------------ tokens -- */
:root {
  /* Surfaces and text */
  --bg: #F6F5F9; --surface: #FFFFFF; --ink: #1F1D2B; --muted: #6B6880; --line: #E4E1EC;
  --code: #F1EFF6; --accent: #7950E4; --on-accent: #FFFFFF;
  /* Status text on the page background */
  --ok: #2E7D57; --bad: #B4472F;
  /* Tiles stay pastel in dark mode too (ICON_SPEC: no inversion), so their inks do not
     change with the theme. */
  --ok-tile: #E0F5E7; --ok-glyph: #329968; --ok-ink: #1F5E40; --ok-edge: #BFE6CC;
  --bad-tile: #FFE1E9; --bad-glyph: #DB558C; --bad-ink: #8E2E55; --bad-edge: #F6C3D2;
  --warn-tile: #FFF0D8; --warn-glyph: #D58A2B; --warn-ink: #8A5A17;
  --test-tile: #E1EAFE; --test-ink: #2F4296;
  --run-tile: #E9DCFC; --run-ink: #4B2DA6;
  /* Depth: shadows under toasts and sheets, the scrim behind a sheet */
  --shadow: rgba(31, 29, 43, .18); --scrim: rgba(31, 29, 43, .42);
  /* Category tile/glyph pairs (ICON_SPEC colour table) */
  --ai-tile: #E9DCFC; --ai-glyph: #7950E4;
  --cloud-tile: #DCEFFC; --cloud-glyph: #218DE1;
  --swipe-tile: #FFE1E9; --swipe-glyph: #DB558C;
  --photos-tile: #FCE2EE; --photos-glyph: #D55C91;
  --approvals-tile: #E0F5E7; --approvals-glyph: #329968;
  --security-tile: #FFF0D8; --security-glyph: #D58A2B;
  --tailnet-tile: #E1EAFE; --tailnet-glyph: #657DD8;
  --memory-tile: #E8E4FA; --memory-glyph: #8072C9;
  --tasks-tile: #FFF0DD; --tasks-glyph: #D9933B;
  --activity-tile: #DDF3EF; --activity-glyph: #369D91;
  /* Type */
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --text-xs: 11.5px; --text-sm: 13px; --text-md: 15px; --text-lg: 17px; --text-xl: 24px;
  /* Space, shape, motion */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 28px;
  --radius-sm: 10px; --radius-md: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --tap: 44px; --page-max: 640px;
  /* Fixed bars the shell may add (it sets these); toasts and the offline banner clear them.
     --kit-kb is how far a phone keyboard covers an open sheet (set by Kit while one is open). */
  --top-bar-h: env(safe-area-inset-top, 0px); --bottom-bar-h: 0px; --kit-kb: 0px; --talk-kb: 0px;
  --ease: .2s ease;
  color-scheme: light;
}
/* Dark: follow the device unless the page sets data-theme="light"; data-theme="dark"
   forces it. Keep the two blocks identical (the token test compares them). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121117; --surface: #1B1A22; --ink: #ECEAF4; --muted: #A29FB4; --line: #2C2A36;
  --code: #23212C; --accent: #B59BFF; --on-accent: #17141F;
  --ok: #6FD3A0; --bad: #F08C73;
  --shadow: rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .62);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #121117; --surface: #1B1A22; --ink: #ECEAF4; --muted: #A29FB4; --line: #2C2A36;
  --code: #23212C; --accent: #B59BFF; --on-accent: #17141F;
  --ok: #6FD3A0; --bad: #F08C73;
  --shadow: rgba(0, 0, 0, .55); --scrim: rgba(0, 0, 0, .62);
  color-scheme: dark; }

/* -------------------------------------------------------------------- base -- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: var(--text-md)/1.55 var(--font-body);
  padding: env(safe-area-inset-top, 0px) max(var(--space-4), env(safe-area-inset-right, 0px))
           max(32px, env(safe-area-inset-bottom, 0px)) max(var(--space-4), env(safe-area-inset-left, 0px)); }
main, .top { max-width: var(--page-max); margin: 0 auto; }
h1 { font-size: var(--text-xl); line-height: 1.2; margin: 0; font-weight: 600; text-wrap: balance; }
h2 { font-size: var(--text-lg); margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible,
select:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
/* Counts, times and ids line up in columns: tabular figures everywhere they appear. */
.chip, .meta, time, kbd, .stat-value, .nav-count, .tab-badge { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- page frame -- */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding-block: var(--space-5) var(--space-4); }
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand-name { font-weight: 600; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: var(--text-sm); }
.who { display: flex; gap: var(--space-3); align-items: center; color: var(--muted);
  font-size: var(--text-sm); }
.link { background: none; border: 0; padding: var(--space-1) 0; color: var(--accent);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }
.count { font: 500 var(--text-sm) var(--font-mono); color: var(--muted); margin-left: var(--space-1); }
.updated, .hint, .meta { color: var(--muted); font-size: var(--text-sm); }
.hint { margin-top: var(--space-1); }
.meta { overflow-wrap: anywhere; }
.stack { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.stack > *, .card > * { min-width: 0; }
.empty { color: var(--muted); margin-top: var(--space-3); padding: 18px;
  border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; }
.err { color: var(--bad); font-size: 14px; }
.page-err { margin-top: var(--space-4); }

main.offline-screen { max-width: 30rem; margin-block: clamp(2rem, 12vh, 6rem); }

/* ------------------------------------------------------------------- tiles -- */
/* <span class="tile tile-tasks"><svg …stroke="currentColor"…></span>; add .tile-app for
   the 64 px app size. Glyphs come from design/icons/. */
.tile { width: var(--tap); height: var(--tap); border-radius: 11px; display: inline-grid;
  place-items: center; flex: none; }
.tile svg { width: 22px; height: 22px; }
.tile-app { width: 64px; height: 64px; border-radius: var(--radius-lg); }
.tile-app svg { width: 30px; height: 30px; }
.tile-ai { background: var(--ai-tile); color: var(--ai-glyph); }
.tile-ok { background: var(--ok-tile); color: var(--ok-glyph); }
.tile-bad { background: var(--bad-tile); color: var(--bad-glyph); }
.tile-warn { background: var(--warn-tile); color: var(--warn-glyph); }
.tile-cloud { background: var(--cloud-tile); color: var(--cloud-glyph); }
.tile-swipe { background: var(--swipe-tile); color: var(--swipe-glyph); }
.tile-photos { background: var(--photos-tile); color: var(--photos-glyph); }
.tile-approvals { background: var(--approvals-tile); color: var(--approvals-glyph); }
.tile-security { background: var(--security-tile); color: var(--security-glyph); }
.tile-tailnet { background: var(--tailnet-tile); color: var(--tailnet-glyph); }
.tile-memory { background: var(--memory-tile); color: var(--memory-glyph); }
.tile-tasks { background: var(--tasks-tile); color: var(--tasks-glyph); }
.tile-activity { background: var(--activity-tile); color: var(--activity-glyph); }

/* ------------------------------------------------------------ cards, forms -- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; display: grid; gap: var(--space-3); min-width: 0; }
.title { font-size: var(--text-lg); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
form { display: grid; gap: var(--space-2); width: 100%; }
label { font-size: var(--text-sm); font-weight: 500; }
input, textarea { font: var(--text-md) var(--font-mono); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px var(--space-3);
  width: 100%; }
textarea { font-family: var(--font-body); min-height: 64px; resize: vertical; }
pre { margin: 0; font: var(--text-sm)/1.5 var(--font-mono); background: var(--code);
  border-radius: var(--radius-sm); padding: 10px var(--space-3); overflow: auto; max-height: 260px;
  white-space: pre-wrap; overflow-wrap: anywhere; }
code, .mono { font: var(--text-sm) var(--font-mono); }

/* ----------------------------------------------------------------- buttons -- */
.btn { border: 1px solid transparent; border-radius: var(--radius-md); padding: 11px 18px;
  font-weight: 600; cursor: pointer; min-height: var(--tap); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); justify-self: start; }
.btn-approve { background: var(--ok-tile); color: var(--ok-ink); border-color: var(--ok-edge); }
.btn-reject { background: var(--bad-tile); color: var(--bad-ink); border-color: var(--bad-edge); }
.btn-ghost { background: transparent; border-color: var(--line); }

/* -------------------------------------------------------- chips (status) -- */
/* Status is never colour alone: a chip always carries its state as text. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 var(--text-xs)/1 var(--font-mono); letter-spacing: .03em; padding: 6px var(--space-2);
  border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--muted); }
.chip.high, .chip.tone-warn { background: var(--warn-tile); color: var(--warn-ink);
  border-color: transparent; }
.chip.tone-ok { background: var(--ok-tile); color: var(--ok-ink); border-color: transparent; }
.chip.tone-bad { background: var(--bad-tile); color: var(--bad-ink); border-color: transparent; }

/* ---------------------------------------- decision cards (swipe, confirm) -- */
/* Used by the dashboard's approvals and by swipe.peyton. */
.swipe { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px; font-weight: 600; font-size: 14px;
  border-radius: var(--radius-lg); }
.swipe-bg.right { background: var(--ok-tile); color: var(--ok-ink); }
.swipe-bg.left { background: var(--bad-tile); color: var(--bad-ink); }
.swipe > .card { position: relative; touch-action: pan-y; transition: transform var(--ease); }
.swipe.dragging > .card { transition: none; }
.chip.state-executed, .chip.state-approved { background: var(--ok-tile); color: var(--ok-ink);
  border-color: transparent; }
.chip.state-rejected, .chip.state-failed { background: var(--bad-tile); color: var(--bad-ink);
  border-color: transparent; }
.plan { display: grid; gap: 6px; min-width: 0; }
.plan-line { font-size: 14px; overflow-wrap: anywhere; }
.plan-line code, .hash { font: var(--text-sm) var(--font-mono); }
.pre-label { font-size: 12px; color: var(--muted); }
.votes { display: grid; gap: var(--space-1); font-size: var(--text-sm); color: var(--muted); }
.votes .rec { color: var(--ink); }
.votes .rec-why { color: var(--muted); padding-left: var(--space-1); overflow-wrap: anywhere; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; }
.confirm { display: grid; gap: 10px; padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--bg); border: 1px solid var(--line); }
.confirm-q { font-weight: 600; }
.check-line { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); }
.check-line input { margin-top: 3px; flex: none; }
.note-toggle { justify-self: start; }
.outcome { font-size: 14px; font-weight: 500; }
.outcome.ok { color: var(--ok); }
.outcome.bad { color: var(--bad); }
.outcome.wait { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .swipe > .card { transition: none; } }

/* -------------------------------------------------------------------- kit -- */
/* Styles for Kit in common.js (toasts, sheets, status chips, skeletons, rich text). Toasts
   and the offline banner clear the shell's fixed bars via --bottom-bar-h / --top-bar-h. */
.kit-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; }
.kit-offscreen { position: fixed; top: 0; left: -9999px; opacity: 0; }
.kit-icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
html.kit-lock { overflow: hidden; }
.kit-x { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.kit-x:hover { color: var(--ink); background: var(--code); }
.kit-x .kit-icon { width: 18px; height: 18px; }
.btn[aria-busy="true"] { cursor: progress; }
@keyframes kit-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes kit-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes kit-slide { from { transform: translateY(100%); } }
@keyframes kit-fade { from { opacity: 0; } }
@keyframes kit-shimmer { to { background-position: -200% 0; } }

/* Status chips: icon + label + tone, never colour alone */
.chip.kit-status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.chip.kit-status .kit-icon { width: 12px; height: 12px; stroke-width: 2.4; }
.chip.tone-run { background: var(--run-tile); color: var(--run-ink); border-color: transparent; }

/* Ids: short on screen, the full one a tap away */
.kit-idchip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.chip.kit-id { position: relative; background: none; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip.kit-id::after { content: ""; position: absolute; inset: -10px -3px; }
.chip.kit-id:hover, .chip.kit-id[aria-expanded="true"] { border-color: var(--accent); color: var(--ink); }
.chip.kit-id:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kit-id-full { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1);
  max-width: 100%; }
.kit-id-full code { overflow-wrap: anywhere; user-select: all; }

/* Copy buttons; the compact ones keep a 44 px hit area */
.kit-copy { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.kit-copy .kit-icon { width: 16px; height: 16px; }
.kit-id-full .kit-copy, .rich-code-bar .kit-copy { position: relative; min-height: 32px;
  padding: 4px 10px; border-color: transparent; border-radius: var(--radius-sm);
  font: 500 var(--text-xs) var(--font-body); color: var(--muted); }
.kit-id-full .kit-copy::after, .rich-code-bar .kit-copy::after { content: ""; position: absolute;
  inset: -6px 0; }
.kit-id-full .kit-copy:hover, .rich-code-bar .kit-copy:hover { color: var(--ink); background: var(--bg); }

/* Toasts: bottom centre on a phone (above any bottom bar), bottom right on wider screens */
.kit-toasts { position: fixed; z-index: 80; left: 0; right: 0; pointer-events: none;
  bottom: calc(var(--bottom-bar-h) + max(var(--space-4), env(safe-area-inset-bottom, 0px)));
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: 0 max(var(--space-4), env(safe-area-inset-left, 0px)); }
.kit-toast { pointer-events: auto; width: min(100%, 440px); display: flex; align-items: center;
  gap: var(--space-2); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: 0 12px 32px -12px var(--shadow);
  animation: kit-rise .18s ease both; }
.kit-toast-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 8px; background: var(--code); color: var(--muted); }
.kit-toast-icon .kit-icon { width: 16px; height: 16px; }
.kit-toast.tone-ok .kit-toast-icon { background: var(--ok-tile); color: var(--ok-ink); }
.kit-toast.tone-bad .kit-toast-icon { background: var(--bad-tile); color: var(--bad-ink); }
.kit-toast-text { flex: 1; min-width: 0; padding-block: 10px; font-size: 14px; font-weight: 500;
  overflow-wrap: anywhere; }
.kit-toast-act { flex: none; padding: 0 var(--space-3); border-color: transparent; color: var(--accent); }
@media (min-width: 720px) {
  .kit-toasts { left: auto; right: max(var(--space-5), env(safe-area-inset-right, 0px));
    align-items: flex-end; padding: 0; }
}

/* Offline banner: in the page flow at the top, stays in view while scrolling */
.kit-banner { position: sticky; top: var(--top-bar-h); z-index: 70;
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  max-width: var(--page-max); margin: 0 auto var(--space-2); padding: var(--space-2) var(--space-4);
  background: var(--warn-tile); color: var(--warn-ink); border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; text-align: center; }

/* Sheets: a centred dialog; a bottom sheet under 720 px */
.kit-sheet { border: 0; padding: 0; color: var(--ink); background: var(--surface);
  width: calc(100% - 2 * var(--space-4)); max-width: 560px; max-height: min(86dvh, 820px);
  border-radius: var(--radius-lg); box-shadow: 0 24px 64px -24px var(--shadow); overflow: hidden; }
.kit-sheet[open] { display: flex; flex-direction: column; animation: kit-pop .18s ease; }
.kit-sheet-sm { max-width: 420px; }
.kit-sheet-lg { max-width: 760px; }
.kit-sheet::backdrop { background: var(--scrim); }
.kit-sheet-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-2); padding: var(--space-3) var(--space-2) var(--space-2) var(--space-5); flex: none; }
.kit-sheet-title { padding-top: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.kit-sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding: 0 var(--space-5) var(--space-4); display: grid; gap: var(--space-3); align-content: start; }
.kit-sheet-foot { flex: none; display: grid; gap: var(--space-2); border-top: 1px solid var(--line);
  padding: var(--space-3) var(--space-5) var(--space-4); }
.kit-sheet-bare > .kit-sheet-err { margin: 0 var(--space-5) var(--space-4); }
.kit-sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.kit-sheet-actions .btn { flex: 0 1 auto; min-width: 7.5em; }
.kit-confirm { display: grid; gap: var(--space-2); }
.kit-confirm-text { overflow-wrap: anywhere; }
.kit-confirm-label code { background: var(--code); border-radius: 5px; padding: 1px 5px; }
@media (max-width: 719px) {
  .kit-sheet { width: 100%; max-width: none; margin: auto 0 var(--kit-kb);
    max-height: calc(100dvh - var(--kit-kb) - env(safe-area-inset-top, 0px) - var(--space-5));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .kit-sheet[open] { animation-name: kit-slide; }
  .kit-sheet-foot { padding-bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px)); }
  .kit-sheet-bare .kit-sheet-body { padding-bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px)); }
  .kit-sheet-actions .btn { flex: 1 1 0; min-width: 0; }
}

/* Skeletons: appear after a beat so a fast answer never flashes; card skeletons take the
   columns of the grid they stand in */
.kit-skel { display: grid; gap: var(--space-3); grid-column: 1 / -1; animation: kit-fade .2s ease .3s both; }
.kit-skel-cards { grid-template-columns: inherit; align-items: start; }
.kit-skel-lines { gap: var(--space-2); }
.kit-skel-card { display: grid; gap: var(--space-3); padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); }
.kit-skel-bar { display: block; height: 12px; border-radius: 6px; width: 80%;
  background: linear-gradient(90deg, var(--code) 25%, var(--line) 50%, var(--code) 75%);
  background-size: 200% 100%; animation: kit-shimmer 1.4s linear infinite; }
.kit-skel-card > :nth-child(1) { width: 32%; }
.kit-skel-card > :nth-child(2) { width: 78%; height: 16px; }
.kit-skel-card > :nth-child(3) { width: 55%; }
.kit-skel-lines > :nth-child(4n+2) { width: 68%; }
.kit-skel-lines > :nth-child(4n+3) { width: 88%; }
.kit-skel-lines > :nth-child(4n) { width: 56%; }

/* Empty states with one next step */
.kit-empty { display: grid; justify-items: center; gap: var(--space-2); }
.kit-empty-icon { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 11px; background: var(--code); color: var(--muted); }
.kit-empty-icon .kit-icon { width: 22px; height: 22px; }
.kit-empty-act { margin-top: var(--space-1); text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; }

/* Rich text (rich()): line breaks are kept; blocks scroll sideways inside themselves */
.rich { white-space: pre-wrap; overflow-wrap: anywhere; }
.rich-list { margin: var(--space-1) 0; padding-left: 1.5em; }
.rich-list .rich-list { margin: 2px 0 0; }
.rich-list > li + li { margin-top: 2px; }
.rich-list > li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.rich-quote { margin: var(--space-1) 0; padding-left: var(--space-3); border-left: 3px solid var(--line);
  color: var(--muted); }
.rich-hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-2) 0; }
.rich a { color: var(--accent); text-underline-offset: 2px; }
.rich-host { color: var(--muted); font-size: .85em; }
.rich :not(pre) > code { background: var(--code); border-radius: 5px; padding: .05em .3em; }
.rich-code { margin: var(--space-2) 0; min-width: 0; background: var(--code);
  border-radius: var(--radius-sm); overflow: hidden; white-space: normal; }
.rich-code-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  min-height: 36px; padding-left: var(--space-3); border-bottom: 1px solid var(--line);
  font: var(--text-xs) var(--font-mono); color: var(--muted); }
.rich-code pre { margin: 0; max-height: 28em; overflow: auto; white-space: pre; overflow-wrap: normal;
  background: none; border-radius: 0; }
.rich-code pre:focus-visible, .rich-table:focus-visible { outline: 2px solid var(--accent);
  outline-offset: -2px; }
.rich-table { margin: var(--space-2) 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line);
  border-radius: var(--radius-sm); white-space: normal; }
.rich-table table { width: 100%; border-collapse: collapse; font-size: var(--text-sm);
  overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.rich-table th, .rich-table td { padding: 6px 10px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); min-width: 6em; }
.rich-table th { font-weight: 600; background: var(--code); }
.rich-table tr:last-child td { border-bottom: 0; }
.rich-table .rich-c { text-align: center; }
.rich-table .rich-r { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .kit-toast, .kit-sheet[open], .kit-skel, .kit-skel-bar { animation: none; }
}

/* Reduced motion: nothing moves, nothing loops, anywhere. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
