/* Codontix Telehealth — Patient Intake Styles
   Design: Apple-level simplicity, mobile-first, calm palette */

/* ── Site Header & Brand Logo ─────────────────────────────── */
/* Google Fonts loaded via <link> in HTML <head> to avoid blocking CSS parsing */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 14px 20px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.brand-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(60, 187, 178, 0.45));
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 3px;
}

.brand-name {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #1a2a3a;
    text-shadow: none;
}

.brand-name-accent {
    color: #2d72a7;
}

.brand-tagline {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.26em;
    color: #1d3383;
    text-transform: uppercase;
    padding-left: 15px;
}

/* ── Audio Guide Toggle + Volume Slider ──────────────────── */

.audio-control-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.audio-toggle-btn {
    pointer-events: auto;
    background: var(--color-surface, #fff);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary, #4E9EDA);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.audio-toggle-btn:hover {
    background: var(--color-primary, #4E9EDA);
    color: #fff;
    box-shadow: 0 2px 8px rgba(78,158,218,0.25);
}

.audio-toggle-btn svg {
    display: block;
}

.audio-toggle-btn .hidden {
    display: none;
}

/* ── Mobile Transfer Button (desktop only, waiting room) ─ */

.mobile-transfer-btn {
    pointer-events: auto;
    background: var(--color-surface, #fff);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary, #4E9EDA);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.mobile-transfer-btn:hover {
    background: var(--color-primary, #4E9EDA);
    color: #fff;
    box-shadow: 0 2px 8px rgba(78,158,218,0.25);
}

.mobile-transfer-btn svg {
    display: block;
}

.mobile-transfer-btn.hidden {
    display: none !important;
}

.mobile-transfer-btn.visible {
    display: flex;
}

.mobile-transfer-hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6e6e73);
    margin: 4px 0 8px;
    text-align: center;
}

.mobile-transfer-hint.hidden,
.mobile-transfer-sent.hidden {
    display: none;
}

.mobile-transfer-sent {
    font-size: 0.85rem;
    color: var(--color-success, #38a169);
    margin: 4px 0 8px;
    text-align: center;
    font-weight: 600;
}

/* ── Volume Slider (vertical, slides below button) ──────── */

.volume-slider-track {
    position: absolute;
    top: 100%;
    margin-top: 8px;
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: top center;
    width: 36px;
    height: 120px;
    background: var(--color-surface, #fff);
    border: 1px solid #dee2e6;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.volume-slider-track.open {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
    pointer-events: auto;
}

/* Invisible bridge covers the 8px margin gap between button and slider,
   so the mouse stays "inside" the wrapper during the crossing. */
.volume-slider-track.open::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.volume-slider-input {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 28px;
    height: 96px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
}
/* Firefox natively respects orient="vertical" on the <input>;
   the writing-mode trick double-rotates the interaction axis, so reset it. */
@supports (-moz-orient: vertical) {
    .volume-slider-input {
        writing-mode: horizontal-tb;
        direction: ltr;
    }
}

/* Track – the line behind the thumb.
   Vertical slider (writing-mode: vertical-lr, direction: rtl):
   progress grows from bottom to top.  --vol-pct is set by JS. */
.volume-slider-input {
    --vol-pct: 80%;
}
.volume-slider-input::-webkit-slider-runnable-track {
    width: 4px;
    height: 100%;
    background: linear-gradient(to top, var(--color-primary, #4E9EDA) var(--vol-pct), #fff var(--vol-pct));
    border-radius: 2px;
}
.volume-slider-input::-moz-range-track {
    width: 4px;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    border: none;
}
/* Filled portion below the thumb */
.volume-slider-input::-moz-range-progress {
    width: 4px;
    background: var(--color-primary, #4E9EDA);
    border-radius: 2px;
}

/* Thumb – the draggable circle */
.volume-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4E9EDA;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    margin-left: -6px;
}
.volume-slider-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4E9EDA;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Custom fill + thumb overlay (purely visual, layered behind the input) */
.volume-slider-fill,
.volume-slider-thumb {
    display: none;
}

/* ────────────────────────────────────────────────────────── */

:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-primary: #4E9EDA;
    --color-primary-hover: #3288ca;
    --color-secondary: #5D7CE9;
    --color-text: #212529;
    --color-text-secondary: #6c757d;
    --color-border: #e9ecef;
    --color-border-focus: #4E9EDA;
    --color-error: #de3730;
    --color-success: #4E9EDA;
    --color-warning: #ff9f0a;
    --color-info-bg: #edf7f6;
    --color-info-border: #b2e0dc;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    min-height: 100vh;
    background: radial-gradient(#d0e4f3, #9caebf);
    overflow-x: hidden;
}

#app {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Step indicator dots */
.step-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 0 28px;
    z-index: 100;
}

.step-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--color-border);
    transition: background var(--transition), transform 0.2s ease;
}

.step-dot.completed {
    background: var(--color-success);
}

.step-dot.active {
    background: var(--color-success);
    transform: scale(1.3);
}

/* Steps */
.step {
    display: none;
    flex: 1;
    padding: 24px 0 40px;
}

.step.active { display: flex; animation: slideInRight 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
.step.active.slide-back { animation: slideInLeft 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
/* Skip slide animation on initial page load (step 1 starts with class="active" in HTML) */
.step.active.no-animate { animation: none; }

.step-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.center-content {
    align-items: stretch;
    text-align: left;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

.center-content h1,
.center-content .subtitle {
    text-align: center;
}

.step-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

#step-1 .center-content,
#step-7 .center-content {
    align-items: center;
    text-align: center;
    gap: 24px;
}

#step-7 .step-header {
    gap: 24px;
}

#step-10 .center-content {
    align-items: center;
    text-align: center;
    gap: 24px;
}

/* Navigation arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, border-color var(--transition), color var(--transition);
    box-shadow: var(--shadow);
}

.nav-arrow:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

#navBack { left: 16px; }
#navForward { right: 16px; }

.form-group-centered {
    width: 100%;
    max-width: 400px;
    align-items: center;
}

.input-phone {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    padding: 18px 20px;
}

.input-phone:-webkit-autofill,
.input-phone:-webkit-autofill:hover,
.input-phone:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: var(--color-text);
    transition: background-color 5000s ease-in-out 0s;
}

/* Verification code digit boxes */
.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.code-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    font-family: var(--font-family);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    caret-color: var(--color-primary);
}

.code-digit:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(60, 187, 178, 0.15);
}

.code-digit.filled {
    border-color: var(--color-primary);
}

.code-digit.error {
    border-color: var(--color-error);
    animation: codeShake 0.4s ease;
}

.code-digit.success {
    border-color: var(--color-success);
}

.code-error {
    color: var(--color-error);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 4px;
    animation: fadeIn 0.3s ease;
}

.code-success {
    margin-top: 12px;
}

.code-success svg {
    display: block;
}

.checkmark-path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.4s ease forwards 0.1s;
}

.code-success svg circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: drawCircle 0.4s ease forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

@keyframes codeShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.btn-centered {
    max-width: 400px;
    font-size: 1.2rem;
    padding: 18px 32px;
}

#verificationSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* ── Introduction Page ─────────────────────────────────── */
#step-intro .center-content {
    align-items: center;
    text-align: center;
    gap: 28px;
}

.intro-cards {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 560px;
}

.intro-card {
    flex: 1;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 16px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.intro-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.intro-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.intro-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.intro-card-icon--live {
    background: rgba(78, 158, 218, 0.12);
    color: var(--color-primary);
}

.intro-card-icon--schedule {
    background: rgba(56, 161, 105, 0.12);
    color: #38a169;
}

.intro-wait-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(78, 158, 218, 0.06);
    border: 1px solid rgba(78, 158, 218, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 560px;
    width: 100%;
    text-align: left;
}

.intro-wait-note svg {
    flex-shrink: 0;
    color: var(--color-primary);
    margin-top: 1px;
}

.intro-wait-note p {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

#step-intro .btn-primary {
    max-width: 560px;
}

@media (max-width: 480px) {
    .intro-cards {
        flex-direction: column;
    }
}

/* Step 1 hero sizing */
#step-1 h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

#step-1 .subtitle {
    font-size: 1.3rem;
    margin-top: -8px;
}

#step-1 .form-group label {
    font-size: 1rem;
}

/* Step 1 slider transition */
#step-1 .step-content {
    position: relative;
}

.step1-slider-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.step1-slider-track {
    position: relative;
}

.step1-panel {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 4px;
    transition: transform 0.7s cubic-bezier(0.25, 0.25, 0.75, 0.75);
}

.step1-panel:last-child {
    position: absolute;
    top: 0;
    width: 100%;
    transform: translateX(100%);
}

.step1-slider-track.slid .step1-panel:first-child {
    transform: translateX(-100%);
}

.step1-slider-track.slid .step1-panel:last-child {
    transform: translateX(0);
}

/* Disable slide animation on Firefox (laggy) */
@supports (-moz-appearance: none) {
    .step1-panel {
        transition: none;
    }
}

.step1-panel .subtitle {
    margin-top: 0;
}

.step1-mobile-logo {
    display: none;
}

.step1-back {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 2;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, border-color var(--transition), color var(--transition);
    opacity: 0;
    pointer-events: none;
}

.step1-back.visible {
    opacity: 1;
    pointer-events: auto;
}

.step1-back:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-top: 0;
    font-weight: 600;
}

.optional {
    color: var(--color-text-secondary);
    font-weight: 400;
    font-size: 0.85rem;
}

/* Form elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-row {
    display: flex;
    gap: 16px;
}

.half { flex: 1; }
.third { flex: 2; }
.sixth { flex: 1; }


.input-large {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-family);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.input-large:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(60, 187, 178, 0.15);
}

.input-large::placeholder {
    color: #aaa;
}

/* Date of birth – three-segment input (MM / DD / YYYY) */
.dob-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dob-inputs .dob-segment {
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
    flex: 0 0 58px;
    width: 58px;
    min-width: 0;
}

.dob-inputs .dob-segment.dob-year {
    flex-basis: 80px;
    width: 80px;
}

.dob-sep {
    color: var(--color-text-muted, #888);
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

.input-large:-webkit-autofill,
.input-large:-webkit-autofill:hover,
.input-large:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: var(--color-text);
    transition: background-color 5000s ease-in-out 0s;
}

select.input-large {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Radio & checkbox */
.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 4px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--color-text);
}

.radio-label input, .checkbox-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-family);
    color: #fff;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), transform 0.15s ease;
    margin-top: 0px;
}

.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--color-primary);
    background: transparent;
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-secondary:hover { background: rgba(60, 187, 178, 0.08); }

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    cursor: pointer;
    padding: 4px 0;
    text-decoration: none;
    margin-top: 16px;
}

.btn-link:hover { text-decoration: underline; }

.btn-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Info box */
.info-box {
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 48px;
}

.info-box p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Saved card display */
.saved-card-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-success);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.saved-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.saved-card-brand {
    font-weight: 600;
    text-transform: capitalize;
}

.saved-card-last4 {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Stripe element */
.stripe-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 16px;
}

.stripe-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.stripe-loading p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.stripe-loading.hidden { display: none; }

.stripe-element {
    min-height: 100px;
    border-radius: var(--radius-sm);
}

.error-text {
    color: #1161a7;
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 20px;
}

.hint-text {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.btn-validation-wrap {
    position: relative;
    width: 100%;
    padding-top: 8px;
}

#step-1 .btn-validation-wrap {
    max-width: 400px;
    padding-top: 30px;
}

#step-1 .inline-validation {
    position: static;
    display: block;
    margin-top: 10px;
}

.sms-consent-notice {
    max-width: 400px;
    margin: 16px auto 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--color-text-muted, #888);
    text-align: center;
}
.sms-consent-notice a {
    color: var(--color-text-muted, #888);
    text-decoration: underline;
}

.inline-validation {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    color: var(--color-error);
    font-size: 0.95rem;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.inline-validation.fade-out {
    opacity: 0;
}

.pcp-search-row {
    display: flex;
    gap: 12px;
}

.pcp-search-row .form-group { flex: 1; }

@media (max-width: 500px) {
    .pcp-search-row { flex-direction: column; gap: 8px; }
}

.pcp-too-many {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin: 4px 0 0;
    animation: pcpFadeIn 0.25s ease;
}

@keyframes pcpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* PCP results */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.result-card {
    padding: 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: linear-gradient(135deg, #e9e9ee, #ddf1ed);
}

.result-card:hover {
    border-color: var(--color-primary);
    background: rgba(60, 187, 178, 0.05);
}

.result-card .name { font-weight: 600; font-size: 1rem; }
.result-card .detail { font-size: 0.85rem; color: var(--color-text-secondary); margin-top: 2px; }

.pcp-loading {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.pcp-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.selected-card {
    padding: 16px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-sm);
    background: rgba(60, 187, 178, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Consent */
.consent-progress {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    text-align: center;
}

.consent-doc {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0px;
    margin-bottom: 16px;
}

.consent-doc-scroll {
    overflow-y: auto;
    max-height: 40vh;
}

.consent-text-scroll {
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin: 0px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.consent-text-scroll p { margin-bottom: 12px; }

.signature-area {
    margin-top: 35px;
    padding-top: 35px;
    border-top: 1px solid var(--color-border);
}

.signature-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-family);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.signature-input:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(60, 187, 178, 0.15);
}

.signature-input::placeholder {
    color: #aaa;
}

.name-mismatch-warning {
    color: #b91c1c;
    font-size: 0.85rem;
    margin-top: 6px;
    padding: 8px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.signature-preview {
    width: 100%;
    min-height: 80px;
    margin-top: 12px;
    padding: 16px 24px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.signature-preview-text {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.3;
    user-select: none;
}

.signature-preview-text.empty {
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 400;
    color: #bbb;
    font-style: italic;
}

.signature-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.95rem;
}

.signature-date-label {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.signature-date-value {
    color: var(--color-text);
    font-weight: 600;
}

.signature-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.signature-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.signature-checkbox label {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.signature-checkbox label::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 1px;
    border: 2px solid var(--color-border);
    border-radius: 5px;
    background: var(--color-surface);
    transition: background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.signature-checkbox input[type="checkbox"]:checked + label::before {
    background: var(--color-success);
    border-color: var(--color-success);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7l3 3 5-5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

/* Loading animation */
.loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    padding-top: 10px;
}

.pulse-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    animation: pulse 2s ease-out infinite;
}

.pulse-ring.delay { animation-delay: 0.8s; }

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.status-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    text-align: center;
}

/* Voice / mic */
.mode-toggle {
    display: flex;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
}

.mode-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    font-weight: 500;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.mode-btn.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow);
}

.ai-question-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.question-category {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.question-hint {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.voice-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 16px;
}

.voice-area.ros-mode {
    padding-top: 8px;
    gap: 0;
}

.transcript-display {
    width: 100%;
    min-height: 80px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    line-height: 1.5;
    margin-top: 24px;
}

.placeholder-text {
    color: #bbb;
    font-style: italic;
}

.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background var(--transition);
}

.mic-btn:hover { transform: scale(1.05); }
.mic-btn .pause-icon { display: none; }
.mic-btn.recording {
    background: var(--color-error);
    animation: micPulse 1.2s ease infinite;
}
.mic-btn.recording .mic-icon { display: none; }
.mic-btn.recording .pause-icon { display: block; }
.mic-btn.paused {
    background: var(--color-error);
    animation: none;
    opacity: 0.7;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(222, 55, 48, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(222, 55, 48, 0); }
}

.confirm-area {
    display: flex;
    justify-content: center;
    padding-top: 24px;
    width: 100%;
}

/* Entity extraction — real-time medical chips */
.listening-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    min-height: 40px;
}

.listening-text {
    color: #aaa;
    font-style: italic;
}

.listening-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.listening-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: dotBounce 1.4s ease-in-out infinite;
}
.listening-dots span:nth-child(2) { animation-delay: 0.16s; }
.listening-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

.entity-checklist {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 0;
    padding-top: 25px;
}

.entity-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    transition: all 0.2s ease;
    user-select: none;
    animation: fadeInUp 0.3s ease;
}

.entity-chip .chip-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.entity-chip:hover {
    transform: scale(1.03);
}

.entity-chip.unchecked {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
    text-decoration: line-through;
}

.entity-chip.from-llm {
    border-style: dashed;
}

.entity-chip.from-llm.unchecked {
    border-style: dashed;
}

.entity-chip.from-records {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.entity-chip.from-records.unchecked {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.llm-processing {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding: 8px 0;
}

.manual-add-area {
    position: relative;
    width: 100%;
    margin-bottom: 0px;
}

.none-applicable-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
}

.none-applicable-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.none-applicable-label.hidden {
    display: none;
}

.manual-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.1s;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: var(--color-primary);
    color: #fff;
}

.autocomplete-item mark {
    font-weight: 700;
    background: none;
    color: inherit;
}

.autocomplete-group-header {
    padding: 8px 14px 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    pointer-events: none;
    user-select: none;
    border-top: 1px solid #eee;
}

.autocomplete-group-header:first-child {
    border-top: none;
}

.insurance-picker-wrapper {
    position: relative;
}

.autocomplete-no-match {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-secondary);
}

.manual-add-input {
    flex: 1;
    min-width: 0;
    font-size: 1rem !important;
    padding: 12px 14px !important;
    height: 48px;
    box-sizing: border-box;
}

.btn-manual-add {
    white-space: nowrap;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    height: 48px;
    box-sizing: border-box;
}

.btn-manual-add.hidden {
    display: none;
}

.btn-manual-add.modify-mode {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.records-loading-card {
    text-align: center;
    padding: 48px 24px;
    max-width: 420px;
    margin: 0 auto;
}

.records-loading-card h2 {
    margin: 16px 0 8px;
    font-size: 1.25rem;
}

.records-loading-card .subtitle {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.surgery-date-input {
    padding: 12px 10px;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    height: 48px;
    box-sizing: border-box;
    cursor: pointer;
}

.surgery-date-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

/* Surgery date / Allergy reaction detail rows (below input, with Add button) */
.surgery-detail-row,
.reaction-detail-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.surgery-detail-row.hidden,
.reaction-detail-row.hidden {
    display: none;
}

.surgery-detail-row .surgery-date-input {
    max-width: 110px;
    flex-shrink: 0;
}

.reaction-detail-row .reaction-select {
    max-width: 220px;
}

/* Medication detail row: dose, units, frequency */
.med-detail-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.med-detail-row.hidden {
    display: none;
}

.med-dose-input {
    width: 100px;
    flex-shrink: 0;
    font-size: 0.95rem;
    padding: 12px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    height: 48px;
    box-sizing: border-box;
}

.med-dose-input.hidden {
    display: none;
}

.med-dose-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

.med-units-select {
    padding: 10px 10px;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    min-width: 90px;
    height: 42px;
    box-sizing: border-box;
    cursor: pointer;
}

.med-units-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

.med-freq-wrapper {
    position: relative;
    max-width: 160px;
}

.med-freq-input {
    width: 100%;
    font-size: 0.95rem;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    height: 42px;
    box-sizing: border-box;
}

.med-freq-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

.med-freq-wrapper .autocomplete-dropdown {
    top: 100%;
    left: 0;
    right: 0;
}

.family-member-select,
.reaction-select {
    padding: 12px 10px;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    height: 48px;
    box-sizing: border-box;
    cursor: pointer;
}

.family-member-select {
    flex: 1;
    min-width: 0;
}

.family-member-select:focus,
.reaction-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

.family-member-select.select-required,
.reaction-select.select-required {
    border-color: var(--color-error, #e53e3e);
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.entity-chip .chip-relation {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-left: 4px;
    font-style: italic;
}

/* HPI chat */
.ai-intro-card {
    text-align: center;
}

.intro-message {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 16px;
    font-weight: 600;
}

.chat-container {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding-left: 26px;
    padding-right: 16px;
    max-height: 540px;
    overflow-y: auto;
}

.chat-messages {
    padding-top: 16px;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.chat-bubble.ai {
    background: #dbeafe;
    border: 1px solid #93b8f0;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    margin-left: 14px;
    position: relative;
    padding-right: 36px;
}

/* Tail border outline */
.chat-bubble.ai::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -15px;
    width: 0;
    height: 0;
    border-top: 11px solid transparent;
    border-right: 15px solid #93b8f0;
    border-bottom: 1px solid #93b8f0;
}

/* Tail fill — covers left border where tail meets bubble */
.chat-bubble.ai::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -14px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-right: 14px solid #dbeafe;
    border-bottom: 0;
}

.tts-speaker-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: none;
    border: none;
    color: #5b7fb5;
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-speaker-btn:hover {
    opacity: 1;
    background: rgba(91, 127, 181, 0.1);
}

.tts-speaker-btn.tts-playing {
    opacity: 1;
    animation: ttsPulse 1s ease-in-out infinite;
}

@keyframes ttsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-bubble.patient {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    margin-right: 14px;
    position: relative;
}

/* Tail border outline */
.chat-bubble.patient::before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -15px;
    width: 0;
    height: 0;
    border-top: 11px solid transparent;
    border-left: 15px solid var(--color-primary);
    border-bottom: 1px solid var(--color-primary);
}

.hpi-text-row {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: flex-end;
}

.hpi-text-row .input-large {
    flex: 1;
    resize: none;
    overflow-y: auto;
    max-height: 200px;
    line-height: 1.4;
}

.hpi-done-area {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.hpi-done-area .btn-primary {
    width: auto;
}

/* Complaints list */
.complaints-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 32px;
}

.complaint-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: left;
}

.complaint-item > div {
    width: 100%;
}

.complaint-item .number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.confirm-actions {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-top: 48px;
}

.confirm-actions button {
    flex: 1;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    box-sizing: border-box;
    margin-top: 0;
}

/* ── Confirm screen overrides ──────────────────────────────── */
#hpiConfirmPanel {
    text-align: center;
}

#hpiConfirmPanel h1 {
    margin-bottom: 8px;
}

#hpiConfirmPanel .subtitle {
    margin-bottom: 0;
}

.confirm-actions {
    margin-top: 28px;
}

/* Visit Goals callout */
.confirm-goals-callout {
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 16px;
    text-align: left;
}

.confirm-goals-callout .confirm-goals-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.confirm-goals-callout .confirm-goals-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.confirm-goals-callout .confirm-goal-pill {
    background: rgba(60, 187, 178, 0.25);
    border: 1px solid rgba(60, 187, 178, 0.5);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 13px;
}

.confirm-goals-callout .confirm-goals-freetext {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* Confirm sections (replaces complaints-list for confirm screen) */
.confirm-sections {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 20px;
}

.confirm-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    text-align: left;
}

.confirm-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 1rem;
}

.confirm-section-header .section-number {
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.confirm-qa-list {
    margin: 0;
    padding: 0;
}

.confirm-qa-row {
    padding: 8px 0;
    font-size: 0.9rem;
}

.confirm-qa-row + .confirm-qa-row {
    border-top: 1px solid var(--color-border);
}

.confirm-qa-row dt {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

.confirm-qa-row dd {
    margin: 0;
}

.confirm-section-goals {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.confirm-section-goals .confirm-goals-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.confirm-section-goals .confirm-goals-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.confirm-section-goals .confirm-goal-pill {
    background: rgba(60, 187, 178, 0.25);
    border: 1px solid rgba(60, 187, 178, 0.5);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 13px;
}

.confirm-section-goals .confirm-goals-freetext {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 6px;
}

/* ── Structured HPI (Step 10 v2) ──────────────────────────── */

.hpi-panel {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.hpi-panel h1 {
    margin-bottom: 24px;
}

.hpi-progress {
    width: 100%;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
}

.hpi-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0;
}

/* Intent cards */
.intent-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin: 24px 0;
}

.intent-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-size: 0.95rem;
    color: var(--color-text);
}

.intent-card:hover {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.04);
}

.intent-card.selected {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.08);
}

.intent-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition);
}

.intent-card.selected .intent-check {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.intent-card.selected .intent-check::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#hpiGoalsPanel .subtitle,
#hpiGoalsPanel .hint-text {
    text-align: left;
}

/* Goal chips */
.goal-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    margin: 20px 0 8px;
}

.goal-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: #fff;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.goal-chip:hover {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.04);
}

.goal-chip.selected {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.08);
}

.goal-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition);
}

.goal-chip.selected .goal-check {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.goal-chip.selected .goal-check::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Goals free text + mic */
.input-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.goals-freetext-section {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 50px;
}

.goals-input-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.goals-input-row .input-large {
    width: 100%;
}

.mic-btn-inline {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    margin-top: 16px;
    margin-bottom: 16px;
}

.mic-btn-inline svg {
    width: 36px;
    height: 36px;
}

.mic-btn-inline:hover { transform: scale(1.05); }

.mf-text-mic {
    margin: 8px auto 0;
}

.mic-btn-inline.recording {
    background: var(--color-error);
    animation: micPulse 1.2s ease infinite;
}

.validation-msg {
    color: var(--color-error);
    font-size: 0.88rem;
    font-weight: 500;
    margin: 4px 0 8px;
}

.optional-tag {
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Red flag options */
.redflag-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin: 32px 0;
}

.redflag-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.redflag-item input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--color-error);
}

/* ER alert card */
.er-alert-card {
    background: #fef2f2;
    border: 2px solid var(--color-error);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
}

.er-alert-card h2 {
    color: var(--color-error);
    margin-bottom: 16px;
}

.er-alert-card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Micro-flow badge */
.microflow-badge {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.microflow-badge.hidden {
    display: none;
}

/* Micro-flow question card */
.mf-question-card {
    width: 100%;
    margin-bottom: 24px;
}

.mf-category-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6b7280);
    margin-bottom: 6px;
}

.mf-question-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

.mf-question-input {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
}

/* Select options (single-select buttons) */
.mf-select-option {
    padding: 10px 18px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition);
    color: var(--color-text);
}

.mf-select-option:hover {
    border-color: var(--color-primary);
}

.mf-select-option.selected {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Multi-select pills */
.mf-multi-select-pill {
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    color: var(--color-text);
}

.mf-multi-select-pill:hover {
    border-color: var(--color-primary);
}

.mf-multi-select-pill.selected {
    background: rgba(79, 70, 229, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 500;
}

/* Searchable select */
.mf-searchable-select {
    width: 100%;
    position: relative;
}

.mf-searchable-select .input-large {
    width: 100%;
    text-align: center;
}

/* Sub-type picker (cascading test type) */
.mf-subtype-wrapper {
    margin-top: 16px;
    animation: mf-fade-in 0.2s ease;
}

.mf-subtype-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

@keyframes mf-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Slider */
.mf-slider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mf-slider input[type="range"] {
    flex: 1;
    height: 6px;
    accent-color: var(--color-primary);
}

.mf-slider-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 32px;
    text-align: center;
}

/* File upload area */
.mf-file-upload {
    width: 100%;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-sm);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: border-color var(--transition);
}

.mf-file-upload:hover {
    border-color: var(--color-primary);
}

/* Micro-flow nav buttons */
.mf-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
}

.mf-nav .btn-secondary,
.mf-nav .btn-primary {
    min-width: 100px;
}

/* Confirm answer detail */
.confirm-answer {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ── Mobile overrides for structured HPI ────── */
@media (max-width: 480px) {
    .intent-options {
        grid-template-columns: 1fr;
    }

    .intent-card {
        padding: 14px 16px;
    }

    .er-alert-card {
        padding: 20px;
    }

    .mf-question-input {
        gap: 8px;
    }

    .mf-select-option,
    .mf-multi-select-pill {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .mf-nav {
        flex-direction: column-reverse;
    }

    .mf-nav .btn-secondary,
    .mf-nav .btn-primary {
        width: 100%;
    }

    .goal-chip {
        width: 100%;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-actions button {
        width: 100%;
    }
}

/* Waiting room */
.wait-time {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.video-tile {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-tile-local {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.5);
    object-fit: cover;
    z-index: 2;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.video-tile-local.dragging {
    cursor: grabbing;
    transition: none !important;
}

/* ── Matched Panel ─────────────────────────────────────── */
.matched-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    gap: 20px;
}

.matched-check { animation: matchFadeIn 0.4s ease; }

.matched-heading {
    font-size: 1.6rem;
    font-weight: 700;
    animation: matchFadeIn 0.5s ease 0.15s both;
}

.matched-provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: matchFadeIn 0.5s ease 0.3s both;
}

.matched-avatar-wrap {
    position: relative;
    width: 96px;
    height: 96px;
}

.matched-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
}

.matched-avatar-fallback {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.matched-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.matched-title {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.matched-auto-msg {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    animation: matchFadeIn 0.4s ease 0.5s both;
}

@keyframes matchFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Provider Info Overlay (on video) ─────────────────── */
.provider-info-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    transition: opacity 0.4s ease;
}

.provider-info-overlay.hidden {
    display: none;
}

.provider-info-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.provider-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 28px;
    text-align: center;
    max-width: 340px;
}

.provider-overlay-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.6);
}

.provider-overlay-avatar-fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(78, 158, 218, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.provider-overlay-info h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.provider-overlay-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.88rem;
    margin: 0;
}

/* Hide education/training info when not fullscreen */
.provider-overlay-edu {
    display: none;
}

/* ── Fullscreen: show training info, bigger text, centered ── */
:fullscreen .provider-overlay-card,
:-webkit-full-screen .provider-overlay-card {
    max-width: 500px;
    gap: 16px;
    padding: 48px 36px;
}

:fullscreen .provider-overlay-avatar,
:-webkit-full-screen .provider-overlay-avatar {
    width: 100px;
    height: 100px;
}

:fullscreen .provider-overlay-avatar-fallback,
:-webkit-full-screen .provider-overlay-avatar-fallback {
    width: 100px;
    height: 100px;
}

:fullscreen .provider-overlay-info h3,
:-webkit-full-screen .provider-overlay-info h3 {
    font-size: 2.4rem;
}

:fullscreen .provider-overlay-title,
:-webkit-full-screen .provider-overlay-title {
    font-size: 1.5rem;
    margin: 0 0 16px;
}

:fullscreen .provider-overlay-edu,
:-webkit-full-screen .provider-overlay-edu {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

:fullscreen .provider-overlay-edu strong,
:-webkit-full-screen .provider-overlay-edu strong {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#remoteAudioContainer { display: none; }

.video-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.control-btn svg {
    width: 28px;
    height: 28px;
}

.control-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.control-btn.off { background: var(--color-error); border-color: var(--color-error); color: #fff; }
.control-btn.active { background: var(--color-secondary); border-color: var(--color-secondary); }

.desktop-only { display: flex; }
@media (max-width: 480px) { .desktop-only { display: none; } }

/* ── Visit Goals Banner ────────────────────────────────── */

.visit-goals-banner {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 8px 12px;
    z-index: 10;
    font-size: 13px;
    transition: opacity 0.3s;
}
.visit-goals-header { display: flex; justify-content: space-between; align-items: center; }
.visit-goals-label { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; }
.visit-goals-collapse-btn { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 0 4px; }
.visit-goals-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.visit-goal-pill { background: rgba(60, 187, 178, 0.25); border: 1px solid rgba(60, 187, 178, 0.5); border-radius: 12px; padding: 2px 10px; font-size: 13px; }
.visit-goals-min-tab {
    position: absolute; top: 8px; left: 8px; z-index: 10;
    background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px; padding: 2px 8px; font-size: 11px; cursor: pointer;
}

/* ── Fullscreen Mode ────────────────────────────────────── */

.video-call-wrapper:fullscreen,
.video-call-wrapper:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    background: #000;
}

.video-call-wrapper:fullscreen .video-container,
.video-call-wrapper:-webkit-full-screen .video-container {
    flex: 1;
    min-height: 0;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
}

.video-call-wrapper:fullscreen .video-tile,
.video-call-wrapper:-webkit-full-screen .video-tile {
    border-radius: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Keep local pip filled */
.video-call-wrapper:fullscreen .video-tile-local,
.video-call-wrapper:-webkit-full-screen .video-tile-local {
    object-fit: cover;
}

/* Controls bar in fullscreen */
.video-call-wrapper:fullscreen .video-controls,
.video-call-wrapper:-webkit-full-screen .video-controls {
    padding: 12px;
    flex-shrink: 0;
}

/* Chat panel in fullscreen */
.video-call-wrapper:fullscreen .chat-panel,
.video-call-wrapper:-webkit-full-screen .chat-panel {
    max-width: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    flex-shrink: 0;
}

/* Settings panel in fullscreen */
.video-call-wrapper:fullscreen .settings-panel,
.video-call-wrapper:-webkit-full-screen .settings-panel {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: auto;
}

/* CSS-based fullscreen fallback (iPadOS where native API fails) */
.video-call-wrapper.is-pseudo-fullscreen {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 0;
}
.video-call-wrapper.is-pseudo-fullscreen .video-container {
    flex: 1; min-height: 0; max-width: none; aspect-ratio: auto; border-radius: 0;
}
.video-call-wrapper.is-pseudo-fullscreen .video-tile {
    border-radius: 0; width: 100%; height: 100%; object-fit: contain;
}
.video-call-wrapper.is-pseudo-fullscreen .video-tile-local {
    object-fit: cover;
}
.video-call-wrapper.is-pseudo-fullscreen .video-controls {
    padding: 12px; flex-shrink: 0;
}
.video-call-wrapper.is-pseudo-fullscreen .chat-panel {
    max-width: none; border-radius: 0; border-left: none; border-right: none; flex-shrink: 0;
}
.video-call-wrapper.is-pseudo-fullscreen .settings-panel {
    flex-shrink: 0; margin-left: auto; margin-right: auto;
}
.video-call-wrapper.is-pseudo-fullscreen .visit-goals-banner,
.video-call-wrapper.is-pseudo-fullscreen .visit-goals-min-tab { position: fixed; }

/* Fullscreen overlay hidden — main control bar is used instead */
.fullscreen-overlay { display: none; }

.video-call-wrapper:fullscreen .visit-goals-banner,
.video-call-wrapper:-webkit-full-screen .visit-goals-banner { position: fixed; }
.video-call-wrapper:fullscreen .visit-goals-min-tab,
.video-call-wrapper:-webkit-full-screen .visit-goals-min-tab { position: fixed; }

/* ── Noise Cancellation Toggle ──────────────────────────── */

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 4px;
}

.settings-toggle-row .settings-label {
    padding: 0;
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    border: none;
    background: var(--color-border);
    cursor: pointer;
    padding: 0;
    transition: background var(--transition);
}

.toggle-switch.on { background: var(--color-primary); }

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.on .toggle-knob { transform: translateX(20px); }

/* ── Screen Share ───────────────────────────────────────── */

.screen-share-tile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 1;
}

.video-container.screen-share-active .video-tile:not(.video-tile-local) {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.5);
    object-fit: cover;
    z-index: 3;
}

/* ── Pinch-to-Zoom ──────────────────────────────────────── */

.zoomable {
    transform-origin: 0 0;
    will-change: transform;
    touch-action: none;
}

.zoom-reset-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.zoom-reset-btn:hover { background: rgba(0,0,0,0.7); }

/* ── Chat Panel ──────────────────────────────────────────── */

.chat-panel {
    width: 100%;
    max-width: 800px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: 280px;
    margin-bottom: 8px;
}

.chat-header, .settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-close, .settings-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
}

.chat-msg {
    line-height: 1.4;
}

.chat-sender {
    font-weight: 600;
    color: var(--color-primary);
}

.chat-input-bar {
    display: flex;
    padding: 8px;
    gap: 8px;
    height: 100px;
}

.chat-input-bar input {
    flex: 1;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.9rem;
    outline: none;
}

.chat-input-bar input:focus {
    border-color: var(--color-primary);
}

.chat-send {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ── Settings Panel ──────────────────────────────────────── */

.settings-panel {
    width: 100%;
    max-width: 800px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding-bottom: 14px;
    margin-bottom: 8px;
}

.settings-label {
    display: block;
    padding: 10px 14px 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.settings-select {
    display: block;
    width: calc(100% - 28px);
    margin: 0 14px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--color-bg);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

/* Utility */
.hidden { display: none !important; }

/* Text history forms */
.text-history-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}

.text-history-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.checklist-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
    background: #fff;
}

.checklist-item.selected {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ---------------------------------------------------------------------------
   Insurance Card Capture
   --------------------------------------------------------------------------- */

/* Scan prompt area */
.card-scan-prompt {
    text-align: center;
    padding: 32px 16px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    background: var(--color-info-bg);
    margin-bottom: 24px;
}

.card-scan-icon {
    color: var(--color-primary);
    margin-bottom: 12px;
}

.card-scan-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-scan-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.card-capture-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.btn-capture {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-primary);
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.btn-capture:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-capture:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-capture-full {
    width: 100%;
    max-width: 340px;
    justify-content: center;
}

.card-scan-skip {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

#insuranceFormFields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-upload-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.card-upload-toggle:hover {
    text-decoration: underline;
}

.card-upload-toggle svg {
    flex-shrink: 0;
}

/* Desktop SMS status */
.card-capture-desktop {
    text-align: center;
}

.desktop-sms-info {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.desktop-sms-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 0.95rem;
}

.sms-status-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* OCR processing state */
.card-ocr-processing {
    text-align: center;
    padding: 48px 16px;
}

.card-ocr-processing p {
    margin-top: 24px;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

/* OCR-filled field highlight */
.ocr-filled {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}

/* Camera overlay */
.camera-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    flex-direction: column;
}

.camera-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 16px;
    display: flex;
    justify-content: flex-end;
}

.camera-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-viewport {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card guide frame overlay */
.card-guide-frame {
    position: absolute;
    width: 85%;
    max-width: 420px;
    aspect-ratio: 1.586 / 1;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    pointer-events: none;
}

.card-guide-frame .corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #fff;
    border-style: solid;
}

.card-guide-frame .corner.tl {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 8px 0 0 0;
}

.card-guide-frame .corner.tr {
    top: -2px;
    right: -2px;
    border-width: 3px 3px 0 0;
    border-radius: 0 8px 0 0;
}

.card-guide-frame .corner.bl {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 8px;
}

.card-guide-frame .corner.br {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 8px 0;
}

.guide-instruction {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
}

.guide-status {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-success);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 16px;
    pointer-events: none;
}

/* Camera controls */
.camera-controls {
    padding: 24px;
    display: flex;
    justify-content: center;
    background: #000;
}

.shutter-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.shutter-btn:active {
    transform: scale(0.9);
}

.shutter-ring {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
}

/* Card preview modal */
.card-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.card-preview-content {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.card-preview-content h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.card-preview-image-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
    background: #f0f0f0;
}

.card-preview-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.card-preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.card-preview-actions .btn-secondary,
.card-preview-actions .btn-primary {
    flex: 1;
    max-width: 180px;
}

/* Standalone card capture page */
.card-capture-standalone {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-capture-standalone .step {
    display: none;
}

.card-capture-standalone .step.active {
    display: block;
}

.success-checkmark {
    margin-bottom: 20px;
}

.success-checkmark svg {
    display: inline-block;
}

.checkmark-path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkDraw 0.5s ease-out 0.3s forwards;
}

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

/* ── Mobile Bottom Navigation Bar ────────────────────────── */

.mobile-nav-bar {
    display: none;
}

/* ── Mobile Navigation Arrow Buttons ────────────────────── */

.mobile-nav-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, border-color var(--transition), color var(--transition);
    box-shadow: var(--shadow);
}

.mobile-nav-arrow:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.mobile-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
    html { font-size: 16px; }
    #app { padding: 68px 16px 120px; }

    /* Hide logo on mobile, but keep the audio control visible */
    .site-header {
        display: flex;
        padding: 10px 16px;
    }
    .site-header .brand-logo { display: none; }

    .site-header .audio-control-wrap {
        position: fixed;
        top: 12px;
        right: 16px;
        z-index: 210;
    }

    .site-header .audio-toggle-btn {
        width: 44px;
        height: 44px;
    }

    .site-header .volume-slider-track {
        top: 100%;
    }

    /* Correct vertical centering: account for 68px header + 120px bottom nav */
    .center-content { min-height: calc(100vh - 188px); }

    /* Never show mobile-transfer button on mobile devices */
    .mobile-transfer-btn { display: none !important; }
    .mobile-transfer-hint { display: none !important; }

    /* Hide desktop nav elements on mobile */
    .nav-arrow-desktop { display: none !important; }
    .step-dots-desktop { display: none !important; }

    /* Show mobile bottom nav bar */
    .mobile-nav-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        padding: 14px 24px 24px;
        background: linear-gradient(to top, rgb(185 218 251 / 97%) 60%, rgba(248, 249, 250, 0));
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .mobile-nav-bar .step-dots {
        padding: 0;
        width: 60%;
        justify-content: space-between;
        gap: 0;
    }

    .mobile-nav-bar .step-dot {
        width: 12px;
        height: 12px;
    }

    .mobile-nav-bar .mobile-nav-arrow {
        flex-shrink: 0;
    }

    .mobile-nav-bar > .mobile-nav-arrow.hidden {
        display: flex !important;
        visibility: hidden;
    }

    .step1-back {
        display: none !important;
    }

    .consent-progress {
        display: none;
    }

    .step1-mobile-logo {
        display: block;
        width: 100px;
        margin: 0 auto 0px;
    }

    .form-row { flex-direction: column; gap: 12px; }
    .half, .third, .sixth { flex: auto; }
    h1 { font-size: 1.75rem; }
    #step-1 h1 { font-size: 2.25rem; }
    #step-1 .subtitle { font-size: 1.1rem; }
    .input-phone { font-size: 1.25rem; }
    .code-digit { width: 42px; height: 50px; font-size: 1.2rem; }
    .code-inputs { gap: 8px; }
    .signature-preview-text { font-size: 1.8rem; }
    .card-capture-buttons { flex-direction: column; align-items: stretch; }
    .btn-capture { justify-content: center; }
    .card-guide-frame { width: 90%; }
    .guide-instruction { font-size: 0.85rem; bottom: 80px; }
    .guide-status { bottom: 110px; }
    .shutter-btn { width: 64px; height: 64px; }
    .shutter-ring { width: 48px; height: 48px; }

    #step-10 .center-content { gap: 12px; }
    #step-10 .step-header { gap: 8px; }
    #step-10 .step-header h1 { font-size: 1.5rem; }
    #step-10 .step-header .subtitle { font-size: 0.95rem; }
    .video-container {
        max-width: none;
        width: calc(100vw - 32px);
        aspect-ratio: auto;
        height: calc(100vh - 260px);
        max-height: 60vh;
        border-radius: 12px;
    }
    .video-tile-local {
        width: 90px;
        height: 68px;
        bottom: 8px;
        right: 8px;
    }
    .control-btn {
        width: 48px;
        height: 48px;
    }
    .control-btn svg {
        width: 24px;
        height: 24px;
    }
    .chat-panel {
        max-height: 200px;
    }
}

/* ── Eligibility Verification Badge ──────────────────────── */

.eligibility-result {
    margin-top: 16px;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
}

.eligibility-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #5a6977;
    background: #f4f6f8;
    border-radius: 10px;
    padding: 14px 18px;
}

.eligibility-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #1b7a3d;
    background: #eaf7ef;
    border-radius: 10px;
    padding: 14px 18px;
}

.eligibility-success svg {
    flex-shrink: 0;
    color: #22a352;
}

.eligibility-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #7a5c1b;
    background: #fdf6e3;
    border-radius: 10px;
    padding: 14px 18px;
}

.eligibility-warning svg {
    flex-shrink: 0;
    color: #c79a1e;
}

.eligibility-warning > div {
    text-align: center;
}

.eligibility-dispute-link {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #7a5c1b;
    text-decoration: underline;
    cursor: pointer;
}

.eligibility-dispute-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #1b6a7a;
    background: #e8f4f8;
    border-radius: 10px;
    padding: 14px 18px;
}

.eligibility-dispute-confirm svg {
    flex-shrink: 0;
    color: #22a38a;
}

/* ── DICOM Scan Upload ──────────────────────────────────── */

.dicom-drop-zone {
    border: 2px dashed #cfd8dc;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafbfc;
}

.dicom-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(78, 158, 218, 0.06);
}

.drop-zone-icon {
    color: #90a4ae;
    margin-bottom: 12px;
}

.dicom-drop-zone.drag-over .drop-zone-icon {
    color: var(--color-primary);
}

.drop-zone-text {
    font-size: 1rem;
    color: var(--color-text-secondary, #666);
    margin-bottom: 16px;
}

.drop-zone-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.dicom-hint {
    font-size: 0.82rem;
    color: #999;
    margin-top: 12px;
    text-align: center;
}

.dicom-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 24px 0 12px;
}

.dicom-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.dicom-progress-fill.indeterminate {
    width: 100% !important;
    background: linear-gradient(90deg, var(--color-primary) 25%, rgba(78, 158, 218, 0.35) 50%, var(--color-primary) 75%);
    background-size: 200% 100%;
    animation: dicom-shimmer 1.5s ease-in-out infinite;
}

@keyframes dicom-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#dicomReviewPhase {
    width: 100%;
}

.dicom-scan-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}

.dicom-scan-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: opacity 0.2s;
}

.dicom-scan-card.excluded {
    opacity: 0.45;
}

.dicom-scan-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
}

.dicom-scan-info {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.dicom-scan-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-primary, #1d1d1f);
}

.dicom-scan-meta {
    font-size: 0.82rem;
    color: var(--color-text-secondary, #666);
    margin-top: 2px;
}

#dicomNoScans {
    text-align: center;
    padding-top: 16px;
}

#dicomNoScans .btn-secondary {
    margin-top: 16px;
}

.dicom-review-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.dicom-review-actions button {
    flex: 1;
}

.dicom-desktop-link-btn {
    width: 100%;
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--color-text-secondary, #666);
    border-style: dashed;
}

.dicom-desktop-link-sent {
    margin-top: 16px;
    padding: 14px 18px;
    background: #e8f5e9;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #2e7d32;
    text-align: center;
    animation: mf-fade-in 0.2s ease;
}

.dicom-desktop-link-sent p {
    margin: 0;
}

@media (max-width: 480px) {
    .dicom-drop-zone {
        padding: 32px 16px;
    }
    .drop-zone-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .dicom-scan-card {
        padding: 12px;
    }
}

/* ── Pre-Call Device Check — Guided Walkthrough ────────── */

.device-check-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.device-check-panel.hidden {
    display: none;
}

/* Each step is a full-width card */
.dc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    animation: fadeInUp 0.35s ease both;
}

.dc-step.hidden {
    display: none;
}

.dc-step h1 {
    text-align: center;
    margin-bottom: 0;
}

.dc-step .subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-top: -8px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Step action buttons */
.dc-step-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.dc-step-actions .btn-primary {
    width: 100%;
}

.dc-trouble-link {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.dc-trouble-link.hidden {
    display: none;
}

/* Camera preview */
.dc-camera-preview-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border-radius: var(--radius);
    overflow: hidden;
}

.dc-camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.dc-camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
}

.dc-camera-placeholder.hidden {
    display: none;
}

/* Device selectors */
.dc-device-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
}

.dc-camera-select-wrap.hidden,
.dc-mic-select-wrap.hidden {
    display: none;
}

/* Mic meter */
.dc-mic-meter-wrap {
    width: 100%;
}

.dc-mic-meter {
    width: 100%;
    height: 16px;
    background: var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.dc-mic-meter-fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 8px;
    transition: width 0.08s linear;
}

.dc-mic-meter-fill.active {
    background: #22a352;
}

.dc-mic-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 4px;
}

/* Speaker visual */
.dc-speaker-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dc-speaker-visual.playing svg {
    animation: speakerPulse 0.6s ease infinite;
}

@keyframes speakerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.dc-play-btn {
    min-width: 160px;
}

.dc-play-btn.hidden {
    display: none;
}

/* Fix guidance text */
.dc-fix-text {
    font-size: 0.85rem;
    color: #7a5c1b;
    padding: 10px 14px;
    background: #fdf6e3;
    border-radius: var(--radius-sm);
    text-align: left;
    width: 100%;
}

.dc-fix-text.hidden {
    display: none;
}

/* Permission guidance */
.dc-permission-guidance {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: left;
    width: 100%;
}

.dc-permission-guidance ol {
    padding-left: 20px;
    margin: 0;
    line-height: 1.7;
    font-size: 0.9rem;
}

/* Ready / all-set step */
.dc-ready-icon {
    padding-top: 8px;
}

.dc-ready-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.dc-ready-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    justify-content: center;
}

.dc-ready-item svg {
    flex-shrink: 0;
}

#dcStepReady .btn-primary {
    width: 100%;
    margin-top: 4px;
}

/* Skip link at bottom */
.dc-skip-wrap {
    text-align: center;
    padding-top: 4px;
}

.dc-skip-link {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

@media (max-width: 480px) {
    .dc-step-actions .btn-primary {
        padding: 16px;
        font-size: 1.05rem;
    }
    .dc-mic-meter {
        height: 20px;
        border-radius: 10px;
    }
    .dc-mic-meter-fill {
        border-radius: 10px;
    }
}

/* ── Pharmacy autocomplete ─────────────────────────────────── */
#pharmacyAutocompleteWrap {
    position: relative;
    width: 100%;
}

#pharmacyAutocompleteWrap.disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* No-coverage overlay — replaces form content when state isn't covered */
.no-coverage-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 320px;
    animation: fadeIn 0.3s ease;
}

.no-coverage-overlay.hidden { display: none; }

.no-coverage-card {
    background: var(--color-surface, #fff);
    border: 1.5px solid var(--color-border, #dee2e6);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.no-coverage-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(78, 158, 218, 0.12);
    color: var(--color-primary, #4E9EDA);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.no-coverage-icon svg {
    width: 32px;
    height: 32px;
}

.no-coverage-card h2 {
    font-family: var(--font-heading, 'Nunito', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.no-coverage-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-secondary, #666);
    margin: 0 0 8px;
}

.no-coverage-sub {
    font-size: 0.88rem !important;
    margin-top: 4px;
}

.no-coverage-card .btn-secondary {
    margin-top: 24px;
}
