/* The ask box (QuestionsController): the question form, an answer with its
   numbered citations (KB's indigo), what it cited and looked at, the past
   questions. Tokens come from application.css; nothing sets a width that
   could scroll at 390 px. */
.ask-form { display: flex; flex-direction: column; gap: 10px; }
.ask-form textarea { min-height: 84px; font-size: 16px; line-height: 1.45; }
.ask-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ask-spend { margin: 8px 2px 16px; }

h1.ask-question { font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }

.ask-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.ask-status-slot:empty, .ask-answer-slot:empty, .ask-steps-slot:empty { display: none; }
.ask-status { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.ask-pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; animation: ask-pulse 1.2s ease-in-out infinite; }
@keyframes ask-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .ask-pulse { animation: none; } }
.ask-failure { margin: 0; overflow-wrap: anywhere; }

.ask-answer { font-size: 16px; }
.ask-answer.is-writing > :last-child::after { content: "▍"; color: var(--accent); margin-left: 2px; }

/* A citation: a small numbered link, indigo (KB's), raised a little. */
.cites { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 2px; vertical-align: super; line-height: 1; font-size: 11px; }
.cite {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink);
  font: 500 11px "IBM Plex Mono", monospace; text-decoration: none; line-height: 1;
}
a.cite:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cite-unread { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.cite-missing { background: none; border-style: dashed; border-color: var(--danger); color: var(--danger); }
@media (max-width: 720px) {
  /* A finger-sized target without changing the line's look. */
  .cites { gap: 6px; }
  .cite { position: relative; }
  a.cite::after { content: ""; position: absolute; inset: -12px -6px; }
}

.ask-cited { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.ask-cited-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ask-cited-list li { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 14px; }
.ask-cited-list .cite { flex: none; min-width: 24px; }
.ask-cited-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.ask-cited-body a { color: var(--ink); text-decoration-color: var(--accent-line); }
.ask-warning { margin-top: 10px; color: var(--amber); }
.ask-error-text { color: var(--danger); overflow-wrap: anywhere; }

.ask-foot { border-top: 1px solid var(--line-soft); padding-top: 10px; overflow-wrap: anywhere; }
.ask-cost { color: var(--ink); font-weight: 600; }

.ask-steps > summary { min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent-ink); font-size: 13px; font-weight: 500; list-style: none; text-decoration: none; }
.ask-steps > summary::-webkit-details-marker { display: none; }
.ask-steps > summary::before { content: "▸"; display: inline-block; width: 1em; }
.ask-steps[open] > summary::before { content: "▾"; }
.ask-steps-list { margin: 4px 0 0; padding-left: 1.6em; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ask-steps-list li { overflow-wrap: anywhere; min-width: 0; }
.ask-steps-list li::marker { color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.ask-step { margin-right: 6px; }
.ask-arg { color: var(--muted); }
.ask-step-result { white-space: nowrap; }
.ask-steps-list li.is-error .ask-step-result { white-space: normal; }

.ask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ask-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line-soft); min-width: 0; }
.ask-row:first-child { border-top: 0; padding-top: 0; }
.ask-row-title { color: var(--ink); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; text-decoration: none; }
.ask-row-title:hover { color: var(--accent-ink); text-decoration: underline; }

/* The word before a citation, its chips and the punctuation after stay together. */
.cite-tail { white-space: nowrap; }
/* The Cited list: a fixed column for the numbers; takeaways under their note. */
.ask-cited-num { flex: none; width: 28px; display: flex; }
.ask-cited-takeaways { list-style: none; margin: 6px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ask-cited-takeaways li { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ask-cited-takeaways .cite { flex: none; min-width: 24px; }
.ask-cited-takeaways a { color: var(--ink-2); text-decoration-color: var(--line); }
/* Each note (or item) of the Cited list is its own row, numbered or not. */
.ask-cited-list > li + li { border-top: 1px solid var(--line-soft); padding-top: 8px; }
/* A search's words, as typed (quotes and all). */
.ask-query { font-family: "IBM Plex Mono", monospace; font-size: 12px; padding: 0 4px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-soft); overflow-wrap: anywhere; }

/* A draft (being checked, or never checked): set apart, never read as the answer. */
.ask-draft-label { color: var(--amber); font-weight: 500; }
.ask-answer.is-draft { color: var(--ink-2); border-left: 3px solid var(--amber); padding-left: 12px; }
.ask-unchecked > summary, .ask-review > summary { min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent-ink); font-size: 13px; font-weight: 500; list-style: none; text-decoration: none; }
.ask-unchecked > summary::-webkit-details-marker, .ask-review > summary::-webkit-details-marker { display: none; }
.ask-unchecked > summary::before, .ask-review > summary::before { content: "▸"; display: inline-block; width: 1em; }
.ask-unchecked[open] > summary::before, .ask-review[open] > summary::before { content: "▾"; }
.ask-unchecked .ask-warning { margin: 0 0 8px; }
.ask-review-list { margin: 4px 0 0; padding-left: 1.6em; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ask-review-list li { overflow-wrap: anywhere; min-width: 0; }
.ask-review-before, .ask-review-after { display: block; margin-top: 2px; padding-left: 8px; border-left: 2px solid var(--line); color: var(--muted); }
.ask-review-before { text-decoration: line-through; text-decoration-color: var(--line); }
.ask-review-after { border-left-color: var(--accent-line); color: var(--ink-2); }
.ask-review-none { margin: 0; }
/* A note cited only through its takeaways: its number, not a chip. */
.ask-cited-group { min-width: 24px; text-align: center; color: var(--muted); font: 500 11px "IBM Plex Mono", monospace; line-height: 18px; }
/* The cost line's parts wrap between, never inside (a model name). */
.ask-foot-part { white-space: nowrap; }
.ask-nowrap { white-space: nowrap; }
.ask-cited { margin-top: 4px; }
.ask-caveat { margin: 0; }
