/* Cura Core · ask.css
   "Ask me anything" (views/ask.js): the sidebar button on the cover, the
   floating button (agency portal on phones, staff pages everywhere), and the
   panel that rises from the bottom left (a 440px plate on a wide screen, a
   bottom sheet on a phone). Blue is the action and the agency's own wording
   (the best answer); gold only for the Premium note; matches are marked like
   the find bar's hits. Tokens from tokens.css. */

/* ---------------- the sidebar button (on the dark cover) ---------------- */

.ask-side {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 10px 12px; border: 0; border-radius: var(--r-plate-md);
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14) inset, 0 14px 30px -18px rgba(0, 0, 0, .6);
  color: #fff; font-family: var(--font-sans); text-align: left; cursor: pointer;
  transition: transform .18s var(--ease-plate), background .18s ease, box-shadow .18s ease;
}
.ask-side:hover { transform: translateY(-2px); background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); box-shadow: 0 0 0 1px rgba(127, 214, 199, .45) inset, 0 18px 34px -18px rgba(0, 0, 0, .7); }
.ask-side:active { transform: translateY(0); }
.ask-side:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.ask-side[aria-expanded="true"] { box-shadow: 0 0 0 1px rgba(127, 214, 199, .6) inset, 0 14px 30px -18px rgba(0, 0, 0, .6); }
.ask-chip {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px;
  background: rgba(127, 214, 199, .14); color: var(--mint); box-shadow: 0 0 0 1px rgba(127, 214, 199, .35) inset;
}
.ask-chip .i { width: 20px; height: 20px; }
.ask-lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ask-lbl b { font-weight: 600; font-size: 14.5px; line-height: 1.2; color: #fff; }
.ask-lbl small { font-size: 12.5px; line-height: 1.3; color: var(--cover-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-side.locked .ask-lbl small { color: var(--gold-cover-text); }
.ask-side .ask-lock { width: 15px; height: 15px; color: var(--gold-lock); flex: none; }

/* The host only holds fixed things; it takes no place in the page's own layout (the portal shell is a grid). */
.ask-host { display: contents; }

/* ---------------- the floating button ---------------- */

.ask-fab {
  position: fixed; z-index: 45; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: none; align-items: center; justify-content: center; gap: 8px; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bot)); color: #fff;
  font-family: var(--font-sans); font-weight: 600; font-size: 15px; line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 14px 30px -12px var(--btn-glow), 0 2px 0 var(--btn-edge);
  transition: transform .18s var(--ease-plate), box-shadow .18s ease;
}
.ask-fab .i { width: 24px; height: 24px; }
.ask-fab-t { display: none; }
@media (hover: hover) { .ask-fab:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 20px 36px -14px var(--btn-glow), 0 3px 0 var(--btn-edge); } }
.ask-fab:active { transform: translateY(1px); }
.ask-fab:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.ask-host.open .ask-fab { visibility: hidden; }

/* agency portal: only while the sidebar is hidden (phones and small tablets) */
@media (max-width: 900px) { .ask-agency .ask-fab { display: inline-flex; } }
/* a short laptop screen, where the sidebar scrolls and its foot can be out of view: also beside the sidebar */
@media (min-width: 901px) and (max-height: 860px) {
  .ask-agency .ask-fab { display: inline-flex; left: calc(var(--side-w) + 2 * var(--frame-gap, 14px) + 12px); }
}

/* staff pages: always, as a labelled pill ("Ask"), opposite the "Contents and search" button */
.ask-staff .ask-fab { display: inline-flex; width: auto; height: 46px; padding: 0 18px 0 14px; }
.ask-staff .ask-fab .i { width: 20px; height: 20px; }
.ask-staff .ask-fab-t { display: inline; }

/* ---------------- the panel ---------------- */

.ask-scrim { display: none; }
.ask-panel {
  position: fixed; z-index: 92; left: calc(var(--side-w) + 2 * var(--frame-gap, 14px) + 10px); bottom: 14px;
  display: flex; flex-direction: column; width: 440px; max-height: calc(100vh - 28px);
  background: #fff; border-radius: 24px; color: var(--ink); font-family: var(--font-sans);
  box-shadow: 0 0 0 1px rgba(22, 34, 44, .07), 0 4px 10px rgba(22, 34, 44, .08), 0 30px 60px -18px rgba(22, 34, 44, .38), 0 60px 90px -40px rgba(22, 34, 44, .3);
  animation: ask-in .22s var(--ease-plate);
}
.ask-panel[hidden] { display: none; }
.ask-staff .ask-panel { left: 16px; bottom: 16px; }
@keyframes ask-in { from { opacity: 0; transform: translateY(10px) scale(.985); transform-origin: bottom left; } }

.ask-grip { display: none; }
.ask-head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 10px 18px; }
.ask-mark {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bot)); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 6px 12px -6px var(--btn-glow);
}
.ask-mark .i { width: 21px; height: 21px; }
.ask-head .grow { flex: 1; min-width: 0; }
.ask-head h2 { font-size: 20px; line-height: 1.2; }
.ask-head p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.ask-close { flex: none; }

.ask-form { padding: 2px 16px 12px; }
.ask-input { position: relative; }
.ask-input textarea.input {
  min-height: 76px; height: 76px; padding: 11px 92px 11px 14px; resize: none; overflow: hidden;
  font-size: 15px; line-height: 1.45; border-radius: var(--r-plate-sm);
}
.ask-go { position: absolute; right: 8px; bottom: 8px; min-height: 36px; padding: 0 12px 0 14px; gap: 6px; }
.ask-go .i { width: 15px; height: 15px; }

.ask-body { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 16px 16px; scrollbar-width: thin; }
.ask-foot {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.45; color: var(--ink-3);
}
.ask-foot .i { width: 15px; height: 15px; margin-top: 1px; flex: none; }

/* ---------------- what is inside ---------------- */

.ask-label { margin: 16px 0 8px; font-family: var(--font-sans); font-weight: 600; font-size: 11.5px; line-height: 1.3; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.ask-hint { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }

.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chip-q {
  display: inline-flex; align-items: center; min-height: 36px; padding: 7px 13px; border: 0; border-radius: var(--r-plate-sm); cursor: pointer;
  background: #fff; color: var(--ink-2); font-family: var(--font-sans); font-weight: 500; font-size: 13.5px; line-height: 1.3; text-align: left;
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 2px 0 var(--line);
  transition: transform .18s var(--ease-plate), box-shadow .18s ease, color .18s ease;
}
.ask-chip-q:hover { transform: translateY(-2px); color: var(--ink); box-shadow: 0 0 0 1px var(--field) inset, 0 10px 18px -10px rgba(22, 34, 44, .35), 0 2px 0 var(--line); }
.ask-chip-q:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ask-chips.recent .ask-chip-q { background: var(--surface-2); }

.ask-loading { padding: 6px 0; }
.ask-loading .sk { margin: 12px 0; }

.ask-none, .ask-empty { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.ask-none p { margin: 0 0 12px; }
.ask-empty { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-plate-md); background: var(--amber-soft); color: var(--amber-ink); }
.ask-empty .i { color: var(--amber); flex: none; margin-top: 2px; }

/* the best answer: the agency's own words, so blue */
.ask-best { margin-top: 4px; }
.ask-quote {
  position: relative; padding: 14px 16px 6px 18px; border-radius: var(--r-plate-md);
  background: linear-gradient(180deg, #F1F6FA, #F7FAFC); box-shadow: 0 0 0 1px var(--blue-line) inset;
}
.ask-quote::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue-bright); }
.ask-quote p { margin: 0 0 9px; font-family: var(--font-paper); font-size: 16px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.ask-gap { color: var(--ink-3); margin-right: 4px; }
.ask-panel mark { background: var(--hit); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px var(--hit-line) inset; }

.ask-open {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 11px 14px; border-radius: var(--r-plate-md);
  background: #fff; color: var(--blue); font-weight: 600; font-size: 14px; line-height: 1.35; text-decoration: none !important;
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 2px 0 var(--line);
  transition: transform .18s var(--ease-plate), box-shadow .18s ease, color .18s ease;
}
.ask-open > span { flex: 1; min-width: 0; }
.ask-open .i { width: 18px; height: 18px; flex: none; }
.ask-open .go { color: var(--blue); }
.ask-open:hover { color: var(--blue-hover); transform: translateY(-2px); box-shadow: 0 0 0 1px var(--blue-line) inset, 0 12px 22px -12px rgba(22, 34, 44, .35), 0 2px 0 var(--line); }

.ask-panel .ref { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .02em; color: var(--ink-3); white-space: nowrap; }
.ask-open .ref { color: var(--blue-ink); }

.ask-own {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 6px; vertical-align: 1px;
  background: var(--blue-soft); color: var(--blue-ink); font-family: var(--font-sans); font-weight: 600; font-size: 11px; letter-spacing: .02em; text-transform: none;
}

.ask-group { margin-top: 2px; }
.ask-rows { display: flex; flex-direction: column; gap: 6px; }
.ask-row {
  display: block; padding: 10px 13px; border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none !important;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform .18s var(--ease-plate), box-shadow .18s ease;
}
a.ask-row:hover, .ask-rule-main:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2) inset, 0 12px 22px -12px rgba(22, 34, 44, .32); }
a.ask-row:focus-visible, .ask-rule-main:focus-visible, .ask-open:focus-visible, .ask-ext:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ask-row-t { display: block; font-weight: 600; font-size: 14px; line-height: 1.35; color: var(--ink); }
.ask-row-t .ref { margin-right: 3px; }
.ask-row-d { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.ask-row-s { display: block; margin-top: 4px; font-family: var(--font-paper); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.ask-row-k { display: block; margin-bottom: 2px; font-weight: 600; font-size: 11.5px; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); }

.ask-rule { display: flex; flex-direction: column; padding: 0; }
.ask-rule-main { display: block; padding: 10px 13px 6px; border-radius: 14px 14px 0 0; color: var(--ink); text-decoration: none !important; transition: transform .18s var(--ease-plate), box-shadow .18s ease; }
.ask-rule-main:hover { transform: none; box-shadow: none; }
.ask-rule:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2) inset, 0 12px 22px -12px rgba(22, 34, 44, .32); }
.ask-rule .ask-row-d { -webkit-line-clamp: 3; }
.ask-ext {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin: 0 13px 10px; padding: 2px 0;
  color: var(--blue); font-weight: 600; font-size: 12.5px; text-decoration: none !important;
}
.ask-ext .i { width: 13px; height: 13px; }
.ask-ext:hover { color: var(--blue-hover); text-decoration: underline !important; }
.ask-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--blue); font-weight: 600; font-size: 13px; text-decoration: none !important; }
.ask-more .i { width: 14px; height: 14px; }
.ask-more:hover { color: var(--blue-hover); }

/* Premium note (agency without the feature): gold, and only here */
.ask-premium { display: flex; gap: 12px; margin-top: 4px; padding: 16px; border-radius: var(--r-plate-md); background: var(--gold-soft); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.ask-premium-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: #fff; color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.ask-premium h3 { font-size: 17px; line-height: 1.3; color: var(--gold-ink); }
.ask-premium p { margin: 6px 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* ---------------- smaller screens ---------------- */

@media (max-width: 900px) {
  .ask-agency .ask-panel { left: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); }
}

/* phones: a bottom sheet over a scrim */
@media (max-width: 640px) {
  .ask-host.open .ask-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 91; background: var(--scrim); animation: scrim-in var(--dur-2) var(--ease); }
  .ask-panel, .ask-agency .ask-panel, .ask-staff .ask-panel {
    left: 0; right: 0; bottom: 0; width: auto; max-height: min(88vh, 760px); max-height: min(88dvh, 760px);
    border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom);
    animation: ask-up .26s var(--ease-plate);
  }
  .ask-grip { display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: var(--line-2); }
  .ask-head { padding-top: 8px; }
  .ask-form { padding-bottom: 10px; }
  .ask-go { padding: 0 16px; }
  body.ask-sheet-open { overflow: hidden; }
}
@keyframes ask-up { from { transform: translateY(40px); opacity: .4; } }

@media (prefers-reduced-motion: reduce) {
  .ask-panel, .ask-side, .ask-fab, .ask-row, .ask-open, .ask-chip-q { animation: none !important; transition: none !important; }
}
@media print { .ask-host, .ask-side { display: none !important; } }
