/* ---------- AI (section 26) ----------
   Only for the accounts that have it. Nothing of it has a colour of its own: the depth colour stays Z's. The menu's AI
   group, the preview on an object, the box, and the Ask panel are the menu's, the dock's and the rail's own surfaces. */

/* The menu's group: a small head, then its actions two to a row, their names in the menu's column of names. */
.mai { display: grid; grid-template-columns: 1fr 1fr; padding-left: 24px; }
.mai-h {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; height: 24px; margin-left: -24px; padding: 1px 10px 0 8px; box-sizing: border-box;
  font: 500 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-q);
}
.mai-h svg { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
.mai .mi { min-width: 0; padding: 0 4px 0 10px; }
.mai .mi.w, .mai .mi.odd { grid-column: 1 / -1; }

/* A primary button in a dock-like row: ink on the surface's colour, the way the hud chip is. */
.ap-ok, .ab-go, .ak-go[type="submit"] { color: var(--surface); background: var(--ink); }
@media (hover: hover) { .ap-ok:hover, .ab-go:hover, .ak-go[type="submit"]:hover { color: var(--surface); background: color-mix(in srgb, var(--ink) 84%, var(--surface)); } }
.ap-ok:active, .ab-go:active, .ak-go[type="submit"]:active { box-shadow: none; background: color-mix(in srgb, var(--ink) 76%, var(--surface)); }

/* The preview: a still copy of the object with the answer in it, floating a little above the object, its outline
   dashed while it is only a proposal; and under it, in screen size, a bar like the dock. */
#aiprev { position: fixed; inset: 0; z-index: 11; pointer-events: none; }     /* over the guide, under the rail */
.ap-card { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ap-obj, .ap-obj:focus-within { box-shadow: var(--pop); outline: 1.25px dashed var(--ink-3); outline-offset: 5px; transition: none; }
.ap-obj.header { outline: 0; }
/* The object faded while the answer is thought out, a light passing under what it holds (its own ::before and ::after
   are its tally and marks, so the light is a background). */
.ap-obj.ap-wait > * { opacity: .38; }
.ap-obj.ap-wait {
  background-image: linear-gradient(100deg, transparent 35%, color-mix(in srgb, var(--ink) 7%, transparent) 50%, transparent 65%);
  background-size: 250% 100%; background-repeat: no-repeat; animation: ai-sheen 1.5s linear infinite;
}
@keyframes ai-sheen { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.ap-caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -.17em; background: var(--ink-2); animation: ai-blink 1s steps(1) infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }
@keyframes ai-blink-wk { 50% { --pulse: 0; } }
html.wk .ap-obj .ap-caret { animation-name: ai-blink-wk; opacity: var(--pulse); }    /* as .pic-try's (cards.css, html.wk) */
.ap-bar {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 2px; max-width: calc(100vw - 16px); padding: 3px; box-sizing: border-box;
  border-radius: 8px; pointer-events: auto; white-space: nowrap;
  background: var(--glass); box-shadow: var(--glass-sh);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  user-select: none; -webkit-user-select: none;
}
.ap-t { flex: none; padding: 0 8px 0 9px; font: 500 9.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.ap-s { flex: 0 1 auto; min-width: 0; padding-right: 8px; overflow: hidden; text-overflow: ellipsis; font: 500 12px/16px var(--f-ui); color: var(--ink-q); }
.ap-s:empty { display: none; }
.ap-s.err { color: var(--ink); white-space: normal; max-width: 300px; }
/* while it runs, the logo at work before the words (aiSay) is what moves */
:where(.ap-s, .ab-s, .gh-s, .ak-m) > .ai-mk { width: 1.35em; height: 1.35em; margin-right: .5em; vertical-align: -.32em; }
@keyframes ai-pulse { 50% { opacity: .45; } }

/* The box: a field on the menu's surface, a sparkle where an icon would be, a quiet line under it. */
#aibox {
  position: fixed; left: 0; top: 0; z-index: 31; width: 420px; max-width: calc(100vw - 16px); padding: 4px; box-sizing: border-box;
  border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule), var(--pop);
  cursor: grab; touch-action: none;      /* carried by all but its field and what takes a press, by a finger too (ai-box.js) */
}
#aibox .ab-in { cursor: text; }
#aibox.held, #aibox.held * { cursor: grabbing; }
:where(html.phone) #aibox { cursor: auto; touch-action: auto; }     /* on a phone (or a tablet) it stays at the top (PHONE) */
/* The field wraps and grows (abFit), the logo and the buttons by its last line. Past one line the box is multi: the
   field takes its whole width, the buttons go under it at the right, and it grows to a good part of the screen before it
   scrolls (a 100-character Chinese prompt used to scroll out of sight, two-thirds of the width beside the buttons). */
.ab-row { display: flex; align-items: flex-end; gap: 2px; }
.ab-row > .ab-g.mark { flex: none; width: 20px; height: 20px; margin: 0 2px 8px 6px; color: var(--ink-2); }
#aibox.run .ab-row > .ab-g.mark { color: var(--ink); }   /* thinking: the logo plays it (markAi) */
.ab-l { flex: none; align-self: flex-start; margin-top: 14px; padding: 1px 6px 0 2px; font: 500 9.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.ab-in {
  flex: 1; min-width: 0; height: 36px; max-height: min(320px, 42vh); padding: 7px 6px 7px 2px; box-sizing: border-box; border: 0; outline: none;
  resize: none; overflow-y: auto; scrollbar-width: thin; background: transparent;
  font: 400 14.5px/22px var(--f-ui); letter-spacing: -.005em; color: var(--ink);
}
.ab-in::placeholder { color: var(--ink-3); }
.ab-in:placeholder-shown { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }   /* empty: the hint on one line */
.ab-in:read-only { color: var(--ink-2); }
.ab-row .btn { height: 30px; margin-bottom: 3px; }
#aibox.multi .ab-row { flex-wrap: wrap; justify-content: flex-end; }
#aibox.multi .ab-row::after { content: ""; flex-basis: 100%; order: 1; }     /* the line break before the buttons */
#aibox.multi .ab-row > .btn { order: 2; }
#aibox.multi .ab-row > .ab-g.mark { align-self: flex-start; margin: 8px 2px 0 6px; }
.ab-ask { color: var(--ink-2); }
/* Speaking (ai-voice.js): the microphone by the buttons, in the box and the panel. Listening it is dark, its glyph
   becomes a meter (.lv: bars that rise with the voice, scaled by ai-voice.js) and it swells with the voice (--lv, 0 to
   1); while what was said is written down its glyph breathes. */
.vc-mic { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }   /* held on a phone: no selecting, no callout, no scrolling */
.vc-mic[hidden] { display: none; }
.vc-mic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.vc-mic:disabled { opacity: .45; cursor: default; }
.vc-mic[data-st="rec"], .vc-mic[data-st="rec"]:hover, .vc-mic[data-st="rec"]:active {
  color: var(--surface); background: var(--ink);
  box-shadow: 0 0 0 calc(1px + var(--lv, 0) * 7px) color-mix(in srgb, var(--ink) 16%, transparent); transition: box-shadow 90ms linear;
}
.vc-mic > * { grid-area: 1 / 1; }
.vc-lv { display: none; align-items: center; gap: 2px; height: 16px; }
.vc-lv i { width: 2.5px; height: 100%; border-radius: 2px; background: currentColor; transform: scaleY(.16); transition: transform 70ms linear; }
.vc-mic.lv[data-st="rec"] svg { visibility: hidden; }
.vc-mic.lv[data-st="rec"] .vc-lv { display: flex; }
.vc-mic[data-st="busy"] svg { animation: vc-breathe 1.1s ease-in-out infinite; }
@keyframes vc-breathe { 50% { opacity: .3; } }
/* What it makes from: a quiet token under the field, with × to make without it. */
.ab-pick { display: flex; margin: -1px 10px 7px 30px; }
.ab-pk { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; height: 24px; padding-left: 9px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--rule-2); font: 500 12px/24px var(--f-ui); color: var(--ink-2); }
.ab-pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-unpick { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-left: 1px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink-q); cursor: pointer; }
.ab-unpick svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4px; stroke-linecap: round; }
@media (hover: hover) { .ab-unpick:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); } }
.ab-unpick:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
#aibox.run .ab-unpick { visibility: hidden; }
.ab-s { margin: 0 10px 6px 30px; font: 500 12px/16px var(--f-ui); color: var(--ink-q); }
.ab-s.err { color: var(--ink); }
#aibox.run .btn.ab-go { color: var(--ink); background: var(--press-bg); box-shadow: var(--press); }     /* Stop */
/* Under the line while it is empty: a few things to ask for, as the menu's rows; then a foot on a hairline with the
   switch (a small track, ink when on) and Expand. */
.ab-ex { display: flex; flex-direction: column; padding: 2px 0 4px; }
.ab-k { display: flex; justify-content: space-between; margin: 2px 10px 4px 30px; font: 500 9.5px/16px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-q); }
.ab-k kbd { display: inline-block; margin-right: 4px; padding: 0 4px; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 3px; font: inherit; line-height: 13px; letter-spacing: 0; }
.ab-ex button {
  height: 30px; padding: 0 10px 0 30px; border: 0; border-radius: 5px; text-align: left; cursor: pointer;
  font: 400 13px/30px var(--f-ui); color: var(--ink-2); background: transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
@media (hover: hover) { .ab-ex button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); } }
.ab-ex button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ab-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 0; padding: 4px 0 0; border-top: 1px solid var(--rule); }
.ab-sw {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; border: 0; border-radius: 5px; cursor: pointer;
  font: 500 12.5px/1 var(--f-ui); color: var(--ink-2); background: transparent;
}
.ab-sw i { position: relative; flex: none; width: 24px; height: 14px; border-radius: 7px; background: var(--rule-2); transition: background-color 140ms ease-out; }
.ab-sw i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: translate 160ms cubic-bezier(.2,.8,.2,1); }
.ab-sw[aria-checked="true"] { color: var(--ink); }
.ab-sw[aria-checked="true"] i { background: var(--ink); }
.ab-sw[aria-checked="true"] i::after { translate: 10px 0; }
@media (hover: hover) { .ab-sw:hover { color: var(--ink); } }
.ab-sw:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ab-sw:disabled { opacity: .5; cursor: default; }
/* The model asked (ai.js aiModelMenu): a quiet menu, the size of the box's buttons. As wide as its row allows: each
   model's prices are in it, and in Chinese they need more than 24em. */
.ai-pick-model { flex: 0 1 auto; min-width: 0; max-width: 100%; height: 28px; padding: 0 22px 0 8px; border: 0; border-radius: 8px;
  font: 500 12px/28px var(--f-ui); color: var(--ink-2); background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23778' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3 4.5L6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 6px center / 10px;
  appearance: none; -webkit-appearance: none; field-sizing: content; cursor: pointer; text-overflow: ellipsis; }
@media (hover: hover) { .ai-pick-model:hover { color: var(--ink); background-color: color-mix(in srgb, var(--ink) 7%, transparent); } }
.ai-pick-model:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
/* Its list, open: in the look's own ink and paper. Chrome and Firefox draw a transparent menu's list on white, in the
   menu's ink; at night that is light grey on white, which can't be read. (Safari and phones use their own menus.) */
.ai-pick-model option { color: var(--ink); background-color: var(--surface); }
/* Its row: under the Make box's foot and the Ask panel's head, at the right; gone while there is nothing to choose. */
.ai-mrow { display: flex; justify-content: flex-end; align-items: center; gap: 2px; padding: 2px 4px 0; }
.ai-mrow:has(> select[hidden]), #aibox:not([data-mode="gen"]):not([data-mode="edit"]) .ab-mrow { display: none; }
.ai-mlabel { flex: none; font: 500 9.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-q); }
.ak-mrow { padding: 0 10px 4px; }
.ab-hist { margin-left: auto; height: 30px; color: var(--ink-2); }
.ab-hist:disabled { opacity: .5; }
/* The open board's row: its name in the labels' quiet capitals, then Expand, Change… and Polish (ai-ghost.js, ai-edit.js). */
.ab-bd { display: flex; align-items: center; gap: 2px; padding: 0 0 0 10px; }
.ab-bd[hidden] { display: none; }
.ab-bl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 9.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-q); }
.ab-bd .btn { display: flex; flex: none; align-items: center; gap: 6px; height: 30px; color: var(--ink-2); }
.ab-bd .btn[hidden] { display: none; }
.ab-bd svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4px; stroke-linecap: round; stroke-linejoin: round; }
.ab-bd .btn:disabled { opacity: .5; cursor: default; }

/* The Ask panel: the rail's raised glass at the right edge, the conversation in it, the field in a well at its foot. */
#ask {
  position: fixed; z-index: 13; right: calc(env(safe-area-inset-right, 0px) + 14px); top: calc(env(safe-area-inset-top, 0px) + 62px);
  display: flex; flex-direction: column; width: min(clamp(420px, 33vw, 540px), calc(100vw - 28px)); height: min(960px, calc(100vh - 62px - 14px)); min-height: 280px; box-sizing: border-box;
  border-radius: 18px; background: var(--glass); box-shadow: var(--glass-sh);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
/* As ChatGPT's (Jarred, 2026-11-06): its name in plain words, what it reads quieter beside it; the question a soft bubble at
   the right, the answer on the panel itself, set roomier; the field a rounded box with a round button. */
.ak-h { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px 22px; }
.ak-t { flex: none; font: 600 16px/22px var(--f-ui); letter-spacing: -.01em; color: var(--ink); }
.ak-s { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13px/22px var(--f-ui); color: var(--ink-q); }
.ak-new, .ak-hist { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.ak-hist[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--raise-sm), var(--edge); }
.ak-x {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px;
  color: var(--ink-2); background: transparent; cursor: pointer;
}
.ak-x svg { width: 12px; height: 12px; }
@media (hover: hover) { .ak-x:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 80%, transparent); } }
.ak-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.ak-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 22px; padding: 12px 22px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ak-0 { margin: auto 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
p.ak-0, .ak-0s { margin: 0; font: italic 400 15.5px/1.45 var(--f-display); color: var(--ink-2); font-optical-sizing: auto; }
.ak-0h { margin: 0; font: 600 21px/1.3 var(--f-ui); letter-spacing: -.02em; color: var(--ink); }
.ak-0s { max-width: 34ch; font-size: 15px; }
/* the questions to start with: soft pills, one to a line in the panel's width, asked with a press */
.ak-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.ak-tq { height: 34px; padding: 0 14px; border-radius: 999px; font: 400 13.5px/1 var(--f-ui); color: var(--ink-2);
  background: var(--surface); box-shadow: 0 0 0 1px var(--rule); white-space: nowrap; }
@media (hover: hover) { .ak-tq:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--rule-2); } }
.ak-tq:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ak-m { white-space: pre-wrap; overflow-wrap: anywhere; }
.ak-m.q {
  align-self: flex-end; max-width: 82%; padding: 9px 15px; border-radius: 20px; box-sizing: border-box;
  font: 400 15px/22px var(--f-ui); color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, var(--surface));
}
.ak-m.a { font: 400 15px/1.7 var(--f-ui); color: var(--ink); }
/* An answer's Markdown (ai-ask.js askMd), set small, as the panel's words are: its lines kept as they were, a code block
   in a well that scrolls sideways, a table that does too, a formula typeset (one on a line of its own centred). */
.ak-m.a > :first-child { margin-top: 0; }
.ak-m.a > :last-child { margin-bottom: 0; }
.ak-m.a :is(p, ul, ol, blockquote, pre, .rd-tw) { margin: 0 0 10px; }
.ak-m.a :is(h1, h2, h3, h4, h5, h6) { margin: 18px 0 6px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.ak-m.a h1 { font-size: 18px; } .ak-m.a h2 { font-size: 16.5px; } .ak-m.a h3 { font-size: 15px; } .ak-m.a :is(h4, h5, h6) { font-size: 14.5px; }
.ak-m.a :is(ul, ol) { padding-left: 1.5em; }
.ak-m.a li { padding-left: .15em; }
.ak-m.a li + li { margin-top: 4px; }
.ak-m.a strong { font-weight: 600; }
.ak-m.a li > :is(ul, ol, p, pre, blockquote, .rd-tw) { margin: 3px 0 0; }
.ak-m.a li::marker { color: var(--ink-2); }
.ak-m.a li.rd-task { position: relative; list-style: none; }
.ak-m.a .rd-tick { position: absolute; left: -1.35em; top: .3em; width: .9em; height: .9em; box-sizing: border-box; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.ak-m.a .rd-tick.on { background: var(--ink); box-shadow: none; }
.ak-m.a .rd-tick.on::after { content: ""; position: absolute; left: .3em; top: .12em; width: .2em; height: .42em; border: solid var(--surface); border-width: 0 .12em .12em 0; rotate: 45deg; }
.ak-m.a blockquote { margin-left: 0; padding: 0 0 0 10px; border-left: 2px solid var(--rule-2); color: var(--ink-2); }
.ak-m.a a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
@media (hover: hover) { .ak-m.a a:hover { text-decoration-color: currentColor; } }
.ak-m.a a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 2px; }
.ak-m.a code { padding: 1px 4px; border-radius: 3px; font: 500 .88em/1.4 var(--f-mono); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.ak-m.a pre { position: relative; padding: 12px 12px; border-radius: 10px; overflow-x: auto; white-space: pre; background: var(--press-bg); box-shadow: inset 0 0 0 1px var(--rule); scrollbar-width: thin; }
/* a code block's language over it and Copy at its right, as ChatGPT's (ai-ask.js askMd) */
.ak-m.a pre[data-lang] { padding-top: 34px; }
.ak-m.a pre[data-lang]::before { content: attr(data-lang); position: absolute; left: 12px; top: 9px; font: 500 11.5px/16px var(--f-ui); color: var(--ink-q); white-space: nowrap; }
.ak-m.a pre:not([data-lang]) { padding-right: 40px; }
.ak-m.a pre > .ak-cp { position: absolute; top: 4px; right: 4px; }
.ak-m.a pre code { padding: 0; font-size: 12.5px; line-height: 1.55; background: none; white-space: pre; tab-size: 4; }
.ak-m.a hr { height: 1px; margin: 12px 0; border: 0; background: var(--rule-2); }
.ak-m.a img { max-width: 100%; height: auto; vertical-align: middle; }
.ak-m.a .rd-tw { overflow-x: auto; scrollbar-width: thin; }
.ak-m.a table { border-collapse: collapse; font-size: 13.5px; line-height: 1.45; white-space: normal; }
.ak-m.a :is(th, td) { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.ak-m.a :is(th, td):last-child { padding-right: 0; }
.ak-m.a th { font-weight: 600; border-bottom-color: var(--rule-2); }
.ak-tex:not(.ok) { font: 500 .88em/1.4 var(--f-mono); color: var(--ink-2); }    /* its TeX, until KaTeX is here */
.ak-tex.blk { display: block; margin: 6px 0; overflow-x: auto; overflow-y: hidden; text-align: center; scrollbar-width: thin; }
.ak-tex.blk .katex-display { margin: 0; }
/* a code block's colours, as a note's (marks.css, ::highlight(cx-…)) */
.ak-m :is(.ak-kw, .ak-tag) { color: color-mix(in oklab, #c4314b 72%, currentColor); }
.ak-m .ak-str { color: color-mix(in oklab, #2f7d32 72%, currentColor); }
.ak-m .ak-com { color: color-mix(in oklab, currentColor 48%, transparent); }
.ak-m :is(.ak-num, .ak-lit) { color: color-mix(in oklab, #b25f00 72%, currentColor); }
.ak-m :is(.ak-fn, .ak-attr) { color: color-mix(in oklab, #3f5fd0 72%, currentColor); }
.ak-m .ak-type { color: color-mix(in oklab, #8a3fc0 70%, currentColor); }
/* The web pages an answer read, under it: small keys, each a link to the page. */
.ak-src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; white-space: normal; }
.ak-src-k { font: 500 9.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-q); margin-right: 2px; }
.ak-src a { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 7px;
  border-radius: 4px; font: 500 11.5px/16px var(--f-ui); color: var(--ink-2); text-decoration: none; background: var(--surface); box-shadow: var(--raise-sm), var(--edge); }
@media (hover: hover) { .ak-src a:hover { color: var(--ink); } }
.ak-src a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
/* Make this on the canvas: under the last answer, small and quiet. */
.ak-acts { display: flex; align-items: center; gap: 2px; margin: -12px 0 0 -6px; }
.ak-cp { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; color: var(--ink-q); border-radius: 7px; }
.ak-cp svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4px; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .ak-cp:hover { color: var(--ink); } }
.ak-cp.done { color: var(--ink); }
.ak-mk { align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; font-size: 12.5px; color: var(--ink-2); border-radius: 7px; }
.ak-mk svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4px; stroke-linecap: round; stroke-linejoin: round; }
/* A citation: its number in a small raised key, in line; one whose object is gone is struck through. On the canvas, a
   ring round what it stands for, over the canvas and under the chrome. */
.ak-ref {
  display: inline-grid; place-items: center; min-width: 18px; height: 17px; margin: 0 1px; padding: 0 4px; border: 0; border-radius: 3px;
  vertical-align: 1px; cursor: pointer; font: 600 10.5px/1 var(--f-mono); color: var(--ink); background: var(--surface);
  box-shadow: var(--raise-sm), var(--edge); transition: background-color 120ms ease-out, color 120ms ease-out;
}
@media (hover: hover) { .ak-ref:hover { color: var(--surface); background: var(--ink); } }
.ak-ref:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ak-ref.gone { cursor: default; color: var(--ink-q); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--rule-2); background: transparent; }
#ask.dv :is(.ak-ref, .ak-mk) { opacity: .38; pointer-events: none; }     /* they go to things, and make them, on a flat canvas (dv: the side view is up, dvUi: a rule on body.dv looked over the whole page at each toggle) */
#aihi {
  position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; border-radius: 8px; box-sizing: border-box;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 7px color-mix(in srgb, var(--ink) 12%, transparent);
  opacity: 0; transition: opacity 140ms ease-out;
}
#aihi.on { opacity: 1; }
.ak-m.wait { color: var(--ink-q); font-size: 13px; }
.ak-e { margin: 0 16px 6px; font: 500 12px/16px var(--f-ui); color: var(--ink); }
.ak-f {
  display: flex; align-items: flex-end; gap: 6px; margin: 0 12px 12px; padding: 7px 7px 7px 18px; border-radius: 26px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--rule), 0 2px 8px -2px rgba(0,0,0,.08);
}
.ak-f:focus-within { box-shadow: 0 0 0 1px var(--rule-2), 0 2px 10px -2px rgba(0,0,0,.12); }
.ak-in {
  flex: 1; min-width: 0; height: 38px; max-height: 240px; padding: 8px 0; box-sizing: border-box; border: 0; outline: none; resize: none;
  background: transparent; font: 400 15.5px/22px var(--f-ui); color: var(--ink);
}
.ak-in::placeholder { color: var(--ink-3); }
.ak-f .vc-mic { width: 38px; height: 38px; border-radius: 50%; }
.ak-go { display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.ak-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2px; stroke-linecap: round; stroke-linejoin: round; }
#ask:not(.run) .ak-f:not(:has(.ak-in:not(:placeholder-shown))) .ak-go { opacity: .35; }     /* nothing typed: there is nothing to send */
#ask.run .ak-go { color: var(--surface); background: var(--ink); box-shadow: none; }     /* Stop: the square */

/* Mail & calls (ai-ask-mail.js): the switch over the field, at its left, a small well with the mode in view raised out
   of it; and what an answer about mail used, as keys under it: its mark, its words, the second of them quieter. */
.ak-mode { flex: none; align-self: flex-start; display: flex; gap: 2px; margin: 0 14px 8px; padding: 2px; border-radius: 7px; background: var(--press-bg); box-shadow: var(--press); }
.ak-mode[hidden], .ak-hv:not([hidden]) ~ .ak-mode { display: none; }
.ak-mode > button {
  height: 22px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-2); cursor: pointer;
  font: 500 12px/22px var(--f-ui); white-space: nowrap; transition: background-color 120ms ease-out, color 120ms ease-out;
}
.ak-mode > button[aria-checked="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--raise-sm), var(--edge); }
@media (hover: hover) { .ak-mode > button[aria-checked="false"]:not(:disabled):hover { color: var(--ink); } }
.ak-mode > button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ak-mode > button:disabled { cursor: default; }
.ak-mode:has(> button:disabled) { opacity: .55; }
.ak-src .ak-fr {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 22px; padding: 0 8px 0 6px; box-sizing: border-box; border: 0;
  border-radius: 4px; font: 500 11.5px/16px var(--f-ui); color: var(--ink-2); text-decoration: none; background: var(--surface);
  box-shadow: var(--raise-sm), var(--edge); cursor: pointer;
}
.ak-fr svg { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8px; stroke-linecap: round; stroke-linejoin: round; }
.ak-fr b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ak-fr small { flex: 0 1 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 11px/16px var(--f-ui); color: var(--ink-q); }
span.ak-fr { cursor: default; }
@media (hover: hover) { :is(a, button).ak-fr:hover { color: var(--ink); } }
.ak-fr:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (pointer: coarse) {
  .ak-mode > button { height: 30px; padding: 0 12px; line-height: 30px; }
  .ak-src .ak-fr { height: 28px; }
}

/* History (ai-history.js), in the panel in place of the conversation: a search field in a well, then what was asked,
   as rows (what it was and when, its first question, the start of its last answer), × on each; Older and Clear at the
   foot. */
.ak-hv { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2px 8px 8px; }
.ak-q {
  flex: none; height: 34px; margin-bottom: 6px; padding: 0 12px; box-sizing: border-box; border: 0; border-radius: 7px; outline: none;
  background: var(--press-bg); box-shadow: var(--press); font: 400 14px/34px var(--f-ui); color: var(--ink);
}
.ak-q::placeholder { color: var(--ink-3); }
.ak-q:focus { box-shadow: var(--press), 0 0 0 1.5px var(--ink-3); }
.ak-hl { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; transition: opacity 120ms ease-out; }
.ak-hv[aria-busy="true"] .ak-hl { opacity: .55; }
.ak-h0 { margin: 28px 10px; }
.ak-hi { position: relative; flex: none; }
.ak-ho {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 34px 9px 10px; box-sizing: border-box; border: 0; border-radius: 6px;
  text-align: left; cursor: pointer; color: var(--ink); background: transparent; transition: background-color 120ms ease-out;
}
@media (hover: hover) { .ak-ho:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); } }
.ak-ho:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ak-hk { font: 500 9.5px/14px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-q); }
.ak-ht, .ak-hs { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.ak-ht { font: 500 13.5px/19px var(--f-ui); }
.ak-hs { font: 400 12.5px/17px var(--f-ui); color: var(--ink-2); }
.ak-hx {
  position: absolute; top: 6px; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px;
  color: var(--ink-q); background: transparent; cursor: pointer; opacity: 0; transition: opacity 120ms ease-out;
}
.ak-hx svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4px; stroke-linecap: round; }
.ak-hi:hover .ak-hx, .ak-hx:focus-visible { opacity: 1; }
@media (hover: hover) { .ak-hx:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); } }
@media (hover: none) { .ak-hx { opacity: 1; } }
.ak-hx:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ak-hf { flex: none; display: flex; gap: 8px; padding-top: 6px; }
.ak-hf:has(> .btn:not([hidden])) { border-top: 1px solid var(--rule); margin-top: 4px; }
.ak-hf .btn { height: 28px; font-size: 12px; }
.ak-clear { margin-left: auto; color: var(--ink-2); }
.ak-clear.sure { color: var(--ink); background: var(--surface); box-shadow: var(--raise-sm), var(--edge); }

/* A phone (html.phone: a phone or a tablet, or a window as narrow as a phone): the panel is a sheet along the bottom,
   over the guide, and on a tablet no wider than the phone's sheets (pocket.css), in the middle. */
:where(html.phone) #ask { left: calc(env(safe-area-inset-left, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); top: auto;
       bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); width: auto; max-width: 620px; margin-inline: auto; height: min(84vh, 720px); }
@media (pointer: coarse) {
  .ap-bar .btn, .ab-row .btn, .ab-bd .btn, .ab-sw, .vc-mic { height: 36px; }
  .ak-go, .ak-f .vc-mic { width: 36px; height: 36px; }
  .ak-cp { width: 36px; height: 36px; }
  .vc-mic { width: 36px; }
  .vc-lv { gap: 2.5px; height: 18px; }
  .vc-lv i { width: 3px; }
  .ab-ex button { height: 38px; line-height: 38px; }
  .ak-x { width: 36px; height: 36px; }
  .ab-pk { height: 32px; line-height: 32px; }
  .ab-unpick { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-caret, .ap-obj.ap-wait { animation: none !important; }
  .vc-mic[data-st="busy"] svg { animation: none; opacity: .5; }
  .vc-lv i { transition: none; }
}
@media (pointer: coarse) { .ab-up { display: none !important; } }      /* no arrow keys to go back with */
