/* Full-screen map explorer. Colours come from the tokens in app.css. */
body.mapapp { margin: 0; height: 100vh; overflow: hidden; background: var(--bg); }
#bigmap { position: fixed; inset: var(--banner-h, 54px) 0 0 0; z-index: 0; }

.map-side {
  position: fixed; top: calc(var(--banner-h, 54px) + 12px); left: 12px; z-index: 1000; width: 330px; max-height: calc(100vh - var(--banner-h, 54px) - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-head .brand { font-size: 14px; }
.side-toggle { background: transparent; color: var(--text-2); border: 1px solid var(--line); font-size: 12px; padding: 3px 10px; }
.side-title { font-size: 18px; margin: 0; }
.side-help { color: var(--text-2); font-size: 13.5px; line-height: 1.5; margin: 4px 0 10px; }
.side-row { display: flex; gap: 10px; align-items: flex-end; margin: 10px 0 4px; }
.field.inline { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.map-search { position: relative; margin-top: 4px; }
.map-search input { width: 100%; box-sizing: border-box; }
.map-results { list-style: none; margin: 4px 0 0; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.map-results li { padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.map-results li:hover, .map-results li[aria-selected="true"] { background: var(--accent-soft); }
.map-results .tag { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.pin-btn { flex: 1; }
.pin-btn[aria-pressed="true"] { background: var(--accent-strong); box-shadow: inset 0 0 0 2px var(--on-accent); }
.link-btn { background: transparent; color: var(--accent-strong); border: 0; padding: 0; text-decoration: underline; font-size: 13px; }
.side-layers { margin-top: 12px; font-size: 13.5px; }
.side-foot { color: var(--muted); font-size: 12px; line-height: 1.5; border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 14px; }
.map-side.collapsed #sideBody { display: none; }
#sideBody { margin-top: 8px; }

/* The see-through information box */
.info-box {
  position: fixed; right: 12px; top: calc(var(--banner-h, 54px) + 12px); z-index: 999; width: 360px; max-height: calc(100vh - var(--banner-h, 54px) - 40px); overflow: auto;
  background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
  font-size: 13.5px; line-height: 1.5;
}
.info-box h2 { font-size: 17px; margin: 0 0 2px; }
.info-box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); margin: 14px 0 4px; }
.info-box .sub { color: var(--text-2); font-size: 12.5px; }
.info-box .big { font-family: var(--mono); font-size: 24px; font-weight: 500; }
.info-box ul { margin: 4px 0; padding-left: 18px; }
.info-box .kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.info-box .kv span:nth-child(even) { font-family: var(--mono); text-align: right; }
.info-box .close { position: absolute; top: 8px; right: 10px; background: transparent; color: var(--text-2); border: 0; font-size: 18px; padding: 2px 6px; }
.info-box .note { font-size: 12px; }
.info-box a.open { display: inline-block; margin-top: 8px; font-weight: 500; }

.net-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; border: 1px solid #fff; }

@media (max-width: 720px) {
  .map-side { left: 8px; right: 8px; width: auto; top: calc(var(--banner-h, 54px) + 8px); max-height: 45vh; }
  .info-box { left: 8px; right: 8px; width: auto; bottom: 8px; max-height: 45vh; }
}

/* Live trains */
.live-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 1000; max-width: min(640px, calc(100vw - 32px));
  background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.live-pill[hidden] { display: none; }
.route-list ol { margin: 4px 0 6px; padding-left: 18px; max-height: 180px; overflow: auto; }
.leaflet-popup-content .sub, .leaflet-tooltip .sub { color: var(--text-2); }
@media (max-width: 720px) { .live-pill { bottom: auto; bottom: 34px; border-radius: 12px; } }

/* Live train icons: Underground = round badge in the line colour; National Rail = headcode label by punctuality */
.train-icon { background: none; border: 0; }
.tube-train { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: var(--c);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); box-sizing: border-box; }
.tube-train svg { width: 15px; height: 15px; }
.rail-train { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 6px 0 3px; border-radius: 6px; background: var(--c); color: var(--c);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); box-sizing: border-box; white-space: nowrap; }
.rail-train svg { width: 15px; height: 15px; flex: none; }
.rail-train b { color: #fff; font: 600 11.5px/1 var(--mono); letter-spacing: 0.02em; }
.tube-train.sel, .rail-train.sel { outline: 3px solid #1374A8; outline-offset: 1px; }
.live-pill .key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin: 0 3px 0 6px; vertical-align: -1px; }

/* Site navigation lives in the banner */
.map-nav { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.map-nav a { color: var(--text-2); text-decoration: none; }
.map-nav a:hover { text-decoration: underline; color: var(--text); }
.map-nav .map-home { font-weight: 600; color: var(--on-accent); background: var(--accent); border-radius: 7px; padding: 3px 10px; }
.map-nav .map-home:hover { background: var(--accent-strong); color: var(--on-accent); text-decoration: none; }

/* One train selected: the others fade; a stop-by-stop message during the journey replay */
.train-icon { transition: opacity 0.2s; }
#bigmap.train-focus .train-icon:not(.is-sel) { opacity: 0.22; }
#bigmap.train-focus .train-icon:not(.is-sel):hover { opacity: 0.8; }
.journey-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 6px; }
.journey-btns p { margin: 0; }
.journey-btns button:not(.link-btn) { padding: 5px 12px; font-size: 13px; }
.journey-btns .ghost-btn { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 5px 9px; }
.journey-btns .ghost-btn:disabled { opacity: 0.35; cursor: default; }
.stop-msg .stop-name { font-size: 17px; font-weight: 600; margin: 2px 0; }
.stop-msg .stop-time { font-size: 14px; }
.stop-msg .stop-from { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--accent-strong); }
.stop-popup p.sub { font-size: 11.5px; margin: 6px 0 0; }

/* Top banner: site menu and layer filters */
.map-banner { position: fixed; inset: 0 0 auto 0; z-index: 1200; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); }
.map-banner .brand { font-size: 14px; white-space: nowrap; }
.layer-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.layer-menu { position: relative; font-size: 13px; }
.layer-menu summary { list-style: none; cursor: pointer; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; user-select: none; }
.layer-menu summary::-webkit-details-marker { display: none; }
.layer-menu summary::after { content: " \25BE"; color: var(--text-2); }
.layer-menu summary:hover, .layer-menu[open] summary { background: var(--accent-soft); }
.layer-menu .count { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); width: 290px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }
.menu-body label { display: flex; align-items: center; gap: 7px; padding: 5px 2px; cursor: pointer; line-height: 1.3; }
.menu-body label:has(input:disabled) { color: var(--muted); cursor: default; }
.menu-body input { margin: 0; flex: none; }
.menu-body .net-dot { margin: 0; flex: none; }
.menu-note { color: var(--text-2); font-size: 12px; line-height: 1.45; margin: 6px 0 2px; }
.menu-note:empty { display: none; }
@media (max-width: 720px) {
  .map-banner { padding: 6px 8px; gap: 4px 8px; flex-wrap: nowrap; flex-direction: column; align-items: stretch; }
  .map-banner .brand { display: none; }
  .map-nav, .layer-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: 0; white-space: nowrap; }
  .layer-menu { position: static; }
  .menu-body { left: 8px; right: 8px; top: 100%; width: auto; margin-top: 4px; max-height: 60vh; overflow: auto; }
}

/* Aircraft */
.plane-icon { background: none; border: 0; transition: opacity 0.2s; }
.plane-icon span { display: block; width: 22px; height: 22px; }
.plane-icon svg { width: 22px; height: 22px; fill: #3B3F8F; stroke: #fff; stroke-width: 1.1; paint-order: stroke; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
#bigmap.train-focus .plane-icon { opacity: 0.22; }
.leaflet-tooltip .route-note { display: inline-block; max-width: 240px; white-space: normal; font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
