/* "Ask us" widget (App\Platform\AskUs), Evergreen & Ember. Loaded by the website layout, the admin layout and the guest layout.
   Own tokens (--au-*) so it looks the same whichever stylesheet is around it: alabaster sheet inside the app, pine panel on the
   website (its deep bands), ember button everywhere. 390 px: a full-width sheet from the bottom. No inline styles (CSP). */
.askus {
  --au-ember: #F25A2B; --au-ember-hover: #E14E20; --au-ember-ink: #1A0A04;
  --au-bg: #FFFFFF; --au-bg-2: #F6F4EE; --au-ink: #10201A; --au-ink-2: #3C4D45; --au-mute: #5B6B63; --au-rule: #E2E0D7;
  --au-field: #FFFFFF; --au-field-rule: #C6C8BE; --au-green: #166A4A; --au-mint: #2E9B6E; --au-live: #157A4B;
  --au-me: #E3F0E9; --au-me-ink: #0F5238; --au-them: #F6F4EE; --au-them-ink: #10201A; --au-bad: #B83535; --au-bad-bg: #FBE3E0;
  --au-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --au-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --au-lift: 0 2px 6px rgba(16, 32, 26, .08), 0 30px 70px -24px rgba(16, 32, 26, .45);
  --au-ease: cubic-bezier(.2, .7, .2, 1);
  position: fixed; right: 16px; bottom: 16px; z-index: 95; font: 400 .9375rem/1.5 var(--au-sans); color: var(--au-ink);
}
.askus * { box-sizing: border-box; }
.askus-site { --au-bg: #0B1F18; --au-bg-2: #12352A; --au-ink: #EEF3EF; --au-ink-2: #CFE2D7; --au-mute: #A8B8AF; --au-rule: #1F4235; --au-field: #12352A; --au-field-rule: #2E5A49; --au-mint: #7FE0B0; --au-live: #7FE0B0; --au-me: #16382A; --au-me-ink: #DFF2E7; --au-them: #153C2F; --au-them-ink: #EEF3EF; --au-bad: #FF9A9A; --au-bad-bg: #3D1C1C; --au-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 34px 70px -24px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .askus-app, :root[data-theme="dark"] .askus-bare { --au-bg: #12352A; --au-bg-2: #0F2A20; --au-ink: #E6EDE8; --au-ink-2: #BFCDC5; --au-mute: #9AA8A1; --au-rule: #1F4235; --au-field: #0F2A20; --au-field-rule: #2E5A49; --au-mint: #7FE0B0; --au-live: #7FE0B0; --au-me: #16382A; --au-me-ink: #DFF2E7; --au-them: #0F2A20; --au-them-ink: #E6EDE8; --au-bad: #FF9A9A; --au-bad-bg: #3D1C1C; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .askus-app, :root:not([data-theme="light"]) .askus-bare { --au-bg: #12352A; --au-bg-2: #0F2A20; --au-ink: #E6EDE8; --au-ink-2: #BFCDC5; --au-mute: #9AA8A1; --au-rule: #1F4235; --au-field: #0F2A20; --au-field-rule: #2E5A49; --au-mint: #7FE0B0; --au-live: #7FE0B0; --au-me: #16382A; --au-me-ink: #DFF2E7; --au-them: #0F2A20; --au-them-ink: #E6EDE8; --au-bad: #FF9A9A; --au-bad-bg: #3D1C1C; }
}
/* the website's phone menu drawer covers the page: keep the button out of it */
html.nav-open .askus:not(.is-open) { display: none; }
/* the app's toasts share the corner: lift them above the button */
body:has(.askus) .toasts { bottom: 84px; }
/* ...and keep the end of every page clear of the button, so the last row's actions are never underneath it (18 Oct 2026). */
body:has(.askus) main { padding-bottom: max(112px, var(--askus-clear, 0px)); }

/* ---- the button ---- */
.askus-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--au-ember); color: var(--au-ember-ink); text-decoration: none; font: 600 .9375rem/1 var(--au-sans); letter-spacing: .01em; border: 0; cursor: pointer; position: relative; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 24px -10px rgba(242, 90, 43, .75); transition: transform .2s var(--au-ease), background .15s, box-shadow .2s; }
.askus-btn:hover { background: var(--au-ember-hover); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 14px 30px -10px rgba(242, 90, 43, .9); }
.askus-btn:focus-visible { outline: 2px solid var(--au-ember); outline-offset: 3px; }
.askus-btn .ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.askus-dot { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: #157A4B; border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(21, 122, 75, .6); animation: askus-pulse 2s infinite; }
@keyframes askus-pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 122, 75, .55); } 70% { box-shadow: 0 0 0 9px rgba(21, 122, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 122, 75, 0); } }
.askus.is-open .askus-btn { opacity: 0; pointer-events: none; }

/* ---- the panel ---- */
.askus-panel { position: absolute; right: 0; bottom: 0; width: 390px; max-width: calc(100vw - 32px); max-height: min(680px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--au-bg); color: var(--au-ink); border: 1px solid var(--au-rule); border-radius: 18px; box-shadow: var(--au-lift); overflow: hidden; transform-origin: bottom right; animation: askus-in .22s var(--au-ease); }
.askus-panel[hidden] { display: none; }
@keyframes askus-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .askus-panel { animation: none; } .askus-dot { animation: none; } .askus-btn { transition: none; } }
.askus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--au-rule); }
.askus-title { margin: 0; font: 400 1.5rem/1.1 var(--au-serif); letter-spacing: -.01em; color: var(--au-ink); }
.askus-brand { margin: 2px 0 0; font-size: .8125rem; color: var(--au-mute); }
.askus-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--au-rule); background: transparent; color: var(--au-ink-2); cursor: pointer; display: grid; place-items: center; flex: none; }
.askus-close:hover { background: var(--au-bg-2); }
.askus-close .ic, .askus-search .ic, .askus-send .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.askus-body { padding: 14px 18px 18px; overflow: auto; overscroll-behavior: contain; }
.askus-label, .askus-form label, .askus-reply label { display: block; font-size: .8125rem; font-weight: 600; color: var(--au-ink-2); margin: 0 0 4px; }
.askus-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.askus-search { position: relative; }
.askus-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--au-mute); pointer-events: none; }
.askus input, .askus textarea { width: 100%; font: inherit; color: var(--au-ink); background: var(--au-field); border: 1px solid var(--au-field-rule); border-radius: 10px; padding: 9px 12px; margin: 0; }
.askus input[type="search"] { padding-left: 38px; }
.askus input:focus-visible, .askus textarea:focus-visible, .askus-close:focus-visible, .askus-send:focus-visible, .askus-hit a:focus-visible, .askus-link:focus-visible { outline: 2px solid var(--au-ember); outline-offset: 2px; }
.askus textarea { resize: vertical; min-height: 64px; }
.askus-hits { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.askus-hit { padding: 10px 12px; border: 1px solid var(--au-rule); border-radius: 12px; background: var(--au-bg-2); display: grid; gap: 2px; }
.askus-hit-t { font-weight: 600; color: var(--au-ink); text-decoration: none; }
.askus-hit-s { margin: 0; font-size: .8125rem; color: var(--au-mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.askus-hit-open { font-size: .8125rem; font-weight: 600; color: var(--au-mint); text-decoration: none; }
.askus-hit-open:hover, .askus-hit-t:hover { text-decoration: underline; }
.askus-none { font-size: .875rem; color: var(--au-mute); padding: 6px 2px; }
.askus-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--au-rule); display: grid; gap: 10px; }
.askus-form label { margin: 0; }
.askus-form label input, .askus-form label textarea { margin-top: 4px; font-weight: 400; }
.askus-sub { margin: 0; font: 400 1.25rem/1.2 var(--au-serif); color: var(--au-ink); }
.askus-note { margin: -4px 0 0; font-size: .875rem; color: var(--au-ink-2); }
.askus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.askus-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.askus-errors { background: var(--au-bad-bg); color: var(--au-bad); border-radius: 10px; padding: 8px 12px; font-size: .875rem; display: grid; gap: 2px; }
.askus-errors[hidden] { display: none; }
.askus-send { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--au-ember); color: var(--au-ember-ink); font: 600 .9375rem/1 var(--au-sans); cursor: pointer; transition: background .15s; }
.askus-send:hover { background: var(--au-ember-hover); }
.askus-send:disabled { opacity: .6; cursor: progress; }
.askus-send-sm { height: 40px; padding: 0 16px; }
/* thread */
.askus-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .875rem; color: var(--au-ink-2); }
.askus-state { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--au-mint); }
.askus-msgs { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; max-height: 300px; overflow: auto; overscroll-behavior: contain; }
.askus-msg { display: grid; gap: 3px; max-width: 88%; }
.askus-msg.from-customer { justify-self: end; text-align: right; }
.askus-bubble { padding: 9px 12px; border-radius: 14px; background: var(--au-them); color: var(--au-them-ink); white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
.from-customer .askus-bubble { background: var(--au-me); color: var(--au-me-ink); border-bottom-right-radius: 4px; }
.from-operator .askus-bubble { border-bottom-left-radius: 4px; }
.askus-time { font-size: .75rem; color: var(--au-mute); }
.askus-reply { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.askus-reply textarea { min-height: 44px; }
.askus-foot { margin: 10px 0 0; font-size: .8125rem; color: var(--au-mute); }
.askus-foot a, .askus-link { color: var(--au-mint); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }

/* ---- phones: a full-width sheet ---- */
@media (max-width: 640px) {
  .askus { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .askus-app { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .askus-panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: calc(100dvh - 24px); border-radius: 18px 18px 0 0; border-bottom: 0; transform-origin: bottom center; }
  .askus-grid { grid-template-columns: 1fr; }
}

/* ---- the public thread page (/support/t/{token}, website layout) ---- */
.askus-page { max-width: 720px; }
.askus-page .askus-msgs { max-height: none; overflow: visible; margin: 18px 0; gap: 14px; }
.askus-page .askus-msg { max-width: 80%; }
.askus-page .askus-bubble { background: var(--sheet, #fff); border: 1px solid var(--rule, #E2E0D7); color: var(--ink, #10201A); }
.askus-page .from-customer .askus-bubble { background: var(--green-soft, #DFF2E7); color: var(--green-soft-ink, #0F5438); border-color: transparent; }
.askus-page .askus-time { color: var(--ink-3, #5B6B63); }
.askus-page .askus-reply { margin-top: 10px; }
.askus-page textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule-strong, #C6C8BE); background: var(--sheet, #fff); color: var(--ink, #10201A); min-height: 90px; }
.askus-page .askus-send { background: #F25A2B; color: #1A0A04; }
.askus-page .askus-send:hover { background: #E14E20; }
.askus-page .askus-errors { background: var(--bad-bg, #FBE3E0); color: var(--bad, #C83E3E); border-radius: 10px; padding: 8px 12px; font-size: .875rem; }
.askus-page .askus-errors[hidden] { display: none; }
.askus-page .askus-live { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--ok, #157A4B); }
.askus-page .askus-live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.askus-page .askus-live[hidden] { display: none; }
.askus-page .askus-meta { color: var(--ink-3, #5B6B63); font-size: .9375rem; }
