.trip-map-page {
    --trip-map-ink: #1d2b37;
    --trip-map-muted: #71808d;
    --trip-map-line: #e5ebef;
    color: var(--trip-map-ink);
}

.trip-map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin: 8px 0 18px;
    padding: 22px 24px;
    border-radius: 14px;
    background: linear-gradient(120deg, #f3f8f8, #eaf1f6);
}

.trip-map-header h2 {
    margin: 4px 0;
    font-size: 1.65rem;
}

.trip-map-eyebrow {
    margin: 0;
    color: #638091;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.trip-map-subtitle {
    margin: 7px 0 0;
    color: var(--trip-map-muted);
}

.trip-map-fit-button {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #1769aa;
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.trip-map-fit-button:hover { background: #12558a; }

.trip-map-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    min-height: 570px;
    overflow: hidden;
    border: 1px solid var(--trip-map-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(34, 55, 70, 0.08);
}

.trip-map-sidebar {
    z-index: 1;
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding: 20px 16px 14px 20px;
    border-right: 1px solid var(--trip-map-line);
    background: #fff;
}

.trip-map-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.trip-map-sidebar-heading h3 {
    margin: 5px 0 0;
    font-size: 1.05rem;
}

.trip-map-stop-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 20px;
    background: #eef4f7;
    color: #34566d;
    font-size: 0.75rem;
    font-weight: 700;
}

.trip-map-status {
    margin: 14px 0 8px;
    color: var(--trip-map-muted);
    font-size: 0.79rem;
    line-height: 1.5;
}

.trip-map-status-error { color: #b42332; }

.trip-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 4px 0 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--trip-map-line);
}

.trip-map-filters[hidden] { display: none; }

.trip-map-filter-title {
    width: 100%;
    color: var(--trip-map-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.trip-map-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid var(--trip-map-line);
    border-radius: 20px;
    color: #40515e;
    font-size: 0.72rem;
    cursor: pointer;
}

.trip-map-filter input { margin: 0; accent-color: #1769aa; }

.trip-map-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--marker-color);
}

.trip-map-stops {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    overflow: auto;
    margin: 0;
    padding: 4px 4px 10px 0;
    list-style: none;
}

.trip-map-stop {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 7px;
    border-bottom: 1px solid #f0f3f5;
}

.trip-map-stop-number {
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--marker-color);
    box-shadow: 0 1px 5px rgba(25, 45, 60, 0.22);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.trip-map-stop-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.trip-map-stop-day {
    color: #758794;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.trip-map-stop-copy strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-map-stop-copy > span:last-of-type {
    overflow: hidden;
    color: var(--trip-map-muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trip-map-stop-copy small {
    color: #b42332;
    font-size: 0.67rem;
}

.trip-map-stop-unresolved { opacity: 0.72; }

.trip-map-focus-button {
    padding: 5px 7px;
    border: 1px solid #dce5eb;
    border-radius: 6px;
    background: #fff;
    color: #1769aa;
    font: inherit;
    font-size: 0.68rem;
    cursor: pointer;
}

.trip-map-focus-button:hover { background: #f0f6fa; }

.trip-map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding-top: 12px;
    border-top: 1px solid var(--trip-map-line);
    color: var(--trip-map-muted);
    font-size: 0.65rem;
}

.trip-map-legend-line {
    width: 20px;
    height: 0;
    border-top: 3px solid #1769aa;
}

.trip-map-legend-direct {
    margin-left: 6px;
    border-top-style: dashed;
    border-top-color: #71808d;
}

.trip-map-canvas-wrap {
    position: relative;
    min-width: 0;
    min-height: 570px;
    background: #e8eff0;
}

.trip-map-canvas {
    position: absolute;
    inset: 0;
    min-height: 570px;
    z-index: 0;
}

.trip-map-attribution-note {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 400;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.86);
    color: #4a5963;
    font-size: 0.58rem;
    pointer-events: none;
}

.trip-map-footnote {
    margin: 10px 2px;
    color: var(--trip-map-muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.trip-map-marker-icon { background: transparent; border: 0; }

.trip-map-marker {
    display: flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--marker-color);
    box-shadow: 0 2px 7px rgba(22, 42, 56, 0.35);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.trip-map-marker { line-height: 1; }

@media (max-width: 760px) {
    .trip-map-header { align-items: flex-start; flex-direction: column; padding: 17px; }
    .trip-map-header h2 { font-size: 1.35rem; }
    .trip-map-layout { grid-template-columns: 1fr; }
    .trip-map-sidebar { order: 2; max-height: 380px; border-top: 1px solid var(--trip-map-line); border-right: 0; }
    .trip-map-canvas-wrap, .trip-map-canvas { min-height: 420px; }
    .trip-map-canvas-wrap { order: 1; }
}
