/* ═══════════════════════════════════════════════════════════════════════════
   The Ask tab, revamped (design 024) — conversations first, sources per chat.

   The pages ARE the mockups (tmp/mockups/Ask{List,New,Chat,Sources,Added}.dc.html):
   every size, padding, radius and weight below is the mockup's inline style,
   and every colour is a theme token (tmp/mockups/handoff/screens.md, "Literal →
   token map"), so imago-light renders the mockup's values and imago-dark and
   the six older themes follow. NO literal colour in this file — the one hex is
   a var() fallback in the dialog's shadow (`run_frontend_assets_test.py::
   test_024_ask_css_uses_tokens` holds it to that).

   The petal radius is only on Imago's own content (`.im-ai*`: answers, the
   offer, the thinking card, the source choice, proposed actions); bubbles,
   chips, cards, figures, tables and the dialog are square.
   Logical properties throughout, so a right-to-left page mirrors.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── the page, and the four mockup hexes screens.md's map collapses ─────────
   Derived here from existing tokens (theme files are linked with no
   cache-buster and read by regex tools — imago.css's note), within ±3 per
   channel of the mockup in imago-light, and following dark.

   025: on `.ask-scope` too — the Ask's source cards, band chips and picker
   used outside the Ask (the Studio's New dashboard and a board's sources
   strip). Without it `.ask-card.is-off` there read an undefined variable and
   its border fell back to `currentColor`. A scope carries the page's type too,
   so a card is the same box in either place. */
:is(.ask-page, .ask-scope) {
  --ask-hairline: color-mix(in srgb, var(--border) 70%, var(--surface));   /* #e3ecf6 */
  --ask-row-line: color-mix(in srgb, var(--border) 60%, var(--surface));   /* #e6eef7 */
  --ask-row-hover: color-mix(in srgb, var(--lift) 60%, var(--surface));    /* #f7fafe */
  --ask-tint: color-mix(in srgb, var(--ai-border, var(--accent-dim)) 30%, var(--surface));
  --ask-accent-hover: color-mix(in srgb, var(--accent) 86%, var(--text));  /* #24508f */
}
.ask-scope { color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
.ask-page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--depth);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
.ask-page.is-chat { line-height: 1.55; }
/* the mockups' element resets, at zero specificity (:where), so a class's own
   size — .ask-b2's 14px — is never undone by them */
:where(.ask-page, .ask-scope) a { color: var(--accent); }
:where(.ask-page, .ask-scope) a:hover { color: var(--ask-accent-hover); }
:where(.ask-page, .ask-scope) :is(button, input, textarea, select) { font: inherit; color: inherit; }
:where(.ask-page, .ask-scope) :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── shared controls ──────────────────────────────────────────────────────── */
/* .b1 is .im-btn.im-btn--primary; the mockup's has no border */
:is(.ask-page, .ask-scope) .im-btn--primary, :is(.ask-page, .ask-scope) a.im-btn--primary { border: 0; line-height: 1.5; color: var(--on-accent, #fff); }
:is(.ask-page, .ask-scope) .im-btn--primary:hover { background: var(--ask-accent-hover); color: var(--on-accent, #fff); }
.ask-b2 {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px;
  border: 1px solid var(--bhi); border-radius: 12px; background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.ask-page a.ask-b2 { color: var(--text); }
.ask-b2:hover, .ask-page a.ask-b2:hover { border-color: var(--accent-dim); background: var(--lift); color: var(--text); }
.ask-b2:disabled { cursor: not-allowed; opacity: .5; }
.ask-b2 svg { flex: none; }
.ask-icon-btn {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ask-icon-btn:hover { background: var(--void); color: var(--text); }
.ask-icon-btn--40 { width: 40px; height: 40px; }
.ask-ghost {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 8px;
  border-radius: 12px; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.ask-page a.ask-ghost, .ask-page a.ask-ghost:hover { color: var(--text); }
.ask-ghost:hover { background: var(--void); }
.ask-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--bhi); border-radius: 9999px; background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 14px; text-align: start;
}
.ask-chip:hover { border-color: var(--accent-dim); background: var(--lift); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* the connector-mark tile, at the sizes the mockups draw it */
.ask-tile {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--void); color: var(--accent); font-weight: 600;
}
.ask-tile svg { display: block; }
.ask-tile--18 { width: 18px; height: 18px; border-radius: 5px; font-size: 9px; }
.ask-tile--20 { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; }
.ask-tile--24 { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.ask-tile--30 { width: 30px; height: 30px; border-radius: 8px; }
.ask-tile--32 { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }

/* a small source chip: the list's rows, a step's tag */
.ask-sc {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 4px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font-size: 13px; white-space: nowrap;
}
.ask-sc.is-off { border-color: var(--text); padding-inline-start: 6px; }
.ask-sc.is-off svg { flex: none; color: var(--text); }
.ask-sc--step { height: 26px; }

/* the search field and the source filter */
.ask-search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  background: var(--lift); border: 1px solid var(--border); border-radius: 12px; color: var(--muted);
}
.ask-search svg { flex: none; }
.ask-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font-size: 14px;
}
/* One box, as drawn: the field inside draws no frame of its own; the box it
   sits in shows the focus (the page-wide :focus-visible ring would otherwise
   draw a second frame inside it). */
.ask-search input:focus, .ask-search input:focus-visible { outline: none; }
.ask-search:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-mid);
  outline: 2px solid transparent;   /* forced-colors mode drops the shadow; this ring shows there */
}
.ask-search input::placeholder { color: var(--muted); }
.ask-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
/* the one dropdown (Select.tsx), at the mockup's size: its caret, hover and
   focus come from the dropdown system in app.css (`.ask-filter .dd-trigger`) */
/* a native select is as wide as its widest option: the page measures it
   (--ask-filter-w) so the trigger keeps the mockup's width as options change */
.ask-filter .dd-trigger {
  min-width: var(--ask-filter-w, 0px);
  height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 32px 0 12px;
  background-color: var(--surface); color: var(--text); font-size: 14px;
  background-position: right 17.5px center, right 13px center;
}

/* ── Conversations (AskList) ──────────────────────────────────────────────── */
.ask-main--list { flex: 1; padding: 36px clamp(16px, 4vw, 56px) 48px; }
.ask-col { width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.ask-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ask-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.ask-lead { margin: 6px 0 0; color: var(--muted); max-width: 560px; }
.ask-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ask-tools .ask-search { flex: 1 1 320px; }
.ask-group { display: flex; flex-direction: column; gap: 10px; }
.ask-group > h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.ask-rows {
  list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.ask-row {
  display: flex; align-items: center; gap: 4px; padding-inline-end: 10px;
  border-top: 1px solid var(--ask-row-line);
}
.ask-row:first-child { border-top: 0; }
.ask-row:hover { background: var(--ask-row-hover); }
.ask-row__link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap;
  padding-block: 16px; padding-inline: 20px 8px; text-decoration: none;
}
.ask-page a.ask-row__link, .ask-page a.ask-row__link:hover { color: var(--text); }
.ask-row__text { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ask-row__title { font-weight: 500; font-size: 16px; }
.ask-row__sentence {
  font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ask-row__srcs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ask-row__meta {
  flex: 0 0 104px; display: flex; flex-direction: column; align-items: flex-end;
  font-size: 13px; color: var(--muted); text-align: end;
}
.ask-row__meta > :first-child { color: var(--text); }
.ask-row .im-menu-anchor { position: relative; }
.ask-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ask-foot > span { font-size: 14px; color: var(--muted); }
.ask-empty { padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.ask-empty__title { font-weight: 500; font-size: 16px; }
.ask-empty__text { font-size: 14px; color: var(--muted); }
.ask-empty .ask-b2 { align-self: flex-start; margin-top: 10px; }
.ask-skel-row { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--ask-row-line); }
.ask-skel-row:first-child { border-top: 0; }

/* a row's menu and the chat's More actions: the shared .im-menu, anchored */
.ask-menu-wrap { position: relative; display: inline-flex; }
.ask-menu-wrap .im-menu { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 5; min-width: 200px; }

/* ── the band (New chat, a conversation) ─────────────────────────────────── */
.ask-band-wrap {
  position: sticky; top: 0; z-index: 2; background: var(--depth);
  border-bottom: 1px solid var(--ask-hairline);
}
.ask-band {
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 10px 16px 10px 12px;
}
.ask-band__rule { width: 1px; height: 24px; background: var(--border); flex: none; }
.ask-band__title { margin: 0; margin-inline-start: 4px; font-size: 18px; font-weight: 600; min-width: 0; line-height: 1.55; }
.ask-band__title:focus { outline: none; }
.ask-band__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-rename {
  margin: 0; margin-inline-start: 4px; font-size: 18px; font-weight: 600; line-height: 1.55;
  min-width: 0; width: min(420px, 100%); border: 1px solid var(--bhi); border-radius: 8px;
  padding: 0 8px; background: var(--surface); color: var(--text);
}
.ask-band__spacer { flex: 1 1 24px; }
.ask-srcs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-srcs__label { font-size: 14px; color: var(--muted); }
.ask-src {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 10px;
  border: 1px solid var(--bhi); border-radius: 12px; background: var(--surface);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.ask-src.has-x { padding: 0 4px 0 10px; }
.ask-src.is-off { border-color: var(--text); }
.ask-src.is-off > svg { flex: none; color: var(--text); }
.ask-x {
  width: 36px; height: 36px; flex: none; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ask-x:hover { background: var(--void); color: var(--text); }
.ask-add { padding: 0 14px 0 10px; }
.ask-add[aria-expanded="true"] { border-color: var(--accent); background: var(--lift); }

/* ── New chat (AskNew) ────────────────────────────────────────────────────── */
.ask-main--new { flex: 1; padding: 40px clamp(16px, 4vw, 56px) 48px; }
.ask-main--new > .ask-col { max-width: 760px; gap: 32px; }
.ask-main--new .ask-lead { max-width: none; }
.ask-section { display: flex; flex-direction: column; gap: 16px; }
.ask-h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.ask-cards {
  border: 0; margin: 0; padding: 0; min-width: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px;
}
.ask-card {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 13px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); cursor: pointer; min-width: 0;
}
.ask-card.is-on { padding: 11px 12px; border: 2px solid var(--accent); background: var(--lift); }
.ask-card.is-off { border-color: var(--ask-hairline); background: var(--ask-row-hover); cursor: default; }
.ask-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ask-card.is-on .ask-tile--30 { background: var(--accent); color: var(--on-accent, #fff); }
.ask-card.is-off .ask-tile--30 { background: var(--border); color: var(--text); }
.ask-card__text { display: flex; flex-direction: column; min-width: 0; }
.ask-card__text strong { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.ask-card__type { font-size: 12.5px; color: var(--muted); }
.ask-card__status {
  font-size: 12.5px; color: var(--text); display: inline-flex; gap: 5px; align-items: center; margin-top: 3px;
}
.ask-card__status.is-muted { color: var(--muted); }
.ask-card__status svg { flex: none; }
.ask-check--18 { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.ask-check--20 { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.ask-h3 { margin: 0; font-size: 15px; font-weight: 500; color: var(--muted); }
.ask-examples { display: flex; flex-direction: column; gap: 10px; }

/* the composer (.im-composer is the mockup's form) */
.ask-page .im-composer textarea { font-size: 16px; line-height: inherit; }
/* One box, as drawn: the composer's own 2px border is the frame; the textarea
   inside draws none (the page-wide :focus-visible ring drew a second frame 6px
   inside it), and focus shows as a soft halo around that one box. */
.ask-page .im-composer textarea:focus,
.ask-page .im-composer textarea:focus-visible { outline: none; }
.ask-page .im-composer:focus-within {
  box-shadow: 0 0 0 4px var(--accent-mid);
  outline: 2px solid transparent;   /* forced-colors mode drops the shadow; this ring shows there */
}
.ask-page .im-composer textarea::placeholder { color: var(--muted); }
.ask-reads { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ask-reads__name { color: var(--text); font-weight: 500; }
.ask-reads.is-warn { color: var(--text); }
.ask-change { font-size: 13px; font-weight: 500; padding: 12px 6px; }
.ask-composer__gap { flex: 1; }
.ask-mic {
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.ask-mic.is-recording { border-color: var(--accent); color: var(--accent); }
.ask-mic:disabled { cursor: progress; opacity: .6; }
.ask-send {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--accent);
  color: var(--on-accent, #fff); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; flex: none;
}
.ask-send:hover { background: var(--ask-accent-hover); }
.ask-send:disabled { cursor: not-allowed; opacity: .5; }
.ask-send.is-stopping { width: auto; padding: 0 14px; gap: 8px; font-size: 14px; font-weight: 500; }
.ask-composer-why { margin: 10px 0 0; font-size: 13px; color: var(--text); }
.ask-voice { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ── a conversation (AskChat, AskAdded) ──────────────────────────────────── */
.ask-main--chat { flex: 1; padding: 28px clamp(16px, 3vw, 48px) 32px; }
.ask-thread {
  width: 100%; max-width: 840px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px;
}
.ask-turn { display: flex; flex-direction: column; gap: 24px; }
.ask-event {
  display: flex; align-items: center; gap: 12px; margin: 0; font-size: 13px; color: var(--muted);
  text-align: center;
}
.ask-event::before, .ask-event::after { content: ""; flex: 1 1 24px; height: 1px; background: var(--border); }
.ask-page .im-msg-user.ask-bubble {
  align-self: flex-end; max-width: 560px; border-radius: 12px; padding: 12px 16px;
  display: flex; gap: 12px; align-items: flex-start; font-size: 15px;
}
.ask-bubble p { margin: 0; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--wing-accent, var(--accent-mid)); color: var(--wing-bg, var(--text));
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.ask-play {
  width: 30px; height: 30px; flex: none; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--muted); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.ask-prov { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.ask-prov strong { color: var(--text); font-weight: 600; }
.ask-prov > svg { flex: none; }
.ask-page .im-steps { background: var(--surface); }
.ask-page .im-steps ol li { flex-wrap: wrap; }
.ask-page .im-steps li > svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.ask-page .im-steps li.is-failed > svg { color: var(--text); }
.ask-step-detail { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; padding-inline-start: 26px; }
.ask-step-detail pre {
  margin: 0; padding: 10px 12px; background: var(--lift); border: 1px solid var(--border); border-radius: 8px;
  font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}
.ask-step-meta { font-size: 13px; color: var(--muted); }
.ask-page .im-answer-headline > p { margin: 0; }
.ask-page .im-answer-headline > p + p { margin-top: 8px; }
.ask-page .im-answer-headline strong { color: var(--accent); font-weight: 600; }
.ask-figure {
  margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.ask-figure__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ask-figure figcaption { font-weight: 500; }
.ask-figure__scroll { overflow-x: auto; }
/* 022's guarantee: an offered drawing is never drawn narrower than
   answer_chart.ASK_MIN_CHART_PX — the figure scrolls instead */
.ask-figure .chart-wrap { min-width: 376px; }
.ask-seg { display: inline-flex; background: var(--void); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.ask-seg button {
  height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 14px;
}
.ask-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; }
.ask-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.ask-figure .ask-table-wrap { border: 0; border-radius: 0; }
.ask-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ask-table caption { text-align: start; padding: 12px 12px 4px; font-weight: 500; }
.ask-table th {
  text-align: start; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ask-table td { padding: 9px 12px; border-bottom: 1px solid var(--ask-row-line); }
.ask-table tbody tr:last-child td { border-bottom: 0; }
.ask-table .is-num { text-align: end; }
.ask-table-note { margin: 0; padding: 4px 12px 12px; font-size: 13px; color: var(--muted); }
.ask-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-actions .ask-b2 svg { width: 16px; height: 16px; }
.ask-audit { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.ask-callouts { display: flex; flex-direction: column; gap: 10px; }
.ask-proposed { display: flex; flex-direction: column; gap: 10px; }
.ask-proposed .ask-action { background: var(--surface); }
.ask-action__head { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ask-action__title { font-weight: 500; }
.ask-action__detail { font-size: 14px; color: var(--muted); margin: 0; }
.ask-action__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-action__outcome { font-size: 13px; color: var(--muted); margin: 0; }
.ask-choice__opts { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-choice__note { font-size: 13px; color: var(--muted); margin: 0; }
.ask-choice code { font: 14px var(--mono); }
.ask-choice > p { margin: 0; }
.ask-timeline { display: flex; flex-direction: column; gap: 24px; }

/* ── the offer card (AskChat's second answer, AskAdded's resolved one) ───── */
.ask-page .im-ai.ask-offer { gap: 16px; }
.ask-page .im-answer-headline.ask-offer__h { max-width: 64ch; }
.ask-found { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.ask-found > span:first-child { color: var(--muted); }
.ask-tag { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.ask-offer__note { margin: 0; font-size: 14px; color: var(--muted); }
.ask-offer__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-offer__error { margin: 0; font-size: 14px; color: var(--text); }
.ask-page .im-ai.ask-offer.is-done { gap: 14px; }
.ask-offer__text { margin: 0; font-size: 16px; max-width: 64ch; }

/* ── Change sources (AskSources): the dialog under Add source ────────────── */
.ask-picker {
  position: absolute; top: calc(100% - 6px); inset-inline-end: 16px; width: min(440px, calc(100% - 32px));
  background: var(--surface); border: 1px solid var(--bhi); border-radius: 16px;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--wing-bg, #384064) 18%, transparent);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; z-index: 3; line-height: 1.55;
}
.ask-picker__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ask-picker__h { margin: 0; font-size: 17px; font-weight: 600; }
.ask-picks { display: flex; flex-direction: column; gap: 6px; }
.ask-pick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); cursor: pointer;
}
.ask-pick.is-on { border-color: var(--ai-border, var(--accent-dim)); background: var(--lift); }
.ask-pick.is-off { border-color: var(--ask-hairline); background: var(--ask-row-hover); cursor: default; }
.ask-pick.is-on .ask-tile--32 { background: var(--surface); }
.ask-pick.is-off .ask-tile--32 { background: var(--border); color: var(--text); }
.ask-pick__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ask-pick__name { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; flex-wrap: wrap; }
.ask-pick__meta { font-size: 13px; color: var(--muted); }
.ask-chg { font-size: 12px; font-weight: 500; border-radius: 9999px; padding: 1px 8px; }
/* the map's #24508f mix, taken from the AI ink rather than the accent: the two
   are one colour in imago-light, and in imago-dark the accent's mix is ~4.4:1 on
   the dark tint where the AI ink's is well over 4.5 (§8.6) — no theme selector
   (conventions: theme-family selectors live in imago.css and builder.css only) */
.ask-chg--add { color: color-mix(in srgb, var(--ai-ink, var(--accent)) 86%, var(--text)); background: var(--ask-tint); }
.ask-chg--remove { color: var(--muted); background: var(--void); }
.ask-picker__note {
  margin: 0; display: flex; gap: 10px; font-size: 13px; color: var(--muted); background: var(--void);
  border-radius: 10px; padding: 12px;
}
.ask-picker__note svg { flex: none; color: var(--accent); }
.ask-picker__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ask-picker__foot > span:first-child { font-size: 14px; color: var(--muted); }
.ask-picker__error { margin: 0; font-size: 14px; color: var(--text); }
/* 025: what a pick changes — a board's tiles that stop updating (Q2) */
.ask-picker__warn {
  margin: 0; display: flex; gap: 10px; font-size: 13px; color: var(--text); padding: 12px;
  border: 1px solid var(--bhi); border-radius: 10px; background: var(--surface);
}
.ask-picker__warn svg { flex: none; }
.ask-picker__empty { margin: 0; font-size: 14px; color: var(--muted); padding: 4px 2px; }

/* ── the insight list drawer (Q2) ────────────────────────────────────────── */
.ask-drawer-scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--wing-bg, #384064) 24%, transparent); z-index: 40; }
.ask-drawer {
  position: fixed; inset-block: 12px; inset-inline-end: 12px; width: min(420px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--bhi); border-radius: 16px; z-index: 41;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--wing-bg, #384064) 18%, transparent);
}
.ask-drawer__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--ask-hairline, var(--border)); }
.ask-drawer__head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.ask-drawer__body { flex: 1; min-height: 0; overflow-y: auto; }

/* ── states ───────────────────────────────────────────────────────────────── */
.ask-page .im-thinking { vertical-align: middle; }
.ask-stages { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.ask-stages li.is-run { color: var(--text); font-weight: 500; }
.ask-stages li.is-ok { color: var(--text); }
.ask-page .im-error p { margin: 0; font-size: 14px; }
.ask-loading { display: flex; flex-direction: column; gap: 10px; }

/* ── reduced motion: the guard imago.css gives .im-* ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [class*="ask-"], [class*="ask-"]::before, [class*="ask-"]::after { animation: none !important; transition: none !important; }
}
