/* =============================================================================
   FLINT on the website: the chat bubble (assets/js/ask-widget.js)
   The same look as Flint in the app (apps/client/src/shared/components/MrFox):
   a deep green-to-black gradient sheet, the fox in a glass circle, white bubbles
   for Flint and teal (#33BFBF) for the client, glass chips and input, and the
   launcher's glow ring that pulses like the app's.
   Phone first: the panel fills the screen as a sheet. From 720px it is a
   window bottom right, beside the page.
   ============================================================================= */
.ask-panel, .fox .fox-wa.ask-fab {
  --fl-top: #2E564C; --fl-mid: #142E29; --fl-deep: #050E0C;   /* the app's sheet gradient */
  --fl-glass: rgba(255, 255, 255, .12); --fl-glass-2: rgba(255, 255, 255, .08);
  --fl-line: rgba(255, 255, 255, .12); --fl-line-2: rgba(255, 255, 255, .22);
  --fl-dim: rgba(255, 255, 255, .62); --fl-user: #33BFBF; --fl-online: #2ECC71;
  --fl-teal: #008080; --fl-teal-soft: #E6F4F4; --fl-mint: #98FFF0;
}

/* ---------- the launcher ----------
   Takes the WhatsApp button's place (.fox-wa keeps its position, including the
   lifts on checkout and on profiles with a dock). Dark like the app's sheet,
   the fox in a glass circle, and a glow ring that pulses (app: 0.2 to 1 over
   1.1s each way). */
.fox .fox-wa.ask-fab { position: fixed; width: auto; min-width: 54px; height: 54px; padding: 0 18px 0 8px; gap: 10px; display: inline-flex; align-items: center; border: 0; border-radius: 27px; background: linear-gradient(135deg, var(--fl-top) 0%, var(--fl-mid) 55%, var(--fl-deep) 100%); color: #fff; font: 600 .95rem/1 var(--fox-font-display, inherit); letter-spacing: .01em; cursor: pointer; box-shadow: 0 10px 28px rgba(5, 14, 12, .35), inset 0 1px 0 rgba(255, 255, 255, .12); transition: bottom .3s ease, transform .2s ease; }
.fox .fox-wa.ask-fab[hidden] { display: none; }
.fox .fox-wa.ask-fab:hover { transform: translateY(-1px); }
.fox .fox-wa.ask-fab:focus-visible { outline: 2px solid var(--fl-mint); outline-offset: 3px; }
.fox .fox-wa.ask-fab .ask-fab__ring { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--fl-glass); }
.fox .fox-wa.ask-fab .ask-fab__ring::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 0 12px rgba(152, 255, 240, .55); animation: flint-glow 2.2s ease-in-out infinite; pointer-events: none; }
.fox .fox-wa.ask-fab .ask-fab__fox { width: 28px; height: 28px; object-fit: contain; }
@keyframes flint-glow { 0%, 100% { opacity: .2; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@media (max-width: 719px) { .fox .fox-wa.ask-fab .ask-fab__t { display: none; } .fox .fox-wa.ask-fab { padding: 0; width: 54px; justify-content: center; } }
html.ask-open .fox .fox-wa.ask-fab { display: none; }
@media (min-width: 720px) { html.ask-open .fox .fox-wa.ask-fab { display: inline-flex; } html.ask-open .fox .fox-wa.ask-fab .ask-fab__ring::before { animation: none; opacity: 0; } }

/* ---------- the panel ----------
   Above the site header (200) and the menu drawer (251), so nothing of the
   page shows through it on a phone. */
.ask-panel { position: fixed; z-index: 300; inset: 0; display: flex; flex-direction: column; color: #fff; font-family: var(--fox-font-family); background: linear-gradient(180deg, var(--fl-top) 0%, var(--fl-mid) 45%, var(--fl-deep) 100%); }
.ask-panel[hidden] { display: none; }
@media (max-width: 719px) { html.ask-open, html.ask-open body { overflow: hidden; } }
@media (min-width: 720px) {
  .ask-panel { inset: auto 20px calc(88px + env(safe-area-inset-bottom)) auto; width: 400px; height: min(660px, calc(100vh - 120px)); border-radius: 24px; box-shadow: 0 30px 70px rgba(5, 14, 12, .45), 0 0 0 1px rgba(255, 255, 255, .06); overflow: hidden; }
}

.ask-head { display: flex; align-items: center; gap: 10px; padding: 14px 10px 12px 16px; padding-top: calc(14px + env(safe-area-inset-top)); border-bottom: 1px solid var(--fl-line); }
@media (min-width: 720px) { .ask-head { padding-top: 14px; } }
.ask-panel .ask-head__id { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; }
.ask-head__av { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--fl-glass); }
.ask-head__fox { width: 31px; height: 31px; object-fit: contain; animation: flint-breathe 3.2s ease-in-out infinite; }
@keyframes flint-breathe { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.08); } }
.ask-panel .ask-head__id > div { display: grid; gap: 3px; min-width: 0; }
.ask-panel .ask-head__t { margin: 0 !important; font: 700 1.05rem/1.15 var(--fox-font-display, inherit); color: #fff; }
.ask-panel .ask-head__s { margin: 0 !important; display: flex; align-items: center; gap: 6px; font-size: .74rem; line-height: 1.2; color: var(--fl-dim); }
.ask-panel .ask-head__s::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--fl-online); box-shadow: 0 0 0 3px rgba(46, 204, 113, .18); }
.ask-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: rgba(255, 255, 255, .7); cursor: pointer; transition: background .2s ease, color .2s ease; }
.ask-icon svg { width: 20px; height: 20px; }
.ask-icon:hover, .ask-icon:focus-visible { background: var(--fl-glass); color: #fff; outline: none; }

.ask-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.ask-thread { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }

/* Bubbles: white for Flint with the fox beside the first of a run, teal for the client. */
.ask-msg { position: relative; max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.ask-msg p { margin: 0; white-space: pre-line; }
.ask-msg--you { align-self: flex-end; background: var(--fl-user); color: #fff; border-bottom-right-radius: 5px; }
.ask-msg--fox { align-self: flex-start; margin-left: 34px; background: #fff; color: var(--fox-color-text, #2F3A45); border-bottom-left-radius: 5px; }
.ask-thread > .ask-msg--fox:first-child::before,
.ask-thread > :not(.ask-msg--fox) + .ask-msg--fox::before { content: ""; position: absolute; left: -34px; bottom: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--fl-teal-soft) url("/image/flint-fox-128.png") center / 20px no-repeat; }
/* Typing: three teal dots until the first word arrives. */
.ask-msg.is-typing p { display: none; }
.ask-msg.is-typing::after { content: ""; display: block; width: 34px; height: 10px; background: radial-gradient(circle, var(--fl-teal) 3.5px, transparent 4px) 0 50% / 12px 10px repeat-x; animation: ask-dots 1s linear infinite; }
@keyframes ask-dots { 0% { opacity: .35; } 50% { opacity: 1; } 100% { opacity: .35; } }

/* Answer buttons: glass, like the app's quick replies. */
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 34px; }
.ask-chips .ask-try__k { width: 100%; }
.ask-chip { min-height: 38px; padding: 8px 14px; border: 1px solid var(--fl-line-2); border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: .86rem; font-weight: 600; text-align: left; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.ask-chip:hover, .ask-chip:focus-visible { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); outline: none; }
.ask-replies { margin-top: 2px; }
.ask-chip--here { display: inline-flex; align-items: center; gap: 6px; border-color: rgba(152, 255, 240, .55); color: var(--fl-mint); }
.ask-chip--here svg { width: 15px; height: 15px; flex: none; }

/* ---------- cards, brief, a person: white cards on the dark sheet ---------- */
.ask-extras { display: grid; gap: 10px; margin-left: 34px; }
.ask-three { display: grid; gap: 8px; }
.ask-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ask-card, .ask-card:hover, .ask-card:visited { color: var(--fox-color-text, #2F3A45); text-decoration: none; }
.ask-card { display: flex; gap: 12px; padding: 9px 10px 9px 9px; border-radius: 14px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); transition: transform .2s ease, box-shadow .2s ease; }
.ask-card:hover, .ask-card:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .28); outline: none; }
.ask-card__img { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--fl-teal-soft); }
.ask-card__b { min-width: 0; display: grid; gap: 2px; }
.ask-card__b p { margin: 0; }
.ask-card__n { font-weight: 600; font-size: .93rem; color: #121417; }
.ask-card__m { font-size: .78rem; color: #5E6773; }
.ask-card__r { font-size: .85rem; line-height: 1.4; color: #2F3A45; }
.ask-fine { margin: 0; font-size: .74rem; line-height: 1.45; color: var(--fl-dim); }

.ask-brief { padding: 12px 14px; border-radius: 14px; background: #fff; color: #2F3A45; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.ask-brief__k { margin: 0 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fl-teal); }
.ask-brief dl { display: grid; gap: 6px; margin: 0; }
.ask-brief dl div { display: grid; grid-template-columns: 60px 1fr; gap: 10px; font-size: .9rem; }
.ask-brief dt { color: #5E6773; }
.ask-brief dd { margin: 0; color: #121417; overflow-wrap: anywhere; }
.ask-brief dl div { grid-template-columns: 92px 1fr; }
.ask-brief__ch { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--fl-teal); font: inherit; font-size: .8rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ask-brief__need { margin: 14px 0 4px; font-size: .88rem; font-weight: 700; color: #121417; }
.ask-slot { padding: 10px 0; border-top: 1px solid #E5EBEF; }
.ask-slot.is-busy { opacity: .55; pointer-events: none; }
.ask-slot__q { margin: 0 0 8px; font-size: .86rem; color: #2F3A45; }
.ask-slot__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-brief .ask-chip { min-height: 36px; padding: 7px 12px; border-color: #CFD8DC; background: #fff; color: #121417; font-size: .82rem; }
.ask-brief .ask-chip:hover, .ask-brief .ask-chip:focus-visible { background: #F2F7F7; border-color: var(--fl-teal); }
.ask-brief .ask-chip.is-on { border: 2px solid var(--fl-teal); padding: 6px 11px; }
.ask-slot__date { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .82rem; color: #5E6773; }
.ask-slot__date input { min-height: 38px; padding: 0 10px; border: 1px solid #CFD8DC; border-radius: 10px; background: #fff; color: #121417; font: inherit; font-size: 16px; }
.ask-slot__f { display: flex; gap: 6px; margin-top: 8px; }
.ask-slot__f input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid #CFD8DC; border-radius: 10px; background: #fff; color: #121417; font: inherit; font-size: 16px; }
.ask-slot__f input:focus { outline: none; border-color: var(--fl-teal); }
.ask-slot__ok { flex: none; min-width: 52px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--fl-teal); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.ask-slot__e { margin: 6px 0 0; font-size: .8rem; color: #B3261E; }
.ask-slot__e:empty { display: none; }
.ask-brief__more { display: block; margin: 10px 0 0; padding: 6px 0; border: 0; background: none; color: var(--fl-teal); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.ask-brief__hi { margin: 10px 0 0; font-size: .82rem; color: #5E6773; }
.ask-brief__hi a { color: var(--fl-teal); font-weight: 600; }
.ask-go { margin: 12px 0 0; }
.ask-go__b { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--fl-teal); color: #fff; font: 600 .95rem/1 var(--fox-font-display, inherit); cursor: pointer; box-shadow: 0 6px 16px rgba(0, 128, 128, .35); }
.ask-human { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #fff; color: #2F3A45; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.ask-human p { margin: 0; font-size: .9rem; }
.ask-panel a.ask-human__b, .ask-panel a.ask-human__b:visited, .ask-panel a.ask-human__b:hover { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; border-radius: 999px; background: #25d366; color: #063d1f !important; font: 700 .95rem/1 var(--fox-font-display, inherit); text-decoration: none; }
.ask-human__l { justify-self: center; font-size: .88rem; color: var(--fl-teal); }

/* Start a new chat: a quiet line after every brief, and a clear offer when a
   new request arrives in an old chat. */
.ask-newline { margin: 2px 0 0; font-size: .8rem; color: var(--fl-dim); }
.ask-newline__b { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: #fff; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ask-fresh { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.ask-fresh p { margin: 0; font-size: .9rem; color: #121417; }
.ask-fresh__b { justify-self: start; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--fl-teal); color: #fff; font: 600 .9rem/1 var(--fox-font-display, inherit); cursor: pointer; }

/* ---------- the box: glass input, teal send with an up arrow ---------- */
.ask-box { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--fl-line); background: transparent; }
@media (min-width: 720px) { .ask-box { padding-bottom: 14px; } }
.ask-box textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 16px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 22px; background: var(--fl-glass-2); color: #fff; font: inherit; font-size: 16px; line-height: 1.35; resize: none; caret-color: var(--fl-mint); }
.ask-box textarea::placeholder { color: rgba(255, 255, 255, .5); }
.ask-box textarea:focus { outline: none; border-color: rgba(152, 255, 240, .55); background: rgba(255, 255, 255, .11); }
.ask-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--fl-teal); color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 128, 128, .45); transition: transform .15s ease, opacity .2s ease; }
.ask-send:hover { transform: translateY(-1px); }
.ask-send svg { width: 20px; height: 20px; }
.ask-send:disabled { opacity: .4; cursor: default; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .ask-msg.is-typing::after, .ask-head__fox, .fox .fox-wa.ask-fab .ask-fab__ring::before { animation: none; }
}
@media print { .ask-panel, .fox .fox-wa.ask-fab { display: none; } }
