.sr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 40, 90, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.mda-embed,
.mda-embed * ,
.mda-embed *::before,
.mda-embed *::after {
    box-sizing: border-box;
}

.mda-embed {
    --mda-blue-900: #0b2f6b;
    --mda-blue-700: #1a56db;
    --mda-blue-600: #2563eb;
    --mda-blue-500: #2f6bf0;
    --mda-blue-100: #dce9ff;
    --mda-panel-bg: #eaf1ff;
    --mda-text-muted: #3457a0;

    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    background: rgba(10, 30, 70, .62);
    backdrop-filter: blur(7px);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.mda-embed img {
    display: block;
    max-width: 100%;
}

.mda-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px 24px 32px;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 30px 60px rgba(10, 30, 70, .35);
}

.mda-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mda-blue-100);
    color: var(--mda-blue-700);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.mda-close-btn:hover {
    background: var(--mda-blue-500);
    color: #fff;
}

.mda-close-btn:active {
    transform: scale(.92);
}

.mda-close-btn:focus-visible,
.mda-btn:focus-visible {
    outline: 3px solid var(--mda-blue-500);
    outline-offset: 2px;
}

.mda-close-btn svg {
    width: 16px;
    height: 16px;
}

.mda-success-row {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 18px;
    padding: 0 38px 26px 0;
}

.mda-check-badge {
    display: flex;
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--mda-blue-100);
}

.mda-check-badge .mda-circle {
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--mda-blue-600);
}

.mda-check-badge svg {
    width: 28px;
    height: 28px;
}

.mda-success-text {
    min-width: 0;
}

.mda-success-text h2 {
    margin: 2px 0 8px;
    color: var(--mda-blue-900);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: break-word;
}

.mda-success-text p {
    margin: 0;
    color: var(--mda-blue-900);
    font-size: 16px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.mda-panel {
    padding: 24px 22px 26px;
    border-radius: 20px;
    background: var(--mda-panel-bg);
    text-align: center;
}

.mda-panel-top {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    text-align: left;
}

.mda-person-icon {
    display: flex;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--mda-blue-100);
}

.mda-person-icon svg {
    width: 30px;
    height: 30px;
    stroke: var(--mda-blue-600);
}

.mda-badge-pill {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--mda-blue-700);
    font-size: 14px;
    font-weight: 700;
}

.mda-badge-pill span {
    overflow-wrap: anywhere;
}

.mda-badge-pill svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.mda-panel-text {
    min-width: 0;
}

.mda-panel-text h2 {
    margin: 0 0 14px;
    color: var(--mda-blue-900);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.mda-fine {
    margin: 0 0 22px;
    padding: 0 4px;
    color: var(--mda-text-muted);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.mda-actions {
    display: grid;
    width: 100%;
    gap: 12px;
}

.mda-btn {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 2px solid var(--mda-blue-600);
    border-radius: 999px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.mda-btn-primary {
    background: var(--mda-blue-600);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}

.mda-btn-primary:hover {
    border-color: var(--mda-blue-700);
    background: var(--mda-blue-700);
}

.mda-btn-primary svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.mda-btn-secondary {
    background: #fff;
    color: var(--mda-blue-700);
}

.mda-btn-secondary:hover {
    background: #f3f7ff;
}

.mda-btn:active {
    transform: scale(.985);
}

.mda-doctor-wrap {
    position: relative;
    display: block;
    width: 170px;
    height: 170px;
    margin: 8px auto 0;
}

.mda-doctor-circle {
    width: 150px;
    height: 150px;
    margin: 10px auto 0;
    overflow: hidden;
    border-radius: 50%;
    background: var(--mda-blue-100);
}

.mda-doctor-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
}

.mda-spark {
    position: absolute;
    width: 4px;
    border-radius: 2px;
    background: var(--mda-blue-600);
}

.mda-s1 { top: 6px; left: 22px; height: 22px; transform: rotate(-18deg); }
.mda-s2 { top: 26px; left: 6px; height: 16px; transform: rotate(-18deg); }
.mda-s3 { top: 2px; right: 26px; height: 22px; transform: rotate(18deg); }
.mda-s4 { top: 22px; right: 8px; height: 16px; transform: rotate(18deg); }
.mda-s5 { bottom: 6px; left: 30px; height: 16px; transform: rotate(-18deg); }

.mda-heart {
    position: absolute;
    top: 58px;
    right: 0;
    width: 34px;
    height: 34px;
}

.mda-heart svg {
    width: 100%;
    height: 100%;
    stroke: var(--mda-blue-600);
}

@media (min-width: 640px) {
    .mda-modal {
        max-width: 460px;
        padding: 32px 30px 36px;
    }
}

@media (min-width: 900px) {
    .mda-modal {
        max-width: 760px;
        padding: 36px 40px 40px;
        border-radius: 32px;
    }

    .mda-success-row {
        gap: 18px;
        padding: 0 46px 30px 0;
    }

    .mda-success-text h2 { font-size: 26px; }
    .mda-success-text p { font-size: 17px; }

    .mda-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 200px;
        grid-template-areas:
            "top photo"
            "copy photo"
            "actions photo";
        align-items: center;
        column-gap: 32px;
        padding: 32px 36px;
        text-align: left;
    }

    .mda-panel-top { grid-area: top; margin-bottom: 18px; }
    .mda-panel-text { grid-area: copy; }
    .mda-panel-text h2 { text-align: left; }
    .mda-fine { padding: 0; text-align: left; }
    .mda-actions { grid-area: actions; display: flex; gap: 14px; }
    .mda-doctor-wrap {
        grid-area: photo;
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }

    .mda-doctor-circle {
        width: 176px;
        height: 176px;
        margin-top: 12px;
    }
}

@media (min-width: 1200px) {
    .mda-modal { max-width: 860px; }
}

@media (max-width: 380px) {
    .mda-modal { padding: 20px 16px 24px; border-radius: 22px; }
    .mda-success-row { gap: 14px; }
    .mda-check-badge { width: 64px; height: 64px; }
    .mda-check-badge .mda-circle { width: 46px; height: 46px; }
    .mda-panel { padding: 18px 14px 20px; }
    .mda-badge-pill { padding: 9px 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .mda-btn,
    .mda-close-btn { transition: none; }
}

.patient-beta-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 25, 55, 0.58);
    backdrop-filter: blur(8px);
    font-family: 'Segoe UI', Arial, sans-serif;
}

.patient-beta-success-modal {
    width: min(100%, 420px);
    padding: 36px 32px 30px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    background: #ffffff;
    color: #102b54;
    text-align: center;
    box-shadow: 0 28px 80px rgba(5, 25, 60, 0.28);
    animation: patient-beta-success-in 220ms ease-out both;
}

.patient-beta-success-icon {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    place-items: center;
    border: 8px solid #e7f6ef;
    border-radius: 50%;
    background: #16865c;
    color: #ffffff;
}

.patient-beta-success-icon svg {
    width: 28px;
    height: 28px;
}

.patient-beta-success-eyebrow {
    margin: 0 0 10px;
    color: #16865c;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-beta-success-modal h2 {
    margin: 0;
    color: #102b54;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
}

.patient-beta-success-subtitle {
    margin: 10px 0 0;
    color: #2563a6;
    font-size: 16px;
    font-weight: 700;
}

.patient-beta-success-text {
    margin: 16px 0 26px;
    color: #52657c;
    font-size: 15px;
    line-height: 1.6;
}

.patient-beta-success-close {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: #145bd7;
    color: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.patient-beta-success-close:hover {
    background: #104bb4;
}

.patient-beta-success-close:active {
    transform: scale(0.985);
}

.patient-beta-success-close:focus-visible {
    outline: 3px solid #76a9ff;
    outline-offset: 3px;
}

@keyframes patient-beta-success-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .patient-beta-success-modal {
        padding: 30px 24px 24px;
        border-radius: 20px;
    }

    .patient-beta-success-modal h2 {
        font-size: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .patient-beta-success-modal {
        animation: none;
    }
}

.sr-card {
    background: #ffffff;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 22px 22px 18px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 20, 0.25);
    box-sizing: border-box;
}

.sr-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 22px;
    color: #0b2f6b;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.sr-close:hover {
    opacity: 0.7;
}

.sr-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.sr-check-wrap {
    position: relative;
    width: 62px;
    height: 62px;
    flex: 0 0 auto;
}

.sr-check-halo {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: #dbe9fd;
}

.sr-check-circle {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #1c6dfc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-check-circle svg {
    width: 28px;
    height: 28px;
}

.sr-spark {
    position: absolute;
    width: 4px;
    height: 14px;
    border-radius: 4px;
    background: #1c6dfc;
}

.sp1 {
    top: -18px;
    left: 10px;
    transform: rotate(-20deg);
}

.sp2 {
    top: -6px;
    left: -14px;
    transform: rotate(35deg);
}

.sp3 {
    top: -18px;
    right: -6px;
    transform: rotate(20deg);
}

.sp4 {
    top: 6px;
    right: -18px;
    transform: rotate(-25deg);
}

.sr-title {
    color: #0b2f6b;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
}

.sr-text {
    color: #0b2f6b;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.sr-box {
    background: #eaf3ff;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.sr-box-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #d7e8ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-box-icon svg {
    width: 24px;
    height: 24px;
}

.sr-box-content {
    flex: 1 1 260px;
    min-width: 200px;
}

.sr-box-title {
    color: #0b2f6b;
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.3;
}

.sr-box-desc {
    color: #16407f;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}

.sr-actions {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    width: 100%;
    margin-top: 8px;
    align-items: stretch;
    justify-content: flex-start;
}

.sr-btn {
    border-radius: 18px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid #1c6dfc;
    white-space: nowrap;
    min-width: 0;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.sr-btn-primary {
    background: #1c6dfc;
    color: #ffffff;
    border-color: #1c6dfc;
    box-shadow: 0 0 0 1px rgba(28, 109, 252, 0.1);
    flex: 1.9 1 auto;
    min-width: 200px;
}

.sr-btn-primary:hover {
    background: #0f5ae0;
}

.sr-btn-secondary {
    background: #ffffff;
    color: #1c6dfc;
    border: 2px solid #1c6dfc;
    flex: 0.72 1 0;
    min-width: 90px;
    margin-left: auto;
}

.sr-btn-secondary:hover {
    background: #f2f7ff;
}

.sr-photo-wrap {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    position: relative;
}

.sr-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

@media (max-width: 520px) {
    .sr-card {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .sr-top {
        gap: 14px;
        margin-bottom: 18px;
    }

    .sr-check-wrap {
        width: 56px;
        height: 56px;
    }

    .sr-check-circle {
        width: 56px;
        height: 56px;
    }

    .sr-check-circle svg {
        width: 26px;
        height: 26px;
    }

    .sr-check-halo {
        inset: -10px;
    }

    .sp1, .sp2, .sp3, .sp4 {
        display: none;
    }

    .sr-title {
        font-size: 20px;
    }

    .sr-text {
        font-size: 13.5px;
    }

    .sr-box {
        padding: 16px;
        border-radius: 14px;
        flex-direction: column;
        text-align: center;
    }

    .sr-box>.sr-box-content>div {
        flex-direction: column;
        align-items: center;
    }

    .sr-box-title {
        font-size: 15px;
    }

    .sr-box-desc {
        font-size: 13px;
    }

    .sr-actions {
        justify-content: center;
    }

    .sr-btn {
        flex: 1 1 auto;
        justify-content: center;
        padding: 11px 14px;
        font-size: 13px;
    }

    .sr-photo-wrap {
        display: block;
        width: 120px;
        height: 120px;
        margin: 8px auto 0;
    }
}

@media (max-width: 430px) {
    .sr-actions {
        flex-direction: column;
    }

    .sr-btn {
        width: 100%;
    }
}
