.route-mode-toggle .btn.active {
    background-color: var(--color-primary, #126B85);
    border-color: var(--color-primary, #126B85);
    color: #fff;
}

.route-meta-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.route-walk-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(30, 60, 44, 0.08);
    color: var(--color-primary, #126B85);
    font-size: 0.9rem;
    font-weight: 600;
}

.route-leg-hint {
    color: #6c757d;
    font-size: 0.8rem;
}

[data-theme="dark"] .route-walk-stats {
    background: rgba(110, 184, 212, 0.12);
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-leg-hint {
    color: var(--color-text-muted);
}

.map-section .map-title {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

#routeMapHint {
    max-width: 420px;
    line-height: 1.35;
}

.map-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.map-export-actions .btn {
    font-size: 0.85rem;
}

.route-list-grid .route-list-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.route-list-grid .route-list-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.route-list-card-cover {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    display: block;
    background: var(--color-bg-muted);
}

.route-list-card-location {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.35rem;
    color: var(--color-primary);
}

.route-list-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-primary, #126b85);
    margin: 0 0 0.25rem;
}

.route-list-card-year {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
    min-height: 1.3em;
}

.route-list-card-year--empty {
    visibility: hidden;
}

.route-list-card-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.route-list-card-clamp--2 {
    -webkit-line-clamp: 2;
    min-height: calc(1.35em * 2);
}

.route-list-card-clamp--3 {
    -webkit-line-clamp: 3;
    min-height: calc(1.45em * 3);
}

.route-list-card-name.route-list-card-clamp--2 {
    min-height: calc(1.35em * 2);
}

.route-list-card-desc.route-list-card-clamp--3 {
    min-height: calc(1.45em * 3);
}

.route-list-card-clamp--empty {
    color: transparent;
    user-select: none;
    pointer-events: none;
}

.route-list-card-clamp.is-truncated:hover {
    cursor: pointer;
}

.route-list-card-name.route-list-card-clamp.is-truncated:hover,
.route-list-card-desc.route-list-card-clamp.is-truncated:hover {
    color: var(--color-primary, #126b85);
}

.route-list-card-clamp.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    cursor: pointer;
}

.route-list-card-places {
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0 0 0.65rem;
}

.route-list-card-place-chip {
    display: inline;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(18, 107, 133, 0.12);
    color: var(--color-primary, #126b85);
    font-weight: 600;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.route-list-card-place-chip--empty {
    visibility: hidden;
}

.route-list-card-places-sep {
    display: inline-block;
    margin: 0 0.2rem;
    color: var(--color-primary-light, #6b9cbd);
    font-weight: 700;
}

.route-list-card-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--color-text-muted);
    margin: 0 0 0.65rem;
}

.route-list-card-desc--empty {
    color: transparent;
    user-select: none;
}

.route-list-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
}

.route-list-card-meta-sep {
    opacity: 0.55;
}

.route-list-card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 0.55rem;
    margin-bottom: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.route-list-card-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.78rem;
}

.route-list-card-stars {
    display: inline-flex;
    gap: 0.05rem;
    color: var(--color-rating-star-empty);
}

.route-list-card-stars .bi-star-fill {
    color: var(--color-rating-star);
}

.route-list-card-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.route-list-card-reaction {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border);
}

.route-list-card-reactions-empty {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.route-list-card-btn {
    width: 100%;
}

.route-poi-list-row {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.route-poi-list-btn {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    cursor: pointer;
}

.route-poi-list-btn:hover strong {
    color: var(--color-primary-light);
}

.route-poi-exclude-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 0.05rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted, #6c757d);
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.route-poi-exclude-btn:hover,
.route-poi-exclude-btn:focus-visible {
    color: #b02a37;
    background: rgba(176, 42, 55, 0.08);
    outline: none;
}

.route-poi-list-item.is-excluded {
    opacity: 0.55;
}

.route-poi-list-item.is-excluded .route-poi-list-btn strong {
    text-decoration: line-through;
}

.route-poi-list-item.is-excluded .route-poi-exclude-btn {
    color: var(--color-primary, #126B85);
}

.route-poi-list-item.is-excluded .route-poi-exclude-btn:hover,
.route-poi-list-item.is-excluded .route-poi-exclude-btn:focus-visible {
    color: var(--color-primary-light, #137A9E);
    background: rgba(18, 107, 133, 0.1);
}

.route-poi-list-item.is-excluded .route-leg-hint {
    display: none;
}

.route-poi-list-wrap--scroll {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 107, 133, 0.45) transparent;
    padding-right: 0.15rem;
    margin-bottom: 0;
}

.route-poi-list-wrap--scroll::-webkit-scrollbar {
    width: 6px;
}

.route-poi-list-wrap--scroll::-webkit-scrollbar-thumb {
    background: rgba(18, 107, 133, 0.45);
    border-radius: 999px;
}

.route-poi-list-wrap--scroll .route-poi-list {
    margin-bottom: 0;
}

.route-poi-list-item {
    border-left: 0;
    border-right: 0;
}

.route-poi-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.route-poi-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow-md);
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--color-border);
}

.route-poi-card__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.route-poi-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--color-primary);
}

.route-poi-card__coords {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

.route-poi-card__meta-block {
    text-align: right;
    max-width: 100%;
}

.route-poi-card__address {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
}

.route-poi-card__reactions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.route-poi-card__reaction {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border);
}

.route-poi-card__reactions-empty {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.reaction-picker--compact .react-btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.95rem;
}

.route-poi-card__body {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 1.25rem;
    align-items: start;
}

.route-poi-card__media {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.route-poi-img-edit {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-subtle);
}

.route-poi-card__figure {
    margin: 0;
}

.route-poi-card__photo-link {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

.route-poi-card__photo-caption {
    margin: 0.35rem 0 0.65rem;
    font-size: 0.8rem;
    line-height: 1.4;
    font-style: italic;
    color: var(--color-text-muted);
    text-align: left;
}

.route-poi-card__photo {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background: var(--color-bg-muted);
}

.route-poi-card__photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: var(--color-text-muted);
    font-size: 2rem;
    background: var(--color-bg-muted);
    border-radius: 10px;
}

.route-poi-card__content {
    min-width: 0;
}

.route-poi-card__text {
    font-size: 0.92rem;
    line-height: 1.65;
    text-align: justify;
    hyphens: auto;
    color: var(--color-text);
    margin: 0;
}

.route-poi-card__text--empty {
    text-align: left;
}

.route-poi-admin-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--color-border);
}

.route-poi-admin-form__inner {
    margin-top: 0.75rem;
}

@media (max-width: 767.98px) {
    .route-poi-card__head {
        flex-direction: column;
    }

    .route-poi-card__meta-block {
        text-align: left;
        width: 100%;
    }

    .route-poi-card__reactions {
        justify-content: flex-start;
    }

    .route-poi-card__body {
        grid-template-columns: 1fr;
    }

    .route-poi-card__photo {
        height: 160px;
    }
}

.route-poi-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.route-modal-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg-subtle);
}

.route-modal-gallery-img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 10px;
    object-fit: contain;
}

.route-admin-panel summary {
    cursor: pointer;
}

.route-poi-modal__text {
    font-size: 0.92rem;
    line-height: 1.65;
    text-align: justify;
    hyphens: auto;
    color: var(--color-text);
}

.route-poi-modal__text p {
    margin: 0 0 0.75rem;
}

.route-poi-modal__text p:last-child {
    margin-bottom: 0;
}

.poi-modal .modal-body img#modalImage {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

/* Карта на всю высоту блока (равна левой колонке) */
@media (min-width: 992px) {
    .route-map-layout > .col-lg-4,
    .route-map-layout > .col-lg-8 {
        display: flex;
        flex-direction: column;
    }

    .route-page .route-map-column {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    .route-page .route-map-section {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        margin-bottom: 0;
        min-height: 100%;
        overflow: hidden;
    }

    .route-page .route-map-section .map-title {
        flex: 0 0 auto;
    }

    .route-page .route-map-canvas,
    .route-page #routeMap {
        flex: 1 1 0;
        min-height: 0;
        width: 100% !important;
        height: 100% !important;
    }

    .route-page #routeMap > ymaps {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
    }
}

@media (max-width: 991.98px) {
    .route-page .route-map-section {
        display: flex;
        flex-direction: column;
    }

    .route-page .route-map-section #routeMap {
        flex: 0 0 auto;
        height: 360px !important;
        min-height: 360px;
    }
}

[data-theme="dark"] .route-page-title {
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-page-summary {
    color: var(--color-text-muted);
}

[data-theme="dark"] .route-admin-panel,
[data-theme="dark"] .route-description-block,
[data-theme="dark"] .route-sidebar-panel {
    background: var(--color-surface) !important;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .route-admin-panel h5,
[data-theme="dark"] .route-admin-panel .form-label,
[data-theme="dark"] .route-admin-panel label {
    color: var(--color-text);
}

[data-theme="dark"] .route-admin-panel .form-control,
[data-theme="dark"] .route-description-block {
    color: var(--color-text);
}

[data-theme="dark"] .route-list-card-location,
[data-theme="dark"] .route-list-card-name {
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-list-card-name.route-list-card-clamp.is-truncated:hover,
[data-theme="dark"] .route-list-card-desc.route-list-card-clamp.is-truncated:hover {
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-list-card-place-chip {
    background: rgba(110, 184, 212, 0.15);
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-list-card-place-chip--empty {
    color: transparent;
}

[data-theme="dark"] .route-list-card-reaction {
    background: var(--color-bg-subtle);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .route-poi-card__title {
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-mode-toggle .btn-outline-success {
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-theme="dark"] .route-mode-toggle .btn-outline-success.active {
    color: #fff;
}

[data-theme="dark"] .map-section .map-title,
[data-theme="dark"] .map-section .map-title h2 {
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-poi-list-btn:hover strong {
    color: var(--color-primary-light);
}

[data-theme="dark"] .route-poi-exclude-btn:hover,
[data-theme="dark"] .route-poi-exclude-btn:focus-visible {
    color: #f1aeb5;
    background: rgba(241, 174, 181, 0.12);
}

[data-theme="dark"] .route-poi-list-item.is-excluded .route-poi-exclude-btn:hover,
[data-theme="dark"] .route-poi-list-item.is-excluded .route-poi-exclude-btn:focus-visible {
    color: var(--color-primary-light);
    background: rgba(126, 200, 220, 0.12);
}

[data-theme="dark"] .route-poi-img-edit {
    background: var(--color-bg-subtle);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="dark"] .route-poi-img-edit .form-label,
[data-theme="dark"] .route-poi-admin-form .form-label {
    color: var(--color-text);
}
