:root {
  color-scheme: dark;
  --bg: #0b0c07;
  --sidebar: #0e0f09;
  --panel: #11120b;
  --panel-2: #16170e;
  --text: #f1f2e6;
  --muted: #a7aa8e;
  --faint: #6e715c;
  --line: rgba(232, 236, 196, .12);
  --line-strong: rgba(232, 236, 196, .22);
  --lime: #d4da5a;
  --gold: #c9a75a;
  /* Corrections are apricot; asks are lime. */
  --apricot: #f0ad74;
  --danger: #f0a58a;
  --display: "Funnel Display", ui-sans-serif, system-ui, sans-serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
/* One workspace document: the sidebar, a top bar, then either the playground or an account view. */
#workspace-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; background: var(--bg); }
/* The playground is two columns: the demo card with the input under it, then the history. */
#chat-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); background: var(--bg); }
#input-column { order: 2; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 22px 0; }
#chat-workspace > #conversation { order: 1; margin-right: 24px; border-right: 1px solid var(--line); }
#account-workspace { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#auth-view { flex: 1; height: 100dvh; overflow-y: auto; }
/* Element defaults stay inside the workspace chrome so Clerk's components keep their own styles. */
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) :is(button, input, textarea, select) { font: inherit; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) :is(button, select) { cursor: pointer; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) :is(button, a) { -webkit-tap-highlight-color: transparent; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) a { color: inherit; text-decoration: none; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) button { border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; color: var(--text); background: transparent; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) :is(button, select):disabled { opacity: .5; cursor: wait; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) :is(button, a, textarea):focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) select:focus-visible { outline: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { flex: 0 0 auto; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: rgba(11,12,7,.9); backdrop-filter: blur(18px); }
.workspace-title { display: flex; gap: 11px; align-items: center; }
.workspace-title > span { display: grid; gap: 4px; }
.workspace-title small { color: var(--faint); font: 500 9.5px var(--mono); letter-spacing: .13em; }
.workspace-title strong { font: 600 20px/1 var(--display); }
.header-actions { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12.5px; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) select { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: var(--panel); color: var(--text); }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) select option { background: var(--panel); color: var(--text); }

#conversation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
#messages { width: min(900px, 100%); margin: 0 auto; padding: 32px 24px; }
#welcome { width: min(620px, 100%); margin: auto; padding: 10vh 0 7vh; text-align: center; color: var(--muted); line-height: 1.7; }
.eyebrow, .message .speaker { color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
#welcome h1 { margin: 9px 0 14px; color: var(--text); font: 620 clamp(32px,5vw,50px)/1 var(--display); letter-spacing: -.04em; }
.message { width: fit-content; max-width: min(760px, 92%); margin: 0 0 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: var(--panel-2); overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.message.user { margin-left: auto; border: 0; border-radius: 15px 15px 4px 15px; background: var(--lime); color: #11120a; }
.message .speaker { display: block; margin-bottom: 7px; }
.message.user .speaker { color: rgba(17,18,10,.62); text-align: right; }
.message .body { white-space: pre-wrap; }
.result-meta { margin-top: 9px; color: var(--faint); font-size: 11.5px; }
.message.user .result-meta { color: rgba(17,18,10,.62); }
.message.abstention { border-color: rgba(201,167,90,.28); }
/* A reply's first line takes the color of what it answers: asks lime, corrections apricot. */
.message.ask-reply > .body { color: var(--lime); }
.message.correction-reply > .body { color: var(--apricot); }
.message.investigable { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.message.investigable:hover, .message.investigable:focus-visible, .message.investigating { border-color: rgba(212,218,90,.35); background: #1b1d12; outline: 0; }
.message.tool-simulation { min-width: 220px; border-color: rgba(212,218,90,.25); background: rgba(212,218,90,.055); }
.message.tool-simulation .body { color: var(--text); font: 500 13px var(--mono); }
.tool-call-state { margin-top: 8px; color: var(--lime); font-size: 11.5px; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) details { margin-top: 11px; padding-top: 8px; border-top: 1px solid var(--line); }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.evidence { margin-top: 9px; color: var(--muted); font: 400 12px/1.55 var(--mono); }
.evidence pre { overflow: auto; padding: 12px; border-radius: 9px; background: var(--bg); }
.evidence code { font-size: 12px; }
.evidence table { display: block; overflow: auto; border-collapse: collapse; }
.evidence td, .evidence th { padding: 6px; border: 1px solid var(--line-strong); }
.evidence img { max-width: 100%; }

#composer-panel { flex: 0 0 auto; }
.composer-inner { width: 100%; padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(17,18,11,.98); box-shadow: 0 16px 55px rgba(0,0,0,.32); }
.toolbar { display: flex; align-items: center; gap: 6px; margin: 7px 3px 0; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.modes { display: flex; gap: 4px; }
.toolbar button { border-color: transparent; padding: 5px 10px; color: var(--muted); }
.toolbar button[aria-pressed="true"] { background: rgba(255,255,255,.07); color: var(--text); }
.toolbar label { display: flex; align-items: center; gap: 7px; }
.toolbar input { accent-color: var(--lime); }
.confidence-label { margin-left: auto; color: var(--muted); }
.confidence-label select { padding: 4px 7px; font-size: 12px; }
.input-row { display: flex; gap: 7px; align-items: flex-end; padding: 5px; border: 1px solid var(--line-strong); border-radius: 10px; background: #202217; transition: border-color .15s ease, box-shadow .15s ease; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) textarea { width: 100%; min-width: 0; resize: none; max-height: 40vh; overflow-y: auto; border: 0; outline: 0; padding: 5px 7px 6px; background: transparent; color: #fafbed; line-height: 22px; }
:where(#sidebar, .topbar, #chat-workspace, #history-dialog, #library) textarea::placeholder { color: #8c9073; }
#submit { flex: 0 0 auto; height: 40px; padding: 0 15px; border: 0; border-radius: 8px; background: var(--lime); color: #10110a; font-weight: 650; }
#submit:hover { background: #e0e669; }
/* A pending correction: the button says Correct, in gold, so it is clear the next message teaches. */
#submit.correcting { background: var(--apricot); color: #1a1209; }
#submit.correcting:hover { background: #f5bd8c; }
#composer.correcting .input-row { border-color: rgba(240,173,116,.55); }
#composer.correcting .input-row:focus-within { border-color: var(--apricot); box-shadow: 0 0 0 3px rgba(240,173,116,.16); }
.message.user.correction { background: var(--apricot); color: #1a1209; }
.message.user.correction .speaker { color: rgba(26,18,9,.62); }
#submit span { margin-left: 8px; }
[data-tooltip] { position: relative; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 30; width: max-content; max-width: 250px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #282a1d; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.45); font: 11.5px/1.4 var(--sans); text-align: left; white-space: normal; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .12s ease, transform .12s ease; }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.control-tooltip { display: flex; align-items: center; gap: 7px; border-radius: 6px; outline-offset: 3px; }
.tutorial-card { flex: 0 0 auto; padding: 16px; border: 1px solid rgba(212,218,90,.34); border-radius: 14px; background: #202217; color: var(--muted); box-shadow: 0 24px 70px rgba(0,0,0,.55); font-size: 13px; }
.tutorial-kicker { display: block; margin-bottom: 7px; color: var(--faint); font: 500 9.5px var(--mono); letter-spacing: .13em; }
.tutorial-card strong { display: block; color: var(--lime); font: 600 16px/1.2 var(--display); }
.tutorial-card p { margin: 8px 0 0; line-height: 1.5; }
#guide-exit { margin-top: 12px; padding: 5px 10px; border-color: var(--line); color: var(--muted); font-size: 12px; }
#guide-exit:hover { color: var(--text); }
.guide-next { display: block; margin-top: 10px; color: var(--lime); font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.tutorial-target { position: relative; z-index: 9; border-color: var(--lime) !important; box-shadow: 0 0 0 2px rgba(212,218,90,.32), 0 0 24px rgba(212,218,90,.16) !important; }
/* The control a demo step is waiting for pulses until it is pressed. */
#submit.tutorial-target { animation: guide-pulse 1.4s ease-in-out infinite; }
@keyframes guide-pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(212,218,90,.35), 0 0 0 0 rgba(212,218,90,.4); } 50% { box-shadow: 0 0 0 2px rgba(212,218,90,.35), 0 0 0 8px rgba(212,218,90,0); } }
@media (prefers-reduced-motion: reduce) { #submit.tutorial-target { animation: none; } }
#error { padding: 9px 2px; color: var(--danger); font-size: 13px; white-space: pre-wrap; }
#notice { padding: 7px 2px; color: var(--lime); font-size: 12px; }

.sidebar { flex: 0 0 286px; width: 286px; overflow-y: auto; padding: 22px 16px 18px; border-right: 1px solid var(--line); background: var(--sidebar); color: var(--text); font-size: 13px; display: flex; flex-direction: column; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 20px/1 var(--display); }
.brand img { width: 22px; height: 25px; }
.sidebar nav { display: grid; gap: 3px; margin: 0 0 21px; }
.sidebar-caption { display: block; padding: 0 9px 7px; color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .13em; }
.sidebar-workspace { margin: 0 0 13px; padding: 0 2px; border: 0; }
.sidebar-workspace > summary { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0 7px 7px; border: 0; list-style: none; color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.sidebar-workspace > summary::-webkit-details-marker { display: none; }
.sidebar-workspace > summary .disclosure-mark { color: var(--muted); font-size: 14px; }
.sidebar-workspace:not([open]) > summary .disclosure-mark { font-size: 0; }
.sidebar-workspace:not([open]) > summary .disclosure-mark::after { content: "+"; font-size: 14px; }
.sidebar-workspace .primary-nav { margin-bottom: 13px; }
.sidebar-workspace .sidebar-model { margin-bottom: 0; }
.sidebar nav a, .sidebar nav button { width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; }
.primary-nav a, .primary-nav button { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 7px; }
.nav-icon { color: var(--faint); text-align: center; }
.demo-nav { gap: 7px !important; }
.sidebar .demo-card { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; align-items: center; min-height: 58px; padding: 9px 10px; border-color: var(--line); background: rgba(255,255,255,.02); }
.sidebar .demo-card:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.sidebar .demo-card[aria-current="page"] { border-color: rgba(212,218,90,.36); background: rgba(212,218,90,.09); }
.demo-card strong { display: block; color: var(--text); font-weight: 560; }
.demo-glyph { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(212,218,90,.08); color: var(--lime); font: 15px var(--mono); }
.sidebar nav a:hover, .sidebar nav button:hover { color: var(--text); background: rgba(255,255,255,.035); }
.sidebar nav [aria-current] { border-color: rgba(212,218,90,.22); background: rgba(212,218,90,.08); color: var(--text); }
.sidebar small { display: block; margin-top: 3px; color: var(--faint); font-size: 11px; }
.sidebar-model { display: grid; gap: 7px; margin: 0 0 13px; padding: 0 2px; }
.sidebar-model .sidebar-caption { padding-left: 7px; padding-bottom: 0; }
.sidebar-model select { width: 100%; background: var(--bg); }
.sidebar-model button { width: 100%; padding: 7px 10px; color: var(--muted); text-align: left; font-size: 12px; }
/* Workspace (account) and Playground sections; the playground submenu shows only inside the playground. */
.sidebar .sidebar-section { gap: 4px; margin: 0 0 18px; }
.sidebar-section > .sidebar-caption { padding-left: 9px; }
.playground-menu { display: grid; gap: 14px; margin: 8px 0 0 13px; padding: 4px 0 0 11px; border-left: 1px solid var(--line); }
.playground-menu .submenu a { padding-block: 6px; font-size: 12.5px; }
.playground-menu .submenu [aria-current="page"] { border-color: transparent; background: rgba(212,218,90,.08); color: var(--text); }
.sidebar .primary-nav a[data-nav="playground"][aria-current="true"]:not([data-submenu]) { border-color: transparent; background: transparent; color: var(--text); font-weight: 560; }
.demo-nav { display: grid; }
.session-card { margin: 0 2px 4px; padding: 12px; border: 1px solid rgba(212,218,90,.23); border-radius: 11px; background: rgba(212,218,90,.055); }
.session-card .sidebar-caption { padding: 0 0 8px; }
#learner-name { display: block; color: var(--lime); font: 11px/1.45 var(--mono); overflow-wrap: anywhere; }
.session-card p { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; padding: 14px 9px 0; border-top: 1px solid var(--line); }
.sidebar .sidebar-footer nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.sidebar-footer a { color: var(--faint); font-size: 11.5px; }
.sidebar-footer a:hover { color: var(--text); }
.sidebar .sidebar-footer nav a { width: auto; padding: 0; border: 0; border-radius: 0; color: var(--faint); font-size: 11.5px; }
.sidebar .sidebar-footer nav a:hover { color: var(--text); background: none; }
.powered-by { margin: 0; color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .04em; }
.account-control { position: relative; }
.account-icon { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 50%; }
.account-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-menu { position: absolute; z-index: 40; top: calc(100% + 9px); right: 0; width: 220px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 11px; background: #17180f; box-shadow: 0 22px 70px rgba(0,0,0,.6); }
.account-menu strong { display: block; padding: 9px 10px; color: var(--text); font-weight: 550; overflow-wrap: anywhere; }
.account-menu a, .account-menu button { width: 100%; display: block; padding: 8px 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; text-align: left; font-size: 13px; }
.account-menu a:hover, .account-menu button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.account-menu button { border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; margin-top: 5px; padding-top: 10px; }
.message-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.suggestion-chip { color: var(--lime); border-color: rgba(212,218,90,.25); background: rgba(212,218,90,.06); }
#close-sidebar, #toggle-sidebar, #sidebar-backdrop { display: none; }
.playground-actions { display: flex; gap: 9px; align-items: center; }
body.presentation .sidebar { display: none; }

.raw-response pre, .audit-event pre { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font: 12px/1.5 var(--mono); }
#history-dialog { width: min(850px, calc(100% - 30px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 22px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font: 600 28px/1 var(--display); }
.audit-event { margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; }
.dialog-intro { margin: 10px 0 0; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.audit-event .body { white-space: pre-wrap; overflow-wrap: anywhere; }
#history-error, #library-error { margin-top: 12px; color: var(--danger); white-space: pre-wrap; }
#library p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.library-card { display: block; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.library-current { border-color: rgba(212,218,90,.22); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading h3 { margin: 3px 0 0; font: 600 21px/1.15 var(--display); }
.section-kicker { color: var(--faint); font: 500 9.5px var(--mono); letter-spacing: .13em; }
.status-pill { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.status-pill[data-enabled="true"] { border-color: rgba(212,218,90,.28); color: var(--lime); }
.status-pill[data-enabled="false"] { color: var(--gold); }
.library-expander > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; list-style: none; }
.library-expander > summary::-webkit-details-marker { display: none; }
.library-expander > summary > span:first-child { display: grid; gap: 4px; }
.library-expander > summary strong { color: var(--text); font: 560 17px var(--display); }
.training-tools-body { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
#library label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
#library input { max-width: 100%; color: var(--text); }
#library textarea { min-height: 140px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--bg); }
#model-details { color: var(--muted); font: 12px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.library-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13px; }
.saved-sequence, .stored-artifact { padding: 14px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: 13px; }
.saved-sequence:last-child, .stored-artifact:last-child { border-bottom: 0; }
.stored-artifact code { color: var(--text); font-size: 11px; overflow-wrap: anywhere; }
.library-link { display: inline-block; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--lime); }
.library-link:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); }

* { scrollbar-color: #383b29 var(--bg); }
@media (max-width: 1000px) {
  .sidebar { flex-basis: 250px; width: 250px; padding-inline: 12px; }
  .topbar, .header-actions { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  #toggle-sidebar, #close-sidebar { display: inline-block; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(300px, 85vw); box-shadow: 24px 0 60px rgba(0,0,0,.55); }
  body.sidebar-open .sidebar { display: flex; }
  body.sidebar-open #sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 19; width: 100%; border: 0; border-radius: 0; background: rgba(0,0,0,.66); }
  .topbar { min-height: 0; padding: 11px 14px; }
  .header-actions { width: auto; }
  #presentation { font-size: 11px; }
}
/* Narrow screens stack the columns: demo card and input first, the history scrolling below. */
@media (max-width: 960px) {
  #chat-workspace { display: flex; flex-direction: column; }
  #input-column { flex: 0 1 auto; max-height: 60%; padding: 12px 12px 10px; gap: 10px; }
  #input-column { order: 0; }
  #chat-workspace > #conversation { order: 1; flex: 1 1 0; margin-right: 0; border-right: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .header-actions { width: auto; margin-left: auto; }
  #presentation { display: none; }
  #messages { padding: 20px 14px 24px; }
  #welcome { padding-block: 7vh; }
  .composer-inner { padding: 7px; }
  .toolbar { gap: 3px; }
  .toolbar button { padding: 5px 8px; }
  [data-tooltip]::after { position: fixed; right: 10px; bottom: 112px; left: 10px; width: auto; max-width: none; transform: translateY(4px); }
  [data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { transform: translateY(0); }
  .confidence-label { gap: 4px; }
  #submit { padding: 0 13px; }
  #submit span { display: none; }
  #prompt { font-size: 16px; }
  .tutorial-card { padding: 12px; font-size: 12px; }
  .message { max-width: 96%; }
  #history-dialog { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
/* Automatic recovery copies on the Training sequences page. */
.recovery-policy { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.recovery-note { margin: 4px 0 0; color: var(--gold); font-size: 12px; }
#demo-list { display: contents; }
#composer.correcting textarea:focus-visible { outline-color: var(--apricot); }

/* Destructive library actions read apricot-red and stay quiet until hovered. */
.library-actions button.danger-action { color: var(--danger); border-color: rgba(240,165,138,.3); background: transparent; }
.library-actions button.danger-action:hover:not(:disabled) { background: rgba(240,165,138,.08); }
/* The history's own Copy button stays at the top of the scrolling history. */
#conversation .history-actions { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 8px 4px 0; pointer-events: none; }
#conversation .history-actions button { pointer-events: auto; }
/* Training-sequence assistant: a chat card above the composer that proposes sequences for Teach. */
.assistant-card { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel); }
.assistant-card[hidden] { display: none; }
.assistant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.assistant-head strong { display: block; color: var(--lime); font: 600 16px/1.2 var(--display); }
.assistant-buttons { display: flex; gap: 6px; }
.assistant-buttons button { padding: 4px 10px; font-size: 12px; }
#assistant-log { display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; font-size: 13.5px; }
#assistant-log .muted, .assistant-send-row .muted { color: var(--muted); }
#assistant-log p { margin: 0; }
.assistant-message { padding: 8px 10px; border-radius: 10px; background: var(--panel-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-message.user { align-self: flex-end; max-width: 90%; background: rgba(212,218,90,.12); }
.assistant-message.error { color: var(--danger); }
.assistant-progress { margin-top: 6px; font-size: 12px; }
.assistant-progress:empty { display: none; }
.assistant-proposal { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid rgba(212,218,90,.34); border-radius: 10px; }
.assistant-proposal strong { color: var(--lime); font-size: 13px; }
.assistant-proposal pre { margin: 0; max-height: 220px; overflow: auto; padding: 8px; border-radius: 8px; background: var(--bg); font: 12px/1.5 var(--mono); white-space: pre; }
.assistant-proposal button { align-self: flex-start; background: var(--lime); color: #0b0c07; border-color: var(--lime); }
#assistant-form { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.assistant-send-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
