.public-location-scope-trigger {
    cursor: pointer;
}

.public-community-join-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding-inline: 14px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.public-community-join-btn:hover {
    background: var(--primary-hover, var(--primary));
    border-color: var(--primary-hover, var(--primary));
    color: #fff;
    transform: translateY(-1px);
}

.public-community-join-btn svg {
    width: 17px;
    height: 17px;
}

.public-location-modal[hidden] {
    display: none !important;
}

.public-location-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    padding: 24px;
}

.public-location-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(8, 28, 20, .48);
    backdrop-filter: blur(5px);
    cursor: default;
}

.public-location-modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(12, 54, 34, .20);
}

.public-location-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--border);
}

.public-location-modal-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.public-location-modal-title > svg {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--primary);
}

.public-location-modal-title strong {
    display: block;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.35;
}

.public-location-modal-title small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}

.public-location-modal-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft, var(--surface));
    color: var(--text-secondary);
    cursor: pointer;
}

.public-location-modal-close svg {
    width: 18px;
    height: 18px;
}

.public-location-scope-form {
    padding: 20px 22px 22px;
}

.public-location-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 16px;
}

.public-location-field > span {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 800;
}

.public-location-field > small {
    margin-top: -2px;
    color: var(--text-muted);
    font-size: 12px;
}

.public-location-field select {
    width: 100%;
    min-height: 48px;
    padding-inline: 13px 38px;
    border: 1px solid var(--border);
    border-radius: 13px;
    outline: 0;
    background: var(--surface-soft, #f8fbf9);
    color: var(--text-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 650;
}

.public-location-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.public-location-field select:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.public-location-modal-note {
    margin: 2px 0 0;
    padding: 12px 13px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.75;
}

.public-location-modal-status {
    min-height: 22px;
    margin: 10px 0 0;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.public-location-modal-status.is-error {
    color: #b42318;
}

.public-location-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.public-location-save,
.public-location-cancel {
    min-height: 44px;
    padding-inline: 18px;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.public-location-save {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
}

.public-location-save:disabled {
    opacity: .65;
    cursor: progress;
}

.public-location-cancel {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}

body.public-location-modal-open {
    overflow: hidden;
}

/* Generic region/city scope placeholders can open the same location dialog. */
.public-scope-tabs button.public-scope-location-choice {
    position: relative;
    min-width: auto;
    min-height: 54px;
    padding-inline: 14px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.public-scope-tabs button.public-scope-location-choice:hover {
    color: var(--primary);
}

@media (max-width: 1050px) and (min-width: 781px) {
    .public-location-scope-trigger {
        width: auto;
        padding-inline: 10px;
    }

    .public-location-scope-trigger span {
        display: inline;
    }

    .public-community-join-btn {
        padding-inline: 11px;
        font-size: 13px;
    }
}

@media (max-width: 780px) {
    .public-location-modal {
        align-items: end;
        padding: 10px;
    }

    .public-location-modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 20px;
    }

    .public-location-modal-head {
        padding: 18px 16px 14px;
    }

    .public-location-scope-form {
        padding: 16px;
    }

    .public-location-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .public-location-save,
    .public-location-cancel {
        width: 100%;
    }

    .public-scope-tabs button.public-scope-location-choice {
        min-height: 48px;
        padding-inline: 11px;
        font-size: 13px;
    }
}
