/* DV48 ASK — shared behaviour styles for both skins. Skins set the tokens and the look. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: progress; }
svg { display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; flex: none; }

.skip { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--paper, #fff); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }

/* ---------- no-JS: the accordion is the page; with JS the chat is, and the list is a view */
.nojs [data-js-only], .nojs .js-only { display: none !important; }
.js .nojs-only, .js .range-nojs { display: none; }
.nojs .range-ctl { display: none; }
.js .faq-list { display: none; }
.js[data-view=list] .faq-list { display: block; }
.js[data-view=list] [data-ask=panel], .js[data-view=list] .launcher, .js[data-view=list] .bell { display: none !important; }

/* icon pairs: moon/sun on the theme button, list/chat on the view button */
[data-action=theme]:not([role=menuitem]) > .i:nth-of-type(2) { display: none; }
[data-theme=dark] [data-action=theme]:not([role=menuitem]) > .i:nth-of-type(1) { display: none; }
[data-theme=dark] [data-action=theme]:not([role=menuitem]) > .i:nth-of-type(2) { display: block; }
[data-action=view]:not([role=menuitem]) > .i:nth-of-type(2) { display: none; }
[data-view=list] [data-action=view]:not([role=menuitem]) > .i:nth-of-type(1) { display: none; }
[data-view=list] [data-action=view]:not([role=menuitem]) > .i:nth-of-type(2) { display: block; }

/* ---------- chat log */
.chat-log { will-change: scroll-position; position: relative; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.chat-log:focus-visible { outline-offset: -3px; }
.msg { display: flex; gap: 10px; align-items: flex-start; flex: none; }
.msg--user { justify-content: flex-end; align-items: flex-end; }
.msg .bubble { min-width: 0; }
.bubble p + p, .ans > * + * { margin-top: 10px; }
.msg.is-new { animation: msg-in .34s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }

/* streamed answer: words fade in one after another, then the rich blocks rise in */
.msg.is-pending { position: absolute; left: var(--pad-l, 0); right: var(--pad-r, 0); visibility: hidden; pointer-events: none; }
.is-new .w { animation: w-in .3s ease-out both; animation-delay: calc(var(--i) * var(--step, 24ms)); }
@keyframes w-in { from { opacity: 0; } }
.is-new .ans > :is(.range, .ans-table-wrap, .ans-bike, .ans-btn, .ans-list), .is-new .fb, .is-new .fu:not(.fu--greet) {
  animation: rise .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--after, 0ms);
}
.is-new .ans > .ans-list { animation-name: w-in; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* typing indicator */
.typing { display: flex; gap: 5px; align-items: center; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: dot 1.05s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .3; } 30% { transform: translateY(-4px); opacity: 1; } }

/* answers */
.ans-bike svg { width: 100%; height: auto; aspect-ratio: 640 / 380; }
.ans-table-wrap { overflow-x: auto; }
.ans-table { width: 100%; border-collapse: collapse; }
.ans-table th, .ans-table td { text-align: left; vertical-align: top; }
.ans-list { padding-left: 1.3em; }
.ans-list li + li { margin-top: 4px; }
.ans-btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; }
.ans-btn .i { width: 18px; height: 18px; }
.range-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.range-ticks { display: flex; justify-content: space-between; }
.range-line b, .range-table b { display: inline-block; font-variant-numeric: tabular-nums; }
mark { color: inherit; }

/* range input: track filled up to the thumb with --p */
.range-input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.range-input::-webkit-slider-runnable-track { height: var(--track-h, 6px); border-radius: 99px; background: var(--track-fill) 0 0 / var(--p, 50%) 100% no-repeat, var(--track-off); }
.range-input::-moz-range-track { height: var(--track-h, 6px); border-radius: 99px; background: var(--track-off); }
.range-input::-moz-range-progress { height: var(--track-h, 6px); border-radius: 99px; background: var(--track-fill); }
.range-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: var(--thumb, 22px); height: var(--thumb, 22px); margin-top: calc((var(--track-h, 6px) - var(--thumb, 22px)) / 2); border-radius: 50%; background: var(--thumb-bg); border: var(--thumb-border); box-shadow: var(--thumb-shadow, none); }
.range-input::-moz-range-thumb { width: var(--thumb, 22px); height: var(--thumb, 22px); border-radius: 50%; background: var(--thumb-bg); border: var(--thumb-border); box-shadow: var(--thumb-shadow, none); }
.range-input:focus-visible { outline: none; }
.range-input:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--ring); outline-offset: 2px; }
.range-input:focus-visible::-moz-range-thumb { outline: 3px solid var(--ring); outline-offset: 2px; }

/* feedback */
.fb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-q, .fb p { margin: 0; }
.fb-btn, .fb-human { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fb-btn .i, .fb-human .i { width: 18px; height: 18px; }

/* search results (combobox listbox) */
.search { position: relative; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px; max-height: min(360px, 60vh); overflow-y: auto; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.opt-q { min-width: 0; }
.opt .i { width: 16px; height: 16px; }
.opt-head { padding: 6px 10px; }

/* accordion */
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-ico { transition: transform .22s ease; }
.faq-item[open] .faq-ico { transform: rotate(180deg); }

/* menus */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; display: flex; flex-direction: column; padding: 6px; }
.menu [role=menuitem], .menu [role=menuitemradio] { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; text-align: left; white-space: nowrap; }

/* form */
.handoff { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field input, .field textarea { width: 100%; }
.field textarea { resize: vertical; min-height: 76px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sent:focus { outline: none; }
.sent:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; }

.only-phone { display: none !important; }
@media (pointer: coarse) { .range-input { height: 44px !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .typing i { opacity: .6; }
}
