/* Colors, fonts and radius are set from the business config at runtime (see app.js). */
:root {
  --primary: #E5007D; --on-primary: #fff; --accent: #FFD900;
  --background: #F3F2F2; --surface: #fff; --text: #111827; --muted: #5b6070; --border: #e3e1e1;
  --radius: 7px; --font: "Roboto Condensed", system-ui, sans-serif; --font-heading: "Oswald", var(--font);
  --primary-soft: color-mix(in srgb, var(--primary) 13%, #fff);
  --primary-border: color-mix(in srgb, var(--primary) 28%, #fff);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; }
body { background: var(--background); color: var(--text); font: 17px/1.45 var(--font);
  display: flex; flex-direction: column; }
body > * { width: 100%; }
[hidden] { display: none !important; }
button, input { font: inherit; }
h1, h3, .eyebrow { font-family: var(--font-heading); }

/* Header bar in Moyee's signature pink with crisp white items */
.bar { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 720px; margin: 16px auto 6px; padding: 10px 18px;
  z-index: 20; background: var(--primary); color: var(--on-primary); border: 1px solid color-mix(in srgb, var(--primary) 82%, #000); border-radius: 999px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 26%, transparent); }
.bar-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.bar button.secondary.small { height: 32px; display: inline-flex; align-items: center; padding: 0 13px; font-size: 13px; white-space: nowrap; border-radius: 999px;
  background: #fff; color: var(--primary); border: 1.5px solid #fff; }
.bar button.secondary.small:hover { background: rgba(255, 255, 255, .9); }
.step-pill { display: inline-flex; align-items: center; font: 700 12px/1 var(--font-heading); text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .92);
  background: none; border: 0; border-radius: 0; padding: 0 4px; white-space: nowrap; }
.profile-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; max-width: 720px; margin: 0 auto; padding: 6px 16px; }
.profile-tag { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; background: var(--primary-soft);
  border: 1px solid var(--primary); border-radius: 6px; padding: 2px 10px; color: var(--primary); }
button.lang-toggle,
button.link.restart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .58); color: #fff;
  text-decoration: none; cursor: pointer; flex-shrink: 0;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .14s ease;
}
button.lang-toggle { font: 700 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .03em; }
button.link.restart { font: 500 17px/1 system-ui, sans-serif; }
button.lang-toggle:hover,
button.link.restart:hover { background: #fff; color: var(--primary); border-color: #fff; }
button.lang-toggle:active,
button.link.restart:active { transform: scale(0.94); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; font: 600 19px/1 var(--font-heading); text-transform: uppercase; letter-spacing: .03em; }
.brand img { height: 32px; display: block; filter: brightness(0) invert(1); }

.card { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 14px 16px 20px; }
#chat, .foot { width: 100%; max-width: 688px; margin-left: auto; margin-right: auto; }
h1 { margin: 0 0 8px; font-size: 36px; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; }
.muted { color: var(--muted); }

button.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--primary); color: var(--on-primary); border: 1.5px solid var(--primary); border-radius: var(--radius);
  padding: 10px 20px; font: 600 15px/1.2 var(--font-heading); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; transition: all .18s ease; }
button.primary:hover:not(:disabled) { background: transparent; color: var(--primary); }
button.primary:disabled { opacity: .5; cursor: default; }
button.secondary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); border-radius: var(--radius);
  padding: 7px 14px; font: 600 14px/1.2 var(--font-heading); text-transform: uppercase; letter-spacing: .03em; cursor: pointer; transition: all .18s ease; }
button.secondary:hover { background: var(--primary-soft); }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px 0; }

#thread { display: flex; flex-direction: column; gap: 12px; }
/* 3x separation (12px gap + 24px margin = 36px) between each new question/turn and previous answers */
.options + .bubble.bot,
.bubble.me + .bubble.bot,
.options + .eyebrow,
.bubble.me + .eyebrow { margin-top: 24px; }
.bubble { max-width: 90%; padding: 13px 16px; border-radius: 10px; white-space: pre-wrap; font-size: 17px; scroll-margin-top: 24px; }
.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.bubble.bot { white-space: pre-line; } /* keeps intended line breaks, e.g. in the language question */
.bubble p, .bubble ul.points { margin: 10px 0 0; }
.bubble > :first-child { margin-top: 0; }
.bubble p.q { font: 600 18px/1.25 var(--font-heading); text-transform: uppercase; letter-spacing: .02em; color: var(--text); }
ul.points { margin: 8px 0 0; padding-left: 20px; }
ul.points li + li { margin-top: 4px; }
ul.points li::marker { color: var(--primary); }
.me { align-self: flex-end; background: var(--primary); color: var(--on-primary); font-weight: 600;
  border-radius: 10px 10px 2px 10px; box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 26%, transparent); }

/* "Someone is typing": three bouncing dots, plus a label for long waits */
.typing { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); min-height: 46px; }
.typing-dots { display: inline-flex; gap: 5px; }
.typing-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .35; animation: hop 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-6px); opacity: 1; } }
.typing-label:empty { display: none; }

/* A blinking cursor while a message types itself out */
.caret::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: currentColor; animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.fade-in { animation: fade-up .28s cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes fade-up { from { opacity: 0; transform: translate3d(0, 7px, 0); } }
@media (prefers-reduced-motion: reduce) { .typing-dots i, .caret::after, .fade-in, .options button.picked { animation: none; } }
.error { border-color: #d9a3a3; }
.error a, .error button { margin-left: 8px; }

.insight { align-self: flex-start; max-width: 90%; background: color-mix(in srgb, var(--accent) 22%, #fff);
  border: 1px solid var(--accent); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 10px 14px; font-size: 16px; font-weight: 600; }

/* Option chips vs secondary free-text trigger ("Write my own answer") vs primary CTA ("Continue") */
.options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.options-break { flex-basis: 100%; height: 2px; }
.options button { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--primary-border); color: var(--text); border-radius: 8px;
  padding: 9px 15px; font: 600 16px/1.25 var(--font); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: transform .15s cubic-bezier(0.23, 1, 0.32, 1), background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
@media (hover: hover) and (pointer: fine) {
  .options button:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); transform: translateY(-1px); }
}
.options button:active:not(:disabled),
button.primary:active:not(:disabled),
button.secondary:active:not(:disabled) { transform: scale(0.97); }
.options button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 26%, transparent); }
.options button:disabled { opacity: .45; cursor: default; }

/* Distinct lightweight ghost-pill style for "Write my own answer" */
.options button.write {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(17, 24, 39, .04); border: 1.25px dashed #9ca3af; color: #4b5563;
  border-radius: 999px; padding: 7px 14px; font: 500 14.5px/1.2 var(--font); box-shadow: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, padding .3s ease, transform .15s ease;
}
.options button.write:hover:not(:disabled) {
  background: rgba(17, 24, 39, .08); border-color: #4b5563; color: #111827; transform: translateY(-1px);
}
.write .label { display: inline-block; max-width: 20em; overflow: hidden; white-space: nowrap; transition: max-width .35s ease, opacity .2s ease; }
.write .x { display: inline-flex; align-items: center; justify-content: center; width: 0; overflow: hidden; opacity: 0; font-size: 18px; line-height: 1;
  transform: rotate(-90deg) scale(.4); transition: width .35s ease, opacity .25s ease .1s, transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.options button.write.open {
  gap: 0; border-style: solid; border-color: #111827; background: #111827; color: #fff;
  width: 34px; height: 34px; padding: 0;
}
.write.open .label { max-width: 0; width: 0; overflow: hidden; opacity: 0; }
.write.open .x { width: 16px; opacity: 1; transform: rotate(0) scale(1); }

/* Distinct bold CTA pill for multi-select "Continue →" */
.options button.continue-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #111827; color: #fff; border: 1.5px solid #111827;
  border-radius: 999px; padding: 8px 18px;
  font: 600 14.5px/1.2 var(--font-heading); text-transform: uppercase; letter-spacing: .05em;
  box-shadow: 0 4px 12px rgba(17, 24, 39, .2);
}
.options button.continue-btn .cont-arrow { display: inline-flex; align-items: center; color: var(--accent); font-size: 15px; }
.options button.continue-btn:hover:not(:disabled) {
  background: #000; border-color: #000; color: #fff;
  box-shadow: 0 6px 16px rgba(17, 24, 39, .28); transform: translateY(-1px);
}
.options button.continue-btn:hover:not(:disabled) .cont-arrow { transform: translateX(3px); }
.options button.continue-btn:disabled {
  background: #e5e7eb; border-color: #d1d5db; color: #9ca3af; box-shadow: none; opacity: 1;
}
.options button.continue-btn:disabled .cont-arrow { color: #9ca3af; }

/* Earlier steps stay faded but tappable: tapping one goes back to that step */
.options.past button { opacity: .55; transition: opacity .2s, background .16s; }
.options.past button:hover, .options.past button:focus-visible { opacity: .9; }
.options.past button.picked, .options.past button[aria-pressed="true"] { opacity: 1; }

/* The chosen chip stays filled while the others fade */
.options button.picked, .options button[aria-pressed="true"]:disabled { background: var(--primary); border-color: var(--primary); color: var(--on-primary); opacity: 1; }
.options button.picked { animation: pick .3s ease; }
@keyframes pick { 50% { transform: scale(1.05); } }
.options button.primary.picked { display: none; } /* multi-select "Continue" disappears once used */

#composer { display: flex; gap: 8px; margin-top: 14px; max-height: 90px; overflow: hidden; opacity: 1; transform: translateY(0);
  transition: max-height .35s ease, opacity .3s ease, transform .35s ease, margin-top .35s ease; }
#composer.collapsed { max-height: 0; margin-top: 0; opacity: 0; transform: translateY(-8px); }
#composer input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
@media (prefers-reduced-motion: reduce) { #composer, .write, .write * { transition: none !important; } }
#composer input { flex: 1; min-width: 0; padding: 11px 14px; border: 1.5px solid var(--primary-border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 17px; }

.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: 14px; color: var(--primary); margin: 10px 0 -4px; font-weight: 600; }
.products { display: grid; gap: 14px; }
.product { background: var(--surface); border: 1.5px solid var(--primary-border); border-radius: 12px; padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.05); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.product:hover { border-color: var(--primary); box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 16%, transparent); }
.product.main { border: 2.5px solid var(--primary); padding: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, #fff) 0%, var(--surface) 40%); }
.product h3 { margin: 0; font-size: 22px; line-height: 1.15; text-transform: uppercase; letter-spacing: .02em; color: var(--primary); }
.product.alt h3 { font-size: 19px; }
.product .top { display: flex; gap: 16px; align-items: flex-start; }
.product .head { flex: 1; min-width: 0; }
.product .pic { flex: none; width: 116px; aspect-ratio: 1; border: 1px solid #dcdcdc; border-radius: 7px; background: #f6f6f6; padding: 8px; overflow: hidden; }
.product.alt .pic { width: 86px; }
.product .pic img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease-in; }
.product:hover .pic img { transform: scale(1.08); }
/* On phones the main pick's photo sits big above the name; alternatives keep theirs beside it */
@media (max-width: 480px) {
  .product.main .top { flex-direction: column; gap: 10px; }
  .product.main .pic { width: 180px; align-self: center; }
  .product.alt .pic { width: 92px; }
}
.product .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; font-size: 13px; }
.chip { border: 1px solid #dcdcdc; background: #f6f6f6; border-radius: 6px; padding: 3px 10px; font-weight: 600; }
.chip.label { background: var(--accent); border-color: var(--accent); color: #111827; font-family: var(--font-heading);
  text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.chip.match { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.chip.off { color: var(--muted); text-decoration: line-through; opacity: .7; }
.price { font: 600 22px/1.2 var(--font-heading); color: var(--text); }
.product p { margin: 8px 0 0; font-size: 16px; }
.sub-line { font-size: 15px; margin-top: 6px; }
.sub-line a { color: var(--primary); font-weight: 700; text-decoration: none; }
.sub-line a:hover { text-decoration: underline; }
.product .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.product a.primary { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: var(--on-primary); border: 1.5px solid var(--primary); border-radius: var(--radius);
  padding: 9px 18px; text-decoration: none; font: 600 15px/1.2 var(--font-heading); text-transform: uppercase; letter-spacing: .04em; transition: all .2s ease; }
.product a.primary:hover { background: transparent; color: var(--primary); }

.tips { background: var(--surface); border: 1.5px solid var(--primary-border); border-left: 5px solid var(--accent); border-radius: 10px; padding: 14px 18px; }
.tips ul { margin: 8px 0 0; padding-left: 20px; }
.tips li + li { margin-top: 6px; }

.fit-q { margin: 10px 0 -4px; font: 600 17px/1.3 var(--font-heading); text-transform: uppercase; letter-spacing: .02em; }

.foot { margin-top: auto; padding: 18px 0 4px; font-size: 13px; color: var(--muted); text-align: center; }
.foot p { margin: 4px 0; }
#credit:not(:empty) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; }
#credit heybox-buddy { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; }

/* Inside the chat-bubble widget — coordinated open/close choreography */
body.embed .bar { margin: 0; max-width: none; min-height: 54px; border-radius: 0; border-top: 0; border-left: 0; border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .2); padding: 10px 51px 10px 14px; box-shadow: 0 2px 10px rgba(229, 0, 125, .2);
  transform: translate3d(0, 0, 0); opacity: 1;
  transition: transform .28s cubic-bezier(0.23, 1, 0.32, 1), opacity .2s cubic-bezier(0.23, 1, 0.32, 1); }
body.embed .brand img { height: 26px; }
body.embed h1 { font-size: 28px; }
body.embed .card { padding-top: 12px; transform: translate3d(0, 0, 0) scale(1); opacity: 1;
  transition: transform .34s cubic-bezier(0.22, 1, 0.36, 1) .035s, opacity .22s cubic-bezier(0.23, 1, 0.32, 1) .025s; }
body.embed .foot { transform: translate3d(0, 0, 0); opacity: 1;
  transition: transform .32s cubic-bezier(0.22, 1, 0.36, 1) .08s, opacity .24s cubic-bezier(0.23, 1, 0.32, 1) .08s; }
body.embed[data-panel-state="closed"] .bar { opacity: 0; transform: translate3d(0, -6px, 0); transition: none; }
body.embed[data-panel-state="closed"] .card { opacity: 0; transform: translate3d(0, 16px, 0) scale(.985); transition: none; }
body.embed[data-panel-state="closed"] .foot { opacity: 0; transform: translate3d(0, 8px, 0); transition: none; }
body.embed[data-panel-state="closing"] .bar { opacity: 0.45; transform: translate3d(0, -4px, 0);
  transition: transform .18s cubic-bezier(0.32, 0.72, 0, 1), opacity .16s ease-out; }
body.embed[data-panel-state="closing"] .card { opacity: 0.25; transform: translate3d(0, 10px, 0) scale(.985);
  transition: transform .2s cubic-bezier(0.32, 0.72, 0, 1), opacity .16s ease-out; }
body.embed[data-panel-state="closing"] .foot { opacity: 0; transform: translate3d(0, 6px, 0);
  transition: transform .16s cubic-bezier(0.32, 0.72, 0, 1), opacity .14s ease-out; }
@media (prefers-reduced-motion: reduce) {
  body.embed .bar, body.embed .card, body.embed .foot,
  body.embed[data-panel-state="closed"] .bar, body.embed[data-panel-state="closed"] .card, body.embed[data-panel-state="closed"] .foot,
  body.embed[data-panel-state="closing"] .bar, body.embed[data-panel-state="closing"] .card, body.embed[data-panel-state="closing"] .foot {
    transform: none !important;
    transition: opacity .16s ease !important;
  }
}

@media (max-width: 520px) {
  .bar { margin: 0; max-width: none; border-radius: 0; border-top: 0; border-left: 0; border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .2); padding: 10px 12px; gap: 6px; }
  body.embed .bar { min-height: 54px; padding: 10px 51px 10px 12px; }
  body.embed .brand img, .brand img { height: 23px; }
  .bar-right { gap: 7px; }
  .step-pill { padding: 0 2px; font-size: 11px; }
  .bar button.secondary.small { height: 32px; padding: 0 9px; font-size: 11px; }
  button.lang-toggle, button.link.restart { width: 32px; height: 32px; }
  button.lang-toggle { font-size: 11.5px; }
  button.link.restart { font-size: 17px; }
  .profile-bar { padding: 5px 12px; gap: 5px; border-bottom: 1px solid var(--border); }
  .profile-tag { font-size: 12px; padding: 2px 8px; }
  .card { padding: 10px 12px 16px; }
  .bubble { max-width: 94%; padding: 11px 14px; font-size: 16px; }
  .bubble p.q { font-size: 16px; }
  .options { gap: 7px; }
  .options button { padding: 8px 13px; font-size: 15px; }
  .options button.write { padding: 6.5px 12px; font-size: 13.5px; }
  .options button.continue-btn { padding: 7.5px 15px; font-size: 13.5px; }
}
