/* ===================== Emma, AI Partnership Concierge (Phase 1, 2026-11-30) =====================
   Hero card (State A), conversation panel (State B) and compact launcher (State C). Kept in its own file so it can be removed cleanly.
   Responsive layout: see "Approved responsive layout" below (desktop rail, tablet rails, compact mobile card). */
.hero-rail { display: contents; }
.hero-visual { min-width: 0; }   /* the card must never widen the hero grid (200% text) */
.emma-card { min-width: 0; position: relative; z-index: 6; background: #fff; border-radius: var(--r-md); padding: .5rem; box-shadow: var(--shadow-2), 0 0 0 .4rem rgba(214, 243, 241, .95); }
.emma-tile { position: relative; display: block; border-radius: calc(var(--r-md) - .35rem); overflow: hidden; background: var(--c-ocean-tint); cursor: pointer; aspect-ratio: 4 / 3; }
.emma-tile img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; display: block; transition: transform .35s ease; }
.emma-tile:hover img { transform: scale(1.03); }
.emma-play { position: absolute; top: .55rem; right: .55rem; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--c-sunrise-gold); color: var(--c-deep-ocean); box-shadow: 0 6px 14px -6px rgba(18,51,74,.5); }
.emma-play .ic { width: 1.05rem; height: 1.05rem; fill: currentColor; margin-left: .12rem; }
.emma-body { display: grid; gap: .45rem; padding: .6rem .35rem .3rem; }
.emma-id { display: flex; align-items: center; gap: .55rem; margin: 0; line-height: 1.15; }
.emma-id b { display: block; font: 700 1.2rem var(--font-head); color: var(--c-deep-ocean); }
.emma-id small { display: block; font-size: .8rem; color: var(--c-navy-slate); margin-top: .1rem; }
.emma-dot { flex: none; width: .65rem; height: .65rem; border-radius: 50%; background: #2E9E57; box-shadow: 0 0 0 .2rem rgba(46,158,87,.18); }
.emma-msg { margin: 0; font: 700 1rem/1.28 var(--font-head); color: var(--c-deep-ocean); }
.emma-msg .v-short { display: none; }
.emma-sub { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--c-navy-slate); }
.emma-speak { width: 100%; min-height: 2.9rem; margin-top: .15rem; white-space: nowrap; }
.emma-micro { margin: 0; font-size: .76rem; color: var(--c-navy-slate); text-align: center; }

/* Approved responsive layout + benefit-led messaging (2026-11-30). */
/* Wide desktop (approved composition): rail = chips + Emma's card; full headline, subheadline and CTA in the card. */
@media (min-width: 75em) {
  .hero-rail { display: flex; flex-direction: column; gap: .7rem; position: absolute; z-index: 6; top: 5%; width: 18.5rem;
    right: calc((100vw - min(100vw - 2.5rem, 80rem)) / 2 + .75rem); }
  .hero-rail .float--chips { position: static; }
  .hero-rail .emma-tile { aspect-ratio: 16 / 10; }   /* +25% height vs 2:1 (2026-11-30), chest-up framing */
  .hero-rail .emma-body { gap: .4rem; padding: .55rem .3rem .25rem; }
  .hero-rail .emma-micro { display: none; }
  /* the label moves beside the rail so the taller card never covers it */
  .illus-note { bottom: 2.2rem; right: calc((100vw - min(100vw - 2.5rem, 80rem)) / 2 + 20.25rem); }
}
/* Tablet landscape / small laptops (64-75em): same rail, narrower; compact headline + CTA. */
@media (min-width: 64em) and (max-width: 74.99em) {
  .hero-rail { display: flex; flex-direction: column; gap: .8rem; position: absolute; z-index: 6; top: 5%; right: .75rem; width: 15rem; }
  .hero-rail .float--chips { position: static; }
  .hero-rail .emma-tile { aspect-ratio: 16 / 9; }
  .hero-rail .emma-sub, .hero-rail .emma-micro, .emma-msg .v-full { display: none; }
  .emma-msg .v-short { display: inline; }
  .hero-art { left: -9rem; }
  .emma-speak { padding-inline: .75rem; gap: .35rem; font-size: .92rem; white-space: normal; text-align: center; }
  .illus-note { bottom: 2.2rem; }
}
/* Tablet portrait (48-64em): desktop-style rail inside the photo; compact horizontal card beneath the lifestyle cards. */
@media (min-width: 48em) and (max-width: 63.99em) {
  .hero-rail { display: flex; flex-direction: column; align-items: flex-end; gap: .7rem; position: absolute; z-index: 6; right: 1.25rem; top: 9%; width: 21rem; }
  .hero-rail .float--chips { position: static; }
  .hero-rail .emma-card { width: 100%; display: grid; grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr); gap: .25rem .8rem; align-items: center; }
  .hero-rail .emma-tile { aspect-ratio: 4 / 5; }
  .hero-rail .emma-body { padding: .1rem .2rem .1rem 0; gap: .4rem; }
  .hero-rail .emma-sub, .hero-rail .emma-micro, .emma-msg .v-full { display: none; }
  .emma-msg .v-short { display: inline; }
  .emma-id b { font-size: 1.05rem; }
  .emma-speak { padding-inline: .75rem; gap: .35rem; font-size: .92rem; white-space: normal; text-align: center; }
}
/* Mobile (<48em): the image card is replaced by the compact horizontal card above the main CTAs (visible on arrival). */
.emma-mini { display: none; }
@media (max-width: 47.99em) {
  .hero-visual .emma-card { display: none; }
  .emma-mini { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: .5rem .8rem; align-items: center; margin: 0 0 1.25rem; padding: .7rem .75rem .75rem;
    background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-1), 0 0 0 .3rem rgba(214, 243, 241, .95); }
  .em-face { position: relative; width: 3.5rem; height: 3.5rem; }
  .em-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--c-fresh-lime); }
  .em-face::after { content: ""; position: absolute; right: .1rem; bottom: .1rem; width: .7rem; height: .7rem; border-radius: 50%; background: #2E9E57; box-shadow: 0 0 0 2px #fff; }
  .em-h { margin: 0; font: 700 1.02rem/1.3 var(--font-head); color: var(--c-deep-ocean); }
  .em-id { margin: .15rem 0 0; font-size: .8rem; color: var(--c-navy-slate); }
  .em-id b { color: var(--c-deep-ocean); }
  .em-sub { grid-column: 1 / -1; margin: 0; font-size: .88rem; line-height: 1.45; color: var(--c-navy-slate); }
  .em-cta { grid-column: 1 / -1; width: 100%; min-height: 2.9rem; }
}
/* Short phone screens (e.g. 375 x 667): drop the subheadline so the card and its CTA stay above the fold. */
@media (max-width: 47.99em) and (max-height: 47.5em) { .em-sub { display: none; } }
/* Short screens: shorter image in the pre-conversation panel so Start conversation is visible without scrolling. */

/* State B: conversation panel (non-modal; the page stays usable). */
.emma-panel { position: fixed; z-index: 60; right: 1.25rem; bottom: 1.25rem; width: min(23rem, calc(100vw - 2rem)); max-height: calc(100vh - 2.5rem); max-height: calc(100dvh - 2.5rem);
  display: flex; flex-direction: column; background: #fff; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(18,51,74,.5), 0 0 0 .35rem rgba(214, 243, 241, .95); }
.emma-panel[hidden] { display: none; }
.ep-head { flex: none; display: flex; align-items: center; gap: .6rem; padding: .5rem .45rem .5rem .75rem; background: var(--c-deep-ocean); color: #fff; }
.ep-face { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--c-fresh-lime); }
.ep-title { flex: 1; margin: 0; line-height: 1.2; min-width: 0; }
.ep-title b { display: block; font: 700 1rem var(--font-head); }
.ep-title small { display: block; font-size: .78rem; color: rgba(255,255,255,.88); }
.ep-icon { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.ep-icon:hover { background: rgba(255,255,255,.12); }
.ep-icon[hidden] { display: none; }
.ep-head :focus-visible { outline-color: #fff; outline-offset: -3px; }
.ep-stage { position: relative; flex: none; background: var(--c-deep-ocean); aspect-ratio: 16 / 10; overflow: hidden; }
.ep-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
/* Pre-conversation: a larger chest-up portrait (never below the chest-up minimum, fix 2026-11-30); on short screens the info scrolls; the info scrolls on its own; Start stays in a fixed footer. */
.emma-panel[data-state="intro"] .ep-stage { aspect-ratio: auto; height: clamp(17rem, 36vh, 18.5rem); height: clamp(17rem, 36dvh, 18.5rem); }
.ep-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--c-deep-ocean); }
.ep-connecting { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); margin: 0; padding: .35rem .9rem; border-radius: var(--r-pill); background: rgba(18,51,74,.85); color: #fff; font-size: .85rem; white-space: nowrap; }
.ep-connecting[hidden] { display: none; }
.ep-intro { flex: 1 1 auto; min-height: 0; overflow: auto; padding: .85rem 1.1rem .9rem; display: grid; gap: .55rem; align-content: start; }
.ep-startbar { flex: none; padding: .7rem 1.1rem .85rem; border-top: 1px solid var(--c-teal-tint); background: #fff; }
.ep-h { font-size: 1.2rem; line-height: 1.25; color: var(--c-deep-ocean); }
.ep-sub { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--c-navy-slate); }
.ep-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .84rem; line-height: 1.4; color: var(--c-deep-ocean); }
.ep-points li { display: flex; gap: .5rem; align-items: flex-start; }
.ep-points .ic { flex: none; margin-top: .15rem; color: var(--c-deep-teal); }
.ep-actions[hidden], .ep-startbar[hidden], .ep-preview[hidden], .ep-error[hidden], .ep-foot[hidden], .ep-intro[hidden] { display: none; }
.ep-start, .ep-end, .ep-preview .btn { width: 100%; }
.ep-preview { display: grid; gap: .6rem; padding: .75rem .8rem; border-radius: var(--r-sm); background: var(--c-soft-mint); }
.ep-preview p { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--c-deep-ocean); }
.ep-error { margin: 0; padding: .6rem .75rem; border-radius: var(--r-sm); background: var(--c-coral-tint); color: var(--c-deep-ocean); font-size: .85rem; }
.ep-foot { flex: none; padding: .7rem .8rem .8rem; }
/* Live: a portrait call area, narrower than 640 px (the provider's call page is designed for portrait frames; see demo Doc 06). */
.emma-panel[data-state="live"] .ep-stage { aspect-ratio: 4 / 5; max-height: calc(100vh - 10.5rem); max-height: calc(100dvh - 10.5rem); }
/* Minimized: the same frame stays in place, just smaller, so the call continues (never display:none, never moved). */
.emma-panel[data-state="min"] { width: 15.5rem; }
.emma-panel[data-state="min"] .ep-stage { aspect-ratio: auto; height: 8.5rem; }
.emma-panel[data-state="min"] .ep-title small { display: none; }
.emma-panel[data-state="min"] .ep-foot { padding: .5rem; }
.emma-panel[data-state="min"] .ep-end { min-height: 2.75rem; font-size: .9rem; }
@media (max-width: 47.99em) {
  .emma-panel { left: .75rem; right: .75rem; bottom: .75rem; width: auto; border-radius: var(--r-md); }
  .emma-panel[data-state="live"] .ep-stage { aspect-ratio: auto; height: min(62vh, 30rem); height: min(62dvh, 30rem); }
  .emma-panel[data-state="min"] { left: auto; width: 14rem; }
}

/* State C: compact concierge launcher, shown after Emma's hero card scrolls out of view. */
.emma-launch { position: fixed; z-index: 55; right: 1.25rem; bottom: 1.25rem; display: flex; align-items: center; gap: .65rem; min-height: 3.5rem;
  padding: .4rem 1.1rem .4rem .4rem; border: 0; border-radius: var(--r-pill); background: #fff; color: var(--c-deep-ocean); cursor: pointer; text-align: left;
  box-shadow: var(--shadow-2), 0 0 0 .3rem rgba(214, 243, 241, .95); font-family: var(--font-body); }
.emma-launch[hidden] { display: none; }
.emma-launch img { width: 2.75rem; height: 2.75rem; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--c-fresh-lime); }
.emma-launch b { display: block; font: 700 .95rem/1.2 var(--font-head); }
.emma-launch small { display: block; font-size: .74rem; color: var(--c-navy-slate); }
.emma-launch:hover { box-shadow: var(--shadow-2), 0 0 0 .3rem var(--c-vibrant-teal); }
@media (max-width: 35.99em) { .emma-launch { right: .75rem; bottom: .75rem; padding-right: .9rem; } .emma-launch small { display: none; } }
@media (prefers-reduced-motion: reduce) { .emma-tile img { transition: none; } .emma-tile:hover img { transform: none; } }
.ep-startbar .ep-error { margin-bottom: .6rem; }

/* Phase 2 (local development): "type instead" links, demo button and the business details confirmation card. */
.ep-typed { justify-self: start; min-height: 2.75rem; padding: .4rem 0; border: 0; background: none; color: var(--c-deep-teal); font: 600 .88rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ep-foot .ep-typed { display: block; margin: .35rem auto 0; }
/* Live footer: "Enter Business Details" is a clear secondary action above End conversation (T4, 2026-12-01). */
.ep-foot { display: grid; gap: .5rem; }
.ep-details { width: 100%; border-color: var(--c-deep-teal); background: var(--c-soft-mint); color: var(--c-deep-teal); }
.ep-details:hover { background: var(--c-deep-teal); color: #fff; }
.emma-panel[data-state="min"] .ep-details { min-height: 2.75rem; font-size: .9rem; padding: .4rem .8rem; }
.ep-demo { display: grid; gap: .35rem; margin-bottom: .6rem; }
.ep-demo[hidden], .ep-card[hidden], .ep-card-err[hidden], .ep-card-done[hidden], [data-emma-form][hidden] { display: none; }
.ep-demo .btn { width: 100%; }
.ep-demo p { margin: 0; font-size: .78rem; color: var(--c-navy-slate); text-align: center; }
.ep-demo-plain { width: 100%; }
.ep-foot:has(.ep-demo:not([hidden])) .btn { min-height: 2.75rem; padding-top: .45rem; padding-bottom: .45rem; font-size: .95rem; }
.ep-demo { margin-bottom: .2rem; }
/* Protected avatar (fix 2026-12-01, replaces the Test #005 rule that let the video shrink to 7rem when the demo choices
   appeared). The call area ALWAYS keeps the same upright 4:5 head-and-shoulders portrait as the regular conversation: it is
   never squeezed or cropped by the controls. If the browser is too short for the full-size portrait plus the controls, the
   whole panel becomes proportionally narrower (the portrait scales down, never changes shape), and the controls area below
   scrolls on its own. CSS only: the call iframe is never moved or re-created, so the voice session continues. */
.emma-panel[data-state="live"] { --ep-controls: 8.5rem; --ep-head: 3.65rem;
  --ep-w: min(23rem, calc(100vw - 2rem), max(15rem, calc((100dvh - 2.5rem - var(--ep-head) - var(--ep-controls)) * .8)));
  width: var(--ep-w); }
.emma-panel[data-state="live"]:has(.ep-demo:not([hidden])) { --ep-controls: 8rem; }   /* both demo choices stay in view */
.emma-panel[data-state="live"] .ep-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* header stays one height */
.emma-panel[data-state="live"] .ep-stage { flex: none; width: 100%; height: calc(var(--ep-w) * 1.25); aspect-ratio: auto; max-height: none; }
.emma-panel[data-state="live"] .ep-foot { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 47.99em) {
  .emma-panel[data-state="live"] { --ep-w: min(calc(100vw - 1.5rem), max(15rem, calc((100dvh - 1.5rem - var(--ep-head) - var(--ep-controls)) * .8))); left: auto; width: var(--ep-w); }
}
/* The contact card slides up over the lower part of the call area only: Emma's head and shoulders (the top ~60% of the
   portrait) stay visible, and the card scrolls on its own. */
.ep-card { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--ep-head, 3.65rem) - var(--ep-w, 23rem) * .75); overflow: auto; padding: 1rem 1.1rem 1.1rem; background: #fff;
  border-top: 3px solid var(--c-vibrant-teal); border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: 0 -18px 40px -20px rgba(18,51,74,.45); }
.ep-card-h { font-size: 1.1rem; color: var(--c-deep-ocean); }
.ep-card-dev { margin: .3rem 0 .6rem; padding: .35rem .55rem; border-radius: var(--r-sm); background: var(--c-gold-tint); font-size: .78rem; color: var(--c-deep-ocean); }
.ep-field { display: grid; gap: .2rem; margin-bottom: .55rem; }
.ep-field label { font-size: .82rem; font-weight: 600; color: var(--c-deep-ocean); }
.ep-field input, .ep-field select { min-height: 2.75rem; padding: .45rem .65rem; border: 1px solid #9FB3BF; border-radius: .6rem; font: 400 1rem var(--font-body); color: var(--c-deep-ocean); background: #fff; }
.ep-field input:focus-visible, .ep-field select:focus-visible { outline: 3px solid var(--c-deep-ocean); outline-offset: 1px; }
.ep-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: .6rem; }
.ep-card-use { margin: .2rem 0 .5rem; font-size: .8rem; line-height: 1.45; color: var(--c-navy-slate); }
.ep-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .82rem; line-height: 1.45; color: var(--c-deep-ocean); cursor: pointer; }
.ep-check input { flex: none; width: 1.35rem; height: 1.35rem; margin-top: .1rem; accent-color: var(--c-deep-teal); }
.ep-card-err { margin: .6rem 0 0; padding: .5rem .65rem; border-radius: var(--r-sm); background: var(--c-coral-tint); font-size: .84rem; color: var(--c-deep-ocean); }
.ep-card-actions { display: grid; gap: .5rem; margin-top: .75rem; }
.ep-card-actions .btn { width: 100%; }
.ep-card-done { margin: .6rem 0 0; padding: .8rem; border-radius: var(--r-sm); background: var(--c-soft-mint); font-weight: 600; color: var(--c-deep-ocean); }
/* navigate_website: brief, gentle highlight of the section Emma opened (no motion for reduced-motion users) */
.emma-highlight { outline: 3px solid rgba(0, 179, 173, .55); outline-offset: 6px; border-radius: 12px; transition: outline-color .6s; }
@media (prefers-reduced-motion: reduce) { .emma-highlight { transition: none; } }
