/* ask.css — Ask Materia (ask.js): the bar always on screen (top centre; a round button on a phone) and the answers in a
 * panel beside the scene, never over its middle: a right column of --panel-w on a desktop, a sheet over the lower half on a phone. Tokens from ../_engines/ui/ui.css; badges in the Lab's colours. */
#ask-bar { position: fixed; z-index: 9; top: calc(var(--pad, 16px) + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: min(460px, calc(100vw - 520px)); min-width: 280px; height: 44px; padding: 0 10px 0 14px; border: 1px solid var(--ui-line-strong);
  border-radius: 22px; color: var(--ui-ink-dim); font: 500 14px/1 var(--ui-font); cursor: text; text-align: left; }
#ask-bar:hover { color: var(--ui-ink); border-color: var(--ui-line-strong); background: var(--ui-raise-hover); }
#ask-bar:focus-visible { outline: 2px solid var(--accent, #0b7a6d); outline-offset: 2px; }
#ask-bar svg { width: 18px; height: 18px; flex: none; }
#ask-bar .ask-ph { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#ask-bar .ask-short { display: none; }
#ask-bar kbd { flex: none; font: 600 12px/1 var(--ui-font); padding: 4px 6px; border-radius: 6px; background: var(--ui-raise); color: var(--ui-ink-faint); border: 1px solid var(--ui-line); }
body.ask-on #ask-bar { visibility: hidden; }
/* a phone: the brand at the left, Advanced at the right; the bar becomes a short pill between them */
@media (max-width: 900px) {
  #ask-bar { width: auto; min-width: 0; padding: 0 14px; gap: 7px; }
  #ask-bar .ask-ph, #ask-bar kbd { display: none; }
  #ask-bar .ask-short { display: inline; font-weight: 600; color: var(--ui-ink); }
}

#ask-panel { position: fixed; inset: 0; z-index: 60; }
#ask-panel[hidden] { display: none; }
#ask-panel .ask-scrim { position: absolute; inset: 0; background: var(--ui-scrim); backdrop-filter: blur(3px); }
#ask-panel .ask-box { position: relative; margin: calc(56px + env(safe-area-inset-top)) auto 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 80px - env(safe-area-inset-top));
  display: flex; flex-direction: column; background: var(--ui-surface-strong); border: 1px solid var(--ui-line-strong); border-radius: 18px; box-shadow: 0 24px 80px rgba(20, 30, 40, 0.35); color: var(--ui-ink); font-family: var(--ui-font); }
.ask-form { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--ui-line); }
.ask-form svg { width: 20px; height: 20px; flex: none; color: var(--ui-ink-dim); }
.ask-form input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--ui-ink); font: 500 17px var(--ui-font); outline: none; }
.ask-form input::placeholder { color: var(--ui-ink-faint); }
.ask-go { height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--accent, #0b7a6d); color: var(--accent-ink, #fff); font: 700 15px var(--ui-font); cursor: pointer; }
.ask-x { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ui-ink-dim); font-size: 26px; cursor: pointer; border-radius: 12px; }
.ask-x:hover { background: var(--ui-raise); }
.ask-body { overflow-y: auto; padding: 14px 16px 18px; overscroll-behavior: contain; }
.ask-sub, .ask-sub2 { margin: 0 0 10px; color: var(--ui-ink-dim); font-size: 14px; line-height: 1.45; }
.ask-sub2 { font-size: 13px; margin: 2px 0 6px; }
.ask-label, .ask-gl, .ask-kind { margin: 12px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ui-ink-faint); }
.ask-kind { margin-top: 0; }
.ask-ex { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-ex .ui-chip { text-align: left; min-height: 40px; }
.ask-api { margin: 16px 0 0; font-size: 13px; }
.ask-api a, .ask-lit a { color: var(--accent, #7fd6c2); }
.ask-q { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.ask-status { margin: 0 0 10px; font-size: 13px; color: var(--ui-ink-dim); display: flex; align-items: center; gap: 8px; }
.ask-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ui-good); }
.ask-status.is-live i { background: var(--ui-warn); animation: ask-pulse 1s ease-in-out infinite; }
.ask-status.is-bad { color: var(--ui-bad); } .ask-status.is-bad i { background: var(--ui-bad); }
@keyframes ask-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .ask-status.is-live i { animation: none; } }
.ask-live { margin: 0 0 12px; padding-left: 20px; font-size: 13px; color: var(--ui-ink-dim); }
.ask-live li { margin: 3px 0; word-break: break-word; } .ask-live li.run { color: var(--ui-ink); } .ask-live li.bad { color: var(--ui-bad); }
.ask-answer { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--ui-raise); border: 1px solid var(--ui-line); }
.ask-answer h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ui-ink-faint); }
.ask-answer p { margin: 0 0 6px; font-size: 15.5px; line-height: 1.5; }
.ask-answer small { color: var(--ui-ink-faint); font-size: 12.5px; }
.ask-card { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ui-line); background: rgba(255, 255, 255, 0.025); }
.ask-card h4 { margin: 0 0 2px; font-size: 16.5px; }
.ask-card ul { margin: 4px 0 6px; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.ask-card.is-uns { border-color: rgba(231, 178, 76, 0.4); background: rgba(231, 178, 76, 0.06); }
.ask-card.is-uns h4 { color: #8a5200; font-size: 15px; }
.ask-card.is-err { border-color: rgba(255, 111, 111, 0.35); }
.ask-card.is-lit { border-color: rgba(180, 144, 255, 0.4); background: rgba(180, 144, 255, 0.06); }
.ask-warn { margin: 0 0 10px; font-size: 13px; color: #5b2fb0; line-height: 1.4; }
.ask-lit { padding: 8px 0; border-top: 1px solid var(--ui-line); font-size: 14px; }
.ask-lit p { margin: 0 0 4px; }
.ask-lit blockquote { margin: 4px 0; padding-left: 10px; border-left: 2px solid rgba(180, 144, 255, 0.5); color: var(--ui-ink-dim); font-size: 13.5px; }
.ask-lit .src { font-size: 12.5px; color: var(--ui-ink-dim); word-break: break-word; }
.ask-lit .ok { color: var(--ui-good); } .ask-lit .bad, .ask-log .bad { color: var(--ui-bad); }
.ask-group { margin: 6px 0 8px; }
.ask-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--ui-line); font-size: 14px; }
.ask-row .n { color: var(--ui-ink-dim); overflow-wrap: anywhere; }
.ask-row .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ask-row .v em { font-style: normal; font-weight: 500; color: var(--ui-ink-dim); }
.ask-row .v small { font-weight: 500; color: var(--ui-ink-faint); }
.ask-law { margin: 3px 0; font-size: 12.5px; color: var(--ui-ink-faint); line-height: 1.4; overflow-wrap: anywhere; }
.ask-law span { font-weight: 700; color: var(--ui-ink-dim); margin-right: 4px; }
.ask-big { margin: 6px 0; font-size: 15px; line-height: 1.45; }
.ask-mech { list-style: none; padding-left: 0 !important; }
.ask-mech li { margin: 4px 0; }
.dim { color: var(--ui-ink-faint); }
/* the provenance badge is .badge.word of _engines/ui/ui.css (lab-number.js); L (literature) is Ask's own colour */
.badge.word[data-b="L"] { background: #ece4fb; color: #5b2fb0; }
.ask-open { margin-top: 8px; min-height: 44px; }
.ask-log { margin-top: 8px; font-size: 13px; color: var(--ui-ink-dim); }
.ask-log > summary { cursor: pointer; font-weight: 600; color: var(--ui-ink); min-height: 32px; }
.ask-log ol { padding-left: 20px; }
.ask-log li { margin: 6px 0; }
.ask-log details summary { cursor: pointer; display: inline-block; margin-right: 10px; color: var(--ui-ink-faint); }
.ask-log pre { max-height: 260px; overflow: auto; padding: 8px; border-radius: 8px; background: var(--ui-bg-deep); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 640px) {
  #ask-panel .ask-box { margin: 0; width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  .ask-form input { font-size: 16px; }
  .ask-go { padding: 0 12px; }
}
/* the render first (13/10): no scrim, the bench stays live; the answers scroll inside the panel */
#ask-panel { pointer-events: none; }
#ask-panel .ask-scrim { display: none; }
#ask-panel .ask-box { pointer-events: auto; position: fixed; margin: 0; overflow: visible; }
#ask-panel .ask-body { min-height: 0; flex: 1 1 auto; }
@media (min-width: 760px) {
  #ask-panel .ask-box { left: auto; right: var(--pad, 14px); top: calc(var(--pad, 14px) + var(--ask-h, 46px) + 12px + env(safe-area-inset-top)); bottom: calc(var(--dock-h, 60px) + 26px + env(safe-area-inset-bottom));
    width: var(--panel-w, 400px); max-height: none; box-shadow: 0 18px 50px -18px rgba(20, 30, 40, 0.4); }
  .ask-form { padding-left: 12px; }
  .ask-form input { font-size: 16px; }
  .ask-go { padding: 0 12px; }
}
@media (max-width: 759px) {
  #ask-panel .ask-box { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: auto; max-height: var(--sheet-max, 46vh); border-radius: 18px 18px 0 0; border: 0; border-top: 1px solid var(--ui-line-strong);
    padding: 0 0 env(safe-area-inset-bottom); box-shadow: var(--ui-shadow-sheet); }
}
/* Check a paragraph (ask.js checkHTML): one traffic light per claim */
.ask-check { margin: 18px 0 0; }
.ask-check textarea { width: 100%; box-sizing: border-box; margin: 6px 0 8px; padding: 10px 12px; border: 1px solid var(--ui-line-strong, rgba(20,30,40,.22)); border-radius: 10px; background: var(--ui-surface-solid, #fff); color: inherit; font: 14px/1.45 var(--font, system-ui); resize: vertical; }
.ask-claims { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ask-claims li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ui-raise, rgba(20,30,40,.06)); }
.ask-claims p { margin: 0 0 2px; }
.ask-light { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #9aa3ab; }
.ask-claims .is-ok .ask-light { background: #2e9e5b; } .ask-claims .is-warn .ask-light { background: #e0a100; } .ask-claims .is-bad .ask-light { background: var(--ui-bad, #b3361b); }
.ask-claims .is-run .ask-light { animation: ask-pulse 1s infinite alternate; }
.ask-verdict { font-weight: 600; } .is-ok .ask-verdict { color: var(--ui-measured-text, #17703f); } .is-warn .ask-verdict { color: var(--ui-warn, #8a5200); } .is-bad .ask-verdict { color: var(--ui-bad, #b3361b); }
.ask-ctx { font-size: 12px; }
