.tsmt-map-widget {
    --tsmt-border: #e5e7eb;
    --tsmt-bg: #ffffff;
    --tsmt-soft: #f8fafc;
    --tsmt-text: #111827;
    --tsmt-muted: #64748b;
    --tsmt-primary: #971B31;
    --tsmt-shadow: 0 18px 45px rgba(15, 23, 42, .10);
    color: var(--tsmt-text);
}

.tsmt-map-shell {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.tsmt-map-panel {
    background: var(--tsmt-bg);
    border: 1px solid var(--tsmt-border);
    border-radius: 0;
    padding: 16px;
    box-shadow: var(--tsmt-shadow);
    min-width: 0;
}

.tsmt-map-search {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    border: 1px solid var(--tsmt-border);
    border-radius: 0;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.3;
    color: var(--tsmt-text);
    background: #fff;
}

.tsmt-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tsmt-filter {
    appearance: none;
    border: 1px solid var(--tsmt-border);
    background: var(--tsmt-soft);
    color: var(--tsmt-text);
    border-radius: 0;
    padding: 8px 11px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: .18s ease;
}

.tsmt-filter:hover,
.tsmt-filter.is-active {
    border-color: var(--tsmt-filter-color, var(--tsmt-primary));
    background: var(--tsmt-filter-color, var(--tsmt-primary));
    color: #fff;
}

.tsmt-map-list {
    display: grid;
    gap: 10px;
    max-height: 470px;
    overflow: auto;
    padding-right: 3px;
}

.tsmt-route-card {
    appearance: none;
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--tsmt-border);
    border-radius: 0;
    background: #fff;
    padding: 13px;
    cursor: pointer;
    color: var(--tsmt-text);
    transition: .18s ease;
}

.tsmt-route-card:hover,
.tsmt-route-card.is-active {
    border-color: var(--tsmt-primary);
    box-shadow: 0 10px 28px rgba(151, 27, 49, .14);
    transform: translateY(-1px);
}

.tsmt-route-card__category,
.tsmt-route-card__location,
.tsmt-route-card__meta,
.tsmt-route-card__desc {
    display: block;
}

.tsmt-route-card__category {
    font-size: 12px;
    color: var(--tsmt-primary);
    font-weight: 700;
    margin-bottom: 5px;
}

.tsmt-route-card__title {
    display: block;
    font-size: 17px;
    line-height: 1.2;
    margin-bottom: 5px;
}

.tsmt-route-card__location,
.tsmt-route-card__meta,
.tsmt-route-card__desc {
    font-size: 13px;
    line-height: 1.35;
    color: var(--tsmt-muted);
    margin-top: 4px;
}

.tsmt-map-canvas {
    min-height: 360px;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid var(--tsmt-border);
    box-shadow: var(--tsmt-shadow);
    background: var(--tsmt-map-bg, #EDE6D6);
    z-index: 0;
}

.tsmt-map-widget .leaflet-popup-content-wrapper {
    border-radius: 0;
}

.tsmt-map-widget .leaflet-bar,
.tsmt-map-widget .leaflet-bar a,
.tsmt-map-widget .leaflet-control-layers,
.tsmt-map-widget .leaflet-control-attribution {
    border-radius: 0;
}

.tsmt-popup {
    min-width: 210px;
}

.tsmt-popup__title {
    display: block;
    font-size: 16px;
    margin-bottom: 3px;
}

.tsmt-popup__category {
    display: inline-block;
    color: var(--tsmt-primary);
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 7px;
}

.tsmt-popup p {
    margin: 6px 0;
}

.tsmt-popup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.tsmt-popup__link,
.tsmt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 0;
    padding: 8px 10px;
    background: var(--tsmt-primary);
    color: #fff !important;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.tsmt-map-empty,
.tsmt-map-error,
.tsmt-map-widget__notice {
    padding: 16px;
    border: 1px solid var(--tsmt-border);
    border-radius: 0;
    background: var(--tsmt-soft);
    color: var(--tsmt-muted);
}

.tsmt-route-single-box {
    border: 1px solid var(--tsmt-border, #e5e7eb);
    border-radius: 0;
    padding: 20px;
    margin-top: 28px;
    background: #fff;
}

.tsmt-route-single-box dl {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;
    gap: 8px 18px;
}

.tsmt-route-single-box dt {
    font-weight: 700;
}

.tsmt-route-single-box dd {
    margin: 0;
}

@media (max-width: 900px) {
    .tsmt-map-shell {
        grid-template-columns: 1fr;
    }

    .tsmt-map-list {
        display: flex;
        gap: 12px;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        position: relative;
        scrollbar-width: thin;
    }

    .tsmt-map-list::after {
        content: "→";
        position: sticky;
        right: 0;
        top: 0;
        height: 100%;
        min-width: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #971B31;
        font-size: 20px;
        font-weight: 700;
        background: linear-gradient(to right, rgba(237, 230, 214, 0), #EDE6D6 60%);
        pointer-events: none;
    }

    .tsmt-route-card {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: start;
    }
}
