/* Стили «Памяти» — беседы, как в чате. Владелец — по карте слотов 00-plan §4; цвета только из theme.css.
   Одно поле (composer.js) и один вид сообщений (answer.js) для страницы «Память» (#/ask), поля над вкладками встречи
   и «Сводки» проекта; ответ встречи в правой колонке, панель ответа проекта, панель источника. Вопрос — пузырь справа,
   ответ — текст слева со значком «Памяти»; всё тихое: воздух, тонкие линии, без заливок цветом акцента. */

/* ---------- The field: a rounded box, the text grows to eight lines, the chips of the scope and the round arrow. --- */
.ask { margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.ask-composer { --ask-line: 24px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ask-box { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 8px 16px; border: 1px solid var(--border-strong); border-radius: 24px; background: var(--card); box-shadow: var(--lift); transition: border-color .12s; }
.ask-box:focus-within { border-color: var(--ring); }
.ask-input { display: block; width: 100%; min-height: calc(var(--ask-line) + 8px); max-height: calc(var(--ask-line) * 8 + 8px); padding: 4px 0; border: 0; outline: 0; resize: none; overflow-y: auto; background: transparent; color: var(--foreground); font: inherit; font-size: 15px; line-height: var(--ask-line); overflow-wrap: anywhere; }
.ask-input::placeholder { color: var(--muted-foreground); }
.ask-input:disabled { cursor: not-allowed; }
.w-shell .ask-input:focus-visible { outline: none; } /* the box shows the focus */
.ask-box-foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ask-box-end { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.ask-count { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ask-count.is-over { color: var(--danger); }
.ask-send { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); transition: opacity .12s, background-color .12s; }
.ask-send .w-i { width: 17px; height: 17px; stroke-width: 2.25; }
.ask-send:hover:not(:disabled) { opacity: .86; }
.ask-send:disabled { background: var(--secondary); color: var(--muted-foreground); cursor: default; }
.ask-send.is-stop .w-i { width: 14px; height: 14px; }
.ask-limit, .ask-off { margin: 0 16px; font-size: 13px; line-height: 20px; }
.ask-limit { color: var(--danger); }
.ask-off { color: var(--muted-foreground); }

/* The chips of the scope, as the tools of a chat: small, quiet, a name too long ends in «…». In a conversation the
   field sits at the bottom of the screen, so there their menus open upwards, over it; elsewhere they open down as every
   menu does (on a phone every menu is a sheet from below, placed by popover.css). */
.ask-tools { display: flex; align-items: center; gap: 4px; min-width: 0; margin-left: -8px; }
.ask-tool-wrap { min-width: 0; }
@media (min-width: 761px) { .ak-dock .ask-tool-wrap .w-pop { top: auto; bottom: calc(100% + 8px); } }
.ask-tool { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted-foreground); font-size: 13px; white-space: nowrap; transition: background-color .12s, color .12s; }
button.ask-tool:hover { background: var(--hover); color: var(--foreground); }
.ask-tool > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ask-tool .w-i { flex-shrink: 0; width: 14px; height: 14px; }
.ask-menu-note { margin: 2px 10px 6px; font-size: 12.5px; line-height: 18px; color: var(--muted-foreground); }
/* «Свои даты»: «С» over «По» — two fields of a date side by side were wider than the menu and stuck out of it. */
.ask-dates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 6px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.ask-dates .w-btn { justify-self: start; }

/* ---------- Questions in one press: under a new field, of a meeting, of a project, the follow-ups. ---------- */
.ask-prompts { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ask-prompt { max-width: 100%; min-height: 32px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 16px; background: transparent; color: var(--body); font-size: 13px; line-height: 20px; text-align: left; overflow-wrap: anywhere; transition: background-color .12s, color .12s; }
.ask-prompt:hover { background: var(--hover); color: var(--foreground); }

/* ---------- A turn: the question a bubble on the right, the answer text on the left beside the mark. ---------- */
.ask-turn { display: flex; flex-direction: column; gap: 14px; padding: 14px 0; }
.ask-ask { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
.ask-q { max-width: min(80%, 560px); margin: 0; padding: 9px 15px; border-radius: 20px; background: var(--secondary); color: var(--foreground); font-size: 15px; line-height: 23px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-turn-scope { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0; font-size: 12.5px; color: var(--muted-foreground); }
.ask-turn-scope span { min-width: 0; overflow-wrap: anywhere; }
.ask-turn-scope .w-i { flex-shrink: 0; width: 12px; height: 12px; }
.ask-answer { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.ask-mark { flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 999px; border: 1px solid var(--border); color: var(--foreground); }
.ask-mark .w-i { width: 14px; height: 14px; }
.ask-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ask-body > * { max-width: 100%; }

/* The words of a question that narrowed it, chips «из вопроса» under its bubble; the cross asks again without them. */
.ask-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 100%; }
.ask-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 28px; padding: 0 2px 0 10px; border-radius: 999px; background: var(--secondary); color: var(--body); font-size: 12.5px; white-space: nowrap; }
.ask-chip > span, .ask-chip small { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ask-chip small { font-size: 12px; color: var(--muted-foreground); }
.ask-chip-x { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; color: var(--muted-foreground); }
.ask-chip-x:hover { background: var(--hover); color: var(--foreground); }
.ask-chip-x .w-i { width: 13px; height: 13px; }

.ask-status { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; line-height: 22px; color: var(--muted-foreground); }
.ask-status .w-i { width: 15px; height: 15px; }
.ask-error { align-self: stretch; }

.ask-a { margin: 0; font-size: 15px; line-height: 24px; color: var(--foreground); overflow-wrap: anywhere; }
.ask-a.is-quiet { color: var(--body); }
.ask-claims { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ask-claim > p[dir] { margin: 0; font-size: 15px; line-height: 24px; color: var(--foreground); overflow-wrap: anywhere; }
/* The numbers of the sources: small, raised as footnotes, one press opens the source. */
.ask-refs { white-space: nowrap; }
.ask-ref { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 3px; padding: 0 4px; border-radius: 6px; background: var(--secondary); color: var(--body); font-size: 11px; font-weight: 560; line-height: 1; font-variant-numeric: tabular-nums; text-decoration: none; vertical-align: 2px; transition: background-color .12s, color .12s; }
.ask-ref:hover { background: var(--hover); color: var(--foreground); box-shadow: 0 0 0 1px var(--border-strong); }
.ask-badge { display: inline-flex; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--secondary); color: var(--body); font-size: 12px; line-height: 20px; }
.ask-badge.is-decision { background: var(--accent-soft); color: var(--accent-ink); }
.ask-badge-now { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; font-size: 12.5px; color: var(--late); }

/* «Источники · N» and «Просмотрено N встреч»: a quiet line each, that opens. */
.ask-sources-box, .ask-where { align-self: stretch; font-size: 13px; color: var(--muted-foreground); }
.ask-sources-box > summary, .ask-where > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px; margin-left: -8px; border-radius: 8px; cursor: pointer; list-style: none; }
.ask-sources-box > summary::-webkit-details-marker, .ask-where > summary::-webkit-details-marker { display: none; }
.ask-sources-box > summary .w-i, .ask-where > summary .w-i { width: 14px; height: 14px; transition: transform .12s; }
.ask-sources-box[open] > summary .w-i, .ask-where[open] > summary .w-i { transform: rotate(180deg); }
.ask-sources-box > summary:hover, .ask-where > summary:hover { background: var(--hover); color: var(--foreground); }
.ask-sources { display: flex; flex-direction: column; gap: 1px; margin: 4px -8px 0; padding: 0; list-style: none; }
.ask-quote { display: block; width: 100%; padding: 6px 8px; border-radius: 9px; text-align: left; color: inherit; text-decoration: none; transition: background-color .12s; }
a.ask-quote:hover, button.ask-quote:hover { background: var(--hover); }
.ask-source-head { display: block; font-size: 12.5px; line-height: 18px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ask-source-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 13px; line-height: 19px; color: var(--body); overflow-wrap: anywhere; }
.ask-tag { display: block; font-size: 12px; line-height: 18px; color: var(--muted-foreground); }
.ask-coverage { margin: 4px 0 0; font-size: 12.5px; line-height: 18px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.ask-note { margin: 4px 0 0; font-size: 12.5px; line-height: 18px; color: var(--muted-foreground); }

.ask-conflict { align-self: stretch; padding: 12px 14px; border-radius: 14px; background: var(--late-bg); border: 1px solid var(--late-border); font-size: 13.5px; line-height: 21px; color: var(--body); }
.ask-conflict b { color: var(--foreground); }
.ask-conflict ul { margin: 6px 0; padding-left: 18px; }
.ask-conflict li { overflow-wrap: anywhere; }
.ask-conflict p { margin: 0; }

/* What to do with an answer: small icons under it; the steps of «не нашёл» and of a conflict are quiet buttons. */
.ask-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-left: -6px; }
.ask-conflict .ask-acts { margin: 8px 0 0; }
.ask-marked { padding: 0 8px; font-size: 13px; color: var(--muted-foreground); }

/* «Память» with no meeting to read. */
.ask-empty { display: flex; flex-direction: column; gap: 12px; }
.ask-how { font-size: 13.5px; color: var(--body); }
.ask-how summary { cursor: pointer; color: var(--accent-ink); }

/* ---------- The answer beside a meeting (under the player) and beside a project (a panel on the right). ---------- */
.ask-aside { display: flex; flex-direction: column; min-width: 0; }
.ask-aside-bar { display: flex; align-items: center; gap: 6px; }
.ask-aside-bar .w-h3 { margin: 0 auto 0 0; }
.ask-aside-scope { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted-foreground); }
.ask-panel { position: fixed; z-index: 20; top: 12px; right: 12px; bottom: 12px; width: 440px; max-width: calc(100% - 24px); overflow: auto; padding: 16px 20px 24px; border-radius: 20px; background: var(--card); color: var(--foreground); box-shadow: var(--w-sheet-shadow); }

/* ---------- «Память»: the chats on the left, the conversation in a column, the source on the right. ---------- */
.shell-page .w-main:has(> .ak) { padding-bottom: 0; } /* the field rests on the bottom of the screen, as in a chat */
.ak { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; align-items: start; }
.ak.has-source { grid-template-columns: 220px minmax(0, 1fr) 320px; }

.ak-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 4px; height: calc(100dvh - 40px); min-width: 0; }
.ak-side-top { display: flex; align-items: center; gap: 4px; }
.ak-new { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; color: var(--foreground); font-size: 14px; text-decoration: none; transition: background-color .12s; }
.ak-new:hover { background: var(--hover); }
.ak-new .w-i { flex-shrink: 0; color: var(--muted-foreground); }
.ak-side-close { display: none; } /* only where the chats are a drawer */
.ak-side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; padding: 0 2px 0 10px; }
.ak-side-title { font-size: 12.5px; font-weight: 560; color: var(--muted-foreground); }
.ak-find[aria-expanded="true"] { background: var(--hover); color: var(--foreground); }
.ak-search { flex-shrink: 0; height: 34px; margin: 4px 0; }
.ak-chats { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px 12px; }
.ak-group-title { margin: 14px 0 4px; padding: 0 10px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--muted-foreground); }
.ak-group:first-child .ak-group-title { margin-top: 6px; }
.ak-list { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; }
.ak-chat { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 10px; transition: background-color .12s; }
.ak-chat:hover, .ak-chat.is-on, .ak-chat.has-menu { background: var(--hover); }
.ak-chat.is-on .ak-chat-title { color: var(--foreground); font-weight: 500; }
.ak-chat-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 10px; color: inherit; text-decoration: none; }
.ak-chat-title { flex: 1; min-width: 0; font-size: 14px; color: var(--body); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ak-origin { flex-shrink: 0; font-size: 11.5px; color: var(--muted-foreground); }
.ak-chat .w-popwrap { flex-shrink: 0; margin-right: 4px; }
/* «⋯» shows itself on a hover, on the focus and while its menu is open; a touch screen has no hover, so it stays. */
.ak-chat .ak-chat-more { opacity: 0; }
.ak-chat:hover .ak-chat-more, .ak-chat .ak-chat-more:focus-visible, .ak-chat.has-menu .ak-chat-more { opacity: 1; }
@media (hover: none) { .ak-chat .ak-chat-more { opacity: 1; } }
.ak-none { margin: 6px 10px; font-size: 13px; color: var(--muted-foreground); }
.ak-more { display: block; margin: 8px 6px 0; padding: 6px 4px; border: 0; background: transparent; color: var(--muted-foreground); font-size: 13px; }
.ak-more:hover:not(:disabled) { color: var(--foreground); }
.ak-scrim { display: none; } /* only under the drawer of a phone */

.ak-main { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 760px; min-width: 0; min-height: calc(100dvh - 20px); margin: 0 auto; }
.ak-head { display: flex; align-items: center; gap: 4px; min-height: 36px; }
.ak-head.is-bare { display: none; } /* a new chat on a computer: the question is the heading */
.ak-chats-btn, .ak-fresh { display: none; } /* a phone's: the chats are a drawer there */
.ak-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; line-height: 22px; font-weight: 560; color: var(--foreground); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ak-feed { flex: 1; min-width: 0; padding-top: 4px; }
.ak-dock { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 12px 0 16px; background: linear-gradient(to bottom, transparent, var(--background) 24px); }
.ak-down { position: absolute; top: -32px; left: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin-left: -18px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--foreground); box-shadow: var(--w-pop-shadow); }
.ak-down[hidden] { display: none; }
.ak-end { display: block; height: 0; }
.ak-full { padding: 14px 16px; border-radius: 18px; background: var(--sunken); font-size: 13.5px; }
.ak-full p { margin: 0 0 10px; }

/* A new chat: the question and the field in the middle of the screen, the questions to start with under it. */
.ak-main.is-empty { justify-content: center; }
.ak-hello { display: flex; flex-direction: column; gap: 14px; width: 100%; padding: 0 0 12vh; }
.ak-hello-title { margin: 0 0 6px; font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; text-align: center; color: var(--foreground); }
.ak-hello .ask-prompts { justify-content: center; }

/* ---------- The panel of a source. ---------- */
.ask-source-panel { position: sticky; top: 20px; max-height: calc(100dvh - 40px); overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--sunken); }
.ask-panel-bar { display: flex; align-items: center; justify-content: space-between; }
.ask-panel-item { display: flex; flex-direction: column; gap: 8px; }
.ask-panel-head { margin: 0; font-size: 12.5px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ask-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ask-line { padding: 6px 8px; border-radius: 9px; font-size: 13px; line-height: 19px; color: var(--body); overflow-wrap: anywhere; }
.ask-line.is-quoted { background: var(--card); color: var(--foreground); box-shadow: var(--control-edge); }
.ask-line-head { display: block; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ask-line-head b { font-weight: 540; color: var(--foreground); }
.ask-player { width: 100%; max-height: 200px; border-radius: 12px; background: var(--w-player); }
.ask-panel-item .w-btn { align-self: flex-start; }

@media (max-width: 1100px) {
  .ak, .ak.has-source { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .ak.has-source .ask-source-panel { position: fixed; z-index: 20; top: 12px; right: 12px; bottom: 12px; width: 360px; max-height: none; box-shadow: var(--w-sheet-shadow); background: var(--card); }
  .w-dcol-side.has-answer .ask-aside { order: 0; width: 100%; }
}

@media (max-width: 760px) {
  /* The fields are 16px on a phone (iOS zooms into smaller text); 44px, the finger's target. */
  .ask-input { font-size: 16px; }
  .ask-box { padding: 8px 8px 6px 14px; }
  .ask-send { width: 44px; height: 44px; }
  .ask-tool, .ask-prompt, .ask-chip { min-height: 44px; }
  .ask-tool { height: 44px; padding: 0 10px; }
  .ask-chip-x { width: 44px; height: 44px; }
  .ask-ref { min-width: 28px; height: 28px; vertical-align: 0; }
  .ask-sources-box > summary, .ask-where > summary { min-height: 44px; }
  .ask-acts .w-btn, .ask-acts .w-ib, .ask-panel-bar .w-ib, .ask-aside-bar .w-ib, .ak-head .w-ib { min-height: 44px; min-width: 44px; }
  .ask-q { max-width: 88%; }
  /* The prompts: one line that scrolls sideways instead of wrapping (owner, 06.11.2026); the row has the room of the
     ring of focus, which a row that scrolls would cut, and the margin takes it back. */
  .ask-prompts, .ak-hello .ask-prompts { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin: -4px; padding: 4px; }
  .ask-prompts::-webkit-scrollbar { display: none; }
  .ask-prompt { flex-shrink: 0; max-width: none; white-space: nowrap; }
  .ask-mark { display: none; } /* the column is narrow: the answer takes its width */

  /* The conversation takes the screen; the chats are a drawer from the left by the icon of the head; a source is a
     sheet from below. The drawer never moves by a transform: a menu in it is a sheet fixed to the screen. */
  .ak, .ak.has-source { display: block; }
  .ak-side { display: none; }
  .ak.is-list .ak-side { display: flex; position: fixed; z-index: 41; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); height: auto; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); background: var(--card); box-shadow: var(--w-sheet-shadow); }
  .ak.is-list .ak-scrim { display: block; }
  .ak-side-close { display: inline-flex; width: 44px; height: 44px; }
  .ak-new, .ak-chat-link { height: 44px; font-size: 15px; }
  .ak-chat-title { font-size: 15px; }
  .ak-chat-more { width: 44px; height: 44px; }
  .ak-main { min-height: calc(100dvh - 60px - var(--bottom-h)); }
  .ak-head, .ak-head.is-bare { display: flex; margin: -8px -8px 0; }
  .ak-chats-btn, .ak-fresh { display: inline-flex; }
  .ak-head.is-bare { position: absolute; top: 0; left: 0; }
  .ak-hello-title { font-size: 22px; line-height: 30px; }
  .ak-hello { padding-bottom: 8vh; }
  .shell-page .w-main:has(> .ak) { padding-bottom: 0; }
  .ak-dock { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 12px; } /* it rides above the bottom bar, not under it */
  .ak-end { height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px)); } /* the end of a chat clears the bottom bar */
  .ak.has-source .ask-source-panel { position: fixed; z-index: 36; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 75dvh; border-radius: 20px 20px 0 0; background: var(--card); box-shadow: var(--w-sheet-shadow); }

  /* A narrow phone: the chips drop their icon of a kind, so both names fit beside the arrow; with the counter shown
     near the limit the names end in «…», the menu still names them whole. */
  @media (max-width: 420px) {
    .ask-tools { gap: 0; }
    .ask-tool { padding: 0 8px; }
    .ask-tool > .w-i:first-child { display: none; }
  }

  /* The answer beside a meeting: a sheet over the page, the player a mini bar on top of it. */
  .w-dcol-side.has-answer .ask-aside { position: fixed; z-index: 30; inset: 0; overflow: auto; padding: 16px 16px calc(var(--bottom-h) + 32px); background: var(--card); } /* its end clears the bottom bar */
  .w-dcol-side.has-answer .w-player-wrap ~ .ask-aside { padding-top: 112px; }
  .w-dcol-side.has-answer .w-player-wrap { position: fixed; z-index: 31; top: 0; left: 0; right: 0; margin: 0; width: auto; }
  .w-dcol-side.has-answer .w-player-stage, .w-dcol-side.has-answer .w-parts { display: none; }
  .ask-panel { inset: 0; width: auto; max-width: none; border-radius: 0; padding-bottom: calc(var(--bottom-h) + 24px); }
}
