.gym-finder {
    --gym-panel-border: #333;
    min-width: 0;
}

.gym-finder-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 16px;
    padding: 24px;
    border: 1px solid var(--gym-panel-border);
    border-radius: var(--border-radius);
    background: var(--card-background);
    box-shadow: var(--box-shadow);
}

.gym-back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.gym-back-link:hover {
    color: var(--accent-dark);
}

.gym-finder-intro h1 {
    margin: 0 0 6px;
    color: var(--accent-color);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 650;
    letter-spacing: -0.03em;
}

.gym-finder-intro p {
    margin: 0;
    color: #d4d4d4;
}

.gym-search {
    flex: 0 1 360px;
}

.gym-search span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.gym-search input {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #454545;
    border-radius: 7px;
    background: #111;
    color: var(--text-light);
    font: inherit;
}

.gym-search input:focus {
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(224, 253, 83, 0.14);
}

.gym-search input::placeholder {
    color: var(--text-muted);
}

.gym-finder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 16px;
    min-height: 620px;
}

.gym-map-panel,
.gym-directory {
    overflow: hidden;
    border: 1px solid var(--gym-panel-border);
    border-radius: var(--border-radius);
    background: var(--card-background);
    box-shadow: var(--box-shadow);
}

.gym-map-panel {
    min-width: 0;
}

.gym-map-status-row,
.gym-directory-heading {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--gym-panel-border);
}

.gym-map-status {
    margin: 0;
    color: var(--text-light);
    font-size: 0.86rem;
}

.gym-map-status-row a {
    flex: 0 0 auto;
    color: var(--accent-color);
    font-size: 0.76rem;
    text-underline-offset: 3px;
}

#gymsMap {
    width: 100%;
    height: clamp(568px, 70vh, 760px);
    background: #d8dde1;
}

.gym-map-pin {
    border: 0;
    background: transparent;
}

.gym-map-pin-shape {
    position: relative;
    display: block;
    width: 28px;
    height: 28px;
    transform: rotate(-45deg);
    border: 3px solid #111;
    border-radius: 50% 50% 50% 0;
    background: var(--accent-color);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.45);
}

.gym-map-pin-shape::after {
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: #111;
    content: '';
}

#gymsMap .leaflet-popup-content-wrapper,
#gymsMap .leaflet-popup-tip {
    background: var(--card-background);
    color: var(--text-light);
}

#gymsMap .leaflet-popup-content-wrapper {
    border: 1px solid #3a3a3a;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

#gymsMap .leaflet-popup-content {
    width: min(255px, 70vw) !important;
    margin: 15px;
}

#gymsMap .leaflet-popup-close-button {
    color: var(--text-light);
}

.gym-popup-title {
    margin: 0 22px 6px 0;
    color: var(--accent-color);
    font-size: 1rem;
    line-height: 1.3;
}

.gym-popup-address {
    margin: 0;
    color: #d8d8d8;
    line-height: 1.45;
}

.gym-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.gym-popup-actions a {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--accent-color);
    color: #000;
    font-size: 0.8rem;
    font-weight: 650;
    text-decoration: none;
}

.gym-popup-actions a.secondary {
    background: #333;
    color: var(--text-light);
}

.gym-directory {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.gym-directory-heading h2 {
    margin: 0;
    color: var(--text-light);
    font-size: 1rem;
}

.gym-directory-heading span {
    min-width: 31px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(224, 253, 83, 0.12);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.gym-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.gym-card {
    padding: 14px;
    border-bottom: 1px solid var(--gym-panel-border);
    transition: background-color 0.18s;
}

.gym-card:hover,
.gym-card.active {
    background: rgba(224, 253, 83, 0.07);
}

.gym-card-focus {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.gym-card-focus:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.gym-card-title,
.gym-card-location {
    display: block;
}

.gym-card-title {
    padding-right: 12px;
    color: var(--text-light);
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.3;
}

.gym-card-location {
    margin-top: 5px;
    color: #bcbcbc;
    font-size: 0.78rem;
    line-height: 1.4;
}

.gym-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.gym-card-categories span {
    padding: 3px 6px;
    border: 1px solid #424242;
    border-radius: 999px;
    color: #c9c9c9;
    font-size: 0.64rem;
    line-height: 1.2;
}

.gym-card-actions {
    display: flex;
    gap: 14px;
    margin-top: 11px;
}

.gym-card-actions a {
    color: var(--accent-color);
    font-size: 0.77rem;
    font-weight: 650;
    text-underline-offset: 3px;
}

.gym-empty {
    margin: 0;
    padding: 28px 16px;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 900px) {
    .gym-finder-layout {
        grid-template-columns: 1fr;
    }

    #gymsMap {
        height: min(62vh, 580px);
        min-height: 430px;
    }

    .gym-directory {
        max-height: 620px;
    }
}

@media (max-width: 620px) {
    .gym-finder-intro {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        padding: 18px 14px;
    }

    .gym-search {
        flex-basis: auto;
    }

    .gym-map-status-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    #gymsMap {
        height: max(430px, calc(100dvh - 250px));
        min-height: 0;
        max-height: 620px;
    }
}
