/* Topo page theme. Everything scoped under #topoApp (the dialog lives inside it). */
#topoApp {
  --f-head: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; --f-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-note: "Source Serif 4", Georgia, serif; --hs: 68%; --hs2: 80%; --rad: 2px; --ctl: var(--ink); --strong: var(--ink);
}
/* skins: paper (default), glacier = ice and navy like the Glacier theme, ios = native iOS grouped look */
#topoApp[data-skin="glacier"] {
  --paper: #EDF2F4; --sheet: #F8FBFC; --ink: #15324B; --route: #C94A0A; --sun: #D4A017; --slate: #4D6176; --rule: #15324B26;
  --f-head: "Bricolage Grotesque", system-ui, sans-serif; --f-body: "Hanken Grotesk", system-ui, sans-serif; --f-note: "Hanken Grotesk", system-ui, sans-serif;
  --hs: 100%; --hs2: 100%; --rad: 6px; --ctl: var(--ink); --strong: var(--ink);
}
#topoApp[data-skin="ios"] {
  --paper: #F2F2F7; --sheet: #FFFFFF; --ink: #111111; --route: #007AFF; --sun: #FF9F0A; --slate: #6C6C70; --rule: #C6C6C8;
  --f-head: -apple-system, "SF Pro Display", system-ui, sans-serif; --f-body: -apple-system, "SF Pro Text", system-ui, sans-serif; --f-note: -apple-system, "SF Pro Text", system-ui, sans-serif;
  --hs: 100%; --hs2: 100%; --rad: 12px; --ctl: #C6C6C8; --strong: #C6C6C8;
}
#topoApp {
  /* Local overrides re-skin the relocated dark controls without touching :root. */
  --paper: #E4E7E2; --sheet: #F4F5F1; --ink: #1C2B39; --route: #B83626; --sun: #E3A920; --slate: #4F5D66; --rule: #1c2b3940;
  --bg: #fff; --surface: var(--sheet); --card: var(--paper); --card-hover: #d6dad5; --border: #aab2ae;
  --text: var(--ink); --muted: var(--slate); --accent: var(--route); --accent-strong: var(--ink); --radius: 2px;
  background: var(--paper); color: var(--ink); min-height: 100dvh;
  font: 15px/1.45 var(--f-body);
  padding: 14px 16px 48px; font-variant-numeric: tabular-nums;
}
#topoApp[hidden] { display: none; }
#topoApp *, #topoApp *::before, #topoApp *::after { box-sizing: border-box; }
#topoApp :focus-visible { outline: 3px solid #1b5fd6; outline-offset: 2px; }
#topoApp button { font: inherit; color: inherit; cursor: pointer; }

/* header */
#topoApp .tp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
#topoApp .tp-brand { margin: 0 auto 0 0; font-stretch: var(--hs); font-weight: 850; font-size: 28px; line-height: 1; display: flex; align-items: center; gap: 8px; }
#topoApp .tp-tools { display: flex; gap: 6px; }
#topoApp .tp-searchrow { flex: 1 1 100%; display: flex; gap: 6px; min-width: 0; }
#topoApp .tp-search { flex: 1 1 0; min-width: 0; }
#topoApp .tp-search .search-wrap { max-width: none; min-width: 0; }
#topoApp .search-wrap input { background: #fff; border: 1px solid var(--ctl); border-radius: var(--rad); color: var(--ink); min-height: 40px; padding: 8px 10px; font-size: 15px; font-family: inherit; }
#topoApp .search-wrap input::placeholder { color: var(--slate); opacity: 1; }
#topoApp .search-wrap input:focus { border-color: var(--ink); }
#topoApp .tp-btn { min-height: 40px; padding: 6px 12px; background: transparent; border: 1px solid var(--ctl); border-radius: var(--rad); color: var(--ink); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#topoApp .tp-gear { width: 40px; padding: 0; }
#topoApp .tp-btn:hover { background: #ffffff99; }
#topoApp .tp-btn[aria-pressed=true] { background: var(--ink); color: #fff; }
#topoApp .tp-done { background: var(--ink); color: #fff; }
#topoApp .tp-dhead .tp-btn { min-height: 40px; }

/* 5-day strip */
#topoApp .tp-days { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0 0 6px; padding: 0; border-top: 2px solid var(--strong); border-bottom: 1px solid var(--rule); }
#topoApp .tp-days:empty { display: none; }
#topoApp .tp-days button { width: 100%; background: none; border: 0; border-left: 1px solid var(--rule); padding: 8px 6px; text-align: left; display: block; min-height: 64px; position: relative; }
#topoApp .tp-days li:first-child button { border-left: 0; }
#topoApp .tp-days b { font-stretch: var(--hs); font-weight: 850; font-size: 32px; display: flex; align-items: center; gap: 4px; line-height: 1.05; margin: 2px 0; }
#topoApp .wx { width: 22px; height: 22px; flex: none; color: var(--slate); }
#topoApp .tp-days span { font-size: 12.5px; color: var(--slate); display: block; }
#topoApp .tp-days button:hover { background: #ffffff66; }
#topoApp .tp-days button[aria-current=date] { background: var(--sheet); }
#topoApp .tp-days button[aria-current=date]::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 4px; background: var(--route); }
#topoApp .tp-status { min-height: 20px; font-size: 13px; color: var(--slate); margin: 0 0 10px; }
#topoApp .tp-status.bad { color: var(--route); font-weight: 600; }

/* layout */
#topoApp .tp-layout { display: grid; gap: 18px; }
#topoApp .tp-map { position: relative; }
#topoApp #topoMapSlot { position: relative; height: 240px; border: 1px solid var(--ctl); background: #cfd4cf; isolation: isolate; }
#topoApp #topoMapSlot #map { position: absolute; inset: 0; width: 100%; height: 100%; }
#topoApp .tp-maprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
#topoApp .tp-top-pick[hidden] { display: none; }
/* both map-row actions share one quiet link style */
#topoApp .tp-maprow :is(a, button) { display: inline-flex; align-items: center; min-height: 40px; padding: 0; background: none; border: 0; color: var(--route); font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#topoApp .tp-maprow :is(a, button):hover { color: var(--ink); }
#topoApp .tp-top-pick { margin-left: auto; }
#topoApp .tp-pin span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink); color: var(--ink); font-weight: 800; font-size: 12px; }
#topoApp .tp-pin.on span { background: var(--route); color: #fff; width: 32px; height: 32px; margin: -3px 0 0 -3px; font-size: 14px; }
#topoApp .leaflet-control-zoom a { background: var(--sheet); color: var(--ink); border-radius: var(--rad); }

/* index */
#topoApp .tp-index { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--strong); }
#topoApp .tp-index li { border-bottom: 1px solid var(--rule); }
#topoApp .tp-row { display: grid; grid-template-columns: 28px 1fr auto 48px; gap: 0 10px; align-items: center; width: 100%; background: none; border: 0; padding: 10px 8px 10px 12px; text-align: left; position: relative; min-height: 56px; }
#topoApp .tp-row:hover { background: #ffffff66; }
#topoApp .tp-row[aria-current=true] { background: var(--sheet); }
#topoApp .tp-row[aria-current=true]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; background: var(--route); }
#topoApp .rk { font-stretch: var(--hs); font-weight: 700; font-size: 20px; color: var(--slate); text-align: right; }
#topoApp .nm { font-weight: 650; font-size: 15.5px; line-height: 1.2; display: block; }
#topoApp .nm .fv { color: #8a6200; }
#topoApp .meta { font-size: 12.5px; color: var(--slate); display: block; }
#topoApp .dr { font-size: 13px; color: var(--slate); white-space: nowrap; }
#topoApp .sc { font-stretch: var(--hs); font-weight: 850; font-size: 30px; line-height: 1; text-align: right; }
#topoApp .tp-empty { padding: 14px 12px; color: var(--slate); font-family: var(--f-note); font-size: 16px; }
#topoApp .tp-empty button { background: none; border: 0; padding: 0; color: var(--route); text-decoration: underline; font: inherit; }

/* the guidebook page */
#topoApp .tp-page { background: var(--sheet); padding: 20px 18px 24px; box-shadow: 0 1px 0 var(--rule), 0 12px 30px -18px #1c2b3955; border-radius: var(--rad); order: -1; min-width: 0; scroll-margin-top: 8px; }
#topoApp .tp-page:focus { outline: none; }
#topoApp .tp-map { order: -2; }
#topoApp .tp-ph { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
#topoApp .tp-page h2 { font-stretch: var(--hs); font-weight: 850; font-size: clamp(30px, 9vw, 46px); line-height: .98; margin: 0; overflow-wrap: anywhere; }
#topoApp .tp-hr { display: flex; align-items: center; gap: 10px; flex: none; }
#topoApp .tp-sc2 { font-stretch: var(--hs); font-weight: 850; font-size: 26px; line-height: 1; color: var(--slate); }
#topoApp .tp-sc2 small { font-stretch: var(--hs2); font-weight: 500; font-size: 11px; }
#topoApp .tp-star { width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; line-height: 1; background: transparent; border: 1px solid var(--ctl); border-radius: var(--rad); }
#topoApp .tp-star:hover { background: #ffffff99; }
#topoApp .tp-star[aria-pressed=true] { background: var(--ink); color: var(--sun); }
#topoApp .tp-lede { margin: 10px 0 0; font-weight: 700; font-size: 17px; }
#topoApp .tp-factline { margin: 2px 0 0; color: var(--slate); font-size: 14.5px; }
#topoApp .tp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#topoApp .tp-page h4 { font-stretch: var(--hs2); font-weight: 700; font-size: 15px; margin: 14px 0 4px; color: var(--slate); }
#topoApp .tp-page h3 { font-stretch: var(--hs2); font-weight: 800; font-size: 21px; margin: 20px 0 6px; padding-top: 10px; border-top: 1px solid var(--rule); }
#topoApp .tp-cols { display: grid; gap: 0 32px; }
#topoApp .tp-cols > div { min-width: 0; }
/* one row style for every label/value list on the page: sans, ruled, label left */
#topoApp .tp-facts { display: grid; grid-template-columns: minmax(96px, auto) 1fr; margin: 0; font-size: 14.5px; }
#topoApp .tp-facts dt, #topoApp .tp-facts dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--rule); }
#topoApp .tp-facts dt { color: var(--slate); padding-right: 14px; }
/* no trailing rule on the last row of a list */
#topoApp .tp-facts:last-child dt:nth-last-child(2), #topoApp .tp-facts:last-child dd:last-child, #topoApp .tp-notes li:last-child { border-bottom: 0; }
#topoApp .tp-facts a { color: var(--route); font-weight: 600; text-underline-offset: 3px; }
#topoApp .tp-facts dd { font-weight: 600; overflow-wrap: anywhere; }
#topoApp .tp-notes { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
#topoApp .tp-notes li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); color: var(--route); font-weight: 600; }
#topoApp .tp-notes svg { width: 20px; height: 20px; flex: none; }
#topoApp .tp-cap { margin: 8px 0 0; font-size: 13.5px; color: var(--slate); }
#topoApp .tp-blk + .tp-blk { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--ctl); }
#topoApp .tp-blk h4 { margin: 0 0 8px; }
#topoApp .tp-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--slate); margin: 2px 0 0; }
#topoApp .tp-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; border: 2px solid var(--ink); }
#topoApp .tp-legend .s { background: var(--sun); }
#topoApp .tp-legend .h { background: var(--sheet); border-color: var(--slate); }
#topoApp .tp-wall { overflow-x: auto; max-width: 560px; }
#topoApp .tp-wall svg { width: 100%; height: auto; display: block; }
#topoApp .tp-prose { font: 400 16px/1.6 var(--f-note); margin: 8px 0 0; max-width: 62ch; }
#topoApp .tp-fold { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 4px; }
#topoApp .tp-fold summary { cursor: pointer; padding: 12px 0; font-stretch: var(--hs2); font-weight: 800; font-size: 21px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#topoApp .tp-fold summary::-webkit-details-marker { display: none; }
#topoApp .tp-fold summary::after { content: "+"; font-size: 24px; font-weight: 500; color: var(--slate); }
#topoApp .tp-fold[open] summary::after { content: "\2212"; }
#topoApp .tp-stack { display: flex; height: 18px; background: #1c2b3914; margin: 4px 0 12px; overflow: hidden; }
#topoApp .tp-stack i, #topoApp .tp-key i { --rain: var(--ink); --dryness: #6F8190; --thermal: var(--sun); --travel: #B9C2C6; }
#topoApp .tp-stack i.rain, #topoApp .tp-key i.rain { background: var(--rain); }
#topoApp .tp-stack i.dryness, #topoApp .tp-key i.dryness { background: var(--dryness); }
#topoApp .tp-stack i.thermal, #topoApp .tp-key i.thermal { background: var(--thermal); }
#topoApp .tp-stack i.travel, #topoApp .tp-key i.travel { background: var(--travel); }
#topoApp .tp-stack i + i { border-left: 2px solid var(--sheet); }
#topoApp .tp-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
#topoApp .tp-key li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; }
#topoApp .tp-key i { width: 14px; height: 14px; display: block; }
#topoApp .tp-key b { font-weight: 700; }
#topoApp .tp-key small { font-weight: 400; color: var(--slate); font-size: 13px; }
#topoApp .tp-trk { height: 14px; background: #1c2b3914; position: relative; display: block; }
#topoApp .tp-mod em { font-style: normal; color: var(--slate); text-align: right; font-size: 13px; }
#topoApp .tp-mod { display: grid; grid-template-columns: 104px 1fr 62px; gap: 10px; align-items: center; font-size: 13.5px; padding: 5px 0; }
#topoApp .tp-mod .tp-trk { height: 10px; background: none; border-bottom: 1px solid var(--rule); }
#topoApp .tp-mod .rg { position: absolute; top: 1px; height: 8px; background: var(--slate); opacity: .45; }
#topoApp .tp-mod .av { position: absolute; top: -2px; width: 3px; height: 14px; background: var(--ink); }
#topoApp .tp-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--slate); margin: 0 72px 0 114px; }
#topoApp .tp-links { display: flex; flex-wrap: wrap; gap: 8px; }
#topoApp .tp-links a, #topoApp .tp-links button { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border: 1px solid var(--ctl); border-radius: var(--rad); color: var(--ink); background: transparent; font-weight: 600; font-size: 14px; text-decoration: none; text-align: left; }
#topoApp .tp-links a:first-child { background: var(--ink); color: #fff; }
#topoApp .tp-links a:hover, #topoApp .tp-links button:hover { background: #ffffff99; }
#topoApp .tp-links a:first-child:hover { background: #2c3f52; }

/* dialogs (Filters, Settings): the Topo page again. Ruled rows, label left / control right, h3-style headings, all from the skin variables */
#topoApp .st-moved { display: none !important; }
#topoApp dialog { --pad: 18px; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236b7780' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
  width: min(540px, 100vw - 16px); max-height: 90dvh; margin: auto; padding: 0; background: var(--sheet); color: var(--ink); border: 0; border-top: 4px solid var(--route); border-radius: var(--rad); box-shadow: 0 20px 60px #0008; font: inherit; overflow: auto; overscroll-behavior: contain; }
#topoApp dialog[open] { animation: tp-pop .16s ease-out; }
#topoApp dialog::backdrop { background: #1c2b39b3; }
#topoApp .tp-dhead { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px var(--pad) 10px; background: var(--sheet); border-bottom: 1px solid var(--rule); }
#topoApp .tp-dhead h2 { margin: 0; font-stretch: var(--hs); font-weight: 850; font-size: 26px; line-height: 1.1; }
#topoApp .tp-controls, #topoApp #topoSetBody { padding: 2px var(--pad) calc(24px + env(safe-area-inset-bottom, 0px)); }
#topoApp .tp-controls { display: flex; flex-direction: column; }

/* shared control look */
#topoApp dialog :is(select, input[type=text], input[type=number], input[type=search]) { min-height: 44px; padding: 6px 10px; background-color: #fff; color: var(--ink); border: 1px solid var(--ctl); border-radius: var(--rad); font: inherit; font-size: 15px; }
#topoApp dialog select { width: auto; appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
#topoApp dialog input[type=range] { accent-color: var(--route); width: 100%; min-height: 32px; margin: 0; }
#topoApp dialog :is(.btn, .st-btn) { min-height: 44px; padding: 6px 14px; background: transparent; border: 1px solid var(--ctl); border-radius: var(--rad); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
#topoApp dialog :is(.btn, .st-btn):hover { background: #ffffff99; }
#topoApp dialog :is(.btn, .st-btn):disabled { opacity: .6; cursor: progress; }

/* Filters: the date and drive pills become two ruled rows (label from data-lbl, value in route) */
#topoApp .tp-controls > .popover-anchor { position: static; display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--rule); }
#topoApp .tp-controls > .popover-anchor:first-child { border-top: 2px solid var(--strong); margin-top: 8px; }
#topoApp .tp-controls > .popover-anchor::before { content: attr(data-lbl); color: var(--slate); font-size: 14.5px; }
#topoApp .tp-controls .ctrl-pill { margin-left: auto; min-height: 48px; padding: 0 0 0 8px; gap: 8px; background: none; border: 0; border-radius: var(--rad); color: var(--route); font: inherit; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; }
#topoApp .tp-controls .ctrl-pill::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
#topoApp .tp-controls .ctrl-pill.active::after { transform: rotate(225deg) translate(-2px, -2px); }
#topoApp .tp-controls .ctrl-pill .ic { width: 18px; height: 18px; }
#topoApp .tp-controls .popover { position: static; flex: 0 0 100%; width: auto; margin: 0 0 12px; padding: 12px; transform: none; max-height: none; overflow: visible; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--rad); color: var(--ink); box-shadow: none; }
#topoApp .tp-controls .popover .pop-title-row strong { color: var(--ink); }
#topoApp .tp-controls :is(.cal-quick-btn, .preset-btn, .cal-nav, .cal-day) { background: var(--sheet); border: 1px solid var(--ctl); border-radius: var(--rad); color: var(--ink); min-height: 38px; font: inherit; font-size: 13.5px; }
#topoApp .tp-controls .cal-day { border-color: transparent; background: none; }
#topoApp .tp-controls .cal-day:hover:not(:disabled) { background: var(--sheet); border-color: var(--ink); }
#topoApp .tp-controls .cal-day.today { color: var(--route); border-color: var(--route); }
#topoApp .tp-controls :is(.cal-day.selected, .preset-btn.active) { background: var(--route); border-color: var(--route); color: #fff; }
#topoApp .tp-controls .badge-dot { background: var(--route); border-radius: var(--rad); }
#topoApp .tp-controls .filter-grid { display: flex; flex-direction: column; gap: 24px; width: 100%; padding: 0; margin: 24px 0 0; }
#topoApp .tp-controls .fgroup { display: block; padding: 0; }
#topoApp .fgroup__title { text-transform: none; letter-spacing: 0; font: 800 19px/1.2 var(--f-head); font-stretch: var(--hs2); color: var(--ink); margin: 0 0 2px; padding-top: 10px; border-top: 1px solid var(--rule); }
#topoApp .tp-controls .field-row { display: block; }
#topoApp .tp-controls .field { display: flex; flex-direction: row; text-align: left; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin: 0; border-bottom: 1px solid var(--rule); }
#topoApp .tp-controls .field label, #topoApp .tp-controls .pop-title-row { font-size: 14.5px; color: var(--slate); margin: 0; }
#topoApp .tp-controls .field select { min-width: 132px; max-width: 60%; }
#topoApp .tp-controls .field-row > .field:last-child { border-bottom: 0; }
#topoApp .tp-controls .field:has(input[type=range]) { display: block; padding: 10px 0 8px; min-height: 0; }
#topoApp .tp-controls .pop-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
#topoApp .tp-controls .pop-title-row strong { font-weight: 700; color: var(--ink); }
#topoApp .tp-controls .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 4px; border: 1px solid var(--ctl); border-radius: var(--rad); overflow: hidden; background: var(--sheet); padding: 0; gap: 0; }
#topoApp .tp-controls .seg-btn { min-height: 42px; background: none; border: 0; border-radius: 0; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; }
#topoApp .tp-controls .seg-btn + .seg-btn { border-left: 1px solid var(--ctl); }
#topoApp .tp-controls .seg-btn.active { background: var(--route); color: #fff; }
#topoApp .tp-controls .chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
#topoApp .tp-controls .chip { position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; background: transparent; border: 1px solid var(--ctl); border-radius: var(--rad); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
#topoApp .tp-controls .chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#topoApp .tp-controls .chip span { color: inherit; }
#topoApp .tp-controls .chip:has(input:checked) { background: var(--route); border-color: var(--route); color: #fff; }
#topoApp .tp-controls .chip:has(input:focus-visible) { outline: 3px solid #1b5fd6; outline-offset: 2px; }
#topoApp .tp-controls #btnRefresh { order: 9; width: 100%; margin-top: 22px; min-height: 48px; color: var(--route); font-weight: 700; }

/* Settings */
#topoApp #topoSetBody .st-sec { padding: 0; margin-top: 14px; }
#topoApp #topoSetBody .st-sec:first-child { margin-top: 8px; }
#topoApp .st-h { font: 800 19px/1.2 var(--f-head); font-stretch: var(--hs2); margin: 0 0 6px; padding-top: 10px; border-top: 1px solid var(--rule); }
#topoApp .st-sec:first-child .st-h { border-top: 2px solid var(--strong); }
#topoApp .st-sec:nth-child(n+2) { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding: 8px 0; min-height: 60px; }
#topoApp .st-sec:nth-child(n+2) .st-h { border: 0; margin: 0; padding: 0; font-size: 17px; }
#topoApp .st-sec:nth-child(n+2) select { min-width: 160px; max-width: 100%; }
#topoApp .st-now { margin: 0 0 10px; color: var(--slate); font-weight: 600; }
#topoApp .st-geo { display: flex; gap: 8px; margin: 0 0 4px; }
#topoApp .st-q { flex: 1; min-width: 0; }
#topoApp .st-res { list-style: none; margin: 4px 0 0; padding: 0; }
#topoApp .st-res button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 11px 0; font: inherit; font-size: 14.5px; color: var(--ink); }
#topoApp .st-res button:hover { color: var(--route); }
#topoApp .st-cap { margin: 6px 0 8px; font-size: 13.5px; color: var(--slate); }
#topoApp .st-cap:empty { margin: 0; }
#topoApp .st-sec:first-child > .st-btn { margin-top: 6px; }
#topoApp .st-row { display: flex; flex-wrap: wrap; gap: 8px; }
#topoApp .st-sec:nth-child(n+2) :is(.st-btn, .st-pick) { margin: 0; }
#topoApp .st-sec:first-child .st-btn:not(.st-geo .st-btn) { color: var(--route); font-weight: 700; }

/* phone: bottom sheets with a sticky header */
@media (max-width: 699px) {
  #topoApp dialog { --sr: calc(var(--rad) + 12px); position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 92dvh; border-radius: var(--sr) var(--sr) 0 0; animation: none; }
  #topoApp dialog[open] { animation: tp-sheet .26s cubic-bezier(.2, .8, .2, 1); }
  #topoApp .tp-dhead { border-radius: var(--sr) var(--sr) 0 0; }
}
@keyframes tp-pop { from { opacity: 0; transform: translateY(8px); } }
@keyframes tp-sheet { from { transform: translateY(100%); } }

@media (max-width: 699px) {
  #topoApp .tp-fv { display: none; }
  #topoApp #topoMapSlot { height: 320px; }
  #topoApp .tp-mod { grid-template-columns: 84px 1fr 56px; }
  #topoApp .tp-axis { margin: 0 66px 0 94px; }
  #topoApp .tp-days b { font-size: 27px; }
  #topoApp .wx { width: 19px; height: 19px; }
}
@media (min-width: 700px) {
  #topoApp .tp-searchrow { flex: 0 1 420px; }
  #topoApp .tp-tools { order: 3; }
}
@media (min-width: 900px) {
  #topoApp { padding: 24px 32px 56px; }
  #topoApp .tp-layout { grid-template-columns: 360px 1fr; grid-template-rows: auto 1fr; align-items: start; }
  #topoApp .tp-map { grid-column: 1; grid-row: 1; }
  #topoApp .tp-index { grid-column: 1; grid-row: 2; }
  #topoApp .tp-page { grid-column: 2; grid-row: 1 / 3; padding: 28px 32px 32px; order: 0; }
  #topoApp #topoMapSlot { height: 300px; }
  #topoApp .tp-jump { display: none; }
}
@media (min-width: 1180px) {
  #topoApp .tp-cols { grid-template-columns: 1fr 300px; }
}
@media (prefers-reduced-motion: reduce) { #topoApp * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* headings use the head font */
#topoApp :is(.tp-brand, .tp-page h2, .tp-page h3, .tp-days b, .rk, .sc, .tp-fold summary, .st-h, .tp-dhead h2, .tp-sc2, .tp-page h4) { font-family: var(--f-head); }
#topoApp[data-skin="glacier"] :is(.tp-brand, .tp-page h2, .tp-days b, .sc, .rk) { font-weight: 700; letter-spacing: -.01em; }
#topoApp[data-skin="ios"] :is(.tp-brand, .tp-page h2, .tp-days b, .sc, .rk, .tp-fold summary, .tp-page h3, .st-h) { font-weight: 700; letter-spacing: -.02em; }
#topoApp .tp-ic { width: 40px; padding: 0; }

/* wall window svg takes its colours from the skin */
#topoApp .wl-sun { fill: var(--sun); }
#topoApp .wl-route { stroke: var(--route); }
#topoApp .wl-ink { fill: var(--ink); }
#topoApp .wl-mute { fill: var(--slate); }
#topoApp .wl-rain { fill: var(--route); }
#topoApp .wl-on { fill: var(--sun); stroke: var(--ink); }
#topoApp .wl-off { fill: var(--sheet); stroke: var(--slate); }

/* the map reads like the Glacier theme: washed-out tiles, quiet pins */
#topoApp .leaflet-tile-pane { filter: saturate(.3) contrast(.92) brightness(1.04); }
#topoApp .tp-pin span { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 0 1px 4px #0004; }
#topoApp .tp-pin.on span { background: var(--route); color: #fff; border-color: #fff; }

/* ios skin: grouped lists, soft controls */
#topoApp[data-skin="ios"] .tp-btn, #topoApp[data-skin="ios"] .tp-star, #topoApp[data-skin="ios"] .search-wrap input, #topoApp[data-skin="ios"] .tp-links :is(a, button) { background: #fff; color: var(--ink); }
#topoApp[data-skin="ios"] .tp-links a:first-child { background: var(--route); border-color: var(--route); color: #fff; }
#topoApp[data-skin="ios"] .tp-btn[aria-pressed=true], #topoApp[data-skin="ios"] .tp-done { background: var(--route); border-color: var(--route); color: #fff; }
#topoApp[data-skin="ios"] .tp-star[aria-pressed=true] { background: #fff; color: var(--sun); }
#topoApp[data-skin="ios"] .tp-page { box-shadow: none; }
#topoApp[data-skin="ios"] .tp-days { background: #fff; border-radius: var(--rad); border: 0; overflow: hidden; }
#topoApp[data-skin="ios"] .tp-blk + .tp-blk { border-top-color: var(--rule); }

/* the non-condensed skins need smaller big type so the five days and long crag names fit a phone */
#topoApp:not([data-skin="paper"]) .tp-days b { font-size: 21px; gap: 3px; }
#topoApp:not([data-skin="paper"]) .wx { width: 16px; height: 16px; }
#topoApp:not([data-skin="paper"]) .tp-page h2 { font-size: clamp(24px, 7vw, 32px); line-height: 1.08; overflow-wrap: break-word; }
#topoApp:not([data-skin="paper"]) .tp-days span { font-size: 12px; }

/* ios skin: grey sheet, white inset groups, blue text actions, native-looking segmented control */
#topoApp[data-skin="ios"] dialog { background: var(--paper); border-top: 0; box-shadow: 0 20px 60px #0006; }
#topoApp[data-skin="ios"] .tp-dhead { background: var(--paper); border-bottom: 0; }
#topoApp[data-skin="ios"] .tp-dhead .tp-done { background: none; border: 0; color: var(--route); font-weight: 700; font-size: 17px; padding: 6px 4px; }
#topoApp[data-skin="ios"] .tp-controls .filter-grid { gap: 18px; margin-top: 18px; }
#topoApp[data-skin="ios"] .tp-controls .fgroup, #topoApp[data-skin="ios"] #topoSetBody .st-sec, #topoApp[data-skin="ios"] .tp-controls > .popover-anchor { background: #fff; border-radius: var(--rad); padding: 0 16px; }
#topoApp[data-skin="ios"] .tp-controls > .popover-anchor { border: 0; margin: 0; border-radius: 0; }
#topoApp[data-skin="ios"] .tp-controls > .popover-anchor:first-child { border-radius: var(--rad) var(--rad) 0 0; margin-top: 8px; }
#topoApp[data-skin="ios"] .tp-controls > .popover-anchor:nth-child(2) { border-radius: 0 0 var(--rad) var(--rad); border-top: 1px solid var(--rule); }
#topoApp[data-skin="ios"] .fgroup__title, #topoApp[data-skin="ios"] .st-sec:first-child .st-h { font: 600 13px/1.2 var(--f-body); color: var(--slate); border: 0; padding-top: 12px; margin-bottom: 0; }
#topoApp[data-skin="ios"] .st-sec:nth-child(n+2) .st-h { font: 400 17px/1.2 var(--f-body); letter-spacing: 0; }
#topoApp[data-skin="ios"] #topoSetBody .st-sec { margin-top: 16px; padding: 0 16px; }
#topoApp[data-skin="ios"] #topoSetBody .st-sec:first-child { padding-bottom: 14px; }
#topoApp[data-skin="ios"] #topoSetBody .st-sec:nth-child(n+2) { border-top: 0; }
#topoApp[data-skin="ios"] .tp-controls .field-row > .field:last-child, #topoApp[data-skin="ios"] .tp-controls .chips:last-child { border-bottom: 0; }
#topoApp[data-skin="ios"] dialog :is(select, input[type=text], input[type=number], input[type=search]) { background-color: var(--paper); border-color: transparent; }
#topoApp[data-skin="ios"] .tp-controls .field select, #topoApp[data-skin="ios"] .st-sec:nth-child(n+2) select { background-color: transparent; color: var(--slate); text-align: right; text-align-last: right; padding-right: 26px; min-width: 0; }
#topoApp[data-skin="ios"] dialog :is(.btn, .st-btn) { border-color: transparent; background: var(--paper); color: var(--route); }
#topoApp[data-skin="ios"] .tp-controls #btnRefresh { background: #fff; }
#topoApp[data-skin="ios"] .tp-controls .popover { background: var(--paper); border: 0; }
#topoApp[data-skin="ios"] .tp-controls :is(.cal-quick-btn, .preset-btn, .cal-nav) { background: #fff; border-color: transparent; }
#topoApp[data-skin="ios"] .tp-controls .segmented { background: #7676801f; border: 0; padding: 2px; gap: 2px; border-radius: 9px; }
#topoApp[data-skin="ios"] .tp-controls .seg-btn { border-radius: 7px; min-height: 34px; }
#topoApp[data-skin="ios"] .tp-controls .seg-btn + .seg-btn { border-left: 0; }
#topoApp[data-skin="ios"] .tp-controls .seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #0003; }
#topoApp[data-skin="ios"] .tp-controls .chip { background: var(--paper); border-color: transparent; border-radius: 999px; }
#topoApp[data-skin="ios"] .tp-controls .chip:has(input:checked) { background: var(--route); color: #fff; }
