/* reise.html: full-window map with a floating top bar, story card and timeline.
   style.css is shared with index.html; everything specific to this page lives here. */
:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --ink: #1c1c1e;
  --muted: #6b6a66;
  --line: #e8e6e1;
  --accent: #0e5a7a;
  --accent-soft: #e6f0f4;
  --chip: #f2f1ed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 8px 28px rgba(20, 20, 20, .12);
  --gap: 12px;
  --top: 64px;          /* top bar height */
  --tl: 116px;          /* timeline height */
  --card: 400px;        /* story card width */
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--accent);
}
body { display: block; height: 100vh; overflow: hidden; }
h1, .card h3, .brand-title, .kpis dt { font-family: Fraunces, Georgia, "Times New Roman", serif; }

/* map fills the window; Leaflet's own controls keep clear of the floating parts */
#map { position: fixed; inset: 0; height: auto; }
.leaflet-container { background: #e9e4d8; font-family: inherit; }
.leaflet-tile-pane { filter: saturate(.55) contrast(.96) brightness(1.04); }
.leaflet-top { top: calc(var(--top) + var(--gap) * 2); }
.leaflet-bottom { bottom: calc(var(--tl) + var(--gap) * 2); }
.leaflet-left { left: calc(var(--card) + var(--gap) * 2); }
.leaflet-top.leaflet-right .leaflet-control { margin-right: var(--gap); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { border-bottom-color: var(--line) !important; color: var(--ink) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow); }
.leaflet-popup-tip { box-shadow: none; }
.leaflet-tooltip { border: 0; border-radius: 8px; box-shadow: var(--shadow); padding: 5px 9px; font-size: 12px; color: var(--ink); }
.leaflet-control-attribution { border-radius: 8px; margin: 0 var(--gap) 0 0 !important; background: rgba(255, 255, 255, .75) !important; font-size: 10px; }

/* ---- top bar ---------------------------------------------------------------------------- */
#topbar {
  position: fixed; top: var(--gap); left: var(--gap); right: var(--gap); height: var(--top); z-index: 1000;
  display: flex; align-items: center; gap: 16px; padding: 0 12px 0 20px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-radius: var(--radius); box-shadow: var(--shadow);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title { font-size: 19px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tabs { display: flex; gap: 2px; padding: 3px; margin: 0 auto; min-width: 0; background: var(--chip); border-radius: 11px; scrollbar-width: none; }
.tabs button {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); border: 0; background: transparent;
  border-radius: 8px; padding: 7px 16px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tabs button:focus-visible, .pick button:focus-visible, .linkish:focus-visible, .icon-btn:focus-visible, .play:focus-visible, .primary:focus-visible
  { outline: 2px solid var(--accent); outline-offset: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: #d9d6cf; position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:has(input:checked) { color: var(--ink); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font: italic 600 15px Fraunces, Georgia, serif; color: var(--ink);
}
.icon-btn:hover { background: var(--chip); }

/* ---- story card --------------------------------------------------------------------------- */
#panel {
  position: fixed; z-index: 900; left: var(--gap); width: var(--card);
  top: calc(var(--top) + var(--gap) * 2); bottom: calc(var(--tl) + var(--gap) * 2);
  overflow-y: auto; padding: 20px 22px 28px; background: var(--panel); border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  scrollbar-width: thin; scrollbar-color: #d6d3cc transparent; overflow-wrap: break-word;
}
.lead { font-size: 15px; line-height: 1.55; margin: 4px 0 8px; }
.kicker { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kicker a { color: var(--accent); text-decoration: none; }

.stepper { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
.stepper button, .stepper select, .filters select {
  font: inherit; font-size: 13px; color: inherit; border: 1px solid var(--line); background: var(--panel);
  border-radius: 9px; padding: 6px 8px; min-width: 0; transition: border-color .15s, background .15s;
}
.stepper button { cursor: pointer; font-size: 18px; line-height: 1; }
.stepper button:hover, .stepper select:hover { border-color: #cfcbc2; background: #fbfaf8; }

.pick { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.pick button {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1px solid transparent; background: var(--chip); border-radius: 10px; padding: 8px 12px; transition: background .15s, border-color .15s;
}
.pick button:hover { background: #ebe9e3; }
.pick button[aria-current="true"] { background: var(--accent-soft); border-color: #bcd5df; }
.pick-title { display: block; font-size: 14px; font-weight: 500; }
.pick-meta { display: block; font-size: 12px; color: var(--muted); }
.keepers summary { font-size: 13px; }

.card { margin-top: 18px; font-size: 14px; line-height: 1.55; }
.card h3 { margin: 4px 0 10px; font-size: 28px; font-weight: 650; line-height: 1.12; letter-spacing: -.015em; }
.card .meta { color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; }
.card h4 { margin: 24px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card blockquote { margin: 0 0 8px; padding: 10px 14px; background: var(--chip); border-radius: 10px; font-size: 13.5px; line-height: 1.6; }
.card blockquote.fp { box-shadow: inset 3px 0 0 #D55E00; }
.card blockquote.press { background: #eaf4f0; margin-top: 4px; }
.card .lead-quote {
  margin: 14px 0 6px; padding: 0 0 0 16px; background: none; border-left: 3px solid #D55E00; border-radius: 0;
  font-family: Fraunces, Georgia, serif; font-size: 16.5px; line-height: 1.5; color: #2b2a28;
}
.card .cover { margin: 12px -22px 4px; }
.card .cover img { display: block; width: 100%; max-height: 260px; object-fit: cover; background: var(--chip); }
.card .cover figcaption { padding: 6px 22px 0; font-size: 11.5px; color: var(--muted); }
.card mark { background: #ffe08a; color: inherit; padding: 0 1px; }
.card .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.card .chip { background: #f7e6de; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.card .note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.card .ev { font-size: 12.5px; margin-top: 2px; }
.card .banner { background: #fbeee7; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.card .days { font-size: 13px; line-height: 2; }
.card .records .meta { margin: 0; }
.card a, .linkish, .records a, .thumbs a { color: var(--accent); text-decoration-color: rgba(14, 90, 122, .35); text-underline-offset: 2px; }
.card a:hover, .linkish:hover { text-decoration-color: currentColor; }
.linkish { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.days .linkish { margin-right: 6px; }
.plain { color: #4a4945; }

.status, .lic, .badge, .kind { display: inline-block; font-size: 11px; border-radius: 999px; padding: 0 7px; background: var(--chip); }
.s-schoenbrunn, .s-vienna { background: #dcebf2; }
.s-died { background: #ead9d9; }
.s-free { background: #e3f1ec; }

.thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thumbs li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.4; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--chip); display: block; }
.records img { border-radius: 8px; }

.bars { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 3px; height: 120px; align-items: end; }
.bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.bar .all { display: flex; flex-direction: column; justify-content: flex-end; background: #c9d8e0; border-radius: 4px 4px 0 0; overflow: hidden; }
.bar .hunt { display: block; background: #D55E00; }
.bar .lbl { font-size: 10px; color: var(--muted); text-align: center; margin-top: 3px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.key.all { background: #c9d8e0; }
.key.hunt { background: #D55E00; }

.filters { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; margin: 8px 0 4px; }
.filters select { margin-left: 4px; }
.person { border-bottom: 1px solid var(--line); padding: 8px 0; }
.person summary { margin: 0; font-size: 14px; line-height: 1.4; }
.person summary .note { display: block; margin-left: 14px; }
.person[open] { padding-bottom: 12px; }
.badge { margin-left: 4px; background: #dcebf2; font-variant-numeric: tabular-nums; }
.badge.hunt { background: #f3dcd2; }

/* ---- map boxes: layers and provenance ----------------------------------------------------- */
.map-box, .src-ctl {
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-radius: 12px; box-shadow: var(--shadow);
  padding: 9px 14px; font-size: 13px; color: var(--ink); max-height: 55vh; overflow-y: auto; scrollbar-width: thin;
}
.map-box summary, .src-ctl summary { list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; margin: 0; }
.map-box summary::-webkit-details-marker, .src-ctl summary::-webkit-details-marker { display: none; }
.map-box summary::after, .src-ctl summary::after { content: "▾"; margin-left: auto; padding-left: 10px; color: var(--muted); transition: transform .15s; }
.map-box details:not([open]) summary::after, .src-ctl details:not([open]) summary::after { transform: rotate(-90deg); }
.layers { display: grid; gap: 6px; margin-top: 10px; }
.layers label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.layers input { margin: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.dot.ring { background: none; border: 2px solid var(--c); }
.dot.dash { width: 14px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--c); }

.src-ctl details[open] { width: 300px; max-width: calc(100vw - 100px); }
.src-ctl .note { font-size: 11.5px; color: var(--muted); margin: 6px 0 8px; }
.src-mode { display: block; margin-top: 10px; cursor: pointer; }
#sources { display: grid; gap: 6px; }
#sources label { display: flex; gap: 6px; align-items: flex-start; line-height: 1.3; cursor: pointer; }
#sources .dot { margin-top: 3px; }
#sources input { margin: 1px 0 0; }
#sources .from { color: var(--muted); }
#sources .how { display: block; color: var(--muted); font-size: 11px; font-style: italic; }

/* provenance badges (research mode) */
.srcb {
  display: inline-block; font-size: 10.5px; font-weight: 500; line-height: 1.6; text-transform: none; letter-spacing: 0;
  color: #4a4945; background: var(--chip); border-radius: 999px; padding: 0 7px 0 6px; margin-left: 4px; vertical-align: 1px; white-space: nowrap;
}
.srcb::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 4px; vertical-align: 1px; }

/* Story mode (default): sources, methods and caveats stay out of the way */
body:not(.research) .srcb,
body:not(.research) .src-ctl,
body:not(.research) #panel p.note,
body:not(.research) .place-pop p.note,
body:not(.research) #tl-note { display: none; }

/* popups */
.place-pop .leaflet-popup-content { margin: 14px 16px; width: 300px; }
.place-pop .pop { margin: 0; max-height: 320px; overflow-y: auto; font-size: 13px; scrollbar-width: thin; }
.place-pop .pop h3 { font-size: 19px; margin: 0 0 2px; }
.place-pop .pop h4 { margin: 12px 0 4px; }
.place-pop .pop p { margin: 4px 0; }
.place-pop .off { opacity: 0.3; }

/* ---- timeline ------------------------------------------------------------------------------ */
#timeline {
  position: fixed; z-index: 900; left: var(--gap); right: var(--gap); bottom: var(--gap); height: var(--tl);
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 10px 18px 8px 14px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px);
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 12px;
}
.play {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: var(--ink); color: #fff;
  font-size: 15px; line-height: 44px; padding: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.play:hover { background: var(--accent); }
.tl-main { min-width: 0; }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-bottom: 14px; }
#tl-readout { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tl-readout { font-size: 14px; }
#tl-readout b { font-weight: 600; }
.tl-note { font-size: 11px; color: var(--muted); }
.tl-body { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; }
.tl-labels { display: grid; grid-template-rows: repeat(6, 10px); font-size: 9.5px; line-height: 10px; color: var(--muted); }
.tl-track { position: relative; cursor: pointer; touch-action: none; padding-bottom: 14px; }
.tl-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tl-track svg { display: block; width: 100%; height: 60px; }
.tl-months { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; }
.tl-months span { position: absolute; top: 0; font-size: 10px; line-height: 12px; color: var(--muted); padding-left: 3px; border-left: 1px solid #dedbd4; white-space: nowrap; }
.tl-cursor { position: absolute; top: -4px; height: 68px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--accent); pointer-events: none; }
.tl-cursor::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tl-hover {
  position: absolute; top: -26px; transform: translateX(-50%); background: var(--ink); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 1;
}

/* ---- welcome sheet -------------------------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px;
  background: rgba(28, 28, 30, .45); backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }
.overlay .sheet {
  width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 36px 40px 28px;
  background: var(--panel); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.overlay h1 { margin: 10px 0 12px; font-size: 38px; font-weight: 650; line-height: 1.08; letter-spacing: -.02em; }
.overlay .lead { font-size: 16px; color: #3d3c39; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.kpis div { background: var(--chip); border-radius: 12px; padding: 14px 16px; }
.kpis dt { font-size: 32px; font-weight: 650; line-height: 1; }
.kpis dd { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.primary {
  width: 100%; border: 0; border-radius: 12px; padding: 14px; cursor: pointer;
  background: var(--ink); color: #fff; font: inherit; font-size: 15px; font-weight: 600;
}
.primary:hover { background: var(--accent); }
.overlay .more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.overlay .more summary { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; }
.overlay .stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 13px; }
.overlay .stats dt { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.overlay .stats dd { margin: 0; color: var(--muted); }
.overlay .sources .plain { margin-top: 8px; font-size: 12.5px; line-height: 1.55; }

/* ---- phone: card as a bottom sheet, compact bar and timeline ------------------------------- */
@media (max-width: 760px) {
  :root { --top: 52px; --tl: 88px; --card: 0px; }
  .tl-track svg { height: 36px; }
  .tl-cursor { height: 44px; }
  #topbar { padding: 0 8px 0 12px; gap: 8px; }
  .brand { display: none; }
  .tabs { flex: 1 1 auto; }
  #tl-note { display: none; }
  #tl-readout { font-size: 12.5px; }
  .switch { font-size: 0; gap: 0; }
  .brand-title { font-size: 15px; }
  .tabs { overflow-x: auto; margin: 0; }
  .tabs button { padding: 6px 9px; font-size: 12.5px; }
  #panel { left: 0; right: 0; width: auto; top: auto; bottom: 0; height: 46vh; border-radius: 18px 18px 0 0; }
  #timeline { bottom: calc(46vh + 8px); grid-template-columns: 36px minmax(0, 1fr); }
  .play { width: 36px; height: 36px; line-height: 36px; }
  .tl-head { margin-bottom: 8px; }
  .tl-labels { display: none; }
  .tl-body { grid-template-columns: minmax(0, 1fr); }
  .leaflet-bottom { bottom: calc(46vh + var(--tl) + 20px); }
  .leaflet-left { left: 0; }
  .overlay .sheet { padding: 24px; }
  .overlay h1 { font-size: 28px; }
  .kpis dt { font-size: 24px; }
}

/* ---- icons and colour per kind of content (as on the map) --------------------------------- */
.k-diary { --k: #8c6d46; } .k-hunt { --k: #D55E00; } .k-animal { --k: #2E86C1; } .k-photo { --k: #C2549B; }
.k-object { --k: #C08000; } .k-people { --k: #5b6470; } .k-aboard { --k: #8a5cc0; } .k-press { --k: #00936A; }
.k-archive { --k: #c0392b; } .k-route { --k: #0072B2; } .k-days { --k: #6b6a66; } .k-sea { --k: #4a90b8; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--k, currentColor); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h4 { color: #4a4945; }
.card h4 .ico { width: 17px; height: 17px; vertical-align: -4px; margin-right: 7px; }
.pick-title { display: flex; align-items: center; gap: 7px; }
.pick-title .ico { width: 15px; height: 15px; }

/* facts under the place name */
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.fact { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 999px; color: #2b2a28; }
.fact .ico { width: 14px; height: 14px; }
.f-sea { background: #e4eff5; } .f-hunt { background: #fbe6db; } .f-photo { background: #f8e3ef; } .f-object { background: #f8eccd; }
.f-animal { background: #e0eef8; } .f-people { background: #eceef1; } .f-aboard { background: #eee6f7; }

/* people and animals as rows with an avatar */
.who { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.who li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14px; line-height: 1.35; }
.who .role { display: block; font-size: 12px; color: var(--muted); }
.av {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: #eceef1; color: #4d5560; font: 600 13px Fraunces, Georgia, serif;
}
.av-animal { background: #e0eef8; }
.av .ico { width: 15px; height: 15px; }
.person summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; list-style: none; cursor: pointer; }
.person summary::-webkit-details-marker { display: none; }
.person summary .av { width: 26px; height: 26px; font-size: 12px; }
.person summary .note { flex-basis: 100%; margin-left: 34px; }

/* days of a hunt as pills */
.pills { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.pill .linkish { display: inline-block; text-decoration: none; font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: #4a4945; }
.pill .linkish:hover { background: #e6e3dc; }
.pill.hd .linkish { background: #fbe6db; color: #a0400f; font-weight: 600; }

/* press entries */
.press-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.press-head b a { text-decoration: none; }
.press-head .when { font-size: 12px; color: var(--muted); }
.rel { font-size: 11px; font-weight: 500; padding: 0 7px; border-radius: 999px; }
.rel-high { background: #dff1e9; color: #00744f; }
.rel-medium { background: var(--chip); color: var(--muted); }
.card .records { gap: 12px; }

/* identifiers like Q42941 only in research mode */
body:not(.research) .card .meta [data-src="lod"] { display: none; }
.card h4 .h4-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 4px; }

/* ---- map only (body.immersive): everything but the map, its popups and the focus button slides away */
.focus-btn {
  position: fixed; z-index: 1100; top: calc(var(--gap) + (var(--top) - 36px) / 2); right: calc(var(--gap) + 12px);
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: box-shadow .3s, background .2s;
}
.focus-btn:hover { background: var(--chip); }
.focus-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.focus-btn .ico { --k: currentColor; width: 17px; height: 17px; }
.focus-btn .on { display: none; }
body.immersive .focus-btn { border-color: transparent; box-shadow: var(--shadow); }
body.immersive .focus-btn .on { display: block; }
body.immersive .focus-btn .off { display: none; }
#topbar { padding-right: 60px; }

#topbar, #panel, #timeline, .leaflet-control-zoom, .leaflet-top.leaflet-right .leaflet-control {
  transition: transform .6s cubic-bezier(.4, 0, .2, 1), opacity .45s;
}
body.immersive #topbar { transform: translateY(calc(-100% - 2 * var(--gap))); opacity: 0; pointer-events: none; }
body.immersive #panel { transform: translateX(calc(-100% - 2 * var(--gap))); opacity: 0; pointer-events: none; }
body.immersive #timeline { transform: translateY(calc(100% + 2 * var(--gap))); opacity: 0; pointer-events: none; }
body.immersive .leaflet-top.leaflet-right .leaflet-control { transform: translateX(calc(100% + 2 * var(--gap))); opacity: 0; pointer-events: none; }
body.immersive .leaflet-control-zoom { opacity: 0; pointer-events: none; }
body.immersive .leaflet-bottom { bottom: 0; }
@media (max-width: 760px) {
  #topbar { padding-right: 52px; }
  body.immersive #panel { transform: translateY(calc(100% + 2 * var(--gap))); }
  body.immersive #timeline { transform: translateY(calc(46vh + 100% + 3 * var(--gap))); }
}

/* hover on a map marker: its text in the line above the timeline, or (map only) a pill at the top */
#tl-readout .ico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
#tl-readout.is-hover { color: var(--ink); }
#tl-readout.is-hover b { color: var(--accent); }
.hover-pill {
  position: fixed; z-index: 1050; top: calc(var(--gap) + 6px); left: 50%; transform: translateX(-50%);
  display: none; max-width: calc(100vw - 140px); padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .95); box-shadow: var(--shadow); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.hover-pill .ico { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
body.immersive .hover-pill:not(:empty) { display: block; }
