:root {
  color-scheme: dark;
  --ink: #0e1720;
  --panel: rgba(16, 25, 34, .96);
  --paper: #f0f3ee;
  --dim: #a3b0b7;
  --rule: rgba(198, 223, 225, .17);
  --mint: #acf3da;
  --rail-width: 322px;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --display: "Barlow Condensed", "Arial Narrow", Impact, "Liberation Sans Narrow", sans-serif;
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100%; overflow: hidden }
body { color: var(--paper); background: #397988; font: 14px/1.45 "Inter", Arial, sans-serif }
button, input { color: inherit; font: inherit }
button { cursor: pointer; border: 0 }
a { color: inherit }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px }
[hidden] { display: none !important }
#stage { position: relative; isolation: isolate; width: 100%; height: 100%; height: 100dvh; overflow: hidden }
#map, #pins, #fallback { position: absolute; inset: 0 }
#fallback { overflow: hidden; background: #397988; user-select: none }
#fallback svg { display: block; max-width: none; transform-origin: 0 0 }
#pins { pointer-events: none; overflow: hidden }
#hud, #rail, #detail, #map-controls, #attribution, .compass { position: absolute }
#hud {
  z-index: 8; inset: 0 0 auto; height: 62px; display: flex; align-items: center; gap: 39px;
  padding: 0 24px; background: #111923f5; border-bottom: 1px solid #72909370;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #f7faf3; text-decoration: none }
.brand img { width: 34px; height: 34px }
.brand > span { font: 800 17px/1.1 system-ui,sans-serif; letter-spacing: -.035em }

#hud nav { height: 100%; display: flex; align-items: stretch }
.tab-active { position: relative; display: grid; place-items: center; font: 700 11px var(--mono); letter-spacing: 1.5px }
.tab-active::after { content: ""; position: absolute; bottom: 0; width: 100%; height: 3px; background: var(--mint) }
.region-status { margin-left: auto; text-align: right; color: #e6efea; font: 700 10px/1.6 var(--mono); letter-spacing: 1.4px }
.region-status span { display: block; color: #9aabaa; font-size: 9px; font-weight: 400; letter-spacing: .8px }
#rail, #detail { background: var(--panel); border: 1px solid #b0d4ce48; box-shadow: 0 6px 22px #08131b36; backdrop-filter: blur(9px) }
#rail { z-index: 5; top: 82px; left: 22px; width: var(--rail-width); max-height: calc(100% - 111px); display: flex; flex-direction: column; overflow: hidden }
.rail-intro { flex: none; position: relative; padding: 23px 19px 17px; background: radial-gradient(ellipse at top right, #87dbae13, transparent 65%) }
.eyebrow, .list-header { font: 700 9px/1.4 var(--mono); letter-spacing: 1.35px }
.eyebrow { color: var(--mint) }
.rail-intro .eyebrow::before { content: ""; display: inline-block; width: 16px; height: 2px; background: currentColor; margin: 0 7px 3px 0 }
h1, #detail h2 { font-family: var(--display); text-transform: uppercase; margin: 0; letter-spacing: -.045em; line-height: .98 }
h1 { font-size: 51px; font-weight: 900; font-style: italic; margin: 8px 0 6px }
.rail-intro p { margin: 0; color: #bbc6c8; font-size: 12px }
#toggle-rail { display: none }
#rail-content { display: flex; flex-direction: column; min-height: 0 }
.search-wrap { flex: none; margin: 0 18px 12px; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 11px; background: #0b141a; border: 1px solid #476068 }
.search-wrap span { position: relative; display: block; width: 13px; height: 13px; border: 1.7px solid #acbec3; border-radius: 100%; font-size: 0; flex: none; transform: scale(.83) }
.search-wrap span::after { content: ""; position: absolute; bottom: -4px; right: -4px; width: 6px; height: 2px; background: #acbec3; transform: rotate(45deg) }
#search { min-width: 0; width: 100%; height: 100%; background: transparent; border: none; font-size: 12px }
#search::placeholder { color: #a7b4b9 }
.search-wrap:focus-within { border-color: var(--mint) }
#filters { flex: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 0 18px 16px }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 8px; background: #253239; color: #e1e8e7; border: 1px solid #445159; border-radius: 3px; font: 600 11px/1.2 Arial, sans-serif; min-height: 26px }
.chip svg { width: 12px; height: 12px; color: var(--accent,var(--color,var(--mint))) }
.chip:is(.active,.selected,[aria-pressed=true]) { color: #142522; background: var(--accent,var(--color,var(--mint))); border-color: transparent }
.chip:is(.active,.selected,[aria-pressed=true]) svg { color: inherit }
.list-header { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 9px 18px; border-block: 1px solid var(--rule); background: #d1e4dd08; color: #a5b6b7 }
#result-count { color: #d6dfdb; letter-spacing: .6px }
#list { overflow: auto; overscroll-behavior: contain; min-height: 0; scrollbar-width: thin; scrollbar-color: #536568 transparent }
.row { width: 100%; position: relative; display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 8px 18px; text-align: left; background: transparent; color: #edf2ed; border-bottom: 1px solid var(--rule) }
.row:hover { background: #779f961f }
.row:is(.active,.selected,[aria-current=true],[aria-pressed=true]) { background: #d6f1e712; box-shadow: inset 3px 0 var(--accent,var(--color,var(--mint))) }
.row-icon, .row > svg:first-child { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; color: var(--accent,var(--color,var(--mint))); background: #d9f9ed0a; border: 1px solid #b8e5d72a; border-radius: 5px }
.row-icon svg { width: 18px; height: 18px }
.row > svg:first-child { padding: 5px }
.row-copy { min-width: 0 }
.row strong, .row small { display: block }
.row strong { font-size: 13px; line-height: 1.35 }
.row small { font-size: 11px; margin-top: 2px; color: #aab9bd }
.row-arrow { margin-left: auto; color: #94aba9 }
.pin { position: absolute; pointer-events: auto; display: grid; place-items: center; width: 29px; height: 29px; padding: 4px; transform: translate(-50%,-50%); border-radius: 50%; background: var(--accent,var(--color,var(--mint))); color: #15212a; border: 2px solid #20313b; box-shadow: 0 0 0 1px #f6ffed83,0 2px 4px #0d202865 }
.pin > svg { width: 100%; height: 100%; display: block }
.pin:is(:hover,:focus-visible,.selected,.active,[aria-pressed=true],[aria-current=true]) { z-index: 3; box-shadow: 0 0 0 2px #f7fff2,0 0 0 5px #20313b9c,0 3px 8px #10252a80 }
#detail { z-index: 6; width: min(295px,calc(100% - 30px)); padding: 19px; border-top: 3px solid var(--accent,var(--color,var(--mint))); color: var(--paper); overflow-wrap: anywhere }
#detail h2 { margin: 6px 17px 7px 0; font-size: 29px; font-weight: 850 }
#detail p { font-size: 13px; line-height: 1.55; color: #d5deda; margin: 9px 0 }
#detail .detail-close, #detail button[aria-label*=lose] { position: absolute; right: 6px; top: 6px; color: #d5e3df; background: transparent; width: 30px; height: 30px; font-size: 20px }
#detail .tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 }
#detail .tags > * { border: 1px solid var(--rule); padding: 2px 6px; font-size: 10px; color: #cbd7d5 }
#detail a { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--mint); font-size: 12px; font-weight: 700; text-underline-offset: 3px }
#map-controls { right: 22px; bottom: 61px; z-index: 4; display: grid; border: 1px solid #d0e4da4d; box-shadow: 0 2px 8px #11252a33 }
#map-controls button { background: #121c25ef; color: #edf7ee; width: 38px; height: 37px; padding: 0; font: 23px/1 Arial; border-bottom: 1px solid var(--rule) }
#map-controls button:last-child { border: 0 }
#map-controls button:hover { background: #304441 }
.compass { right: 25px; top: 85px; z-index: 3; display: grid; justify-items: center; gap: 3px; color: white; font: 800 10px/1 var(--mono); text-shadow: 0 1px 3px #081b21 }
.compass i { width: 20px; height: 27px; background: linear-gradient(to right,#eff7e9 50%,#20313b 50%); clip-path: polygon(50% 0,95% 93%,50% 72%,5% 93%); filter: drop-shadow(0 1px 2px black) }
#attribution { z-index: 4; right: 8px; bottom: 5px; padding: 3px 5px; color: #e6eeee; background: #13212bcf; font: 9px/1.35 var(--mono); max-width: calc(100% - 16px); text-align: right }
#attribution a { text-underline-offset: 2px }
#stage > noscript { position: absolute; inset: 40% auto auto 40%; background: var(--panel); padding: 15px }
@media (max-height: 660px) and (min-width: 701px) {
  #rail { top: 72px; max-height: calc(100% - 84px) }
  .rail-intro { padding-block: 11px }
  h1 { font-size: 39px }
  #filters { margin-bottom: 10px }
}
@media (max-width: 700px) {
  #hud { height: 52px; padding: 0 13px; gap: 18px }
  .brand img { width: 28px; height: 28px }
  .brand { gap: 7px }
  .brand > span { font-size: 15px }

  .tab-active,.region-status { font-size: 8px; letter-spacing: .7px }
  .region-status span { font-size: 7px }
  #rail { top: auto; left: 8px; right: 8px; bottom: max(24px,env(safe-area-inset-bottom)); width: auto; max-height: 46dvh }
  .rail-intro { padding: 10px 13px 9px }
  .rail-intro .eyebrow { font-size: 8px }
  h1 { margin: 2px 0 0; font-size: 28px }
  .rail-intro p { display: none }
  #toggle-rail { display: block; position: absolute; top: 13px; right: 11px; padding: 6px 9px; border: 1px solid var(--rule); color: #ecf3ed; background: #24343c; font-size: 10px }
  .search-wrap { margin: 0 12px 7px; height: 32px }
  #filters { margin: 0 12px 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none }
  .chip { flex: none; min-height: 27px }
  .list-header { padding: 5px 12px }
  .row { min-height: 43px; padding: 5px 12px }
  #detail { inset: auto 8px max(24px,env(safe-area-inset-bottom)) 8px !important; transform: none !important; width: auto; max-height: 53dvh; overflow-y: auto; padding: 13px 16px }
  #detail h2 { font-size: 25px }
  #map-controls { right: 9px; top: 67px; bottom: auto }
  #map-controls button { width: 35px; height: 36px }
  .compass { top: 68px; left: 14px; right: auto }
  #attribution { right: 2px; bottom: 2px; font-size: 7px; padding: 2px 3px }
  .pin { width: 27px; height: 27px }
}
@media (max-height: 450px) and (orientation: landscape) {
  #rail { top: 59px; bottom: 12px; left: 10px; right: auto; width: 260px; max-height: none }
  #rail:has(#toggle-rail[aria-expanded=false]) { bottom: auto }
  #detail { max-width: 300px; left: auto !important; max-height: 72dvh }
}

/* Final readability and control pass. The map remains visible behind both panels. */
:root { --panel: rgba(16, 25, 34, .89) }
.rail-intro p, #search { font-size: .875rem }
.row strong { font-size: .9rem }
.row small { font-size: .78rem }
#detail p { font-size: .95rem; line-height: 1.48 }
#detail .tags > * { font-size: .75rem }
#detail a { font-size: .875rem; min-height: 38px }
#detail .detail-close { min-width: 40px; min-height: 40px }
#map { touch-action: none }
#toggle-rail { min-height: 34px }
@media (max-width:700px) {
  #search { font-size: 1rem }
  #map-controls button { width: 44px; height: 42px }
  #toggle-rail { font-size: .75rem }
}
.detail-kicker { display: inline-flex; align-items: center; gap: 8px; min-height: 20px; color: var(--accent,var(--mint)); text-transform: uppercase }
.detail-kicker svg { width: 18px; height: 18px; flex: 0 0 18px }
#detail .detail-area { margin: 8px 0 11px; color: #b3c4c8; font-size: .84rem }
.detail-score { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; margin-top: 11px; border-top: 1px solid var(--rule); color: #bcd3d4; font-size: .79rem }
.detail-score strong { color: #ecf4f2; white-space: nowrap }
.detail-season { display: grid; gap: 3px; padding: 8px 10px; margin-top: 11px; border-left: 2px solid var(--accent,var(--mint)); background:#baccc20c; line-height: 1.35; font-size: .8rem }
.detail-season strong { color: var(--accent,var(--mint)); text-transform: uppercase; font-size:.72rem; letter-spacing:.07em }
.detail-season small { color: #b3c4c8; font-size: .78rem }
#detail a.official-link { display:flex; width:fit-content; min-height:33px; text-decoration:none; border-block-end:1px solid #b4f6e76b }
#detail a.official-link:hover { color:white }
.row-arrow { font-size:0 }
.row-arrow::after { content:""; display:block; width:6px; height:6px; border-top:1.5px solid #9eb6b5; border-right:1.5px solid #9eb6b5; transform:rotate(45deg) }

/* The legend and destination list share a scroll surface on short screens. */
.rail-intro { padding: 15px 17px 12px }
.rail-intro h1 { font-size: 39px; margin: 3px 0 0 }
#filters { display: grid; gap: 1px; margin: 0 10px 10px; overflow: visible }
.legend-row { display: grid; grid-template-columns: 23px 1fr auto; gap: 8px; align-items: center;
  background: #17232c; color: #f0f3ef; border-inline-start: 3px solid transparent;
  min-height: 32px; padding: 4px 10px; text-align: left; font-size: 13px; font-weight: 650 }
.legend-row svg { width: 18px; height: 18px; color: var(--accent) }
.legend-count { color: #c6d1cf; font: 600 12px var(--mono); font-variant-numeric: tabular-nums }
.legend-row:hover { background: #314047 }
.legend-row[aria-pressed=true] { background: #e2ece5; color: #112128; border-color: #388775 }
.legend-row[aria-pressed=true] :is(svg,.legend-count) { color: inherit }
.legend-row:focus-visible, .row:focus-visible { outline: 2px solid #45baad; outline-offset: -2px }
.row[aria-pressed=true] { background: #dce8e1; color: #14252a }
.row[aria-pressed=true] :is(.row-icon,small) { color: #344a4d }
#location-mark { position: absolute; pointer-events: none; width: 0; height: 0 }
#location-mark::before, #location-mark i { content: ''; position: absolute; top: 0; left: 0;
  transform: translate(-50%, -50%); border-radius: 50% }
#location-mark::before { width: var(--diameter); height: var(--diameter); border: 1px solid #21559cb3; background: #4488e52e }
#location-mark i { width: 16px; height: 16px; background: #1976da; border: 3px solid white; box-shadow: 0 0 0 1.5px #17436e }
#location-mark { z-index: 2 }
#pins:focus-within { z-index: 3 }
#locate svg { width: 21px; vertical-align: middle }
#location-panel { position: absolute; z-index: 5; top: 74px; right: 58px; width: max-content;
  max-width: min(270px,calc(100% - var(--rail-width) - 100px)); padding: 10px 35px 10px 12px;
  background: #15222c; box-shadow: 0 3px 14px #13262a44; border-inline-start: 3px solid #83c7ff;
  font-size: 13px; color: white }
#center-location { display: block; margin-top: 6px; padding: 5px 0; background: transparent; color: var(--mint); text-decoration: underline }
#clear-location { position: absolute; top: 1px; right: 2px; width: 31px; height: 32px; background: transparent; font-size: 20px }
@media (max-height: 680px), (max-width: 700px) {
  #rail-content { overflow-y: auto; overscroll-behavior: contain }
  #list { overflow: visible; flex: none }
}
@media (max-width: 700px) {
  #rail { max-height: 56dvh }
  .rail-intro { padding: 8px 13px }
  .rail-intro h1 { font-size: 27px }
  #filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; margin: 0 10px 8px }
  .legend-row { grid-template-columns: 16px 1fr auto; gap: 5px; min-height: 36px; padding: 3px 5px; font-size: .76rem }
  .legend-row svg { width: 16px; height: 16px }
  #location-panel { right: 60px; top: 67px; max-width: calc(100% - 108px) }
}

/* Curated daily edition; keep the map visible below the controls. */
#edition-date { display:block; margin-top:5px; color:#c4d7d5; font-size:.875rem }
#when { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin:0 12px 10px; flex:none }
#when button { min-height:40px; padding:5px 2px; border:1px solid #38807170; border-radius:3px; background:#153b37a0; color:#d3f2ed; font:inherit; font-size:.875rem; font-weight:650; cursor:pointer }
#when button:hover { background:#24554c }
#when button[aria-pressed=true] { color:#102824; background:#9ce5d5; border-color:#a8f3e3; box-shadow:inset 0 -2px #497e72 }
#filters { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:8px }
.legend-row { min-width:0 }
.legend-row span:nth-child(2) { overflow-wrap:anywhere }
.row-hours { color:#9de0d2!important; margin-top:3px }
.event-time { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; font-size:.875rem }
.event-time time { color:var(--accent,var(--mint)); font-weight:700 }
.event-time span { color:#d8e7e4 }
.event-source { display:block; width:max-content; max-width:100%; color:#bfd0d0; font-size:.8125rem; margin-top:10px; text-underline-offset:3px }
@media(max-width:700px) {
  #rail { max-height:52dvh }
  #edition-date { font-size:.8125rem; margin-top:3px }
  #when { margin-bottom:7px }
  #filters { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:max-content; overflow:auto; scrollbar-width:thin; padding-bottom:2px }
}
.row:is(.selected,.active,:hover) .row-hours { color:#215b51!important }
#detail a.event-source { display:flex; color:#bfd0d0; font-size:.8125rem; min-height:30px }

/* City editions: the map brand stays fixed while local controls change. */
.hud-actions { display:flex; align-items:center; gap:7px; margin-left:auto }
.region-status { margin-left:0 }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.city-control { position:relative; display:block; color:#e7f7f1 }
.city-control svg { position:absolute; right:9px; top:50%; width:16px; height:16px; transform:translateY(-50%); pointer-events:none }
#city,#language { min-height:38px; color:#e7f7f1; background:#182d35; border:1px solid #7dc2b276; border-radius:4px; font:650 .875rem/1.15 system-ui,sans-serif; cursor:pointer }
#city { appearance:none; min-width:126px; padding:0 28px 0 10px }
#language { min-width:39px;padding:0 8px }
#city:hover,#language:hover,#toggle-rail:hover { background:#28484b }
#toggle-rail { display:block; position:absolute; z-index:1; top:27px; right:12px; min-height:38px; max-width:100px; padding:5px 8px; background:#20363d; color:#e3f2ec; border:1px solid #7dc2b276; border-radius:4px; cursor:pointer; font:650 .75rem/1.15 system-ui,sans-serif }
#rail.collapsed { width:auto; max-width:calc(100% - 16px); border-radius:4px }
#when { grid-template-columns:repeat(2,minmax(0,1fr)) }
#when button { padding-inline:4px }
@media(max-width:700px) {
  #hud { gap:6px }
  .region-status { display:none }
  #city,#language { min-height:40px; font-size:.8125rem }
  #city { min-width:0; max-width:32vw }
  .brand > span { font-size:clamp(.73rem,3.25vw,.95rem); white-space:nowrap }

  #toggle-rail { top:10px; right:8px }
  #rail.collapsed { right:auto }
}
#detail { max-height:calc(100dvh - 108px); overflow-y:auto; overscroll-behavior:contain }
[data-city]:not([data-city=vancouver]) #attribution .tile-credit:not([hidden]) { margin-left:.4em }
@media(max-width:700px) { #detail { max-height:53dvh } }

/* Compact event rail: keep filters live while giving the map more room. */
.rail-intro { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:11px 12px 10px; }
.rail-intro .edition-copy { min-width:0; }
.rail-intro #edition-region { font:700 1.125rem/1.12 system-ui,sans-serif; text-transform:none; letter-spacing:-.035em; }
.rail-intro #edition-date { margin:3px 0 0; font:500 .75rem/1.25 system-ui,sans-serif; color:#bdd1d0; }
#toggle-rail { position:static; display:inline-grid; place-items:center; flex:none; min-width:44px; width:44px; height:44px; padding:0; background:#20363d; border-radius:5px; }
#toggle-rail svg { width:22px; height:22px; }
#rail-listing { min-height:0; display:flex; flex-direction:column; overflow:hidden; }
#rail:not(.collapsed) #rail-content { overflow:hidden; }
#rail:not(.collapsed) #list { overflow-y:auto; }
.search-wrap > svg { width:18px; height:18px; flex:none; color:#b4c7c9; }
.compact-count,.compact-date { display:none; }
#rail.collapsed {
  --tile:44px; width:auto; max-width:calc(100% - 16px); right:auto; padding:3px; gap:2px;
  border-radius:5px; background:#13232bec; overflow-y:auto; scrollbar-width:thin;
}
#rail.collapsed .rail-intro,#rail.collapsed #rail-content { display:contents; }
#rail.collapsed .edition-copy,#rail.collapsed #when,#rail.collapsed .search-wrap,#rail.collapsed #rail-listing { display:none; }
#rail.collapsed #toggle-rail,#rail.collapsed .compact-date,#rail.collapsed .compact-count,#rail.collapsed .legend-row {
  flex:0 0 var(--tile); min-width:var(--tile); min-height:var(--tile); width:var(--tile); height:var(--tile);
  margin:0; padding:0; border-radius:3px;
}
#rail.collapsed #toggle-rail { order:-3; border-color:#93d0c3; background:#b1e7db; color:#102d2a; }
#rail.collapsed #toggle-rail:hover { background:#cfefe6; }
#rail.collapsed .compact-date {
  order:-2; display:grid; place-items:center; position:relative; background:#174039; color:#e3f6ee;
  border:1px solid #7dc2b276; cursor:pointer;
}
.compact-date .calendar-glyph { width:21px; height:21px; pointer-events:none; }
.compact-date .date-chevron { position:absolute; bottom:2px; right:1px; width:12px; height:12px; pointer-events:none; }
#compact-when {
  appearance:none; position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer;
}
#rail.collapsed .compact-date:focus-within { outline:2px solid #a8f3e3; outline-offset:-3px; }
#rail.collapsed .compact-count {
  order:2; display:grid; grid-template-columns:auto auto; place-content:center; align-items:center; gap:1px;
  color:#bfe9df; font:750 .8rem/1 system-ui,sans-serif; border-top:1px solid #7dc2b253;
}
.compact-count svg { width:15px; height:15px; }
#rail.collapsed #filters {
  display:flex; flex-direction:column; flex:none; width:var(--tile); margin:0; gap:2px; padding:0; overflow:visible;
}
#rail.collapsed .legend-row { display:grid; place-items:center; grid-template-columns:1fr; }
#rail.collapsed .legend-row svg { width:19px; height:19px; }
#rail.collapsed .legend-row span { display:none; }
#rail:not(.collapsed) #list { flex:1 1 auto; }
#toggle-rail:focus-visible { outline:2px solid #a8f3e3; outline-offset:-2px; }
@media (max-width:700px) and (orientation:portrait) {
  #rail.collapsed {
    width:auto; right:8px; max-width:none; height:auto; flex-direction:row; align-items:center;
    overflow:hidden; padding:3px; gap:2px;
  }
  #rail.collapsed #filters {
    flex:1 1 auto; min-width:0; width:auto; flex-direction:row; overflow:auto hidden;
    scrollbar-width:none; padding-inline-end:11px; overscroll-behavior-inline:contain; mask-image:linear-gradient(to right,black calc(100% - 11px),transparent 100%);
  }
  #rail.collapsed .compact-count { border-top:0; border-left:1px solid #7dc2b253; }
  #stage:has(#detail:not([hidden])) #rail.collapsed { visibility:hidden; }
}

/* Information is a site-level utility, not a map navigation control. */
#site-info { position:fixed; right:22px; bottom:210px; color:#e8f5ef; }
#site-info summary { width:38px; height:38px; display:grid; place-items:center; border:1px solid #9cc9be6e;
  background:#121c25f2; border-radius:4px; cursor:pointer; list-style:none; }
#site-info summary::-webkit-details-marker { display:none; }
#site-info summary svg { width:22px; height:22px; }
#site-info summary:focus-visible { outline:2px solid var(--mint); outline-offset:2px; }
#site-info[open] summary,#site-info summary:hover { background:#28484b; color:var(--mint); }
#site-info .site-info-links { position:absolute; bottom:44px; right:0; width:max-content; max-width:calc(100vw - 20px);
  display:grid; gap:2px; padding:5px; background:#142329; border:1px solid #9cc9be6e; border-radius:7px;
  box-shadow:0 9px 26px #070f19a6; }
#site-info:not([open]) .site-info-links { display:none; }
.site-info-links a { display:flex; align-items:center; color:#e4f5ef; text-decoration:none; padding:9px 12px; min-height:44px; border-radius:4px; }
.site-info-links a:hover,.site-info-links a:focus-visible { background:#28484b; }

/* A single vertical scroller lets the mobile controls give way to the event list. */
@media (max-width:700px) {
  #hud { --hud-h:58px; height:var(--hud-h); padding-inline:8px; gap:5px; }
  .brand { min-width:0; flex:1 1 auto; gap:5px; }
  .brand img { width:28px; height:28px; flex:none; }
  .brand > span { display:block; white-space:normal; text-wrap:balance; font-size:clamp(.72rem,3.28vw,.925rem); }

  .hud-actions { flex:0 0 auto; gap:4px; }
  #city,#language,#site-info summary { min-height:44px; height:44px; border-radius:6px; }
  #city { width:clamp(89px,27vw,120px); max-width:none; padding:0 21px 0 7px; font-size:.8125rem; }
  .city-control svg { right:4px; width:14px; }
  #language { min-width:44px; padding:0; }
  #site-info { position:relative; flex:0 0 44px; right:auto; bottom:auto; }
  #site-info summary { width:44px; background:#182d35; border-color:#7dc2b276; }
  #site-info .site-info-links { bottom:auto; top:calc(100% + 8px); }
  #map-controls { top:calc(58px + 10px); right:8px; border-radius:7px; overflow:hidden; }
  #map-controls button { width:44px; height:44px; }
  #location-panel { top:calc(58px + 10px); right:58px; border-radius:6px; }
  .compass { top:calc(58px + 13px); }
  #rail { border-radius:10px 10px 6px 6px; max-height:54dvh; }
  .rail-intro { padding:8px 10px 7px 12px; background:linear-gradient(105deg,#263e3b80,transparent); }
  .rail-intro #edition-region { font-size:1.16rem; }
  .rail-intro #edition-date { font-size:.77rem; }
  #toggle-rail { border-radius:6px; }
  #rail:not(.collapsed) #rail-content {
    flex:1 1 auto; overflow-y:auto; overscroll-behavior-y:contain; scrollbar-width:thin; scrollbar-color:#527c76 transparent;
    scroll-padding-block:0 8px; -webkit-overflow-scrolling:touch;
  }
  #rail:not(.collapsed) #rail-listing,#rail:not(.collapsed) #list { overflow:visible; flex:none; }
  #rail:not(.collapsed) .list-header { position:sticky; top:0; z-index:1; background:#18272e; padding-block:7px; }
  #when { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; margin-inline:10px; }
  #when button { min-height:44px; font-size:.75rem; line-height:1.15; border-radius:4px; }
  .search-wrap { height:44px; margin-inline:10px; border-radius:5px; }
  #filters { min-height:44px; gap:4px; overscroll-behavior-x:contain; }
  .legend-row { min-height:44px; padding-inline:7px; border-radius:5px; }
  .row { min-height:56px; padding-block:7px; }
  .row small { line-height:1.32; }
  #detail { display:flex; flex-direction:column; max-height:57dvh; padding:0; overflow:hidden; border-radius:10px 10px 6px 6px; }
  #detail .detail-scroll { min-height:0; overflow-y:auto; overscroll-behavior-y:contain; padding:13px 15px 15px; -webkit-overflow-scrolling:touch; }
  #detail h2 { margin-inline-end:42px; line-height:1.02; }
  #detail button.detail-close { display:grid; place-items:center; width:44px; height:44px; top:5px; right:5px;
    z-index:1; background:#1c3039; border:1px solid #7dc2b276; border-radius:7px; }
  #detail .detail-kicker { max-width:calc(100% - 44px); }
  #detail a.official-link { min-height:44px; border:1px solid #8ccfc0; border-radius:6px; padding:0 12px; background:#193d37; }
  #detail a.event-source { min-height:44px; width:fit-content; margin-top:1px; }
  #rail.collapsed {
    left:8px; right:8px; top:auto; bottom:max(24px,env(safe-area-inset-bottom)); width:auto; max-width:none;
    flex-direction:row; align-items:center; overflow:hidden; padding:3px; gap:3px; border-radius:8px;
  }
  #rail.collapsed #filters {
    flex:1 1 auto; min-width:0; width:auto; flex-direction:row; overflow:auto hidden; scrollbar-width:none;
    padding-inline-end:10px; overscroll-behavior-x:contain; touch-action:pan-x;
    mask-image:linear-gradient(to right,black calc(100% - 10px),transparent);
  }
  #rail.collapsed .compact-count { border-top:0; border-left:1px solid #7dc2b253; }
  #stage:has(#detail:not([hidden])) #rail.collapsed { visibility:hidden; }
}
@media (max-width:700px) and (max-height:450px) and (orientation:landscape) {
  #rail:not(.collapsed) { top:65px; bottom:12px; max-height:none; width:min(280px,calc(100% - 65px)); }
  #rail.collapsed { bottom:24px !important; }
  #detail { max-height:72dvh; }
}

/* A venue owns one pin and one details panel, regardless of its event count. */
.pin-count { position:absolute; left:calc(100% - 6px); bottom:calc(100% - 7px);
  min-width:16px; height:16px; padding-inline:3px; display:grid; place-items:center; border-radius:10px;
  background:#172832; border:1px solid #b1d5ca; color:#f7fff6; font:700 10px/1 var(--mono); }
#detail .detail-close { z-index:1; }
#detail .detail-scroll { scrollbar-width:thin; scrollbar-color:#527c76 transparent; }
#detail .detail-scroll > h2 { margin-right:34px; }
#detail .venue-heading h2 { margin-inline:0 38px; font-size:clamp(1.25rem,4.8vw,1.5rem); line-height:1.08; }
#detail .venue-event { border-top:1px solid var(--rule); padding:13px 0; }
#detail .venue-event:last-child { padding-bottom:2px; }
#detail .venue-event h3 { margin:6px 0 8px; font:760 1.08rem/1.15 system-ui,sans-serif; }
#detail .venue-event .detail-season { margin-top:7px; }
@media (min-width:701px) {
  #detail { width: min(325px, calc(100% - 30px)); display:flex; flex-direction:column; padding:0; overflow:hidden; }
  #detail .detail-scroll { padding:16px 18px; min-height:0; overflow-y:auto; overscroll-behavior-y:contain; }
  #detail .detail-close { background:#1c3039; border:1px solid #7dc2b276; border-radius:6px; }
}

#detail .event-share { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin-top:7px; }
#detail .event-share a { margin:0; }
#detail .event-copy { background:#193d37; color:#e2fff5; border:1px solid #8ccfc090; border-radius:5px;
  min-height:36px; padding:0 9px; font-size:.81rem; font-weight:700; }
#detail .event-copy:hover { background:#28564d; }
#detail .copy-status { font-size:.77rem; color:#b4f6e7; flex-basis:100%; }
#detail .copy-status:empty { display:none; }
#detail .manual-share { appearance:none; color:#ebfff6; background:#243c45; border:1px solid #8ccfc090;
  border-radius:4px; padding:6px; width:100%; }
@media (max-width:700px) { #detail .event-copy { min-height:44px; } }

.row-copy { flex:1; }
.row-preview { display:grid; gap:4px; margin-top:6px; }
.row-event { display:flex; align-items:baseline; gap:6px; color:inherit; font-size:.74rem; line-height:1.25; }
.row-event-date { flex:none; min-width:2.3em; opacity:.8; font-size:.88em; }
.row-event-name { min-width:0; overflow-wrap:anywhere; }
.row-event-league { flex:none; margin-inline-start:auto; opacity:.82; font:650 .63rem/1 var(--mono); }
.list-empty .chip + .chip { margin-inline-start:6px; }

/* A price toggle independent of the category and date chips. */
.search-filters { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:stretch; gap:5px; flex:none; margin:0 12px 8px; }
.search-filters .search-wrap { min-width:0; margin:0; }
.search-filters input { min-width:0; }
#free-only { min-width:58px; padding:0 9px; font:650 .78rem/1 system-ui,sans-serif; color:#d3f2ed; background:#153b37a0; border:1px solid #388071a0; border-radius:5px; cursor:pointer; }
#free-only:hover { background:#24554c; }
#free-only[aria-pressed=true] { color:#102824; background:#9ce5d5; border-color:#a8f3e3; box-shadow:inset 0 -2px #497e72; }
#free-only:focus-visible { outline:2px solid #a8f3e3; outline-offset:-2px; }
#rail.collapsed .search-filters { display:none; }
#rail.collapsed .compact-count.free-active { background:#174039; color:#e0fff6; }
@media (max-width:700px) { .search-filters { margin-inline:10px; } #free-only { min-height:44px; } }
