/* ============================================================================
   Chat panel
   ========================================================================== */

.chat-launch {
  position: fixed; z-index: 80;
  inset-block-end: 22px; inset-inline-start: 22px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 700;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.chat-launch:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.chat-launch__glyph {
  color: var(--series-1); font-size: 15px; line-height: 1;
}
:root[data-chat-open="true"] .chat-launch { display: none; }

/* ── panel shell ──────────────────────────────────────────────────────────── */

/* The panel opens UNDER the masthead, not over it: the title bar keeps its
   full width — brand, tabs and tools exactly as without the panel — and stays
   usable while the assistant is open. --mast-h is the masthead's measured
   height (dashboard.js); while the panel is open the masthead is pinned, so
   the two always meet at the same line however far the page is scrolled. */
.chat {
  position: fixed; z-index: 90; inset-block-start: var(--mast-h, 0px); inset-block-end: 0;
  inset-inline-start: 0;
  width: min(var(--chat-w, 460px), 100vw);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}
.chat[hidden] { display: none; }

/* The inner edge: drag to resize, double-click to widen — see grip() in
   chat/ui.js. While dragging nothing animates and no text gets selected. */
.chat__grip {
  position: absolute; z-index: 1; inset-block: 0; inset-inline-end: -4px;
  width: 8px; cursor: col-resize; touch-action: none;
}
.chat__grip::after {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 3px; width: 2px;
  background: var(--series-1); opacity: 0; transition: opacity .15s var(--ease);
}
.chat__grip:hover::after,
:root[data-chat-resizing="true"] .chat__grip::after { opacity: .6; }
:root[data-chat-resizing="true"] { cursor: col-resize; user-select: none; }
:root[data-chat-resizing="true"] * { transition: none !important; }
.chat__widen { padding-inline: 8px; font-size: 13px; }
.chat__widen[aria-pressed="true"] { border-color: var(--series-1); color: var(--series-1); }
:root[data-chat-open="true"] .topbar:not(.topbar--band) {
  position: sticky; top: 0; z-index: 40; background: var(--page);
}

.chat__head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}
.chat__title { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.chat__sub { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.chat__close {
  margin-inline-start: auto; flex: none;
  width: 30px; height: 30px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%;
  color: var(--ink-3); font-size: 21px; line-height: 1;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.chat__close:hover { background: var(--surface-sunk); color: var(--ink); }
.chat__headtools { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.chat__headtools .chat__close { margin-inline-start: 2px; }
.chat__threadbtns { display: flex; align-items: center; gap: 4px; }
/* embedded (the start page): the two buttons at the start of the box's tool row */
.chat__tools .chat__threadbtns { margin-inline-end: auto; }
.chat__headbtn {
  padding: 4px 10px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font: 500 12px/1.4 var(--font);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.chat__headbtn:hover { border-color: var(--series-1); color: var(--ink); }

/* ── saved conversations — see showThreads in chat/ui.js ───────────────────── */
/* the list takes the log's place while it is open */
.chat:has(.chat__threads) .chat__log,
.chat:has(.chat__threads) .chat__composer { display: none; }
.chat__threads { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat__threadshead { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--ink); }
.chat__threadlist { display: flex; flex-direction: column; gap: 6px; }
.chat__thread {
  display: flex; align-items: stretch; gap: 4px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.chat__thread[data-current="true"] { border-color: var(--series-1); }
.chat__threadopen {
  flex: 1; min-width: 0; padding: 9px 12px; cursor: pointer; text-align: start;
  display: flex; flex-direction: column; gap: 3px;
  background: none; border: 0; border-radius: 10px; color: var(--ink);
}
.chat__threadopen:hover { background: var(--surface-sunk); }
.chat__threadtitle { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__threadmeta { font-size: 11.5px; color: var(--ink-3); }
.chat__threaddel {
  flex: none; width: 34px; cursor: pointer;
  background: none; border: 0; border-radius: 10px; color: var(--ink-3); font-size: 17px;
}
.chat__threaddel:hover { background: var(--surface-sunk); color: var(--critical); }
.chat__threadsnote { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.chat__resumed { font-size: 12px; }

.chat__log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
  /* The scrollbar at the panel's OUTER edge. An RTL box puts its scrollbar on
     its left, which here is the panel's inner edge: a scrollbar in the middle
     of the screen, beside the page's own at the window's edge, and readers
     grabbed the wrong one. The box runs LTR for the scrollbar's sake alone;
     every entry inside runs RTL again, and the two alignments that follow the
     box's direction are stated the other way round below. Thin and faint, so
     it reads as the panel's, not the page's. */
  direction: ltr;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink-3) 40%, transparent) transparent;
}
/* Entries must never shrink — the log scrolls instead. Without this, a column
   flex container squashes its children once the content overflows, and a chart
   card (which sets overflow:hidden) collapses to a hairline rather than
   pushing the log into scroll. */
.chat__log > * { flex: none; direction: rtl; }

/* ── messages ─────────────────────────────────────────────────────────────── */

.chat__msg {
  max-width: 92%;
  padding: 10px 13px; border-radius: var(--r);
  font-size: 13.5px; line-height: 1.65;
  overflow-wrap: anywhere;
}
.chat__msg--user {
  align-self: flex-end; /* the reader's side — right; the log box runs LTR, see .chat__log */
  background: var(--series-1); color: #fff;
  border-end-start-radius: 5px;
  white-space: pre-wrap;
}
.chat__msg--bot {
  align-self: flex-start; /* the assistant's side — left */
  background: var(--surface-sunk); color: var(--ink);
  border-end-end-radius: 5px;
}

.chat__md > *:first-child { margin-top: 0; }
.chat__md > *:last-child { margin-bottom: 0; }
.chat__md p { margin: 0 0 8px; }
.chat__md ul { margin: 0 0 8px; padding-inline-start: 20px; }
.chat__md li { margin-bottom: 3px; }
.chat__md code {
  padding: 1px 5px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--ring);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  direction: ltr; display: inline-block;
}

.chat__tablewrap { overflow-x: auto; margin: 0 0 8px; }
.chat__table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.chat__table th, .chat__table td {
  padding: 5px 9px; text-align: start; border-bottom: 1px solid var(--line);
}
.chat__table th { color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.chat__table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── status, notes, errors ────────────────────────────────────────────────── */

.chat__status {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: var(--r);
  background: var(--surface-sunk);
  font-size: 12.5px; color: var(--ink-2);
}
.chat__spinner {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid var(--axis); border-top-color: var(--series-1);
  animation: chat-spin .7s linear infinite;
}
@keyframes chat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chat__spinner { animation-duration: 2.4s; } }

.chat__note,
.chat__error {
  align-self: stretch;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 12.5px; line-height: 1.6;
}
.chat__note { background: var(--surface-sunk); color: var(--ink-2); }
.chat__error {
  background: color-mix(in srgb, var(--critical) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--critical) 38%, var(--surface));
  color: var(--ink);
}

/* ── suggestion chips ─────────────────────────────────────────────────────── */

.chat__chips { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.chat__chip {
  cursor: pointer; text-align: start;
  padding: 7px 12px;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.chat__chip:hover { border-color: var(--series-1); color: var(--ink); }
/* 👍 / 👎 under an answer — see addVerdict in chat/ui.js */
.chat__verdict { margin-top: -6px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.chat__vote {
  width: 28px; height: 26px; padding: 0; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 8px;
  font-size: 13px; line-height: 1; opacity: .45; filter: grayscale(1);
  transition: opacity .15s var(--ease), border-color .15s var(--ease);
}
.chat__vote:hover { opacity: .85; }
.chat__vote[aria-pressed="true"] { opacity: 1; filter: none; border-color: var(--line); background: var(--surface); }
.chat__votenote { flex: 1 0 100%; display: flex; gap: 6px; margin-top: 4px; }
.chat__votenote[hidden] { display: none; }
.chat__votefield {
  flex: 1; min-width: 0; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 400 12.5px/1.4 var(--font); color: var(--ink);
}
.chat__votethanks { font-size: 12px; color: var(--ink-3); }

/* the answer's own follow-ups — see splitFollowUps in chat/ui.js */
.chat__next { margin-top: 2px; }
.chat__next::before { content: 'אפשר להמשיך:'; font-size: 11px; color: var(--ink-3); }

/* ── ask_user ─────────────────────────────────────────────────────────────── */

.chat__ask {
  align-self: stretch;
  padding: 12px 13px; border-radius: var(--r);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 40%, var(--surface));
  display: flex; flex-direction: column; gap: 7px;
}
.chat__askq { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.chat__askbtn,
.chat__askskip {
  cursor: pointer; text-align: start;
  padding: 8px 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600;
  transition: border-color .15s var(--ease);
}
.chat__askbtn:hover:not(:disabled) { border-color: var(--series-1); }
.chat__askskip { font-weight: 400; color: var(--ink-3); }
.chat__askbtn:disabled, .chat__askskip:disabled { opacity: .5; cursor: default; }
.chat__ask[data-answered="true"] { opacity: .7; }
/* an answer in the reader's own words, under the options: a labelled field
   that looks like one — white, a firm border, a caret-sized height */
.chat__asktype { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--warning) 45%, var(--line)); }
.chat__asktype__label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chat__asktype__row { display: flex; gap: 6px; }
.chat__askinput {
  flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 12px;
  background: #fff; color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--ink-3) 55%, var(--line)); border-radius: var(--r-sm);
  font: inherit; font-size: 13px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
}
.chat__askinput:hover { border-color: var(--ink-3); }
.chat__askinput:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.chat__askinput::placeholder { color: var(--ink-3); font-style: italic; }
.chat__asksend {
  flex: none; height: 36px; padding: 0 14px; cursor: pointer;
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand); border-radius: var(--r-sm);
  font: inherit; font-size: 12.5px; font-weight: 700;
}
.chat__asksend:hover:not(:disabled) { filter: brightness(.92); }
.chat__asksend:disabled { background: var(--surface-sunk); border-color: var(--line); color: var(--ink-3); cursor: default; }
.chat__askinput:disabled { opacity: .6; cursor: default; }
.chat__askskip { margin-top: 2px; text-align: center; }

/* ── charts the assistant draws ───────────────────────────────────────────── */

.chat__chart { align-self: stretch; }
.chat__kpi {
  padding: 26px 8px; text-align: center;
  font-size: 32px; font-weight: 700; letter-spacing: -.8px; color: var(--ink);
}

/* ── the guided interview's bar: above the composer while it runs ────────── */

.chat__wizard {
  display: flex; align-items: center; gap: 10px;
  margin: 0 14px; padding: 10px 12px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--surface));
  font-size: 12.5px; line-height: 1.45; color: var(--ink);
}
.chat__wizard[hidden] { display: none; }
.chat__wizard__icon { flex: none; color: var(--brand); font-size: 15px; }
.chat__wizard__text { flex: 1 1 auto; min-width: 0; }
.chat__wizard__exit {
  flex: none; height: 30px; padding: 0 12px; cursor: pointer;
  background: var(--surface); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 50%, var(--line)); border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chat__wizard__exit:hover:not(:disabled) { background: var(--brand); color: #fff; }
.chat__wizard__exit:disabled { opacity: .6; cursor: default; }
.chat__wizard[data-leaving="true"] { opacity: .75; }
/* the composer, closed for the interview — and one line high, the buttons
   beside it: nothing is typed here, and the room goes to the questions
   above (the user, 2026-11-15) */
.chat--wizard .chat__composer { padding-top: 8px; }
.chat--wizard .chat__box { opacity: .55; background: var(--surface-sunk); flex-direction: row; align-items: center; gap: 8px; padding-block: 4px; }
.chat--wizard .chat__input { min-height: 0; height: 28px !important; overflow: hidden; white-space: nowrap; }
.chat--wizard .chat__tools { flex: none; }
.chat--wizard .chat__input:disabled { cursor: not-allowed; }
.chat--wizard .chat__input::placeholder { color: var(--ink-2); font-style: italic; }

/* ── composer ─────────────────────────────────────────────────────────────── */

.chat__composer {
  padding: 12px 14px 8px;
  border-top: 1px solid var(--line);
}
/* one box: the question on top, the microphone and send button on a row inside it */
.chat__box {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px 6px;
  background: var(--surface-sunk);
  border: 1px solid transparent; border-radius: var(--r);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.chat__box:focus-within { background: var(--surface); border-color: var(--series-1); }
.chat__input {
  width: 100%; min-width: 0; resize: none;
  padding: 4px 2px;
  font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--ink);
  background: transparent; border: 0;
  min-height: 112px; max-height: 280px;
}
.chat__input::placeholder { color: var(--ink-3); }
.chat__input:focus { outline: 0; }
.chat__tools {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
/* quiet until something is typed, then the brand colour */
.chat__send {
  flex: none; width: 34px; height: 34px; padding: 0; cursor: default;
  display: grid; place-items: center;
  background: var(--line); color: var(--ink-3);
  border: 0; border-radius: 50%;
  transition: background-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease);
}
.chat__send svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chat__send--ready { background: var(--series-1); color: #fff; cursor: pointer; }
.chat__send--ready:hover { opacity: .88; }
.chat__send--busy svg { fill: currentColor; stroke: none; }
.chat__send--busy { background: var(--ink-2); }

.chat__disclaimer {
  padding: 0 14px 12px;
  font-size: 11px; line-height: 1.5; color: var(--ink-3);
}

/* ── wide screens: dock rather than overlay ───────────────────────────────── */

/* The content column makes room for the panel; the masthead above it does
   not — it spans the page as usual, so nothing in it truncates, wraps or
   scrolls out of view. Widening each block by the panel and padding its start
   side by the same amount leaves its content centred in what is left beside
   the panel, exactly as padding the body would, without touching the head. */
@media (min-width: 1500px) {
  :root[data-chat-open="true"] main,
  :root[data-chat-open="true"] .pagefoot {
    max-width: calc(var(--col, 1180px) + var(--chat-w, 460px));
    padding-inline-start: calc(28px + var(--chat-w, 460px));
  }
}

@media (max-width: 520px) {
  .chat { width: 100vw; }
  .chat__grip, .chat__widen { display: none; }
  .chat-launch { inset-block-end: 14px; inset-inline-start: 14px; }
}


/* ── the working trace ───────────────────────────────────────────────────────
   What the assistant is doing, while it does it. Quiet by design: it sits to
   the side of the conversation, not in it, and folds into a single line as soon
   as there is an answer worth reading instead.
   -------------------------------------------------------------------------- */
.chat__trace {
  margin: 2px 0 6px;
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 10px;
}
.chat__trace__sum {
  cursor: pointer; list-style: none;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  padding: 2px 0;
}
.chat__trace__sum::-webkit-details-marker { display: none; }
.chat__trace__sum:hover { color: var(--ink-2); }
.chat__trace[open] .chat__trace__sum { margin-bottom: 4px; }
.chat__trace__item {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  padding: 2px 0;
}
.chat__trace__tool {
  font-size: 11.5px; color: var(--ink-3);
}
.chat__trace__tool::before {
  content: '⟩'; margin-inline-end: 6px; color: var(--line);
}
/* The model's own reasoning, streamed. `display: summarized` means these are
   written to be read — but they are still working notes, so they sit a step
   back from the conversation. */
.chat__trace__think { color: var(--ink-3); font-size: 12px; white-space: pre-wrap; }
/* An answer mid-stream is raw text, so its line breaks have to survive until
   the markdown is parsed at the end. */
.chat__msg--raw { white-space: pre-wrap; }

/* a table in an answer, as a file — see renderMarkdown in chat/ui.js */
.chat__dl {
  margin-top: 4px; padding: 2px 0; cursor: pointer;
  background: none; border: 0; color: var(--ink-3);
  font: 600 11.5px/1.4 var(--font);
}
.chat__dl:hover { color: var(--brand); text-decoration: underline; }

/* ── a spoken question — listen() in chat/ui.js ──────────────────────────── */
.chat__mic {
  flex: none; width: 34px; height: 34px; padding: 0; cursor: pointer;
  display: grid; place-items: center; position: relative;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 50%;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.chat__mic svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat__mic:hover, .chat__mic:focus-visible { background: var(--brand-tint); color: var(--brand); outline: none; }
/* listening: the recording red, and a ring that breathes */
.chat__mic--on, .chat__mic--on:hover { background: var(--critical); color: #fff; }
.chat__mic--on::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--critical); opacity: .5;
  animation: chat-mic 1.2s ease-out infinite;
}
@keyframes chat-mic { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chat__mic--on::after { animation: none; } }

/* the privacy notice, linked from the disclaimer */
.chat__disclaimer__link { color: var(--brand); font-weight: 600; text-decoration: none; white-space: nowrap; }
.chat__disclaimer__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── the questions page: the conversation as the page ───────────────────────
   models/kibbutz.js kibbutzAskConfig, dashboard.js. The reader came to ask
   (the suggestions box, 2026-11-10), and the page takes the form readers know
   from chat applications (the user, the same day): no frame around the
   conversation, a reading column in the middle of the page, the answer as
   plain text and the question as a quiet bubble, one rounded question box.
   The layout only — the colours, the type and the mark are this site's.

   --ask-col is the reading column; a table breaks out of it to --ask-wide,
   because a table is read across and a paragraph is not. */
.ask {
  --ask-col: 760px; --ask-wide: 1040px;
  display: flex; align-items: flex-start; gap: 22px; margin: 6px 0 0;
}
/* the conversation's column, beside the list of conversations (.ask__side) */
.ask__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ask__hello {
  order: 1; margin: 0; text-align: center;
  font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 700; color: var(--brand-deep);
}
.ask .chat[data-embedded] {
  order: 2; position: static; z-index: auto; inset: auto; width: 100%; max-width: none; min-height: 0;
  display: flex; flex-direction: column;
  border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible;
}
.ask__starters { order: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(100%, var(--ask-col)); }
.ask__q {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.ask__q:hover, .ask__q:focus-visible { border-color: var(--brand); color: var(--brand); outline: none; }

/* before the first question: the greeting, the box, the examples — centred */
.ask:not(.ask--talking) .ask__main { min-height: calc(100vh - 300px); justify-content: center; }
.ask:not(.ask--talking) .chat__log { display: none; }
.ask:not(.ask--talking) .chat[data-embedded] .chat__input { min-height: 84px; }
/* a conversation: it fills the page down to the box at its foot */
.ask--talking .ask__hello, .ask--talking .ask__starters { display: none; }
/* --ask-top is the panel's distance from the top of the window (dashboard.js) */
.ask--talking .chat[data-embedded] { height: calc(100vh - var(--ask-top, 150px) - 12px); min-height: 420px; }

.ask .chat[data-embedded] .chat__head,
.ask .chat[data-embedded] .chat__grip,
.ask .chat__greet { display: none; }

/* the log: every piece sits in the reading column */
.ask .chat__log { flex: 1 1 auto; min-height: 0; padding: 8px 0 22px; gap: 16px; }
.ask .chat__log > * { align-self: center; width: min(100%, var(--ask-col)); max-width: none; box-sizing: border-box; }
.ask .chat__msg { font-size: 15.5px; line-height: 1.7; }
/* the answer: text on the page, no bubble */
.ask .chat__msg--bot { padding: 0; border-radius: 0; background: transparent; }
.ask .chat__msg--bot:has(.chat__tablewrap) { width: min(100%, var(--ask-wide)); }
.ask .chat__msg--bot:has(.chat__tablewrap) .chat__md > :not(.chat__tablewrap) { max-width: var(--ask-col); margin-inline: auto; }
/* the question: a quiet bubble on the reader's side of the column (the log
   box runs LTR — the reader's side is the right) */
.ask .chat__msg--user, .ask .chat__status {
  align-self: flex-end; width: fit-content; max-width: min(70%, 560px);
  margin-right: calc((100% - min(100%, var(--ask-col))) / 2);
}
.ask .chat__msg--user { padding: 10px 16px; border-radius: 18px; background: var(--surface-sunk); color: var(--ink); }
.ask .chat__table { font-size: 14px; }
.ask .chat__table th { font-size: 12.5px; }
.ask .chat__table th, .ask .chat__table td { padding: 7px 14px; white-space: nowrap; }
.ask .chat__verdict { margin-top: -8px; }
/* the follow-up questions: a row of chips at the column's start, under the answer */
.ask .chat__next { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; }
.ask .chat__next::before { flex: 1 0 100%; }
.ask .chat__chip { font-size: 13.5px; }

/* the question box: one rounded box, lifted off the page */
.ask .chat[data-embedded] .chat__composer { align-self: center; width: min(100%, var(--ask-col)); padding: 0 0 6px; border-top: 0; }
.ask .chat__box {
  padding: 12px 14px 8px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--ink) 8%, transparent);
}
.ask .chat__box:focus-within { border-color: var(--series-1); }
.ask .chat[data-embedded] .chat__input { font-size: 15.5px; min-height: 52px; }
.ask .chat[data-embedded] .chat__disclaimer { align-self: center; width: min(100%, var(--ask-col)); padding: 0 0 4px; text-align: center; }
.ask .chat__threads { align-self: center; width: min(100%, var(--ask-col)); max-height: 52vh; }

/* a chart in an answer on the questions page: wider than the text, never the
   whole page — columns and lines turn to needles past this width */
.ask .chat__log > .chat__chart { width: min(100%, 900px); }

/* the copy button, beside the thumbs under an answer (chat/ui.js addVerdict) */
.chat__copy { color: var(--ink-2); filter: none; }
.chat__copy svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat__copy[data-done="true"] { opacity: 1; color: var(--good-text, var(--good)); }

/* ── signed bars: what added and what took away, a row each ──────────────────
   charts/signedbars.js. The number line runs left to right on an RTL page too. */
.sbars { display: flex; flex-direction: column; gap: 2px; padding: 4px 2px 6px; }
.sbars__row {
  display: grid; grid-template-columns: minmax(96px, 30%) minmax(0, 1fr) minmax(64px, auto);
  align-items: center; column-gap: 12px; padding: 5px 4px; border-radius: 6px;
}
.sbars__row:hover { background: var(--surface-sunk); }
.sbars__name { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbars__track { position: relative; height: 16px; direction: ltr; }
.sbars__bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--ink-3); }
.sbars__row[data-sign="up"] .sbars__bar { background: var(--series-1); }
.sbars__row[data-sign="down"] .sbars__bar { background: var(--critical); }
.sbars__zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3); }
.sbars__v { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; direction: ltr; color: var(--ink); }
.sbars__unit { margin: 6px 4px 0; font-size: 12px; color: var(--ink-3); text-align: end; }

/* ── the conversations at the side of the questions page (dashboard.js) ──────
   The reader's earlier conversations beside the one in view. Open: a quiet
   column, a row a conversation. Closed: a slim rail with its button. Under
   1000px there is no room for it, and the box's own שיחות button serves. */
.ask__side {
  /* a fixed width: a long first question is cut with an ellipsis, it does
     not widen the column (seen live, 2026-11-10) */
  flex: 0 0 310px; width: 310px; min-width: 0; overflow: hidden; position: sticky; top: 12px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px;
  height: calc(100vh - var(--ask-top, 150px) - 12px); padding: 12px 10px;
  border-radius: 16px; background: var(--surface-sunk);
}
.ask__sidehead { display: flex; align-items: center; gap: 8px; }
.ask__sidetitle { margin-inline-end: auto; font-size: 13.5px; color: var(--ink-2); }
.ask__sidetoggle {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.ask__sidetoggle:hover, .ask__sidetoggle:focus-visible { background: var(--surface); color: var(--brand); outline: none; }
.ask__new {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.ask__new:hover, .ask__new:focus-visible { border-color: var(--brand); color: var(--brand); outline: none; }
.ask__threads { flex: 1 1 auto; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; gap: 2px; }
.ask__threads .chat__thread, .ask__threads .chat__threadopen { min-width: 0; max-width: 100%; }
.ask__threads .chat__threadmeta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__threads .chat__thread { border: 0; background: transparent; }
.ask__threads .chat__thread:hover, .ask__threads .chat__thread[data-current="true"] { background: var(--surface); }
.ask__threads .chat__threadopen { padding: 7px 10px; }
.ask__threads .chat__threadtitle { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__threads .chat__threadmeta { font-size: 11px; }
/* the delete button lies over the row's end and shows on hover, so the
   question has the whole row (the user, 2026-11-10: "isn't it too narrow?") */
.ask__threads .chat__thread { position: relative; }
.ask__threads .chat__threaddel {
  position: absolute; inset-block: 4px; inset-inline-end: 4px; opacity: 0; pointer-events: none;
  background: var(--surface); border-radius: 8px;
}
.ask__threads .chat__thread:hover .chat__threaddel, .ask__threads .chat__threaddel:focus-visible { opacity: 1; pointer-events: auto; }
.ask__threads .chat__note { padding: 6px 10px; background: transparent; font-size: 12px; }
.ask[data-side="closed"] .ask__side { flex-basis: 46px; width: 46px; padding: 8px; background: transparent; }
.ask[data-side="closed"] .ask__sidetitle,
.ask[data-side="closed"] .ask__new,
.ask[data-side="closed"] .ask__threads { display: none; }
@media (min-width: 1001px) {
  /* the list is at the side: the box need not carry the two buttons */
  .ask[data-side="open"] .chat__tools .chat__threadbtns { display: none; }
}
@media (max-width: 1000px) { .ask__side { display: none; } }
