/* @fabgpt-provenance | Fabrizio Salmi | https://chat.fabriziosalmi.com/ | https://github.com/fabriziosalmi/fabgpt-faq | file:style.css | fp:0c58ebc7e326dab3 */
/* FabGPT-FAQ: editorial light/dark system via <meta name="color-scheme"> + light-dark() + OKLCH. */

:root {
  color-scheme: light dark;
  /* Mineral Signature Pigments: Paper (Swiss technical paper) & Obsidian (Leica anodized graphite) */
  --bg: light-dark(#f8f7f4, #0b0c0e);
  --bg-soft: light-dark(#f1f0eb, #101215);
  --bg-raised: light-dark(#ffffff, #121417);
  --text: light-dark(#161614, #ecece9);
  --text-dim: light-dark(#474642, #a8a69e);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --border: light-dark(rgba(22, 22, 20, 0.085), rgba(255, 255, 255, 0.08));
  --border-strong: light-dark(rgba(22, 22, 20, 0.15), rgba(255, 255, 255, 0.15));
  --accent: light-dark(oklch(0.51 0.13 158), oklch(0.75 0.14 160));
  --accent-text: #ffffff;
  --bubble-user: light-dark(#efeee9, #191c22);
  --link: light-dark(oklch(0.46 0.12 158), oklch(0.78 0.13 160));
  --link-3p: light-dark(oklch(0.45 0.11 250), oklch(0.75 0.11 250));
  --code-bg: light-dark(#f2f1ec, #0f1114);
  /* Litographic semantic pigments (equal perceived OKLCH lightness) */
  --sem-sec: oklch(0.58 0.13 32);
  --sem-infra: oklch(0.54 0.10 245);
  --sem-ai: oklch(0.54 0.10 290);
  --sem-gate: oklch(0.64 0.12 78);
  --hl-cm: light-dark(#595854, #9ba1ac);
  --hl-str: light-dark(oklch(0.51 0.13 158), oklch(0.75 0.14 160));
  --hl-kw: light-dark(oklch(0.54 0.10 290), oklch(0.76 0.11 290));
  --hl-flg: light-dark(oklch(0.58 0.13 32), oklch(0.78 0.12 68));
  --hl-num: light-dark(oklch(0.54 0.10 245), oklch(0.76 0.11 240));
  --vert-tint: transparent;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 0.16s var(--ease);
  /* 3-layer physical ambient shadow + zenith specular rim */
  --elev: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 1px rgba(20, 20, 18, 0.04), 0 4px 12px rgba(20, 20, 18, 0.04), 0 16px 36px -8px rgba(20, 20, 18, 0.06);
  --ring: 0 0 0 3px oklch(0.55 0.13 158 / 0.18);
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --elev: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 1px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(0, 0, 0, 0.34);
  --ring: 0 0 0 3px oklch(0.75 0.14 160 / 0.24);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
  --elev: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 1px rgba(20, 20, 18, 0.04), 0 4px 12px rgba(20, 20, 18, 0.04), 0 16px 36px -8px rgba(20, 20, 18, 0.06);
  --ring: 0 0 0 3px oklch(0.55 0.13 158 / 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --elev: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 1px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(0, 0, 0, 0.34);
    --ring: 0 0 0 3px oklch(0.75 0.14 160 / 0.24);
  }
}

/* Ambient Scope Micro-Tint (~3.5% perceptual wash adapting to active vertical) */
:root[data-vert="security"] { --vert-tint: oklch(62% 0.14 160 / 0.04); }
:root[data-vert="ai"] { --vert-tint: oklch(62% 0.14 285 / 0.04); }
:root[data-vert="proxmox"] { --vert-tint: oklch(66% 0.14 55 / 0.04); }
:root[data-vert="cloudflare"] { --vert-tint: oklch(64% 0.14 230 / 0.04); }
:root[data-vert="tools"] { --vert-tint: oklch(62% 0.12 195 / 0.04); }
:root[data-vert="creative"] { --vert-tint: oklch(64% 0.14 330 / 0.04); }

.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;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
}

body {
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(76% 32% at 50% 0%, var(--vert-tint), transparent 72%);
  color: var(--text);
  font: 16px/1.65 var(--font-sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@keyframes page-in {
  from { opacity: 0; }
}

p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.015em; }
table, td, th, kbd, code, .layer-pill, .hero-pill, .page-meta, .scene-svg, .scene-ctrl, .cmdk-meta, .filter-count {
  font-variant-numeric: tabular-nums;
}

/* themed thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); border: 3px solid transparent; background-clip: padding-box; }

/* ---------- header ---------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.topnav {
  position: absolute;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.topnav a:hover { color: var(--text); }
.topnav a svg { vertical-align: -3px; }

.cmdk-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.cmdk-btn:hover { border-color: var(--accent); color: var(--text); background: var(--bg-raised); }
.cmdk-btn kbd {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-dim);
}
@media (max-width: 560px) {
  .cmdk-btn span, .cmdk-btn kbd { display: none; }
  .cmdk-btn { width: 30px; padding: 0; justify-content: center; }
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.theme-btn:hover { border-color: var(--accent); color: var(--text); background: var(--bg-raised); }
/* Show moon in light mode (action: switch to dark), sun in dark mode (action: switch to light) */
.theme-btn .ic-sun { display: none; }
.theme-btn .ic-moon { display: inline-flex; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-btn .ic-sun { display: inline-flex; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-btn .ic-sun { display: inline-flex; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-btn .ic-moon { display: none; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 17px;
}

.brand-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
}

.brand-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 2px;
}

/* ---------- chat area ---------- */

.chat {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 16px 28px;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 14px), transparent 100%);
}

.msg {
  max-width: 768px;
  margin: 0 auto 32px;
  display: flex;
  gap: 12px;
}

.msg-user {
  justify-content: flex-end;
}

.msg-user .bubble {
  background: var(--bubble-user);
  border-radius: var(--r-lg) var(--r-lg) 4px var(--r-lg);
  padding: 10px 16px;
  max-width: 75%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  box-shadow: var(--elev);
}

.msg-bot .avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}

/* the bot's procedural face: blinking eyes, cursor-tracking pupils */
.msg-bot .avatar .face { width: 26px; height: 26px; display: block; }
.face .eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: face-blink 5.6s ease-in-out infinite;
}
.face .pupil {
  transform-box: fill-box;
  transform-origin: center;
  transition: r var(--t);
}
@keyframes face-blink {
  0%, 94.5%, 98.5%, 100% { transform: scaleY(1); }
  96.5% { transform: scaleY(0.08); }
}
@media (prefers-reduced-motion: reduce) {
  .face .eye { animation: none; }
}

.msg-bot .content {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: break-word;
}

/* Golden reading measure (65ch) on prose; diagrams, scenes, tables & code keep full column width */
.msg-bot .content .body p,
.msg-bot .content .body ul,
.msg-bot .content .body ol,
.page .answer p,
.page .answer ul,
.page .answer ol {
  max-width: 65ch;
}

.msg-bot .content p,
.page .answer p { margin: 0 0 0.85em; }
.msg-bot .content p:last-child { margin-bottom: 0; }
.msg-bot .content ul { margin: 0 0 0.85em; padding-left: 22px; }
.msg-bot .content li { margin: 4px 0; }

.msg-bot .content a {
  color: var(--link);
  text-decoration: none;
}
.msg-bot .content a:hover { text-decoration: underline; }

.msg-bot .content code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.92em;
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

/* blinking cursor while streaming */
.msg-bot .typing > *:last-child::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  border-radius: 1px;
  vertical-align: -0.18em;
  background: var(--accent);
  /* R2 - il respiro dell'AI: sinusoidal breathing, not a mechanical on/off blink */
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* R13 - condensazione: the words just streamed materialize from transparency
   (only the freshly appended tail fades; settled text stays opaque) */
.msg-bot .content .cond { animation: chips-in 0.18s ease both; }

/* suggested-question chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  animation: chips-in 0.25s ease;
}

@keyframes chips-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .chips .chip { opacity: 0; animation: chips-in .3s ease forwards; }
  .chips .chip:nth-child(2) { animation-delay: .06s; }
  .chips .chip:nth-child(3) { animation-delay: .12s; }
  .chips .chip:nth-child(4) { animation-delay: .18s; }
  .chips .chip:nth-child(5) { animation-delay: .24s; }
}

.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  transition: background var(--t), border-color var(--t), color var(--t);
}

.chip:hover {
  background: var(--bg-raised);
  border-color: var(--accent);
  color: var(--text);
}

.chip-path {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.chip-path:hover {
  background: var(--accent);
  color: var(--accent-text);
}

.chip:active {
  background: var(--bg-soft);
}

/* concept diagram (inline SVG, theme-aware) */
.msg-bot .content .diagram {
  position: relative;
  margin: 14px 0 2px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}
.diagram {
  position: relative;
  margin: 0;
}
.diagram svg { display: block; max-width: 100%; height: auto; }
.diagram .copy-diagram-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
  z-index: 2;
}
.diagram:hover .copy-diagram-btn { opacity: 1; }
.diagram .copy-diagram-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--text-dim);
}
.diagram .copy-diagram-btn.copied {
  background: rgba(16, 163, 127, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

/* animated flow connectors, only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  .dg-flow {
    stroke-dashoffset: 44;
    animation: dg-dash 1.1s linear infinite;
  }
}
@keyframes dg-dash { to { stroke-dashoffset: 0; } }

/* click-to-copy inline code & code blocks */
.msg-bot .content code, .page .answer code { cursor: pointer; }
.msg-bot .content code:hover, .page .answer code:hover { outline: 1px solid var(--border); }
.msg-bot .content code.copied, .page .answer code.copied { outline: 1px solid var(--accent); color: var(--accent); }

.msg-bot .content pre, .page .answer pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
  margin: 14px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.58;
  font-variant-ligatures: none;
}
.msg-bot .content pre code, .page .answer pre code {
  background: transparent;
  padding: 0;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--text);
  display: block;
  white-space: pre;
  cursor: pointer;
}
.msg-bot .content pre code:hover, .page .answer pre code:hover { outline: none; }

/* header section bar (chat): quick nav + live context breadcrumb */
.statbar {
  flex: 0 0 auto;
  display: grid;
  /* symmetric side columns keep the icon rail optically centered; the live
     breadcrumb (chat only) sits in the right column without pushing it */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 7px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.statnav { display: flex; gap: 6px; grid-column: 2; }
.statnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.statnav a svg { width: 14px; height: 14px; flex: 0 0 auto; }
.statnav a:hover { color: var(--text); border-color: var(--accent); background: var(--bg-soft); }
.statnav a.on { color: var(--accent); border-color: var(--accent); background: var(--bg-soft); font-weight: 600; }
@media (max-width: 680px) {
  .statnav a { width: 34px; padding: 0; }
  .statnav a .nav-lbl { display: none; }
}
.ctxcrumb {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: var(--text-dim);
  text-decoration: none;
}
.ctxcrumb[hidden] { display: none; }
.ctxcrumb-ic { display: inline-flex; flex: 0 0 auto; color: var(--accent); }
.ctxcrumb-ic svg { width: 14px; height: 14px; }
.ctxcrumb span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctxcrumb:hover { color: var(--link); }

/* site footer (generated pages) */
.sitefoot {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 12.5px;
  color: var(--text-dim);
}
.sitefoot-in {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.sitefoot-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.sitefoot-dim { color: var(--text-dim); font-weight: 400; }
.foot-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  font-size: 11px; font-weight: 700;
}
.sitefoot-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sitefoot-nav a { color: var(--text-dim); text-decoration: none; }
.sitefoot-nav a:hover { color: var(--link); text-decoration: underline; }

/* tool result area: empty & waiting states */
.tool-empty { color: var(--text-dim); font-size: 13px; margin: 0; }
.tool-empty::before { content: "→ "; color: var(--accent); }
.tool-wait { color: var(--text-dim); }

/* flex-column body: pages must be allowed to shrink below their pre's max-content */
main.page { width: 100%; min-width: 0; }

/* native feel: no tap flash, no double-tap zoom, visible keyboard focus */
html { -webkit-tap-highlight-color: transparent; }
a, button, input[type="checkbox"], select { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.chat { overscroll-behavior: contain; }
::selection { background: rgba(16, 163, 127, 0.25); }
.ask svg, .page-meta-badge svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }

/* answer action bar & copy Q&A / Session buttons */
.msg-bot .content .qa-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.copy-qa-btn, .copy-session-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.copy-qa-btn:hover, .copy-session-btn:hover {
  background: var(--border);
  color: var(--text);
}
.copy-qa-btn.copied, .copy-session-btn.copied {
  background: rgba(16, 163, 127, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}
.copy-qa-btn svg, .copy-session-btn svg, .copy-diagram-btn svg {
  flex: 0 0 auto;
}

/* ---------- micro-interactions (motion-guarded) ---------- */




/* Always-visible editorial underline on answer links (critical in E-Ink where --link == --text) */
.msg-bot .content a:not(.chip):not(.sol-ask-btn),
.page .answer a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  transition: text-decoration-color var(--t), color var(--t);
}
.msg-bot .content a:not(.chip):not(.sol-ask-btn):hover,
.page .answer a:hover {
  text-decoration-color: currentColor;
}
.msg-bot .content p a[href^="http"]::after,
.msg-bot .content li a[href^="http"]::after,
.page .answer p a[href^="http"]::after,
.page .answer li a[href^="http"]::after {
  content: " ↗";
  font-size: 0.78em;
  opacity: 0.62;
  display: inline-block;
  text-decoration: none;
}




@media (prefers-reduced-motion: no-preference) {
  
  .msg { animation: msg-in .28s ease both; }
  .msg-bot .avatar, .brand-dot { animation: pop-in .35s ease both; }
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- composer ---------- */

.composer {
  flex: 0 0 auto;
  position: relative;
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
}

/* live search: matching questions offered above the composer while typing */
.suggestbox {
  position: absolute;
  bottom: 100%;
  left: 16px;
  right: 16px;
  max-width: 768px;
  margin: 0 auto 2px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--elev);
  overflow: hidden;
  animation: pop-in .15s ease;
}
.suggestbox[hidden] { display: none; }
.suggestbox .sg {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 13px;
  background: none;
  border: 0;
  border-top: 1px solid var(--border);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.suggestbox .sg:first-child { border-top: 0; }
.suggestbox .sg svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--text-dim); }
.suggestbox .sg span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestbox .sg:hover, .suggestbox .sg.on { background: var(--bg-soft); }
.suggestbox .sg.on svg { color: var(--accent); }

.composer-inner {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 7px 7px 7px 18px;
  box-shadow: var(--elev);
  transition: border-color var(--t), box-shadow var(--t);
}

.composer-inner:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

#input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  resize: none;
  outline: none;
  overflow-y: hidden;
  max-height: 180px;
  padding: 5px 0;
}

#send {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 17px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--t), background var(--t), transform var(--t);
}
#send:not(:disabled):hover { background: var(--link); }

#send:disabled {
  opacity: 0.25;
  cursor: default;
}

.composer-note {
  max-width: 768px;
  min-height: 1.45em;
  margin: 8px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}
.composer-note a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.composer-note a:hover { color: var(--text); }

@media (max-width: 600px) {
  .chat { padding-top: 16px; }
  .msg-user .bubble { max-width: 85%; }
  /* primary nav on touch: WCAG 2.5.8 / HIG target sizes */
  .statnav { gap: 8px; }
  .statnav a { width: 44px; height: 40px; }
}

/* prose links on generated pages: never the UA default blue/violet.
   Scoped to p/li so block-card anchors (color: inherit) stay untouched. */
.page p a, .page li a { color: var(--link); }

/* ---------- Code Blocks with Header (Two-Speed Code Card) ---------- */
.code-block {
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--code-bg);
  box-shadow: var(--elev);
  overflow: clip;
  animation: code-card-in 0.16s var(--ease) both;
}
@keyframes code-card-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.code-header {
  position: sticky;
  top: 52px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px 4px 12px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-md) var(--r-md) 0 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  color: var(--text-dim);
}
.chat .code-header {
  top: 0;
}
.code-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.code-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.code-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
  flex: 0 0 auto;
}
.code-sep { opacity: 0.4; }
.code-lang {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
}
.code-header .copy-code-btn,
.code-expand-wrap .copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 6px;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.code-header .copy-code-btn:hover,
.code-expand-wrap .copy-code-btn:hover {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
}
.code-header .copy-code-btn.copied,
.code-expand-wrap .copy-code-btn.copied {
  color: var(--accent);
}
.code-block pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 12px 14px !important;
}
.code-block pre code.has-lines {
  counter-reset: cl;
}
.code-block pre code.has-lines .cl::before {
  counter-increment: cl;
  content: counter(cl);
  display: inline-block;
  width: 2.1em;
  margin-right: 12px;
  text-align: right;
  color: var(--text-dim);
  opacity: 0.34;
  user-select: none;
  -webkit-user-select: none;
  font-variant-numeric: tabular-nums;
}
.code-block.is-clamped pre {
  max-height: 24.5em;
  overflow-y: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.code-expand-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px 6px 12px;
  border-top: 1px solid var(--border);
  background: light-dark(rgba(15, 23, 42, 0.018), rgba(255, 255, 255, 0.02));
}
.code-expand-wrap.copy-only {
  justify-content: flex-end;
}
.code-expand-btn {
  font: 500 11.5px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.code-expand-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ---------- Static Page Enhancements ---------- */
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 6px 0 16px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.page-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-weight: 500;
}
.page-meta-badge + .page-meta-badge::before {
  content: "·";
  margin-right: 6px;
  opacity: 0.45;
}
.page-meta-badge.vert {
  color: var(--accent);
}
.tool-pill-soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--t), background var(--t);
}
.tool-pill-soft svg { width: 14px; height: 14px; color: var(--accent); flex: 0 0 auto; }
.tool-pill-soft:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.page .answer,
.msg-bot .content {
  max-width: 68ch;
  line-height: 1.65;
}

/* Page Prev/Next Navigation */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 32px 0 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.page-nav-card {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  box-shadow: var(--elev);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t);
}
.page-nav-card:hover {
  border-color: var(--accent);
}
.page-nav-card.placeholder {
  visibility: hidden;
}
.page-nav-card .nav-dir {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}
.page-nav-card .nav-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--link);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.page-nav-card.next {
  text-align: right;
}

/* Ask Box in Static Page */
.ask-box {
  margin: 28px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  box-shadow: var(--elev);
}
.ask-box-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.ask-box-icon {
  font-size: 24px;
  line-height: 1;
}
.ask-box h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}
.ask-box p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}
.ask-box-form {
  display: flex;
  gap: 8px;
}
.ask-box-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  outline: none;
}
.ask-box-form input:focus {
  border-color: var(--accent);
}
.ask-box-form button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.ask-box-form button:hover {
  opacity: 0.9;
}

/* Search / Filter on /q/ index */
.filter-wrap {
  margin: 20px 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 8px 0 12px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: var(--elev);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.search-box svg {
  color: var(--text-dim);
  flex: 0 0 auto;
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}
.search-box .filter-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.filter-chip {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.filter-chip:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.filter-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

@media (max-width: 600px) {
  .page-nav { grid-template-columns: 1fr; }
  .ask-box-form { flex-direction: column; }
}

/* ---------- static Q&A page layout (extracted from inline <style>) ---------- */
.page { max-width: 768px; margin: 0 auto; padding: 24px 16px 48px; }
.page h1 { font-size: clamp(24px, 4.5vw, 30px); line-height: 1.24; letter-spacing: -0.015em; margin: 6px 0 10px; }
.crumbs { font-size: 13.5px; color: var(--text-dim); margin-bottom: 6px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.page .answer a { color: var(--link); }
.page .answer ul { padding-left: 22px; }
.page .answer code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.92em;
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  cursor: pointer;
}
.page .answer code:hover { outline: 1px solid var(--border); }
.page .answer code.copied { outline: 1px solid var(--accent); color: var(--accent); }
.qa-actions { display: flex; align-items: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.qa-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.qa-icon-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-raised);
}
.qa-icon-btn.copied {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.qa-actions .ask.qa-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  margin: 0 0 0 4px;
  font-size: 13px;
  line-height: 1;
}
.sol-box { display: block; margin-top: 22px; padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-md); background: var(--bg-raised); box-shadow: var(--elev); }
.sol-kicker { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.sol-box p { margin: 2px 0 10px; font-size: 14px; color: var(--text-dim); }
.sol-box strong { font-size: 15px; }
.sol-links { display: flex; gap: 16px; flex-wrap: wrap; }
.sol-links a { color: var(--link); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.sol-links a:hover { text-decoration: underline; }
.copy-qa-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; font-size: 13px; font-family: inherit; font-weight: 500; cursor: pointer; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.copy-qa-btn:hover { background: var(--border); color: var(--text); }
.copy-qa-btn.copied { background: rgba(16, 163, 127, 0.15); color: var(--accent); border-color: var(--accent); }
.page .ask { display: inline-block; background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 8px 16px; text-decoration: none; font-weight: 600; font-size: 13px; transition: background var(--t); }
.page .ask:hover { background: var(--link); }
.page .related { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 20px; }
.page .related h2 { font-size: 16px; margin-bottom: 12px; }
.page .related a { color: var(--link); text-decoration: none; }
.page .related a:hover { text-decoration: underline; }
.page .related li { margin: 8px 0; }
.page .diagram { margin: 24px 0 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); }
.page .diagram svg { display: block; max-width: 100%; height: auto; }

/* ---------- editorial hero on home (collapses on first prompt) ---------- */
.hero-card {
  max-width: 768px;
  margin: 8px auto 26px;
  padding: 24px 24px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-raised);
  box-shadow: var(--elev);
  transition: opacity .22s ease, transform .22s ease;
}
.hero-card.dismissed {
  display: none;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, .2);
}
.hero-card h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--text);
}
.hero-card h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.55;
}
.hero-try {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-try button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.hero-try button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-raised);
}
.hero-try code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--accent);
}

/* ---------- global Cmd+K native <dialog> palette ---------- */
dialog#cmdk {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-raised);
  color: var(--text);
  width: min(620px, calc(100vw - 24px));
  max-height: min(520px, 78vh);
  margin: min(12vh, 96px) auto auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
  overflow: hidden;
}
dialog#cmdk[open] {
  display: flex;
  flex-direction: column;
}
dialog#cmdk:modal {
  overscroll-behavior: contain;
}
dialog#cmdk::backdrop {
  background: rgba(6, 8, 12, .56);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.cmdk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.cmdk-head input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.cmdk-close {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
}
.cmdk-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
}
.cmdk-item:hover, .cmdk-item.on {
  background: var(--bg-soft);
}
.cmdk-item.on .cmdk-title { color: var(--accent); }
.cmdk-badge {
  flex: 0 0 auto;
  font: 600 10.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.cmdk-k-tool, .cmdk-k-path { color: var(--accent); border-color: var(--accent); }
.cmdk-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.cmdk-meta {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--text-dim);
}
.cmdk-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
}
.cmdk-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ---------- static syntax highlighting (zero runtime JS) ---------- */
.hl-cm { color: var(--hl-cm); font-style: italic; }
.hl-str { color: var(--hl-str); }
.hl-kw { color: var(--hl-kw); font-weight: 600; }
.hl-flg { color: var(--hl-flg); }
.hl-num { color: var(--hl-num); }

/* ---------- share buttons on /q/ pages ---------- */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-soft);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.share-btn:hover { background: var(--border); color: var(--text); text-decoration: none; }
.share-btn.copied { background: rgba(16, 163, 127, .15); color: var(--accent); border-color: var(--accent); }

/* ---------- scroll reading progress bar (progressive enhancement) ---------- */
.read-progress { display: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-read-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    .read-progress {
      display: block;
      position: fixed;
      left: 0;
      top: 0;
      width: 100%;
      height: 3px;
      background: var(--accent);
      z-index: 60;
      pointer-events: none;
      transform-origin: 0 50%;
      animation: grow-read-progress auto linear;
      animation-timeline: scroll();
    }
  }
}

/* ---------- SOTA UX: jump-to-bottom, Stop state, provenance pill, hover controls ---------- */
.jump-bottom {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--elev);
  cursor: pointer;
  z-index: 15;
  transition: border-color var(--t), color var(--t);
}
.jump-bottom[hidden] { display: none; }
.jump-bottom:hover { border-color: var(--accent); color: var(--accent); }

#send.is-stop {
  background: var(--text);
  color: var(--bg);
}
#send.is-stop:hover { opacity: 0.85; }

.layer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.msg-user { align-items: center; }
.edit-prompt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t), border-color var(--t), color var(--t), background var(--t);
}
.msg-user:hover .edit-prompt-btn,
.msg-user:focus-within .edit-prompt-btn,
.edit-prompt-btn:focus-visible {
  opacity: 1;
}
.edit-prompt-btn:hover {
  border-color: var(--border);
  background: var(--bg-soft);
  color: var(--text);
}
@media (hover: none) {
  .edit-prompt-btn { opacity: 0.7; }
}

@media (hover: hover) {
  .msg-bot .content .qa-actions {
    opacity: 0.42;
    transition: opacity var(--t);
  }
  .msg-bot:hover .content .qa-actions,
  .msg-bot:focus-within .content .qa-actions {
    opacity: 1;
  }
}

.composer-hint {
  max-width: 768px;
  margin: 6px auto 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.75;
}
@media (hover: none), (max-width: 640px) {
  .composer-hint { display: none; }
}

/* ---------- diegetic animated SVG scenes (scenes.js) ---------- */
.scene-card {
  position: relative;
  margin: 14px 0 4px;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-soft);
  box-shadow: var(--elev);
  overflow: hidden;
}
.scene-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.sc-node.is-click { cursor: pointer; }
.sc-node.is-click rect { transition: stroke var(--t), fill var(--t); }
.sc-node.is-click:hover rect, .sc-node.is-click:focus-visible rect {
  stroke: var(--accent);
  stroke-width: 2;
  fill: var(--bg-soft);
}
.scene-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}
.scene-prog span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.scene-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.65;
  transition: opacity var(--t);
}
.scene-card:hover .scene-ctrl, .scene-card:focus-within .scene-ctrl { opacity: 1; }
.scene-replay {
  margin-left: auto;
  background: var(--bg-raised);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.scene-replay:hover { border-color: var(--accent); color: var(--accent); }
.sol-ask-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.sol-ask-btn:hover { text-decoration: underline; }

/* ---------- Dieter Rams / Linear precision polish ---------- */

/* Pure Tufte tables: horizontal hairlines only, 11px weight-500 headers, tabular numbers */
.msg-bot .content table,
.page table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.msg-bot .content th,
.page th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-dim);
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--border-strong);
}
.msg-bot .content td,
.page td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.msg-bot .content tr:last-child td,
.page tr:last-child td {
  border-bottom: 0;
}
.msg-bot .content th.num,
.msg-bot .content td.num,
.page th.num,
.page td.num {
  text-align: right;
}

/* Closure cadence reveal for post-stream metadata */
.turn-meta-in {
  animation: chips-in 0.22s var(--ease) both;
}

/* Mechanical micro-tactility (100ms expo-out detent on press) */
@media (prefers-reduced-motion: no-preference) {
  button:not(:disabled),
  .chip,
  .sc-node.is-click {
    transition-timing-function: var(--ease);
  }
  button:not(:disabled):not(.jump-bottom):active,
  .chip:active {
    transform: scale(0.98);
    transition-duration: 90ms;
  }
  .jump-bottom:active {
    transform: translateX(-50%) scale(0.98);
    transition-duration: 90ms;
  }
  .sc-node.is-click {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 90ms var(--ease);
  }
  .sc-node.is-click:active {
    transform: scale(0.98);
  }
}

/* ---------- Core Cockpit: Zero-State Centered Layout, 13-Gate Meter, Live Omni-Bar, 2x2 Hover-to-Peek ---------- */
body.is-empty .chat {
  flex: 0 1 auto;
  margin-top: auto;
  padding: 24px 16px 8px;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
body.is-empty .composer {
  margin-bottom: auto;
  padding-top: 10px;
}
body.is-empty .hero-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: center;
  padding: 8px 16px 14px;
  margin: 0 auto 6px;
}
body.is-empty .hero-card .hero-sub {
  max-width: 56ch;
  margin: 0 auto;
}
body.is-empty .composer-hint {
  display: none;
}
body:not(.is-empty) .starter-grid {
  display: none;
}
.composer {
  transition: opacity 0.2s var(--ease);
}

/* 13-Tick Quality Gate Meter (hardware optical scan) */
.hero-pill {
  text-decoration: none;
  transition: border-color var(--t), color var(--t);
}
.hero-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}
.gate-meter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 11px;
  vertical-align: middle;
}
.gate-meter i {
  display: block;
  width: 1.5px;
  height: 9px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.88;
}
.layer-pill .gate-meter {
  height: 9px;
  margin-right: 2px;
}
.layer-pill .gate-meter i {
  height: 7px;
}
@media (prefers-reduced-motion: no-preference) {
  .gate-meter i {
    animation: gate-scan 0.24s var(--ease) both;
  }
  .gate-meter i:nth-child(1) { animation-delay: 0ms; }
  .gate-meter i:nth-child(2) { animation-delay: 14ms; }
  .gate-meter i:nth-child(3) { animation-delay: 28ms; }
  .gate-meter i:nth-child(4) { animation-delay: 42ms; }
  .gate-meter i:nth-child(5) { animation-delay: 56ms; }
  .gate-meter i:nth-child(6) { animation-delay: 70ms; }
  .gate-meter i:nth-child(7) { animation-delay: 84ms; }
  .gate-meter i:nth-child(8) { animation-delay: 98ms; }
  .gate-meter i:nth-child(9) { animation-delay: 112ms; }
  .gate-meter i:nth-child(10) { animation-delay: 126ms; }
  .gate-meter i:nth-child(11) { animation-delay: 140ms; }
  .gate-meter i:nth-child(12) { animation-delay: 154ms; }
  .gate-meter i:nth-child(13) { animation-delay: 168ms; }
}
@keyframes gate-scan {
  from { opacity: 0.16; transform: scaleY(0.45); }
  to { opacity: 0.88; transform: scaleY(1); }
}

/* Live Omni-Bar (0ms client-side preview above composer) */
.omnibar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 768px;
  margin: 0 auto 8px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  color: var(--text);
  font: 500 12.5px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-align: left;
  box-shadow: var(--elev);
  cursor: pointer;
  animation: code-card-in 0.14s var(--ease) both;
}
.omnibar[hidden] { display: none; }
.omnibar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.omnibar-tag {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
}
.omnibar-val {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.omnibar-go {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.omnibar:hover .omnibar-go {
  border-color: var(--accent);
  color: var(--accent);
}

/* Single-row minimal monochrome starter micro-pills (composer stays 100% focal point) */
.starter-grid {
  max-width: 840px;
  margin: 14px auto 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
}
.starter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  opacity: 0.62;
  font: 500 13px/1.3 var(--font-sans);
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background-color var(--t), opacity var(--t);
}
.starter-pill svg {
  flex: 0 0 auto;
  opacity: 0.7;
  transition: opacity var(--t), color var(--t);
}
.starter-pill code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: inherit;
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
}
.starter-pill:hover,
.starter-pill:focus-visible {
  opacity: 1;
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-soft);
}
.starter-pill:hover svg,
.starter-pill:focus-visible svg {
  opacity: 1;
  color: var(--accent);
}
@media (max-width: 640px) {
  .starter-pill {
    min-height: 36px;
    padding: 6px 11px;
    font-size: 12.5px;
  }
}
.starter-card .sc-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.starter-card code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
}
.starter-card strong {
  font-weight: 600;
  font-size: 14px;
}
.starter-card .sc-peek {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity var(--t);
  white-space: nowrap;
}
.starter-card:hover .sc-peek,
.starter-card:focus-visible .sc-peek {
  opacity: 1;
}
.starter-card .sc-lbl {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color var(--t), opacity var(--t);
}
.starter-card:hover .sc-lbl {
  color: var(--accent);
}
.sc-mini-svg {
  color: var(--text-dim);
  opacity: 0.55;
  transition: opacity var(--t), color var(--t);
}
.starter-card:hover .sc-mini-svg,
.starter-card:focus-visible .sc-mini-svg {
  opacity: 1;
  color: var(--text);
}
.starter-card:hover .sc-mini-pulse {
  stroke: var(--accent);
}

/* ---------- Hardware Identity: Dot-Matrix Surface, 3-Bar Signal Avatar, Unified 52px Header, 3-Skin Switcher ---------- */

/* Subtle engineer paper dot-matrix (3%) + top vertical aura */
:root {
  --dot-c: light-dark(rgba(15, 23, 42, 0.052), rgba(255, 255, 255, 0.048));
}
body {
  background-image:
    radial-gradient(76% 32% at 50% 0%, var(--vert-tint), transparent 72%),
    radial-gradient(var(--dot-c) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px;
}
body.is-empty .composer-inner {
  box-shadow: var(--elev), 0 0 64px oklch(65% 0.13 165 / 0.08);
}

/* E-Ink Braun/Dieter Rams mono skin: ivory paper + ink, single 5px vermilion live dot */
:root[data-skin="eink"] {
  --bg: #f4f3ee;
  --bg-soft: #eae8e0;
  --bg-raised: #faf9f5;
  --text: #141412;
  --text-dim: #3c3b38;
  --border: rgba(20, 20, 18, 0.18);
  --border-strong: rgba(20, 20, 18, 0.36);
  --accent: #141412;
  --accent-text: #faf9f5;
  --link: #141412;
  --bubble-user: #e6e4dc;
  --code-bg: #eeede6;
  --hl-cm: #4a4945;
  --hl-str: #141412;
  --hl-kw: #141412;
  --hl-flg: #33322f;
  --hl-num: #141412;
  --vert-tint: transparent;
  --dot-c: rgba(20, 20, 18, 0.055);
  --elev: none;
  --ring: 0 0 0 2px rgba(20, 20, 18, 0.35);
}
:root[data-skin="eink"] .skin-dot,
:root[data-skin="eink"] .code-dot,
:root[data-skin="eink"] .gate-meter i:last-child {
  background: #c84b31;
  border-color: #c84b31;
}

/* Unified 52px zero-line header -> locked 3-col grid so controls never jump across pages */
.topbar-unified {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 52px;
  padding: 0 18px;
  gap: 14px;
  border-bottom-color: transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), backdrop-filter 0.2s var(--ease);
}
.topbar-unified .brand-wrap { justify-self: start; }
.topbar-unified .topbar-links { justify-self: center; }
.topbar-unified .topnav { justify-self: end; }
.topbar-unified.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}

/* Design Director micro-details: raised keycaps, branded selection, watchmaker focus, 6px scrollbar, CAD ticks, View Transitions */
::selection {
  background: oklch(0.65 0.13 158 / 0.18);
}
:focus-visible {
  outline: 2px solid oklch(0.55 0.13 158 / 0.45);
  outline-offset: 2px;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
  background: light-dark(rgba(22, 22, 20, 0.12), rgba(255, 255, 255, 0.12));
  border: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: light-dark(rgba(22, 22, 20, 0.26), rgba(255, 255, 255, 0.26));
  border: 0;
}
kbd, .cmdk-btn kbd {
  font-size: 11px;
  font-family: var(--font-mono);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.starter-card .sc-lbl {
  opacity: 0.78;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.starter-card:hover .sc-lbl {
  opacity: 1;
}
/* CAD registration corner marks on visual scenes */
.scene-card::before,
.scene-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  opacity: 0.16;
  background:
    linear-gradient(var(--text), var(--text)) left top / 5px 1px no-repeat,
    linear-gradient(var(--text), var(--text)) left top / 1px 5px no-repeat,
    linear-gradient(var(--text), var(--text)) right top / 5px 1px no-repeat,
    linear-gradient(var(--text), var(--text)) right top / 1px 5px no-repeat,
    linear-gradient(var(--text), var(--text)) left bottom / 5px 1px no-repeat,
    linear-gradient(var(--text), var(--text)) left bottom / 1px 5px no-repeat,
    linear-gradient(var(--text), var(--text)) right bottom / 5px 1px no-repeat,
    linear-gradient(var(--text), var(--text)) right bottom / 1px 5px no-repeat;
}
.scene-card::after { display: none; }
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
.topbar-unified .topnav {
  position: static;
}
.topbar-unified .topbar-links {
  display: flex;
  align-items: center;
  gap: 18px;
  grid-column: auto;
}
.topbar-unified .topbar-links a {
  height: auto;
  padding: 4px 2px;
  border: 0;
  border-bottom: 1.5px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t), border-color var(--t);
}
.topbar-unified .topbar-links a:hover,
.topbar-unified .topbar-links a.on {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: transparent;
}
@media (max-width: 720px) {
  .topbar-unified { display: flex; justify-content: space-between; height: auto; flex-wrap: wrap; padding: 8px 14px 6px; row-gap: 6px; }
  .topbar-unified .topbar-links { gap: 10px; }
  .topbar-unified .topbar-links a { font-size: 12px; width: auto; }
}
@media (max-width: 540px) {
  .topbar-unified { height: auto; flex-wrap: wrap; padding: 8px 14px 6px; row-gap: 6px; }
  .topbar-unified .topbar-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }
  .topbar-unified .topbar-links a { font-size: 12px; padding: 2px 0; }
}

/* Interactive Spotlight: Scene SVG node hover -> Code Card lines highlight */
.code-block pre code.is-spotlit .cl {
  opacity: 0.3;
  transition: opacity 0.14s var(--ease), background 0.14s var(--ease);
}
.code-block pre code.is-spotlit .cl.is-hi-line {
  opacity: 1;
  background: oklch(0.65 0.13 158 / 0.12);
  box-shadow: inset 2px 0 0 var(--accent);
  border-radius: 2px;
}

/* Interactive 13-Gate Popover */
.layer-pill { cursor: pointer; }
.gate-popover {
  position: fixed;
  z-index: 80;
  width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: var(--elev);
  font-size: 12px;
  line-height: 1.45;
  animation: code-card-in 0.14s var(--ease) both;
}
.gate-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.gate-pop-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.gate-pop-list li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: 700;
}
.gate-pop-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
}
.gate-pop-foot a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.gate-pop-foot a:hover { text-decoration: underline; }
.ctxcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.ctxcrumb-bar[hidden] { display: none; }

/* 3-Skin Hardware Switcher icon-only (30x30px, 0px width jump across skins) */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.lang-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-raised);
}
.skin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.skin-ic { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.skin-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-raised);
}
.skin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  background: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
  flex: 0 0 auto;
}
:root[data-skin="eink"] .skin-dot {
  background: #111111;
  border-color: #111111;
}
@media (max-width: 560px) {
  .skin-btn .skin-lbl { display: none; }
  .skin-btn { width: 30px; padding: 0; justify-content: center; }
}

/* Geometric 3-bar hardware signal avatar (replaces eyes) */
.msg-bot .avatar {
  border-radius: 9px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  box-shadow: var(--elev);
}
.msg-bot .avatar .sig-mark {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}
.msg-bot .avatar .sig-mark rect {
  transform-box: fill-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  .msg-bot:has(.typing) .sig-b1 { animation: sig-pulse 0.72s var(--ease) infinite alternate; }
  .msg-bot:has(.typing) .sig-b2 { animation: sig-pulse 0.72s var(--ease) 0.14s infinite alternate; }
  .msg-bot:has(.typing) .sig-b3 { animation: sig-pulse 0.72s var(--ease) 0.28s infinite alternate; }
}
@keyframes sig-pulse {
  from { transform: scaleY(0.45); opacity: 0.45; }
  to { transform: scaleY(1.15); opacity: 1; }
}

/* ---------- 800% Optical Lens 10/10 Polish ---------- */

/* 1. Naked 13/13 gate badge on paper + zero green focus leak in E-Ink */
body.is-empty .hero-pill {
  background: transparent;
  border: 0;
  padding: 4px 0;
  margin-bottom: 10px;
}
:root[data-skin="eink"] :focus-visible {
  outline: 2px solid rgba(20, 20, 18, 0.45);
}
:root[data-skin="eink"] ::selection {
  background: rgba(20, 20, 18, 0.14);
}

/* 3 & 4. Geometric unity (14px composer + 8px concentric send) + depth hierarchy */
.composer-inner {
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  border-color: var(--border-strong);
}
#send {
  border-radius: 8px;
  border: 1px solid var(--accent);
}
#send:disabled {
  opacity: 1;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: light-dark(rgba(20, 20, 18, 0.36), rgba(255, 255, 255, 0.34));
  cursor: default;
}
.starter-card {
  background: light-dark(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.025));
  border-color: var(--border);
  box-shadow: none;
}
.starter-card:hover {
  background: var(--bg-raised);
  border-color: var(--border-strong);
  box-shadow: 0 2px 10px rgba(20, 20, 18, 0.05);
}

/* 5. Optical center (44-46%) + Swiss typographic manifesto H1 */
body.is-empty .composer {
  display: flex;
  flex-direction: column;
  padding-bottom: 7vh;
}
body.is-empty .composer-inner {
  order: 1;
  width: 100%;
}
body.is-empty .omnibar {
  order: 2;
  margin: 8px auto 0;
}
body.is-empty .suggestbox {
  position: static;
  order: 2;
  width: 100%;
  margin: 8px auto 0;
}
body.is-empty .starter-grid {
  order: 3;
  width: 100%;
}
body.is-empty .hero-card h1 {
  font-size: clamp(28px, 4.4vw, 38px);
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.16;
  margin-bottom: 10px;
}

/* 6. Discreet viewport-anchored zero-state footer + clean hover-only link */
body.is-empty .composer-note {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0 auto;
  font-size: 12.5px;
  opacity: 0.78;
  transition: opacity var(--t);
}
body.is-empty .composer-note:hover { opacity: 1; }
.composer-note a {
  text-decoration: none;
}
.composer-note a:hover {
  text-decoration: underline;
}

/* 7. Unified 7px soft-rect header geometry (squircle F, 28px controls, no inner kbd border) */
.brand-dot {
  border-radius: 7px;
  width: 26px;
  height: 26px;
}
.brand-tag {
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  margin-top: 0;
}
.cmdk-btn,
.skin-btn {
  height: 28px;
  border-radius: 7px;
}
.cmdk-btn kbd {
  border: 0;
  box-shadow: none;
  background: light-dark(rgba(20, 20, 18, 0.06), rgba(255, 255, 255, 0.08));
  padding: 2px 5px;
}

/* Zero-jump geometry: stable scrollbar gutter + reserved SVG scene aspect-ratio + anti-shift copy + 44px touch targets */
html,
.chat {
  scrollbar-gutter: stable;
}
.scene-svg {
  aspect-ratio: 680 / 240;
}
button.cmdk-item {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.copy-qa-btn { min-width: 104px; justify-content: center; }
.copy-code-btn { min-width: 78px; justify-content: center; }
@media (pointer: coarse) {
  .cmdk-btn, .skin-btn, .edit-prompt-btn, #send { position: relative; }
  .cmdk-btn::after, .skin-btn::after, .edit-prompt-btn::after, #send::after {
    content: "";
    position: absolute;
    inset: -8px;
  }
}

/* Third-party authoritative link: always last, max 1, distinct color + static warning tooltip */
.ref3p-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
}
.ref3p-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--link-3p) 28%, transparent);
  background: color-mix(in srgb, var(--link-3p) 6%, transparent);
  color: var(--link-3p) !important;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: border-color var(--t), background var(--t);
}
.ref3p-link:hover,
.ref3p-link:focus-visible {
  border-color: var(--link-3p);
  background: color-mix(in srgb, var(--link-3p) 11%, transparent);
}
.ref3p-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--link-3p) 14%, transparent);
}
.ref3p-ext {
  font-size: 12px;
  opacity: 0.8;
}
.ref3p-link::before {
  content: attr(data-warn);
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  z-index: 30;
  max-width: min(320px, 85vw);
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}
.ref3p-link:hover::before,
.ref3p-link:focus-visible::before {
  opacity: 1;
}
:root[data-skin="eink"] .ref3p-link {
  --link-3p: #3c3b38;
  border-style: dashed;
  background: transparent;
}

/* ---------- Ecosystem micro-switcher (FAQ / Coder) ---------- */
.chip.chip-accent {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.chip.chip-accent:hover {
  background: var(--accent);
  color: var(--accent-text);
}
.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.brand-wrap .brand {
  text-decoration: none;
  color: inherit;
}
.brand-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.brand-switch > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.brand-switch > summary::-webkit-details-marker { display: none; }
.brand-switch > summary:hover {
  border-color: var(--accent);
  color: var(--text);
}
.brand-switch .sw-caret {
  font-size: 9px;
  opacity: 0.55;
}
.brand-switch[open] .sw-caret,
.brand-switch > summary:hover .sw-caret {
  opacity: 1;
}
.brand-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  box-shadow: var(--elev);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bm-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}
.bm-item strong { display: block; font-size: 13px; font-weight: 600; }
.bm-item small { display: block; font-size: 11.5px; color: var(--text-dim); font-family: var(--font-mono); }
.bm-item:hover { background: var(--bg-soft); }
.bm-item.is-cur { background: var(--bg-soft); cursor: default; }
.bm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  flex: 0 0 auto;
}
.bm-dot.on {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Static hero pill external arrow (zero hover motion) ---------- */
.hero-pill .pill-ext {
  opacity: 0.45;
  transition: opacity var(--t);
}
.hero-pill:hover .pill-ext {
  opacity: 1;
}

/* ---------- Topbar Chat pill on static pages (aligned with CmdK & Skin) ---------- */
.topnav a.topnav-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.topnav a.topnav-chat:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-raised);
}
@media (max-width: 640px) {
  .topnav a.topnav-chat span { display: none; }
  .topnav a.topnav-chat { padding: 0 8px; }
}

/* ---------- 1-click Copy button on static <pre> and /tools/ output ---------- */
.cmd-card pre,
.page pre {
  position: relative;
  padding-right: 76px;
}
.pre-copy-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-raised);
  color: var(--text-dim);
  font: 500 11.5px/1.3 var(--font-sans);
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.pre-copy-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.pre-copy-btn.copied {
  border-color: var(--accent);
  color: var(--accent);
}
.tool-out-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.tool-copy-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font: 500 12.5px/1.2 var(--font-sans);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.tool-copy-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-raised);
}
.tool-copy-btn.copied {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Editorial link affordance on static pages (incl. E-Ink) ---------- */
.cmd-rel a,
.related a {
  text-decoration: underline !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--link-ul, currentColor);
}
.cmd-rel a:hover,
.related a:hover {
  text-decoration-color: currentColor;
}

/* ---------- Zero Fake & Credibility (instant <1ms fade, disambig, Cmd+K mark) ---------- */
@keyframes msg-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .msg-bot .body { animation: msg-in 120ms ease-out; }
}
body:not(.is-empty) .composer-note {
  display: none;
}
.chip code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 4px;
}
.match-disambig {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}
.match-disambig strong { color: var(--text); font-weight: 600; }
.disambig-btn {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--link);
  font: 500 12.5px/1.3 var(--font-sans);
  cursor: pointer;
}
.disambig-btn:hover { border-color: var(--accent); color: var(--text); }
.cmdk-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cmdk-title mark {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------- Comfortable ~120% Editorial Reading Scale & Protagonist Composer ---------- */
.msg,
.composer-inner,
.suggestbox,
.omnibar,
.page,
.sitefoot-in {
  max-width: 840px;
}
body.is-empty .composer-inner {
  min-height: 58px;
  padding: 10px 12px 10px 18px;
  border-color: color-mix(in srgb, var(--text-dim) 45%, var(--border));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}
#input {
  font-size: 17px;
}
.hero-card h1 {
  font-size: clamp(26px, 4.6vw, 40px);
}
.topbar-links a {
  font-size: 14px;
}
.msg-bot .content,
.msg-user .bubble,
.page .answer,
.page .intro {
  font-size: 17.5px;
  line-height: 1.66;
}
.msg-bot .content pre,
.page .answer pre,
.cmd-card pre {
  font-size: 14.5px;
  line-height: 1.6;
}
.chip {
  font-size: 15px;
  padding: 9px 15px;
}
@media (max-width: 640px) {
  .msg-bot .content,
  .msg-user .bubble,
  .page .answer,
  .page .intro {
    font-size: 16.5px;
    line-height: 1.62;
  }
  .msg-bot .content pre,
  .page .answer pre,
  .cmd-card pre {
    font-size: 14px;
  }
  #input {
    font-size: 16px;
  }
}

/* ---------- Desktop 125% Editorial Scale (>= 1100px, MacBook Pro M4 fullscreen) ---------- */
@media (min-width: 1100px) {
  .msg,
  .composer-inner,
  .suggestbox,
  .omnibar,
  .starter-grid,
  .page,
  .sitefoot-in {
    max-width: 900px;
  }
  .hero-card h1 {
    font-size: 44px;
  }
  .topbar-links a {
    font-size: 15px;
  }
  body.is-empty .composer-inner {
    min-height: 62px;
  }
  #input {
    font-size: 18px;
  }
  .msg-bot .content,
  .msg-user .bubble,
  .page .answer,
  .page .intro {
    font-size: 18.5px;
    line-height: 1.68;
  }
  .msg-bot .content pre,
  .page .answer pre,
  .cmd-card pre {
    font-size: 15.5px;
    line-height: 1.62;
  }
  .chip {
    font-size: 15.5px;
    padding: 10px 16px;
  }
}

/* ---------- Mobile Precision (<= 640px & touch targets >= 44px) ---------- */
@media (max-width: 640px) {
  body.is-empty .hero-card .hero-sub,
  .composer-note {
    display: none;
  }
  .hero-pill {
    white-space: nowrap;
    max-width: 100%;
    font-size: 11.5px;
    gap: 6px;
    padding: 5px 10px;
  }
  .hero-pill .pill-track {
    display: none;
  }
  .topbar-links a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
  }
  .cmdk-btn,
  .skin-btn,
  .topnav a.topnav-chat {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
  .brand-wrap .brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .brand-switch > summary {
    min-height: 36px;
    padding: 0 8px;
  }
  .crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ---------- Procedural Ambient Margin Topology Field (desktop >= 1120px) ---------- */
#ambient-field {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  contain: strict;
}
@media (min-width: 1120px) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #ambient-field {
    display: block;
  }
}
:root[data-skin="eink"] #ambient-field {
  display: none !important;
}
.chat,
.composer {
  position: relative;
  z-index: 1;
}

/* ---------- print: entries and cheat-sheets are runbooks ---------- */
@media print {
  #ambient-field,
  .topbar, .statbar, .sitefoot, .qa-actions, .ask, .ask-box, .page-nav,
  .toc, .composer, .chips, .crumbs, .tool-ex, .prog, .step-check { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page, main.page { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .page .answer a::after, .cmd-rel a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  pre, .cmd-card, .steps li { box-shadow: none !important; border: 1px solid #bbb !important; break-inside: avoid; }
  .cmd-card { page-break-inside: avoid; }
}

/* @fabgpt-provenance-end | file:style.css | fp:0c58ebc7e326dab3 | https://chat.fabriziosalmi.com/ */
