/* Call card «Позвоните AI-менеджеру» (partials/call.html, assets/call.js). Colors are base.css tokens;
   transcript bubbles, calc card and lead form are chat.css classes (.chat-msg, .chat-calc, .chat-lead). */

.call { padding: 8px 0 56px; }
.call__panel {
    position: relative; max-width: 760px; margin: 0 auto; padding: 32px 36px;
    border: 1px solid var(--stroke); border-radius: 28px; background: var(--glass);
    box-shadow: var(--card-shadow); text-align: center;
}
.call__panel .eyebrow { justify-content: center; }
.call__panel h2 { font: 700 clamp(22px, 3.2vw, 30px)/1.2 var(--font-d); margin: 12px 0 10px; }
.call__lead { color: var(--dim); max-width: 560px; margin: 0 auto 22px; }
.call__note { font-size: 13px; color: var(--faint); margin: 12px 0 0; }
.call__go { min-width: 220px; justify-content: center; }
.call__go[hidden] { display: none; }
.call__panel:not([data-state="idle"]) .call__note { display: none; }

/* ── voice and speed under the button (plan phase 7): the line and its panel ── */
.call__voice {
    margin: 10px 0 0; padding: 4px 8px; border: 0; border-radius: 8px; background: none; cursor: pointer;
    color: var(--dim); font: 500 13px/1.3 var(--font-b);
}
.call__voice:hover, .call__voice[aria-expanded="true"] { color: var(--white); }
.call__voice:focus-visible, .call__voices button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.call__voice[hidden], .call__voices[hidden] { display: none; }
.call__voices {
    max-width: 420px; margin: 8px auto 0; padding: 14px; text-align: left;
    border-radius: 18px; border: 1px solid var(--stroke); background: var(--bg-soft);
}
#callVoiceList { max-height: min(46vh, 380px); overflow-y: auto; overscroll-behavior: contain; margin: 14px -4px 0; padding: 0 4px; }
.call__vhead { margin: 0 0 6px; color: var(--faint); font: 600 11px/1.2 var(--font-b); letter-spacing: .06em; text-transform: uppercase; }
.call__vlist { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.call__vlist:last-child { margin-bottom: 0; }
.call__vlist li { display: flex; gap: 6px; }
.call__voices button {
    min-height: 40px; padding: 9px 12px; cursor: pointer; border: 1px solid var(--stroke); border-radius: 12px;
    background: var(--glass); color: var(--white); font: 500 14px/1.2 var(--font-b);
}
.call__vlist [data-voice] { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.call__vlist [data-voice] small { color: var(--dim); font-size: 12px; font-weight: 400; }
.call__play { flex: none; width: 44px; }
.call__voices [aria-pressed="true"] { border-color: var(--violet); background: var(--glass-hi); }
.call__tempo { display: flex; flex-wrap: wrap; justify-content: space-between; color: var(--faint); font: 500 12px/1.2 var(--font-b); }
.call__speeds { order: -1; flex: 1 0 100%; display: flex; gap: 6px; margin-bottom: 6px; }
.call__speeds button { flex: 1; position: relative; padding: 0; }
.call__speeds button::after { /* a bar per step, taller = faster */
    content: ""; position: absolute; left: 50%; bottom: 10px; width: 6px; height: var(--h); margin-left: -3px;
    border-radius: 3px; background: var(--faint);
}
.call__speeds [aria-checked="true"] { border-color: var(--violet); background: var(--glass-hi); }
.call__speeds [aria-checked="true"]::after { background: var(--violet); }

/* ── the live call: avatar with a level ring, status, timer, hang up ── */
.call__card {
    display: flex; align-items: center; gap: 14px; text-align: left;
    padding: 14px 16px; border-radius: 20px; border: 1px solid var(--stroke); background: var(--bg-soft);
}
.call__card[hidden] { display: none; }
.call__ring {
    position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center;
}
.call__ring::before {
    content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--violet);
    opacity: .25; transform: scale(1); transition: transform .08s linear, opacity .2s;
}
.call__panel[data-state="listen"] .call__ring::before {
    border-color: var(--mint); opacity: .9; transform: scale(calc(1 + var(--lvl) * .35));
}
.call__panel[data-state="think"] .call__ring::before { border-color: var(--cyan); animation: call-pulse 1.1s var(--ease) infinite; }
.call__panel[data-state="speak"] .call__ring::before { border-color: var(--violet); opacity: .9; animation: call-pulse .7s ease-in-out infinite alternate; }
.call__panel[data-state="connect"] .call__ring::before { animation: call-pulse 1.4s var(--ease) infinite; }
@keyframes call-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.18); opacity: .25; } }
.call__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.call__who b { font-weight: 600; }
.call__who span { font-size: 14px; color: var(--dim); }
.call__time { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 15px; }
.call__hang {
    display: inline-flex; align-items: center; gap: 8px; flex: none; cursor: pointer;
    padding: 10px 16px; border: 0; border-radius: 999px; background: var(--coral); color: #fff;
    font: 600 14px/1 var(--font-b);
}
.call__hang svg { width: 18px; height: 18px; }
.call__hang:hover { filter: brightness(1.08); }

/* ── after the call ── */
.call__end { margin: 0 0 14px; }
.call__end[hidden] { display: none; }
.call__end p { color: var(--dim); margin: 0 0 12px; }

/* ── the lead form and the transcript under the card ── */
.call__lead-form, .call__feed { text-align: left; margin-top: 16px; }
.call__lead-form[hidden], .call__feed[hidden] { display: none; }
.call__feed {
    display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto;
    padding: 14px; border-radius: 20px; border: 1px solid var(--stroke); background: var(--bg-soft);
}
.call__feed > * { flex: none; } /* as .chat-feed: else the calc card shrinks to a strip when the feed scrolls */
.call__feed .chat-msg:empty { display: none; }

@media (max-width: 560px) {
    .call { padding-bottom: 40px; }
    .call__panel { padding: 24px 18px; border-radius: 22px; }
    .call__card { flex-wrap: wrap; }
    .call__hang { width: 100%; justify-content: center; }
    .call__go { width: 100%; }
    .call__feed { max-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
    .call__ring::before { animation: none !important; transition: none; }
}
