/* Find My Train Bangladesh
   Signboard + paper-ticket language: ballast ink, enamel page, rail green, signal red, lamp amber. */
:root {
  --ink: #15201B;
  --page: #EEF2EC;
  --paper: #FBFCFA;
  --green: #0C6B49;
  --green-deep: #08503A;
  --red: #D93A2F;
  --amber: #F4B01C;
  --amber-soft: #FCEBC0;
  --sky: #2F7FC0;
  --steel: #55635C;
  --line: #CBD5CD;
  --ok: #178A55;
  --top-h: 56px;
  --radius: 6px;
  --maxw: 1180px;
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-size: 1rem; line-height: 1.55; font-weight: 400;
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--green); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
.top :focus-visible, .foot :focus-visible { outline-color: var(--amber); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--amber); color: var(--ink); padding: 8px 14px; z-index: 100; font-weight: 700; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

h1, h2, h3 { font-stretch: 72%; font-weight: 800; line-height: 1.04; letter-spacing: 0; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50; height: var(--top-h);
  display: flex; align-items: center; gap: 20px; padding: 0 clamp(12px, 2.4vw, 28px);
  background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-stretch: 70%; font-weight: 800; font-size: 1.35rem; }
.brand-text small { font-size: .7rem; color: #9FB3A8; letter-spacing: .04em; margin-top: 2px; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { color: #C9D6CE; text-decoration: none; padding: 8px 12px; border-radius: 5px; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: #fff; background: #25352D; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--amber); }
.topsearch { margin-left: auto; position: relative; width: min(340px, 34vw); }
.topsearch input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 5px; border: 1.5px solid #3A4D43;
  background: #1D2B24 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239FB3A8' stroke-width='2'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M13 13l4 4' stroke-linecap='round'/%3E%3C/svg%3E") 11px 50% / 16px no-repeat;
  color: #fff; font: inherit; font-size: .95rem;
}
.topsearch input::placeholder { color: #8FA399; }
.topsearch input:focus { outline: none; border-color: var(--amber); }

/* suggestions (shared by header and dock search) */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 4px; list-style: none; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--radius); max-height: min(60vh, 420px); overflow: auto; z-index: 60; }
.suggest li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--amber-soft); }
.suggest .k { grid-row: span 2; align-self: center; min-width: 2.6em; text-align: center; font-stretch: 70%; font-weight: 800; font-size: 1.05rem; border: 1.5px solid var(--ink); border-radius: 4px; padding: 1px 6px; background: #fff; }
.suggest .k.stn { background: var(--green); color: #fff; border-color: var(--green); font-size: .8rem; font-stretch: 85%; }
.suggest b { font-weight: 700; }
.suggest small { color: var(--steel); font-size: .84rem; }
.suggest .none { display: block; color: var(--steel); cursor: default; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px) 56px; }
.crumbs { padding: 16px 0 6px; font-size: .88rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0; padding: 0; color: var(--steel); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--line); }
.crumbs a { color: var(--steel); }
.page-head { padding: 22px 0 20px; max-width: 760px; }
.lede { font-size: 1.1rem; color: var(--steel); margin: 12px 0 0; max-width: 62ch; }
.band { padding: 44px 0 0; }
.band.tight { padding-top: 28px; }
.band > h2 { margin-bottom: 8px; }
.band .lede { margin: 0 0 20px; }
.prose p { max-width: 68ch; }
.prose h2 { margin: 28px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose-page .prose ul { max-width: 68ch; padding-left: 1.2em; }
.more { margin: 18px 0 0; font-weight: 600; }
.notice { background: var(--amber-soft); border: 1.5px solid var(--amber); border-radius: var(--radius); padding: 10px 14px; max-width: 62ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: #fff; color: var(--ink); }
.btn-solid { background: var(--green); border-color: var(--green); color: #fff; }
.btn-solid:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.chips a { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600; }
.chips a:hover { border-color: var(--ink); }
.chips a span { font-size: .8rem; color: var(--steel); }

/* ---------- lists ---------- */
.stub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.stub { display: grid; grid-template-columns: auto 1fr; align-items: stretch; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); text-decoration: none; color: var(--ink); overflow: hidden; }
.stub:hover { background: #fff; box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.stub-no { display: grid; place-items: center; min-width: 74px; padding: 0 10px; background: var(--green); color: #fff; font-stretch: 66%; font-weight: 800; font-size: 2.1rem; }
.stub-body { display: flex; flex-direction: column; padding: 10px 14px; line-height: 1.3; border-left: 2px dashed var(--line); }
.stub-body b { font-weight: 700; }
.stub-body span { color: var(--steel); font-size: .9rem; }
.stub-times { font-weight: 600; color: var(--ink) !important; }

.route-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.route-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.route-list a { font-weight: 600; }
.route-list span { color: var(--steel); font-size: .9rem; white-space: nowrap; }
.cols { list-style: none; margin: 0; padding: 0; columns: 3 240px; column-gap: 28px; }
.cols li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.cols span { color: var(--steel); font-size: .85rem; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.az a { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 5px; background: var(--paper); font-weight: 800; text-decoration: none; color: var(--ink); }
.az a:hover { background: var(--amber); }

/* ---------- FAQ + official ---------- */
.faq { padding-top: 48px; max-width: 800px; }
.faq h2 { margin-bottom: 14px; }
.faq details { border-top: 1.5px solid var(--ink); padding: 0; }
.faq details:last-child { border-bottom: 1.5px solid var(--ink); }
.faq summary { cursor: pointer; padding: 14px 32px 14px 0; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 10px; font-size: 1.5rem; font-weight: 400; }
.faq details[open] summary::after { content: '\2212'; }
.faq details p { margin: 0 0 16px; max-width: 64ch; color: #2C3A33; }
.official { margin-top: 48px; padding: 22px 24px; background: var(--ink); color: #E6EEE9; border-radius: var(--radius); display: grid; gap: 4px; }
.official h2 { color: #fff; font-size: 1.5rem; }
.official p { margin: 4px 0; max-width: 62ch; }
.official-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px !important; }
.official .btn { background: transparent; color: #fff; border-color: #6B7F74; }
.official .btn:hover { background: #25352D; color: #fff; }
.official .btn-solid { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.official .btn-solid:hover { background: #FFC847; color: var(--ink); }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #B7C6BD; padding: 40px clamp(14px, 3vw, 28px) 28px; margin-top: 24px; }
.foot-grid { max-width: var(--maxw); margin: 0 auto 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px; }
.foot h2 { font-size: 1.1rem; color: #fff; margin-bottom: 10px; font-stretch: 80%; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot a { color: #C9D6CE; text-decoration: none; }
.foot a:hover { color: var(--amber); text-decoration: underline; }
.foot-note { max-width: var(--maxw); margin: 0 auto 6px; font-size: .84rem; color: #8FA399; }

/* ---------- home stage ---------- */
.stage { position: relative; height: calc(100svh - var(--top-h)); min-height: 580px; max-height: 920px; background: #DCE5DE; overflow: hidden; }
.is-home .stage .mapbox { position: absolute; inset: 0; border: 0; border-radius: 0; height: auto; }
.mapbox { position: relative; background: #DCE5DE; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; height: min(74svh, 720px); min-height: 380px; }
.map-poster { position: absolute; inset: 0; display: grid; place-items: center; color: var(--steel); font-weight: 600; background:
  repeating-linear-gradient(90deg, transparent 0 79px, rgba(21,32,27,.05) 79px 80px),
  repeating-linear-gradient(0deg, transparent 0 79px, rgba(21,32,27,.05) 79px 80px), #DCE5DE; }
.mapbox.ready .map-poster { display: none; }
.mapbox .maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { font-size: 11px; }

.dock { position: absolute; z-index: 5; top: 16px; left: 16px; bottom: 16px; width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 6px 6px 0 rgba(21,32,27,.18); }
.dock-handle { display: none; }
.dock-list, .dock-detail { overflow: auto; overscroll-behavior: contain; padding: 18px 18px 20px; flex: 1; }
.dock-detail { padding: 0; }
.dock h1 { font-size: clamp(1.7rem, 2.4vw, 2.1rem); margin-bottom: 14px; }
.dock-search { position: relative; }
.dock-search input, .trip input { width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 1rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink); }
.dock-search input:focus, .trip input:focus { outline: 3px solid var(--amber); outline-offset: 0; }
.tabs { display: flex; gap: 0; margin: 16px 0 0; border-bottom: 1.5px solid var(--ink); }
.tabs button { flex: 1; min-height: 42px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--steel); cursor: pointer; border-bottom: 4px solid transparent; margin-bottom: -1.5px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }
.tabs .count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--green); color: #fff; font-size: .75rem; line-height: 1.6; vertical-align: 2px; }
.tabs .count:empty { display: none; }
.pane { padding-top: 6px; }
.hint { margin: 12px 0 0; font-size: .86rem; color: var(--steel); }

.live-list { list-style: none; margin: 0; padding: 0; }
.live-list li { border-bottom: 1px solid var(--line); }
.live-list a { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; color: var(--ink); text-decoration: none; }
.live-list a:hover { background: var(--amber-soft); }
.live-list b { display: grid; place-items: center; height: 34px; border: 1.5px solid var(--ink); border-radius: 4px; background: #fff; font-stretch: 66%; font-weight: 800; font-size: 1.15rem; }
.live-list span { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; min-width: 0; }
.live-list small { color: var(--steel); font-weight: 400; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-style: normal; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1.5px solid currentColor; }
.tag.ontime { color: var(--ok); } .tag.late { color: var(--red); } .tag.early { color: var(--sky); } .tag.stale, .tag.none { color: var(--steel); }

.trip { display: grid; gap: 6px; padding-top: 10px; }
.trip label { font-weight: 700; font-size: .9rem; }
.trip .btn { margin-top: 10px; min-height: 46px; }

/* HUD over the map */
.hud { position: absolute; z-index: 6; left: calc(16px + min(420px, 100% - 32px) + 16px); right: 16px; bottom: 34px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-group { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; }
.hud-group .chip { border-color: transparent; background: transparent; }
.hud-group .chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.hud > .chip { background: var(--paper); }
.hud > .chip[aria-pressed="true"] { background: var(--ink); }
.hud-embedded { left: 12px; right: 12px; bottom: 34px; }
.side-sticky { position: relative; }

/* ---------- ticket (train page + dock) ---------- */
.ticket { --n: 13px; filter: drop-shadow(1.5px 0 0 var(--ink)) drop-shadow(-1.5px 0 0 var(--ink)) drop-shadow(0 1.5px 0 var(--ink)) drop-shadow(0 -1.5px 0 var(--ink)); }
.ticket-main, .ticket-rest { background: var(--paper); padding: 18px 20px; }
.ticket-main {
  -webkit-mask: radial-gradient(circle var(--n) at 0 100%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 100%, #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--n) at 0 100%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 100%, #0000 97%, #000) right / 51% 100% no-repeat;
  border-radius: var(--radius) var(--radius) 0 0; display: flex; gap: 18px; align-items: center;
}
.ticket-rest {
  -webkit-mask: radial-gradient(circle var(--n) at 0 0, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 0, #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--n) at 0 0, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 0, #0000 97%, #000) right / 51% 100% no-repeat;
  border-radius: 0 0 var(--radius) var(--radius); border-top: 2px dashed var(--line); padding-top: 16px;
}
.ticket-no { margin: 0; font-stretch: 62%; font-weight: 900; font-size: clamp(3.6rem, 9vw, 5.6rem); line-height: .85; color: var(--green); letter-spacing: -.01em; }
.ticket h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.ticket h1 .num { margin-left: .3em; font-weight: 600; color: var(--steel); font-size: .6em; }
.ticket-route { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 0; font-weight: 600; }
.ticket-route .to { width: 24px; height: 8px; color: var(--red); flex: none; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .8rem; color: var(--steel); }
.facts dd { margin: 0; font-stretch: 78%; font-weight: 800; font-size: 1.35rem; line-height: 1.15; }
.facts-inline { max-width: 460px; margin-top: 18px; }
.ticket-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.days { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.days li { min-width: 38px; text-align: center; padding: 3px 4px; border-radius: 4px; font-size: .78rem; font-weight: 700; background: var(--green); color: #fff; }
.days li.off { background: transparent; color: var(--steel); border: 1.5px dashed var(--steel); text-decoration: line-through; }
.days li.today { outline: 3px solid var(--amber); outline-offset: 1px; }
.runs-today { margin: 0; font-weight: 700; font-size: .9rem; }
.runs-today.no { color: var(--red); }

.status { margin-top: 16px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 14px 18px 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.status-pill i { width: 11px; height: 11px; border-radius: 50%; background: var(--steel); }
.status-pill[data-state="live"] i { background: var(--ok); box-shadow: 0 0 0 0 rgba(23,138,85,.5); animation: ping 1.8s infinite; }
.status-pill[data-state="stale"] i { background: var(--amber); }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(23,138,85,0); } 100% { box-shadow: 0 0 0 0 rgba(23,138,85,0); } }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.status-grid .k { display: block; font-size: .8rem; color: var(--steel); }
.status-grid b { font-stretch: 78%; font-weight: 800; font-size: 1.2rem; line-height: 1.2; display: block; }
.status-grid b.late { color: var(--red); } .status-grid b.early { color: var(--sky); } .status-grid b.ontime { color: var(--ok); }

/* ---------- split layout ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0 32px; align-items: start; padding-top: 14px; }
.split-a { grid-column: 1; grid-row: 1; }
.split-b { grid-column: 1; grid-row: 2; }
.split-map { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--top-h) + 14px); }
.split-map .mapbox { height: min(calc(100svh - var(--top-h) - 28px), 760px); }

/* ---------- timetable / board ---------- */
.timetable, .board { width: 100%; border-collapse: collapse; }
.timetable th, .timetable td, .board th, .board td { padding: 0 8px; text-align: left; font-weight: 400; border: 0; }
.timetable thead th, .board thead th { white-space: nowrap; font-size: .8rem; color: var(--steel); font-weight: 600; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.timetable tbody th { position: relative; padding: 13px 8px 13px 34px; font-weight: 600; --fill: 0%; }
.timetable tbody th small, .board tbody th small { display: block; font-weight: 400; font-size: .78rem; color: var(--steel); line-height: 1.2; }
.timetable tbody th::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 4px; background: linear-gradient(to bottom, var(--green) var(--fill), var(--line) var(--fill)); }
.timetable tbody tr:first-child th::before { top: 50%; --fill: 0%; }
.timetable tbody tr:last-child th::before { bottom: 50%; }
.timetable tbody th::after { content: ''; position: absolute; left: 6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); }
.timetable tr.passed th::after { background: var(--green); border-color: var(--green); }
.timetable tr.next th::after { border-color: var(--amber); background: #fff; }
.timetable tr.next th, .timetable tr.next td { background: linear-gradient(90deg, var(--amber-soft), transparent 80%); }
.timetable tr { border-bottom: 1px solid var(--line); }
.timetable td { font-stretch: 85%; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.timetable td.eta { color: var(--steel); }
.timetable td.eta.late { color: var(--red); }
.timetable .eta-col, .timetable td.eta { display: none; }
.timetable.has-live .eta-col, .timetable.has-live td.eta { display: table-cell; }
.pip { position: absolute; left: 4px; top: var(--fill); width: 18px; height: 18px; margin-top: -9px; z-index: 2; border-radius: 4px; background: var(--amber); border: 2px solid var(--ink); transform: rotate(45deg) scale(.8); }

.board tbody tr { border-bottom: 1px solid var(--line); }
.board tbody th, .board tbody td { padding-top: 11px; padding-bottom: 11px; }
.board tbody th { font-weight: 600; }
.board td.t { font-stretch: 78%; font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.board td { color: #2C3A33; }
.board td:not(.hide-s) { white-space: nowrap; }

/* ---------- dock detail view ---------- */
.dock[data-view="detail"] .dock-list { display: none; }
.detail-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1.5px solid var(--ink); background: var(--page); position: sticky; top: 0; z-index: 3; }
.detail-head a { font-weight: 700; font-size: .9rem; }
.head-id { display: none; min-width: 0; flex: 1; margin: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.head-id b { font-stretch: 70%; font-weight: 800; font-size: 1.15rem; color: var(--green); }
.detail-body { padding: 16px 16px 24px; }
.detail-body .ticket-no { font-size: 3.4rem; }
.detail-body .ticket-main, .detail-body .ticket-rest { padding: 14px 16px; }
.detail-body h1 { font-size: 1.6rem; margin: 0; }
.detail-body .facts dd { font-size: 1.15rem; }
.detail-body .status { margin-top: 12px; }
.detail-body .band { padding-top: 18px; }
.detail-body h2 { font-size: 1.25rem; margin-bottom: 6px; }

/* map popup + markers */
.maplibregl-popup-content { font-family: inherit; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: none; }
.maplibregl-popup-content b { font-weight: 700; }
.maplibregl-popup-content small { color: var(--steel); display: block; }
.maplibregl-popup-tip { display: none; }
.maplibregl-ctrl-group { border: 1.5px solid var(--ink); border-radius: var(--radius) !important; box-shadow: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .nav a { padding: 8px 9px; }
  .topsearch { width: 220px; }
}
@media (max-width: 900px) {
  .top { height: auto; min-height: var(--top-h); flex-wrap: wrap; padding-block: 8px 4px; gap: 4px 12px; }
  .brand { order: 1; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 6px 10px; }
  .topsearch { order: 2; margin-left: 0; flex: 1; width: auto; min-width: 150px; }
  :root { --top-h: 92px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-a, .split-b, .split-map { grid-column: 1; grid-row: auto; position: static; }
  .split-map { margin: 22px 0 6px; }
  .split-map .mapbox { height: 62svh; }
  .facts { grid-template-columns: repeat(2, 1fr); }

  .stage { min-height: 0; height: calc(100svh - var(--top-h)); }
  .dock { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 58%; height: auto; border-radius: 14px 14px 0 0; border-width: 1.5px 0 0; box-shadow: none; transition: transform .28s ease; }
  .dock[data-state="peek"] { transform: translateY(calc(100% - 118px)); }
  .dock-handle { display: grid; place-items: center; width: 100%; height: 28px; border: 0; background: transparent; cursor: pointer; flex: none; }
  .dock-handle span { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
  .dock-list { padding-top: 0; }
  .dock h1 { font-size: 1.45rem; margin-bottom: 10px; }
  .hud { left: 12px; right: 56px; bottom: auto; top: 12px; justify-content: flex-start; gap: 6px; }
  #hudBack { display: none; }
  .hud-group .chip { padding: 0 10px; min-height: 30px; font-size: .85rem; }
  .head-id { display: block; }
}
@media (max-width: 520px) {
  .brand-text small { display: none; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .ticket-main { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hide-s { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.map-note { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 4; margin: 0; padding: 8px 12px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); font-weight: 600; font-size: .92rem; }
