.call {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fff, var(--mist)); color: var(--ink); font-family: var(--font-body);
}
.call[hidden] { display: none; }
.call-top { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: .9rem; }
.call-top .agent { font-family: var(--font-head); font-weight: 700; color: var(--navy); }
.call-top .sep { color: var(--muted); }
.call-top .timer { font-variant-numeric: tabular-nums; color: var(--muted); }
.call-top .chip { margin-left: auto; border: 1px solid var(--gold); color: var(--ink); background: #FBF4E4; border-radius: 999px; padding: 2px 12px; font-size: .75rem; }

.call-main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; padding: 12px; gap: 12px; box-sizing: border-box; }
.stage-col { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: #fff; }
.stage { position: relative; flex: 1; min-height: 0; background: #0B1B3F; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage video.remote { width: 100%; height: 100%; object-fit: cover; background: #0B1B3F; }
.stage .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #D9DEE7; text-align: center; padding: 0 24px; }
.stage .avatar-dot { width: 96px; height: 96px; border-radius: 50%; background: #16294A; border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 1.8rem; color: #fff; }
.self-tile { position: absolute; right: 12px; bottom: 64px; width: 96px; height: 128px; border-radius: 12px; overflow: hidden; background: #16294A; border: 1px solid #3A4D78; display: flex; align-items: center; justify-content: center; font-size: .75rem; color: #9DAAC2; }
.self-tile video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.captions { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px var(--gutter); background: linear-gradient(0deg, rgba(11, 27, 63, .88), rgba(11, 27, 63, .55)); color: #fff; min-height: 44px; font-size: 1rem; line-height: 1.4; box-sizing: border-box; max-height: 30%; overflow: auto; }
.captions .who { color: #F3DDA6; font-weight: 700; margin-right: 6px; }
.notice { background: #FBF4E4; color: var(--ink); border-bottom: 1px solid var(--gold); padding: 8px var(--gutter); font-size: .9rem; }
.notice[hidden] { display: none; }


.controls { display: flex; justify-content: center; gap: 8px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .9); border-top: 1px solid var(--line); flex-wrap: wrap; }
.ctl { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-weight: 500; cursor: pointer; transition: border-color .2s, transform .15s; }
.ctl:hover { border-color: var(--gold); }
.ctl:active { transform: scale(.98); }
.ctl[data-mic][aria-pressed='true'] { background: #FBEAEA; border-color: var(--danger); }
.ctl.end { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
.ctl:disabled { opacity: .5; }

.finish { position: absolute; inset: 0; background: rgba(11, 27, 63, .94); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; z-index: 5; }
.finish[hidden] { display: none; }
.finish h2 { color: #fff; }
.finish .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }

@media (min-width: 900px) {
  .call-main { flex-direction: row; }
  .panel { width: 340px; }
  .panel-handle { cursor: default; }
  .panel-handle::before { display: none; }
  .panel-body, .panel[data-open='false'] .panel-body { display: block; max-height: none; flex: 1; overflow-y: auto; }
  .self-tile { width: 160px; height: 120px; bottom: 72px; }
}

/* Clip mode: pre-rendered advisor clips instead of the live avatar. */
/* The clips are square head and shoulders; contain keeps the whole head in a wide stage, on the clip backdrop grey. */
.stage video.clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #BCBAB9; }
.stage video.clip[hidden] { display: none; }
.stage video.clip-line { z-index: 1; opacity: 0; transition: opacity .18s ease; }
.stage video.clip-line.is-on { opacity: 1; }
.stage .captions { z-index: 2; }
.call[data-mode='clips'] [data-cam],
.call[data-mode='clips'] [data-type],
.call[data-mode='clips'] .self-tile { display: none; }
@media (min-width: 900px) {
  .clip-card { max-height: 45%; }
}

.stepper { max-width: 40rem; }
.stepper-chat { display: grid; gap: 12px; margin-bottom: 20px; }
.bubble { border-radius: 18px; padding: 12px 16px; max-width: 90%; }
.bubble.q { background: var(--surface); }
.bubble.a { background: var(--navy); color: #fff; justify-self: end; }
.stepper-meta { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.stepper-nav { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
/* Clip mode: the stage is the clip's own square, centred, with the question card below it. */
[data-mode='clips'] .stage { flex: 0 1 auto; aspect-ratio: 1 / 1; height: min(48vh, 560px); min-height: 180px; width: auto; max-width: 100%; align-self: center; border-radius: var(--radius-lg); }
/* The question card takes the rest of the column and scrolls inside it, so long option lists and the Continue button stay reachable. */
[data-mode='clips'] .clip-card { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding: 12px var(--gutter) 14px; }
[data-mode='clips'] .clip-card .search { margin-bottom: 6px; }

/* No call yet, nothing to end. */
.call[data-phase="lobby"] .ctl.end { display: none; }
/* Quote page: the typed questions sit close under the intro. */
.hero-compact { padding: 40px 0 28px; }
.hero-compact .disclosure-block { margin-top: 18px; }
.stepper-section { padding: 28px 0 56px; }

/* Phones: a smaller stage so the question, its options and Continue fit under him. */
@media (max-width: 640px) {
  [data-mode='clips'] .stage { height: min(34vh, 300px); min-height: 160px; }
  [data-mode='clips'] .clip-card { padding: 10px var(--gutter) 12px; }
  .call-top { padding: 6px var(--gutter); }
}
@media (max-width: 640px) { .stage .captions { background: rgba(11, 27, 63, .5); font-size: .85rem; padding: 6px 10px; } }
