/* ask.css — the 2.0 global Ask screen (#/ask; boards Ask + AskLight,
 * OPEN-QUESTIONS #36: no scope chip, one global thread, source cards).
 * Rules (the shell.mjs 2.0 stylesheet list): 2.0 token names only, no raw
 * hex, no prefers-color-scheme, no fixed phone-width px widths, v2- classes.
 *
 * Scroll model (mirrors the legacy Ask): the DOCUMENT scrolls, the header is
 * sticky (.v2-head), the dock (chips + input) is fixed above the floating nav
 * and lifted above the keyboard by js/views/ask-library.js (inline bottom +
 * the thread's grown padding-bottom). */

/* ---------- the thread panel ---------- */
.v2-ask__thread {
  gap: 0;
  padding-top: 16px;
}
/* Clear the dock (chips 36 + gap 8 + input 52 + its top pad 14) above the
 * floating nav (its height + its offset) — beats shell.css's has-tabbar
 * panel rule by specificity. */
body.v2.has-tabbar .v2-panel.v2-ask__thread {
  padding-bottom: calc(var(--nav-h) + max(14px, calc(env(safe-area-inset-bottom, 0px) - 4px)) + 136px);
}
body.v2:not(.has-tabbar) .v2-panel.v2-ask__thread {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 132px);
}

/* ---------- the clock button + its menu (the dropped scope chip's row) ---------- */
.v2-ask__tools {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.v2-ask__clock {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--r2-round);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--t-nav);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 31;
}
/* A 44pt hit area around the 38px visual. */
.v2-ask__clock::before {
  content: "";
  position: absolute;
  inset: -3px;
}
.v2-ask__scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
}
.v2-ask__menu {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 32;
  min-width: 12rem;
  padding: 6px;
  /* surface + row text: .v2-pop (shell.css) */
}
.v2-ask__menuitem {
  width: 100%;
  min-height: var(--hit-min);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r2-well);
  background: transparent;
  color: var(--danger);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.v2-ask__menuitem:active {
  background: var(--s-chip);
}
.v2-ask__menuitem:disabled {
  color: var(--t-dim);
  cursor: default;
}

/* ---------- exchanges ---------- */
.v2-ask__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.v2-ask__exchange {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.v2-ask__q {
  align-self: flex-end;
  max-width: 82%;
  box-sizing: border-box;
  padding: 11px 15px;
  border-radius: 20px 20px 6px 20px;
  background: var(--accent-pill);
  border: 1px solid var(--accent-glass-line);
  box-shadow: var(--sh-raised);
  color: var(--t-primary);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.v2-ask__a {
  color: var(--t-body);
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.v2-ask__a p,
.v2-ask__a ul,
.v2-ask__a ol {
  margin: 0;
}
.v2-ask__a ul,
.v2-ask__a ol {
  padding-left: 1.3em;
}
.v2-ask__a li + li {
  margin-top: 4px;
}
.v2-ask__a > * + * {
  margin-top: 10px;
}
.v2-ask__a strong {
  color: var(--t-primary);
  font-weight: 650;
}
/* The answer and its source cards read as one block. */
.v2-ask__a + .v2-ask__srcs {
  margin-top: -8px;
}

/* ---------- source cards ---------- */
.v2-ask__srcs {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.v2-ask__src {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hit-min);
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: var(--r2-chip);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.v2-ask__src:active {
  background: var(--s-chip);
}
.v2-ask__tile {
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r2-tile);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-line);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
}
.v2-ask__srctext {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.v2-ask__srctitle {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--t-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-ask__srcline {
  font-size: 11.5px;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* "Links for the first 200 …" under a very long list (batch 3 item 5). */
.v2-ask__srcmore {
  margin: 0;
  padding: 0 4px;
  font-size: 11.5px;
  color: var(--t-muted);
}
/* Item 27: a meeting's cited moment rides beside the line as "▶ 14:02" —
   a position on the recording (the transcript's m:ss), not a time of day. */
.v2-ask__srcts {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  margin-left: 0.55em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.v2-ask__chev {
  flex: none;
  display: flex;
  color: var(--t-chevron);
}
/* A SCREEN card (Ask lookup upgrade, 2026-10-13): the same card, a neutral
   tile — a Settings page or a main screen belongs to no skill's accent. */
.v2-ask__tile[data-skill="settings"] {
  background: var(--s-chip);
  border-color: var(--raised-line);
  color: var(--t-muted);
}

/* ---------- thinking ---------- */
.v2-ask__thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
}
.v2-ask__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: v2-ask-pulse 1.2s ease-in-out infinite;
}
.v2-ask__dot:nth-child(2) {
  animation-delay: 0.15s;
}
.v2-ask__dot:nth-child(3) {
  animation-delay: 0.3s;
}
/* The live status line under the dots (the import card's one status line,
   css/cookbook-import.css .v2-ri__status): what the server is really doing
   right now, replaced each time the step changes; never wraps. The dots and
   the line are one block so the line sits right under the dots. */
.v2-ask__working {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v2-ask__status {
  display: block;
  min-height: 1.35em;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes v2-ask-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* ---------- intro / loading / error ---------- */
.v2-ask__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-radius: var(--r2-bigcard);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  text-align: center;
}
.v2-ask__orb {
  width: 44px;
  height: 44px;
  border-radius: var(--r2-round);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-pill);
  color: var(--accent-ink);
}
.v2-ask__introtext {
  margin: 0;
  max-width: 22rem;
  color: var(--t-body);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}
.v2-ask__guestlink {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-min);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.v2-ask__loading {
  margin: 8px 0 0;
  color: var(--t-muted);
  font-size: 14px;
}
.v2-ask__error {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--r2-card);
  background: var(--s-well);
  border: 1px solid var(--well-line);
}
.v2-ask__list > .v2-ask__error:first-child {
  margin-top: 0;
}
.v2-ask__errortext {
  margin: 0;
  color: var(--t-muted);
  font-size: 14px;
  line-height: 1.45;
}
.v2-ask__retry {
  min-height: 36px;
  padding: 0 14px;
  margin-left: -2px;
  border-radius: var(--r2-round);
  border: 1px solid var(--raised-line);
  background: var(--s-card);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- the dock: suggestion chips + input (fixed above the nav) ---------- */
.v2-ask__dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40; /* over the thread, under the nav (50) and the create scrim (45) */
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  padding: 14px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, var(--page-clear), var(--s-panel) 14px);
}
/* At rest the dock sits on the floating nav: its height + its offset + 10. */
body.has-tabbar .v2-ask__dock {
  padding-bottom: calc(var(--nav-h) + max(14px, calc(env(safe-area-inset-bottom, 0px) - 4px)) + 10px);
}
.v2-ask__chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 var(--pad-x);
  scroll-padding: 0 var(--pad-x);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.v2-ask__chips::-webkit-scrollbar {
  display: none;
}
.v2-ask__chip {
  flex: none;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--r2-round);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--t-nav);
  font: inherit;
  font-size: 13px;
  font-weight: 570;
  white-space: nowrap;
  cursor: pointer;
}
.v2-ask__chip:active {
  background: var(--s-chip);
}
.v2-ask__chip:disabled {
  opacity: 0.5;
  cursor: default;
}
.v2-ask__inputrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad-x);
}
.v2-ask__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  box-sizing: border-box;
  padding: 0 18px;
  border-radius: var(--r2-round);
  background: var(--glass-nav);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-nav-line);
  color: var(--t-primary);
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.v2-ask__input::placeholder {
  color: var(--t-placeholder);
}
.v2-ask__input:focus {
  border-color: var(--accent-glass-line);
}
.v2-ask__send {
  width: 52px;
  height: 52px;
  flex: none;
  border: 0;
  border-radius: var(--r2-round);
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.v2-ask__send:disabled {
  opacity: 0.4;
  cursor: default;
}
