/* Interactive trip map (Leaflet view) — appended styles for the route module. */
#tm-map { width: 100%; height: 100%; background: #e8eef0; border-radius: inherit; z-index: 0; }
#tm-map .leaflet-tile-pane { filter: saturate(.92) brightness(1.02); }
#tm-map .leaflet-control-attribution { font-size: 10px; opacity: .75; }

body.tm-active #route-explorer { display: none; }

.tm-wrap { display: grid; gap: 12px; margin: 4px 0 8px; }
.tm-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: .01em; }
.tm-head p { margin: 2px 0 0; font-size: .8rem; opacity: .65; }

.tm-daypills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tm-daypills::-webkit-scrollbar { display: none; }
.tm-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(15, 42, 52, .16); background: rgba(255, 255, 255, .75); color: #12333f; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .18s ease; }
.tm-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--dayc, #287b90); }
.tm-pill small { opacity: .6; font-weight: 500; }
.tm-pill.is-on { background: #12333f; color: #fdfaf3; border-color: #12333f; box-shadow: 0 6px 16px rgba(15, 42, 52, .25); }

.tm-mapbox { position: relative; height: min(70vh, 620px); border-radius: 16px; overflow: hidden; border: 1px solid rgba(15, 42, 52, .14); box-shadow: 0 10px 30px rgba(15, 42, 52, .12); background: #dfe9ec; }
.tm-leader { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 500; overflow: visible; }
.tm-leader path { fill: none; stroke: var(--leader, #287b90); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.tm-leader circle { fill: var(--leader, #287b90); stroke: #fff; stroke-width: 1.6; }

.tm-marker { background: none; border: none; }
.tm-chip { position: relative; width: 46px; height: 46px; border-radius: 50%; background: #fffdfa; border: 2.5px solid var(--chip, #287b90); box-shadow: 0 4px 12px rgba(15, 42, 52, .3); display: grid; place-items: center; transition: transform .16s ease, box-shadow .16s ease; }
.tm-chip:hover { transform: translateY(-2px) scale(1.04); }
.tm-chip.is-active { transform: scale(1.14); box-shadow: 0 0 0 5px color-mix(in srgb, var(--chip, #287b90) 32%, transparent), 0 8px 18px rgba(15, 42, 52, .35); z-index: 600; }
.tm-ico { width: 32px; height: 32px; display: block; pointer-events: none; }
.tm-ico svg { width: 100%; height: 100%; display: block; }
.tm-ord { position: absolute; right: -7px; top: -7px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #f2994a; color: #fff; font-style: normal; font-size: .66rem; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 2px 6px rgba(180, 90, 0, .4); border: 1.5px solid #fff; }

.tm-card { position: absolute; z-index: 620; right: 12px; top: 12px; width: min(320px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; background: rgba(255, 253, 247, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(15, 42, 52, .12); border-radius: 14px; box-shadow: 0 12px 34px rgba(15, 42, 52, .28); padding: 12px 14px 14px; }
.tm-card-head { display: flex; align-items: center; gap: 10px; }
.tm-card-ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1.5px solid rgba(15, 42, 52, .1); display: grid; place-items: center; box-shadow: 0 3px 8px rgba(15, 42, 52, .12); }
.tm-card-ico svg { width: 34px; height: 34px; }
.tm-card-head h4 { margin: 0; font-size: .98rem; line-height: 1.2; }
.tm-card-head small { opacity: .55; font-size: .7rem; }
.tm-close { margin-left: auto; align-self: flex-start; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(15, 42, 52, .08); font-size: 1.05rem; line-height: 1; cursor: pointer; color: #12333f; }
.tm-close:hover { background: rgba(15, 42, 52, .16); }
.tm-story { margin: 9px 0 2px; font-size: .78rem; line-height: 1.55; opacity: .8; }
.tm-cats { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 8px; }
.tm-cat { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--c, #287b90) 45%, transparent); background: color-mix(in srgb, var(--c, #287b90) 10%, #fff); color: #12333f; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; }
.tm-cat b { font-weight: 700; opacity: .55; font-size: .7rem; }
.tm-cat.is-on { background: var(--c, #287b90); border-color: var(--c, #287b90); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--c, #287b90) 35%, transparent); }
.tm-cat.is-on b { opacity: .85; color: #fff; }
.tm-items { display: grid; gap: 4px; margin-top: 4px; }
.tm-empty { font-size: .78rem; opacity: .55; margin: 8px 0; }
.tm-nav { display: inline-flex; margin-top: 10px; padding: 8px 13px; border-radius: 10px; background: #12333f; color: #fdfaf3; font-size: .78rem; font-weight: 600; text-decoration: none; }
.tm-nav:hover { background: #1c4a5c; }

.tm-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .74rem; opacity: .65; }
.tm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 22px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #397dc1, #e77e22, #618344); }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid #287b90; background: #fff; }

.tm-list { display: grid; gap: 14px; }
.tm-daygroup { background: rgba(255, 255, 255, .6); border: 1px solid rgba(15, 42, 52, .1); border-radius: 12px; padding: 10px 10px 8px; }
.tm-dayhead { margin: 0 0 6px; font-size: .82rem; display: flex; align-items: center; gap: 7px; font-weight: 700; }
.tm-dayhead i { width: 10px; height: 10px; border-radius: 50%; background: var(--dayc, #287b90); }
.tm-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: none; background: transparent; font: inherit; font-size: .82rem; text-align: left; border-radius: 8px; cursor: pointer; color: #12333f; }
.tm-row:hover { background: rgba(40, 123, 144, .1); }
.tm-row-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 700; opacity: .75; width: 42px; }
.tm-row-ico { flex: 0 0 auto; }
.tm-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-row-arrow { opacity: .35; }
.tm-dayempty { font-size: .78rem; opacity: .5; margin: 4px 8px; }

@media (max-width: 640px) {
  .tm-mapbox { height: min(64vh, 520px); }
  .tm-card { right: 8px; left: 8px; top: auto; bottom: 8px; width: auto; max-height: 44%; }
  .tm-chip { width: 42px; height: 42px; }
  .tm-ico { width: 29px; height: 29px; }
}

@media (min-width: 900px) {
  .tm-mapbox { height: 640px; }
  .tm-list { max-width: 760px; }
}
