/* Ask.  OWNER: U - 07 from phase V1 (seeded by Ultron for the mockup). */

/* home: the sun above the typing box, a little above the middle of the sky */
.ask-home {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s3); padding: var(--s4) var(--s2) max(22vh, 140px);
  width: min(var(--read), 100%); margin: 0 auto;
}
.ask-home .sun { width: 120px; margin-bottom: var(--s1); }
@media (max-width: 860px) { .ask-home { min-height: calc(100dvh - 72px); padding-bottom: max(18vh, 110px); } }

/* the 40 px send arrow gets a 44 px hit area without changing its look */
.ask-stage .send::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; }

/* after sending: the thread, with the typing box docked at the bottom */
.ask-wrap { min-height: 100dvh; display: flex; flex-direction: column; }
.ask-thread {
  flex: 1; width: min(var(--read), 100%); margin: 0 auto;
  padding: var(--s6) var(--s2) var(--s3); display: grid; align-content: start; gap: var(--s6);
}
.ask-dock {
  position: sticky; bottom: 0; z-index: 5;
  width: min(var(--read), 100%); margin: 0 auto; padding: var(--s1) var(--s2) var(--s3);
}
.ask-dock::before {    /* fades the thread out under the box */
  content: ""; position: absolute; inset: -24px 0 0; z-index: -1;
  background: linear-gradient(180deg, rgb(253 244 232 / 0), rgb(253 244 232 / 0.92) 40%);
}
@media (max-width: 860px) {
  .ask-wrap { min-height: calc(100dvh - 72px); }
  .ask-dock { bottom: calc(64px + env(safe-area-inset-bottom)); padding-left: 76px; }
  .ask-thread { padding-top: var(--s4); }
}

/* anything focused in the thread scrolls clear of the docked box (and the phone's bottom bar) */
.ask-thread :is(a, button, textarea, [tabindex]) { scroll-margin-bottom: calc(var(--s8) * 3); }

.entry { display: grid; gap: var(--s2); scroll-margin-top: var(--s4); }
.you { justify-self: end; max-width: min(520px, 88%); display: grid; justify-items: end; gap: 6px; }
.you-text {
  padding: 12px 16px; border-radius: var(--r-card) var(--r-card) 6px var(--r-card);
  background: var(--sand); white-space: pre-wrap; overflow-wrap: anywhere;
}
.you-searched { text-align: right; }

.answer { display: grid; gap: var(--s2); animation: rise var(--slow) var(--ease); }
.answer .prose { overflow-wrap: anywhere; }
/* the card takes focus only so screen readers start reading there (tabindex -1, not a control):
   no ring, so it keeps its approved look; the next Tab lands on a ringed citation */
.answer:focus, .answer:focus-visible { outline: none; border-radius: var(--r-card); box-shadow: var(--lift); }
.answer .notice { margin-bottom: var(--s1); }
.sources-head { margin-top: var(--s2); padding-top: var(--s3); box-shadow: inset 0 1px 0 var(--hairline); }
/* The sources fold (2026-11-23): the same look as the steps fold */
.sources-fold { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; margin-left: -12px;
  border: 0; border-radius: var(--r-ctl); background: transparent; font: inherit; color: inherit; cursor: pointer; }
.sources-fold:hover { background: rgb(255 255 255 / 0.55); }
.sources-fold:focus-visible { outline: none; box-shadow: var(--ring); }
.sources-fold[aria-expanded="true"] .steps-chevron { transform: rotate(90deg); }
.answer-empty, .answer-error { grid-template-columns: auto 1fr; align-items: center; gap: var(--s2); }
.answer-error .btn-quiet { grid-column: 2; justify-self: start; }

.feedback { display: grid; gap: 10px; padding: 0 var(--s1); }
.feedback-line { display: flex; align-items: center; flex-wrap: wrap; gap: 2px var(--s1); }
.feedback-line .link-btn { margin-left: var(--s1); font-size: 15px; min-height: 44px; color: var(--evergreen); }   /* tide was 4.35:1 on the sky */
.thumb .icon { width: 19px; height: 19px; }
.thumb.down .icon { transform: rotate(180deg); }
.thumb[aria-pressed="true"] { color: var(--sky-low); background: var(--tide); }
.correction { display: grid; gap: var(--s1); }
.correction textarea { min-height: 88px; resize: vertical; }
.correction-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); }
.disclaimer { font-size: var(--t-sm); color: var(--evergreen-soft); }

/* the live steps while an answer is worked on, then one folded line (after Kokonut's AI Tool Calls) */
.steps {
  justify-self: start; width: min(100%, 460px);
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--lift);
  font-size: var(--t-sm); color: var(--evergreen); animation: rise var(--slow) var(--ease);
}
.steps-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 6px; }
.sun.is-tiny { width: 26px; }
.steps-title { font-weight: 600; flex: 1; }
.steps-list { list-style: none; margin: 0; padding: 4px 8px 10px; display: grid; }
.step {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 18px; align-items: center; gap: 8px;
  min-height: 34px; padding: 0 8px; border-radius: var(--r-ctl);
}
.step + .step { box-shadow: 0 -1px 0 var(--hairline); }
.step.is-new { animation: rise var(--fast) var(--ease); }
.step-icon .icon { width: 16px; height: 16px; color: var(--evergreen-soft); }
.step.is-running .step-icon .icon { color: var(--tide); }
.step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.is-running .step-label { font-weight: 500; }
.step.is-stopped .step-label { color: var(--evergreen-soft); }
.step-time { color: var(--evergreen-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-mark { display: grid; place-items: center; }
.step-mark .icon { width: 14px; height: 14px; color: var(--tide); }
.step-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tide); animation: step-pulse 1.4s var(--ease) infinite; }
@keyframes step-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.steps.is-done { width: auto; background: transparent; box-shadow: none; animation: none; }
.steps-fold {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; margin-left: -12px;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  font-size: var(--t-sm); color: var(--evergreen-soft);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.steps-fold:hover { background: rgb(255 255 255 / 0.55); color: var(--evergreen); }
.steps-fold:focus-visible { outline: none; box-shadow: var(--ring); }
.steps-chevron { width: 14px; height: 14px; transition: transform var(--fast) var(--ease); }
.steps-fold[aria-expanded="true"] .steps-chevron { transform: rotate(90deg); }
.steps.is-done .steps-list { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--lift); padding-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .answer, .entry .waiting, .steps, .step.is-new { animation: none; }
}

