/* The Ask screen (js/views/ask.js): a message list, "From the app" figures under an answer, and an input that
   stays at the bottom of the window above the tab bar. Colours are the app's tokens, so light and dark both work. */

.ask-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ask-thread { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ask-thread:empty { display: none; }

.ask-msg { min-width: 0; max-width: 100%; border-radius: var(--radius); padding: 10px 12px; border: 1px solid var(--border); }
.ask-msg.user { align-self: flex-end; max-width: 88%; background: var(--accent-tint); }
.ask-msg.assistant { align-self: stretch; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.ask-msg.thinking { background: var(--surface-2); box-shadow: none; color: var(--text-2); }
.ask-msg.kind-error, .ask-msg.kind-withheld, .ask-msg.kind-unfinished { background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
.ask-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-lead { font-weight: 600; }
.ask-text a.ask-link { display: inline; min-height: 0; margin: 0; padding: 0; }
.ask-notice { margin: 0; }
.ask-note-line, .ask-label { margin: 0; }

.ask-numbers { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ask-numbers h3 { margin: 0; font-size: 0.9rem; }
.ask-numbers h4 { margin: 6px 0 0; font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.ask-kv { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.ask-kv-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px 12px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--border); }
.ask-kv-row:last-child { border-bottom: 0; }
.ask-kv dt { color: var(--text-2); font-size: 0.88rem; min-width: 0; overflow-wrap: anywhere; flex: 1 1 8em; }
.ask-kv dd { margin: 0; min-width: 0; text-align: right; flex: 0 1 auto; overflow-wrap: anywhere; }
.ask-value { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.ask-detail { display: block; font-size: 0.8rem; color: var(--text-3); }

/* The input stays in view while the conversation grows. */
.ask-dock {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 5;
  background: var(--bg); padding: 8px 0 2px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.ask-composer { display: flex; align-items: flex-end; gap: 8px; }
.ask-field { flex: 1 1 auto; min-width: 0; }
.ask-composer textarea { resize: vertical; min-height: var(--tap); max-height: 40vh; line-height: 1.4; }
.ask-composer textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
.ask-composer .btn { flex: none; min-height: var(--tap); }
.ask-line { margin: 0; }

/* Saving from the chat (js/views/ask.js "Saving from the chat"): the trust line, the confirm card, the saved card. */
.ask-trust { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.ask-trust-line { margin: 0; overflow-wrap: anywhere; }
.ask-trust-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ask-trust-actions .btn { min-height: var(--tap); }

.ask-save { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ask-save.ask-pending { border-left-color: var(--caution); }
.ask-save h3 { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.ask-save-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ask-save-items li { display: flex; flex-direction: column; gap: 1px; padding-bottom: 6px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.ask-save-items li:last-child { border-bottom: 0; padding-bottom: 0; }
.ask-save-name { font-weight: 600; }
.ask-save-amount { font-variant-numeric: tabular-nums; }
.ask-save-meta, .ask-save-status, .ask-save-error, .ask-save-note { margin: 0; }
.ask-taste-line { font-weight: 600; overflow-wrap: anywhere; }
.ask-save-error:empty, .ask-save-status:empty { display: none; }
.ask-save-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-save-actions .btn { min-height: var(--tap); flex: 1 1 auto; }

/* The warning sheet (js/views/ai.js confirmTrust) and the choice in Settings. */
.trust-points { margin: 8px 0; padding-left: 1.3em; list-style: disc; font-size: 0.95rem; }
.trust-points li { margin: 0 0 4px; padding-left: 2px; }
.ai-trust { min-width: 0; }
