/* The demonstration wizard and the conversation panel. */

.demo-hero { padding-bottom: 8px; }
.demo-section { padding-top: 8px; }
.wizard { display: grid; gap: 18px; scroll-margin-top: calc(var(--header-h) + 14px); }
.wizard-head { display: grid; gap: 10px; width: min(760px, 100%); margin-inline: auto; }
.wizard-steps { display: flex; justify-content: space-between; gap: 8px; }
.wizard-step { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; min-width: 0; }
.step-dot { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: .86rem; background: var(--surface); transition: background .3s ease, border-color .3s ease, color .3s ease; }
.step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-step.is-active { color: var(--heading); }
.wizard-step.is-active .step-dot { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.wizard-step.is-done .step-dot { background: var(--accent-soft); border-color: var(--c-primary); color: var(--heading); }
@media (max-width: 640px) { .step-name { display: none; } .wizard-step.is-active .step-name { display: inline; } .wizard-step { flex: none; } .wizard-steps { justify-content: flex-start; flex-wrap: wrap; } }
.wizard-progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.wizard-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-cyan)); transform: scaleX(0); transform-origin: left center; transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.step-card { width: min(760px, 100%); margin-inline: auto; display: grid; gap: 16px; padding: clamp(20px, 3vw, 34px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); animation: rise .4s cubic-bezier(.2, .7, .3, 1) both; }
.step-card[hidden], .panel[hidden] { display: none; }
html:not(.js) .wizard .step-card { display: none; }
.step-card h2 { font-size: clamp(1.4rem, 1.2rem + .9vw, 1.9rem); }
.step-card h2:focus { outline: none; }
.radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.radio-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--heading); transition: border-color .18s ease, background .18s ease; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent-bg); margin: 0; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--heading); font-weight: 500; }
.callout .icon { color: var(--accent); margin-top: .18em; }
.callout-plain { background: var(--surface-2); border: 1px solid var(--border); font-weight: 400; }
.callout-plain strong { color: var(--heading); }
.callout-plain p { color: var(--text); font-size: .95rem; }
.step-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.step-actions-between { justify-content: space-between; }
.step-error, .call-error { padding: 10px 14px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .94rem; }
.step-status, .call-status { font-weight: 600; color: var(--muted); min-height: 1.4em; }
.notice { padding: 14px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.phone-input { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.phone-input select { width: 86px; }
.proof { display: grid; gap: 6px; }
.proof-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.proof-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-blue)); transform: scaleX(0); transform-origin: left center; transition: transform .24s linear; }
.proof-text { font-size: .9rem; font-weight: 600; color: var(--muted); }
.otp-field { max-width: 340px; }
.otp { position: relative; }
.otp input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; cursor: text; }
.otp-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.otp-cells span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 1.5rem; font-weight: 700; color: var(--heading); transition: border-color .15s ease, box-shadow .15s ease; }
.otp-cells span.is-filled { border-color: var(--accent); }
.otp-cells span.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- The panel ---------- */
.panel { animation: rise .4s cubic-bezier(.2, .7, .3, 1) both; }
.panel-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .panel-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; } }
.panel-main { display: grid; gap: 18px; padding: clamp(18px, 2.6vw, 30px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.panel-head h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.75rem); }
.panel-head h2:focus { outline: none; }
.preview-badge { padding: 4px 10px; border-radius: 999px; background: rgba(248, 172, 89, .22); color: var(--warning-text); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.preview-badge[hidden] { display: none; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meter { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 4px; align-content: start; }
.meter-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.calls-icons { display: flex; gap: 6px; }
.call-icon { width: 20px; height: 20px; color: var(--border-strong); }
.call-icon.is-left { color: var(--accent); }
.meter-value, .meter-limit { font-weight: 700; color: var(--heading); }
.meter-limit { font-size: 1.15rem; }
.panel-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-caption { font-weight: 600; font-size: .9rem; color: var(--heading); }
.panel-city { margin: 0; padding: .68em 0; font-size: 1rem; font-weight: 700; color: var(--heading); }
@media (max-width: 460px) { .meters, .panel-settings { grid-template-columns: 1fr; } }

.call-stage { display: grid; justify-items: center; gap: 12px; padding: clamp(16px, 2.4vw, 28px) 12px; border-radius: var(--radius); background: radial-gradient(ellipse at 50% 12%, var(--accent-soft), transparent 70%), var(--surface-2); border: 1px solid var(--border); text-align: center; }
.call-orb { position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin: 6px 0; }
.orb-mark { position: relative; width: 62px; height: 62px; }
.orb-ring { position: absolute; inset: 14px; border-radius: 50%; background: var(--c-primary); opacity: 0; }
.call-orb.is-live .orb-ring { animation: orb-pulse 2.4s ease-out infinite; }
.call-orb.is-live .orb-ring:nth-child(2) { animation-delay: .8s; }
.call-orb.is-live .orb-ring:nth-child(3) { animation-delay: 1.6s; }
.call-orb.is-speaking .orb-ring { background: var(--c-blue); animation-duration: 1.1s; }
.call-orb.is-listening .orb-ring { background: var(--c-primary); animation-duration: 2.6s; }
@keyframes orb-pulse { 0% { transform: scale(.8); opacity: .45; } 100% { transform: scale(2.1); opacity: 0; } }
.call-live { display: grid; justify-items: center; gap: 10px; width: 100%; }
.call-live[hidden] { display: none; }
.call-timer { font-size: 2rem; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.level { display: flex; align-items: center; justify-content: center; gap: 3px; width: min(360px, 100%); height: 42px; }
.level span { flex: 1; height: 100%; border-radius: 3px; background: linear-gradient(180deg, var(--c-primary), var(--c-cyan)); transform: scaleY(.06); transition: transform .06s linear; }
.call-status { font-size: 1.02rem; color: var(--heading); }
.outcome { display: grid; gap: 10px; padding: 18px; border-radius: var(--radius); border: 1px solid rgba(26, 179, 148, .4); background: var(--accent-soft); }
.outcome[hidden] { display: none; }
.outcome.is-entering { animation: rise .45s cubic-bezier(.2, .7, .3, 1) both; }
.outcome h3:focus { outline: none; }
.outcome-handoff { display: flex; gap: .55em; align-items: flex-start; font-weight: 600; color: var(--heading); }
.outcome-handoff[hidden] { display: none; }
.outcome-handoff .icon { margin-top: .22em; color: var(--accent); }
.notes { display: grid; gap: 8px; font-size: .9rem; color: var(--muted); }
.notes li { display: flex; gap: .55em; align-items: flex-start; }
.notes .icon { color: var(--accent); margin-top: .2em; width: 1em; height: 1em; }
.link-btn[hidden] { display: none; }

/* ---------- Hints ---------- */
.hints { display: grid; gap: 12px; padding: clamp(16px, 2.4vw, 24px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); position: sticky; top: calc(var(--header-h) + 12px); }
.hints h3 { font-size: 1.18rem; }
.hint-list { position: relative; display: grid; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.hint-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); transition: background .3s ease, border-color .3s ease, opacity .3s ease; }
.hint-item.is-current { border-color: var(--c-primary); background: var(--accent-soft); }
.hint-item.is-past { opacity: .6; }
.hint-mark { flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--border-strong); position: relative; }
.hint-item.is-current .hint-mark { border-color: var(--c-primary); background: radial-gradient(circle, var(--c-primary) 34%, transparent 38%); }
.hint-item.is-past .hint-mark { border-color: var(--c-primary); background: var(--c-primary); }
.hint-item.is-past .hint-mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border-right: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: rotate(40deg); }
.hint-say { font-weight: 600; color: var(--heading); font-size: .95rem; line-height: 1.4; }
.hint-teaches { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.hint-item.is-current .hint-teaches { color: var(--text); }
.hint-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hint-nav .icon-btn[disabled] { opacity: .45; cursor: default; }
.hint-progress { font-size: .85rem; font-weight: 700; color: var(--muted); }
