/* Život v regionu – compact profile modal matching the mobile user interface.
   The location list is intentionally collapsed by default and uses native
   <details> behaviour (keyboard, screen reader, no custom menu state). */

.profile-menu {
    padding: max(12px, env(safe-area-inset-top)) 14px
             max(86px, calc(78px + env(safe-area-inset-bottom)));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.profile-menu.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-menu .profile-panel {
    width: min(100%, 440px);
    min-width: 0;
    flex: 0 1 440px;
    max-height: calc(100dvh - 118px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: auto;
    padding: 22px;
    border-radius: 24px;
    box-shadow: 0 26px 66px rgba(16, 36, 67, .24);
    color: #102443;
    scrollbar-width: thin;
}

.profile-menu .profile-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
}

.profile-menu .profile-panel-head h2 {
    margin: 0;
    font-size: clamp(22px, 5.7vw, 26px);
    line-height: 1.2;
    letter-spacing: -.025em;
    font-weight: 850;
}

.profile-menu .profile-close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 24px;
    background: #f0f4f8;
    color: #17314d;
}

.profile-menu .profile-account-state {
    margin: 0 0 16px;
    padding: 16px;
    background: #f1f6fa;
    border: 1px solid #dce7ee;
    border-radius: 16px;
    color: #516579;
    font-size: 14px;
    line-height: 1.52;
}

.profile-menu .profile-account-state strong {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.3;
    color: #16324d;
}

.profile-menu .profile-account-state--signed-in {
    background: #ebf9f0;
    border-color: #bee3cc;
    color: #166344;
}

.profile-menu .profile-account-state--signed-in strong {
    color: #115936;
}

.profile-menu .profile-login,
.profile-menu .profile-register,
.profile-menu .profile-install {
    margin: 0;
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.profile-menu .profile-auth-primary {
    margin-top: 0 !important;
    background: #126f59 !important;
}

.profile-menu .profile-auth-secondary {
    margin-top: 9px !important;
    border-color: #cad9e3 !important;
}

.profile-menu .profile-install[hidden] {
    display: none !important;
}

.profile-menu .profile-location {
    margin-top: 18px;
    border: 1px solid #d7e7ef;
    border-radius: 16px;
    background: #f5f9fc;
    overflow: hidden;
}

.profile-menu .profile-location-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    padding: 12px 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.profile-menu .profile-location-toggle::-webkit-details-marker {
    display: none;
}

.profile-menu .profile-location-icon {
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #e0f4fa;
    color: #067f9e;
    font-size: 24px;
    font-weight: 750;
}

.profile-menu .profile-location-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.profile-menu .profile-location-label {
    color: #627b8d;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
}

.profile-menu .profile-location-copy strong {
    color: #123e58;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.profile-menu .profile-location-chevron {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: #137c99;
    transition: transform .18s ease;
}

.profile-menu .profile-location[open] .profile-location-chevron {
    transform: rotate(180deg);
}

.profile-menu .profile-location-body {
    border-top: 1px solid #dce9f1;
    padding: 12px;
    background: white;
}

.profile-menu .profile-location-hint {
    margin: 0 0 10px;
    color: #697f91;
    font-size: 12px;
    line-height: 1.45;
}

.profile-menu .region-options {
    display: grid;
    gap: 8px;
    margin: 0;
}

.profile-menu .region-option {
    min-height: 47px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dee8ee;
    border-radius: 11px;
    background: #f7fafc;
    color: #233e54;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 750;
    text-align: left;
    overflow-wrap: anywhere;
}

.profile-menu .region-option.active {
    background: #e8f7fa;
    border-color: #a8d9e6;
    color: #085d7c;
}

.profile-menu .profile-panel-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.profile-menu .profile-panel-actions .profile-install,
.profile-menu .profile-panel-actions .profile-login {
    margin: 0 !important;
}

.profile-menu .profile-panel-actions .profile-install {
    color: #087b98;
    background: #eaf9fc;
    border: 1px solid #bfe7ef;
}

.profile-menu .profile-panel-actions .profile-install.is-installed {
    color: #176e4c;
    background: #e6f7ef;
    border-color: #a9dec3;
}

.profile-menu .profile-notification-action {
    background: #102443;
    color: #fff;
}

.profile-menu .profile-panel-account-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.profile-menu .profile-panel-account-actions .profile-register,
.profile-menu .profile-panel-account-actions .profile-login {
    margin: 0 !important;
}

.profile-menu .profile-panel-account-actions form {
    margin: 0;
}

.profile-menu .profile-logout {
    border: 1px solid #ebcbd2;
    background: #fff5f6;
    color: #a52e40;
}

.profile-menu .profile-close:focus-visible,
.profile-menu .profile-location-toggle:focus-visible,
.profile-menu .region-option:focus-visible,
.profile-menu .profile-login:focus-visible,
.profile-menu .profile-register:focus-visible,
.profile-menu .profile-install:focus-visible {
    outline: 3px solid #18afd2;
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .profile-menu {
        padding: max(10px, env(safe-area-inset-top)) 12px
                 max(86px, calc(78px + env(safe-area-inset-bottom)));
    }

    .profile-menu .profile-panel {
        max-height: calc(100dvh - 104px - env(safe-area-inset-bottom));
        padding: 18px;
        border-radius: 22px;
    }

    .profile-menu .profile-panel-head { margin-bottom: 17px; }
    .profile-menu .profile-location { margin-top: 16px; }
    .profile-menu .profile-account-state { padding: 14px; }
}

@media (max-height: 630px) {
    .profile-menu {
        padding-top: 8px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }

    .profile-menu .profile-panel {
        max-height: calc(100dvh - 30px - env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-menu .profile-location-chevron { transition: none; }
}
