/* Ask everywhere (ASK_EVERYWHERE_ENABLED). Loaded by /ask-everywhere.js only while the flag is on.
   One card style for every page: Pearl by day, Smoke by night, from the app's own theme tokens (Journey's page and
   sheets pass their own j2 tokens). Rule 3: every row has a fixed height (head 16, chips 40, field 44, note one or
   two lines by the card's own width), the placeholder is the same box, chips scroll inside their row and never wrap,
   so nothing moves when chips arrive. Flat bronze is the one primary (the send button). */
.ask-card {
  --ask-glass: var(--glass, rgba(255,253,248,.66)); --ask-strong: var(--glass-strong, rgba(255,255,255,.94));
  --ask-hair: var(--hair, rgba(166,136,110,.26)); --ask-ink: var(--ink, #252525); --ask-ink-3: var(--ink-3, #666666);
  --ask-eye: var(--sand-text, #786450); --ask-soft: var(--sand-soft, #EFE8E0);
  --ask-primary: var(--primary, var(--sand-deep, #7A6247)); --ask-on: var(--on-primary, var(--ivory, #FAF8F4));
  --ask-shadow: var(--shadow, 0 18px 44px -22px rgba(96,66,38,.26));
  --ask-label: var(--f-logo, "Russo One"), "Arial Black", Arial, sans-serif;
  box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; min-width: 0; flex-shrink: 0;
  padding: 14px 16px; border-radius: 24px; border: 1px solid var(--ask-hair); background: var(--ask-glass);
  box-shadow: var(--ask-shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  color: var(--ask-ink); font: 17px/1.45 var(--font-body); text-align: left; container-type: inline-size; overflow: hidden;
}
.j2-theme .ask-card {
  --ask-glass: var(--j2-glass); --ask-strong: var(--j2-glass-strong); --ask-hair: var(--j2-hair); --ask-ink: var(--j2-ink);
  --ask-ink-3: var(--j2-ink-3); --ask-eye: var(--j2-sand-text); --ask-soft: var(--j2-soft); --ask-primary: var(--j2-primary);
  --ask-on: var(--j2-on-primary); --ask-shadow: var(--j2-shadow); --ask-label: var(--j2-label);
}
.ask-card *, .ask-card *::before, .ask-card *::after { box-sizing: border-box; }
/* Inside a sheet (the lab marker): part of the sheet's glass, not a second card on top of it. */
.j2-sheet .ask-card { padding: 14px 0 12px; border: 0; border-top: 1px solid var(--ask-hair); border-radius: 0; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.j2-sheet .ask-chips { margin: 0; padding: 0; scroll-padding: 0; }

.ask-head { display: flex; align-items: center; gap: 8px; height: 16px; }
.ask-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ask-primary); flex: 0 0 auto; }
.ask-eye { font: 11px/1.2 var(--ask-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ask-eye); white-space: nowrap; }

.ask-chips { display: flex; gap: 8px; height: 40px; margin: 0 -16px; padding: 0 16px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.ask-chips::-webkit-scrollbar { display: none; }
.ask-chip { flex: 0 0 auto; display: inline-flex; align-items: center; height: 40px; max-width: none; padding: 0 15px; border-radius: 999px; border: 1px solid var(--ask-hair); background: var(--ask-strong); color: var(--ask-ink) !important; font: 15px/1 var(--font-body) !important; white-space: nowrap; scroll-snap-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ask-chip:active { transform: scale(.98); }
.ask-sk { width: 46%; min-width: 150px; border-color: transparent; background: var(--ask-soft); opacity: .7; animation: ask-pulse 1.4s ease-in-out infinite; cursor: default; }
@keyframes ask-pulse { 50% { opacity: .4; } }

.ask-own { display: flex; align-items: center; gap: 8px; height: 44px; margin: 0; padding: 0 4px 0 16px; border-radius: 999px; border: 1px solid var(--ask-hair); background: var(--ask-strong); }
.ask-input { flex: 1 1 auto; min-width: 0; height: 40px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ask-ink); font: 16px/1.2 var(--font-body); outline: none; box-shadow: none; -webkit-appearance: none; appearance: none; }
.ask-input::placeholder { color: var(--ask-ink-3); opacity: 1; }
.ask-go { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--ask-primary); color: var(--ask-on) !important; cursor: pointer; }
.ask-card button:focus-visible, .ask-own:focus-within { outline: 2px solid var(--ask-primary); outline-offset: 2px; }
.ask-own:focus-within .ask-go:focus-visible { outline-offset: 1px; }

/* The care-team line: two lines reserved on a phone-width card, one where it fits on one line (about 345 px). */
.ask-note { margin: 0; text-align: left; min-height: 2.7em; font: 13px/1.35 var(--font-body); color: var(--ask-ink-3); }
/* r3d: the note keeps two lines reserved until the card is wide enough for the approved care-team line on one line
   (about 430px of General Sans at 13px), so the line arriving with the copy never grows the card (rule 3). */
@container (min-width: 480px) { .ask-note { min-height: 1.35em; } }
.ask-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ask-slot { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .ask-sk { animation: none; } .ask-chip:active { transform: none; } }
.ask-card .ask-input:focus-visible { outline: none; }
/* r4b (Jake, Nov 16 "too busy"): the compact variant is one slim row, label then chips then "Ask your own question";
   no input box and no care line (the page's footnote carries it). The own chip opens Atlas with its composer focused. */
.ask-card.ask-compact { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 10px 16px; min-height: 0; }
.ask-compact .ask-head { flex: 0 0 96px; overflow: hidden; } /* a fixed column: the label loading in never moves the chips (rule 3) */
.ask-compact .ask-chips { flex: 1 1 auto; min-width: 0; height: 36px; margin: 0; padding: 0; scroll-padding: 0; }
.ask-compact .ask-chip { height: 36px; padding: 0 14px; font-size: 14px !important; }
/* Journey A (Jake, Nov 17): the own question is a field, not a dashed chip: the composer's surface, its placeholder colour
   and its send button; it opens Atlas with the composer focused. Fixed height; the skeleton is the same box (rule 3). */
.ask-ownf { flex: 1 1 260px; min-width: 200px; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; margin: 0; padding: 0 4px 0 16px; box-sizing: border-box; border-radius: 999px; border: 1px solid var(--ask-hair); background: var(--ask-strong); color: var(--ask-ink-3) !important; font: 15px/1 var(--font-body); text-align: left; cursor: pointer; }
.ask-ownt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ask-ownf .ask-go { pointer-events: none; }
.ask-ownf-sk .ask-go { opacity: .5; }
.ask-compact .ask-chips { flex: 0 1 auto; }
@media (max-width: 1023px) { .ask-card.ask-compact { flex-wrap: wrap; row-gap: 10px; } .ask-compact .ask-chips { flex: 1 1 calc(100% - 110px); } .ask-ownf { flex: 1 1 100%; } }

/* r4b density (Jake approved): with the Atlas dock on (desktop, 1280 px and up), the page's own Ask card repeats it,
   so it hides; Ask inside sheets and on phones is unchanged. */
@media (min-width: 1280px) { html.atlas-dock-on main#view .ask-card:not(.j2-sheet .ask-card) { display: none !important; } } /* the dock (1280 px and up) is the one Ask */
/* r4b density: on desktop pages the Ask card keeps its field and its care note; the suggested-question chips go. */
@media (min-width: 1024px) { main#view .ask-card .ask-chips { display: none !important; } }
