:root {
    --pwa-navy: #0b2a4a;
    --pwa-blue: #0056b3;
    --pwa-gold: #f5d37a;
    --pwa-green: #218838;
}

body.pwa-dialog-open {
    overflow: hidden;
}

body.pwa-tour-active::before {
    content: "";
    position: fixed;
    z-index: 2500;
    inset: 0;
    background: rgba(11, 42, 74, 0.72);
    pointer-events: none;
    animation: pwa-tour-backdrop-in 280ms ease both;
}

.pwa-tour-focus {
    position: relative !important;
    z-index: 2501 !important;
    transform: scale(1.045) !important;
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.34) !important;
    transition: transform 380ms ease, box-shadow 380ms ease !important;
}

.pwa-install-box.pwa-tour-focus {
    padding: 18px 12px;
    border-radius: 16px;
    background: #fff;
}

.pwa-install-button.is-tour-attention {
    animation: pwa-install-tour-pulse 850ms ease 2;
}

.pwa-install-box {
    display: none;
    margin: -10px 0 30px;
    text-align: center;
}

.pwa-install-box.is-visible {
    display: block;
}

.pwa-install-button {
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--pwa-navy);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    color: var(--pwa-gold);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.pwa-install-button:hover {
    background: #123b64;
}

.pwa-install-button:focus-visible,
.pwa-dialog button:focus-visible {
    outline: 3px solid rgba(0, 86, 179, 0.35);
    outline-offset: 3px;
}

.pwa-install-hint {
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

.pwa-standalone-notice {
    position: relative;
    margin: -8px 0 28px;
    padding: 18px 48px 18px 18px;
    border: 1px solid #b9d8ff;
    border-radius: 14px;
    background: #f1f7ff;
    color: #17324d;
    text-align: left;
}

.pwa-standalone-notice strong {
    display: block;
    margin-bottom: 5px;
    color: var(--pwa-navy);
    font-size: 17px;
}

.pwa-standalone-notice p {
    margin: 0 0 12px;
    line-height: 1.55;
}

.pwa-standalone-notice a {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--pwa-blue);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.pwa-standalone-notice-close {
    position: absolute;
    top: 7px;
    right: 9px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #536475;
    cursor: pointer;
    font-size: 25px;
}

.pwa-dialog-overlay {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(11, 42, 74, 0.62);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.pwa-dialog-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.pwa-dialog {
    position: relative;
    width: min(100%, 480px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 180ms ease;
}

.pwa-dialog-overlay.is-visible .pwa-dialog {
    transform: translateY(0) scale(1);
}

.pwa-dialog-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.pwa-dialog-close:hover {
    background: #f1f3f5;
}

.pwa-dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e8f2ff;
    color: var(--pwa-blue);
    font-size: 32px;
}

.pwa-dialog h2 {
    margin: 0 24px 12px;
    color: var(--pwa-navy);
    font-size: clamp(24px, 5vw, 30px);
    line-height: 1.2;
}

.pwa-dialog-copy {
    margin: 0;
    color: #4f5964;
    font-size: 16px;
    line-height: 1.55;
}

.pwa-dialog-benefit {
    margin: 18px 0;
    padding: 13px 15px;
    border: 1px solid #b9d8ff;
    border-radius: 12px;
    background: #f1f7ff;
    color: #164f8f;
    font-weight: 700;
}

.pwa-dialog-primary,
.pwa-dialog-secondary {
    width: 100%;
    border: 0;
    border-radius: 50px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.pwa-dialog-primary {
    position: relative;
    overflow: hidden;
    padding: 14px 18px;
    background: linear-gradient(135deg, #28a745, var(--pwa-green));
    color: #fff;
    box-shadow: 0 10px 24px rgba(40, 167, 69, 0.24);
}

.pwa-dialog-primary:hover {
    background: linear-gradient(135deg, #2db54d, #1b7430);
}

.pwa-dialog-primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

.pwa-dialog-primary.is-attention::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -45%;
    width: 34%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
    animation: pwa-button-glint 1.1s ease 1;
}

.pwa-dialog-secondary {
    margin-top: 8px;
    padding: 11px 18px;
    background: transparent;
    color: #5d6670;
}

.pwa-dialog-secondary:hover {
    background: #f4f5f6;
}

.pwa-ios-steps {
    display: none;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: #f6f7f9;
    text-align: left;
}

.pwa-ios-steps.is-visible {
    display: block;
}

.pwa-ios-steps h3 {
    margin: 0 0 10px;
    color: var(--pwa-navy);
    font-size: 18px;
}

.pwa-ios-steps ol {
    margin: 0;
    padding-left: 22px;
    color: #404850;
    line-height: 1.65;
}

.pwa-install-steps {
    display: grid;
    gap: 10px;
    padding: 0 !important;
    list-style: none;
}

.pwa-install-steps li {
    display: grid;
    grid-template-columns: 28px 46px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid #dde5ed;
    border-radius: 12px;
    background: #fff;
}

.pwa-step-number {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--pwa-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.pwa-step-icon,
.pwa-step-app-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 11px;
    background: #eef5ff;
    color: var(--pwa-blue);
}

.pwa-step-icon svg {
    width: 31px;
    height: 31px;
}

.pwa-step-plus {
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
}

.pwa-step-app-icon {
    object-fit: cover;
}

.pwa-ios-important {
    margin: 14px 0 0;
    padding: 12px 13px;
    border: 2px solid #e2a500;
    border-radius: 11px;
    background: #fff6d9;
    color: #634900;
    font-size: 14px;
    line-height: 1.45;
}

.pwa-ios-steps-note {
    margin: 10px 0 0;
    color: #666;
    font-size: 13px;
}

.next-appointment.pwa-date-highlight {
    animation: pwa-date-highlight 1.25s ease 2;
}

.pwa-install-feedback {
    position: fixed;
    z-index: 3200;
    right: 18px;
    bottom: 18px;
    max-width: min(360px, calc(100vw - 36px));
    padding: 14px 18px;
    border-radius: 12px;
    background: #155724;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    color: #fff;
    font-weight: 600;
}

@keyframes pwa-date-highlight {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
    45% {
        transform: scale(1.025);
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0.18);
    }
}

@keyframes pwa-button-glint {
    from { left: -45%; }
    to { left: 120%; }
}

@keyframes pwa-tour-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pwa-install-tour-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }
    50% {
        transform: scale(1.055);
        box-shadow: 0 0 0 10px rgba(245, 211, 122, 0.32), 0 14px 32px rgba(0, 0, 0, 0.22);
    }
}

@media (max-width: 520px) {
    .pwa-dialog-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .pwa-dialog {
        width: 100%;
        max-height: 92vh;
        padding: 28px 22px 22px;
        border-radius: 22px 22px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pwa-dialog-overlay,
    .pwa-dialog,
    body.pwa-tour-active::before,
    .pwa-tour-focus,
    .pwa-install-button.is-tour-attention,
    .next-appointment.pwa-date-highlight,
    .pwa-dialog-primary.is-attention::after {
        animation: none !important;
        transition: none !important;
    }
}
