/* The assistant beside every screen (static/ui/assistant.js). At the side of the window, below the top bar; on a wide
   screen the page moves over for it, on a narrow one it covers the page and closes to a tab. */
:root { --assist-w: 360px; }                       /* the person drags it wider or narrower (assistant.js · resizer) */
.assist { position: fixed; inset-inline-end: 0; top: 61px; bottom: 0; width: var(--assist-w); z-index: 25; display: flex; flex-direction: column;
  background: var(--surface); border-inline-start: 1px solid var(--line); box-shadow: var(--shadow); }
.assist[hidden] { display: none; }
.assist-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.assist-head > div { display: grid; gap: 2px; }
.assist-question { padding: 12px 14px 0; max-height: 46vh; overflow: auto; flex: none; }
.assist-question:empty { display: none; }
.assist-body { flex: 1; overflow: auto; padding: 12px 14px; display: grid; gap: 12px; align-content: start; }
.assist-filled > summary { cursor: pointer; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.assist-filled .suggest { margin-top: 8px; }
.assist-filled.hidden { display: none; }
.assist-hint { margin: 0; }
.assist-q { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.assist-q.blocking { border-color: var(--warn); }
.assist-q.done { gap: 2px; }
.assist-q-meta { display: flex; justify-content: space-between; color: var(--ink-3); }
.assist-ask { margin: 0; font-weight: 600; }
.assist-q p { margin: 0; }
.assist-opts { display: grid; gap: 6px; }
.assist-opt { display: grid; justify-items: start; text-align: start; gap: 2px; white-space: normal; height: auto; padding: 8px 10px; }
.assist-why { color: var(--ink-3); font-weight: 400; }
.assist-free { display: flex; gap: 6px; }
.assist-free input { flex: 1; min-width: 0; }
.assist-states { display: flex; flex-wrap: wrap; gap: 10px; }
.assist-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.assist-msg { padding: 8px 10px; border-radius: var(--radius-sm); max-width: 92%; display: grid; gap: 4px; }
.assist-msg.me { background: var(--accent-soft); justify-self: start; }
.assist-msg.ai { background: var(--neutral-soft); justify-self: end; }
.assist-compose { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 6px; background: var(--surface); }
.assist-compose textarea { width: 100%; resize: vertical; min-height: 64px; }
.assist-actions { display: flex; align-items: center; gap: 8px; }
.assist-attach { position: relative; overflow: hidden; cursor: pointer; }
.assist-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.assist-files ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.assist-files li { background: var(--neutral-soft); border-radius: var(--radius-sm); padding: 2px 8px; font-size: 13px; }
.assist-tab { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 25; border-radius: 999px; padding: 10px 16px;
  background: var(--accent); color: #fff; border: 0; box-shadow: var(--shadow); font: inherit; font-weight: 600; cursor: pointer; }
.assist-tab[hidden] { display: none; }
.assist-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The page moves over for the panel only where both fit: from 1440 the page keeps more than its 1040 of two columns
   (narrower, the page's own layout still thinks it is wide and its columns overlap — the run of 11 November). The top
   bar keeps the whole width: the panel starts below it. Narrower, the panel opens over the page and closes to a tab. */
@media (min-width: 1440px) {
  body.assist-open:not(.assist-none) .app-foot,
  body.assist-open:not(.assist-none) .demo-strip { margin-inline-end: calc(var(--assist-w) + 12px); }
  /* 90% of the width beside the panel, centred in it */
  body.assist-open:not(.assist-none) .page { max-width: none; width: calc((100vw - var(--assist-w) - 12px) * 0.9);
    margin-inline-start: calc((100vw - var(--assist-w) - 12px) * 0.05);
    margin-inline-end: calc(var(--assist-w) + 12px + (100vw - var(--assist-w) - 12px) * 0.05); }
}
@media (max-width: 1439px) {
  .assist { width: min(420px, 100vw); }
  .assist-resize { display: none; }
}
/* the separator the person drags to make the panel wider or narrower (the owner, 13 November) */
.assist-resize { position: absolute; top: 0; bottom: 0; inset-inline-start: -4px; width: 8px; cursor: col-resize; z-index: 2; touch-action: none; }
.assist-resize::after { content: ""; position: absolute; top: 50%; inset-inline-start: 3px; width: 2px; height: 40px; margin-top: -20px; border-radius: 2px; background: var(--line); }
.assist-resize:hover::after, .assist-resize:focus-visible::after, body.assist-resizing .assist-resize::after { background: var(--accent, #2563eb); }
.assist-resize:focus-visible { outline: 2px solid var(--focus); }
body.assist-resizing { cursor: col-resize; user-select: none; }
@media print { .assist, .assist-tab { display: none !important; } }
body.assist-none .assist, body.assist-none .assist-tab { display: none !important; }
/* the walk of 13 November: at 1440–1699 px the assistant, the side column and the form shared the width, and the
   facilitators' table of services scrolled sideways in the form — the side column narrows while the assistant is open */
@media (min-width: 1440px) and (max-width: 1699px) {
  body.assist-open:not(.assist-none) .split { grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; }
}
