/* Live-call page. Extends ../styles.css (tokens, fonts, phone, transcript). */
.wrap-call { max-width: 1080px; }
.back { margin: 12px 0 0; font-size: 14px; }
.back a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.back a:hover { color: var(--ink); }
.stage { margin-top: 26px; }

.controls-call { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "level button" "status status"; align-items: center; gap: 10px 12px; }
.level { grid-area: level; display: inline-flex; align-items: flex-end; gap: 3px; height: 28px; --level: 0; }
.level span { width: 5px; height: 6px; border-radius: 3px; background: var(--ink-3); transition: height 80ms linear; }
body[data-mode="live"] .level span { background: var(--honey); }
body[data-mode="live"] .level span:nth-child(1) { height: calc(6px + 10px * var(--level)); }
body[data-mode="live"] .level span:nth-child(2) { height: calc(6px + 18px * var(--level)); }
body[data-mode="live"] .level span:nth-child(3) { height: calc(6px + 22px * var(--level)); }
body[data-mode="live"] .level span:nth-child(4) { height: calc(6px + 16px * var(--level)); }
body[data-mode="live"] .level span:nth-child(5) { height: calc(6px + 9px * var(--level)); }
body[data-speaking="agent"] .level span { background: var(--paper); box-shadow: inset 0 0 0 1px var(--midnight); }

.btn-call { grid-area: button; justify-self: start; min-width: 220px; }
body[data-mode="live"] .btn-call { background: var(--midnight); color: var(--paper); }
body[data-mode="connecting"] .btn-call { opacity: 0.7; }
body[data-mode="live"] .call-clock { background: var(--midnight); color: var(--paper); }
.clock-warn { background: var(--honey) !important; color: var(--midnight) !important; }

.status { grid-area: status; margin: 0; font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.status-ok { color: var(--ink); }
.status-live { color: var(--ink); font-weight: 600; }
.status-warn { color: var(--ink); background: var(--tint); padding: 8px 12px; border-radius: 10px; }

.turnstile { margin-top: 12px; min-height: 66px; }
body[data-mode="ready"] .turnstile, body[data-mode="live"] .turnstile, body[data-mode="connecting"] .turnstile, body[data-mode="ended"] .turnstile { display: none; }

.fallback { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fallback-why { margin: 0; flex: 1 1 240px; font-size: 14px; color: var(--ink-2); }

.turn-partial { opacity: 0.6; }
body[data-mode="live"] .turn-agent { outline: 0; }

.result .voicemail { font-size: 13.5px; }

@media (max-width: 520px) {
  .controls-call { grid-template-columns: 1fr; grid-template-areas: "button" "level" "status"; }
  .btn-call { justify-self: stretch; width: 100%; }
  .level { height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .level span { transition: none; } }
body[data-mode="live"] .fallback, body[data-mode="connecting"] .fallback { display: none; }
