#mapfirstApp, #mapfirstFilterDlg, #mapfirstSettingsDlg {
  --ink: #12202e; --mute: #58677a; --line: #dde3ea; --acc: #1c4fd8; --mfbg: #f4f7fa;
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
#mapfirstApp { position: fixed; inset: 0; overflow: hidden; background: #dfe6e3; z-index: 1; }
#mapfirstApp[hidden] { display: none; }
#mapfirstApp *, #mapfirstFilterDlg *, #mapfirstSettingsDlg * { box-sizing: border-box; }
#mapfirstApp button, #mapfirstFilterDlg button, #mapfirstSettingsDlg button { font: inherit; cursor: pointer; }
#mapfirstApp :focus-visible, #mapfirstFilterDlg :focus-visible, #mapfirstSettingsDlg :focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.mf-i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.mf-map { position: absolute; inset: 0; z-index: 0; background: #dfe6e3; }
#mapfirstApp #map { height: 100%; width: 100%; }
#mapfirstApp .leaflet-tile-pane { filter: grayscale(.55) saturate(.8) contrast(.95) brightness(1.04); }
#mapfirstApp .leaflet-container { font: inherit; }

/* pins */
.mf-pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--c); font: 700 13px Inter, system-ui, sans-serif; color: #12202e; box-shadow: 0 2px 6px #0004; transition: transform .12s; }
.mf-pin.sel { transform: scale(1.35); background: var(--c); color: #fff; }

/* floating top controls */
.mf-top { position: absolute; z-index: 500; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; }
.mf-top > * { pointer-events: auto; }
.mf-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.mf-row2 { justify-content: space-between; }
.mf-end { display: flex; gap: 8px; }
.mf-chip { cursor: default; gap: 6px; }
.mf-chip[hidden] { display: none; }
.mf-chip .wx { width: 20px; height: 20px; flex: none; color: #d98b00; }
.mf-chip small { font-weight: 500; color: var(--mute); font-size: 12.5px; }
.mf-ic { padding: 0; width: 42px; justify-content: center; flex: none; }
.mf-search { flex: 1 1 auto; min-width: 0; }
#mapfirstApp .mf-search .search-wrap { max-width: none; min-width: 0; width: 100%; }
#mapfirstApp .mf-search input { height: 42px; padding: 0 16px; border-radius: 99px; background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 2px 8px #0002; font-size: 15px; }
#mapfirstApp .mf-search input::placeholder { color: var(--mute); }
.mf-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 0 14px; height: 42px; font-weight: 600; font-size: 14px; box-shadow: 0 2px 8px #0002; white-space: nowrap; }
.mf-pill[aria-expanded=true], .mf-pill[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* panel */
.mf-panel { position: absolute; z-index: 550; left: 0; right: 0; bottom: 0; background: var(--mfbg); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px #0003; display: flex; flex-direction: column; max-height: 78%; }
.mf-panel[data-s=detail] { height: 72%; }
.mf-grab { border: 0; background: none; padding: 8px 0 4px; display: grid; place-items: center; width: 100%; }
.mf-grab i { width: 44px; height: 5px; border-radius: 3px; background: #b5c0cc; }
.mf-plist { display: flex; flex-direction: column; min-height: 0; }
.mf-plist h2 { font-size: 13px; font-weight: 600; color: var(--mute); padding: 0 16px 8px; margin: 0; display: none; }
.mf-status { margin: 0; padding: 0 16px 6px; font-size: 13px; color: var(--mute); }
.mf-status[hidden] { display: none; }
.mf-cards { display: flex; gap: 10px; overflow-x: auto; padding: 2px 12px 14px; scroll-snap-type: x proximity; }
.mf-card { scroll-snap-align: start; flex: none; width: 228px; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 8px; }
.mf-card[aria-pressed=true] { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }
.mf-t { display: flex; justify-content: space-between; gap: 8px; }
.mf-card strong { font-size: 15px; line-height: 1.25; display: block; }
.mf-card small { display: block; color: var(--mute); font-size: 12px; }
.mf-badge { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: 18px; }
.mf-kv { display: flex; gap: 12px; font-size: 13px; color: var(--mute); }
.mf-kv > span { display: inline-flex; gap: 4px; align-items: center; }
.mf-empty { padding: 12px 16px; margin: 0; color: var(--mute); font-size: 14px; flex: none; width: 100%; }
.mf-empty.warn { background: #fff1da; color: #6b3f08; border-radius: 12px; }
.mf-pdetail { display: none; min-height: 0; flex: 1; flex-direction: column; }
.mf-panel[data-s=detail] .mf-pdetail { display: flex; }
.mf-panel[data-s=detail] .mf-plist { display: none; }
.mf-dscroll { overflow: auto; padding: 0 16px 24px; flex: 1; }
.mf-back { display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; border: 0; background: none; color: var(--acc); font-weight: 600; padding: 6px 16px 8px; min-height: 40px; }
.mf-dh { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.mf-dh h2 { font-size: 22px; line-height: 1.15; margin: 0; }
.mf-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.mf-tag { display: inline-flex; gap: 5px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.mf-tag.warn { background: #fff1da; border-color: #efcf94; color: #6b3f08; }
.mf-tabs { display: flex; border-bottom: 2px solid var(--line); margin: 4px 0 14px; position: sticky; top: 0; background: var(--mfbg); z-index: 2; }
.mf-tabs button { flex: 1; border: 0; background: none; padding: 10px 4px; font-weight: 600; color: var(--mute); border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px; }
.mf-tabs button[aria-selected=true] { color: var(--acc); border-color: var(--acc); }
.mf-tp { display: none; } .mf-tp.on { display: block; }
.mf-ch { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px 6px; }
.mf-ch svg { width: 100%; height: auto; display: block; }
.mf-ch text { font: 11px Inter, system-ui, sans-serif; fill: #58677a; }
.mf-lg { display: flex; gap: 14px; font-size: 12px; color: var(--mute); margin: 8px 2px; flex-wrap: wrap; }
.mf-lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.mf-hint { font-size: 14px; margin: 10px 2px 0; }
.mf-mrow { display: grid; grid-template-columns: 96px 1fr 52px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mf-rng { position: relative; height: 8px; background: #e4e9ef; border-radius: 4px; }
.mf-rng i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--acc); }
.mf-rng b { position: absolute; top: -3px; width: 3px; height: 14px; background: var(--ink); border-radius: 2px; }
.mf-sb { display: grid; grid-template-columns: 110px 1fr 54px; gap: 10px; align-items: center; margin: 9px 0; font-size: 14px; }
.mf-sb small { color: var(--mute); font-weight: 400; }
.mf-bar { height: 12px; background: #e4e9ef; border-radius: 6px; overflow: hidden; }
.mf-bar i { display: block; height: 100%; background: var(--acc); border-radius: 6px; }
.mf-why { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: 14px; }
.mf-why li { display: flex; gap: 8px; }
.mf-why svg { color: #0b8a5f; margin-top: 2px; }
.mf-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mf-links a, .mf-links button { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--acc); font-weight: 600; font-size: 14px; text-decoration: none; }

/* desktop */
@media (min-width: 860px) {
  .mf-top { left: 424px; flex-wrap: nowrap; }
  .mf-row { display: contents; }
  .mf-end { display: contents; }
  .mf-search { flex: 1 1 auto; max-width: 420px; }
    .mf-panel { left: 12px; top: 12px; bottom: 12px; right: auto; width: 396px; border-radius: 20px; box-shadow: 0 8px 30px #0004; max-height: none; }
  .mf-panel[data-s=detail] { height: auto; }
  .mf-grab { display: none; }
  .mf-plist { flex: 1; padding-top: 16px; }
  .mf-plist h2 { display: block; }
  .mf-cards { flex-direction: column; overflow-y: auto; overflow-x: hidden; flex: 1; }
  .mf-card { width: auto; }
  .mf-back { margin-top: 8px; }
  .mf-tabs { display: none; }
  .mf-tp { display: block; margin-bottom: 22px; }
  .mf-tp::before { content: attr(data-h); display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
}
@media (max-width: 859px) {
  #mapfirstApp .leaflet-control-zoom { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mf-pin { transition: none; } .mf-cards { scroll-behavior: auto; } }


/* gear, detail header and rows (shared look with the Topo page decisions) */
.mf-dh h2 { flex: 1; min-width: 0; }
.mf-hr { display: flex; align-items: center; gap: 10px; flex: none; }
.mf-sc2 { font-weight: 700; font-size: 22px; line-height: 1; color: var(--mute); }
.mf-sc2 small { font-weight: 500; font-size: 11px; }
.mf-star { width: 44px; height: 44px; display: grid; place-items: center; font-size: 20px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; }
.mf-star[aria-pressed=true] { background: var(--ink); color: #f6c453; }
.mf-star[aria-pressed=true] svg { fill: currentColor; }
.mf-lede { margin: 8px 0 0; font-weight: 600; font-size: 16px; }
.mf-factline { margin: 2px 0 0; color: var(--mute); font-size: 14px; }
.mf-rows { display: grid; grid-template-columns: minmax(96px, auto) 1fr; margin: 12px 0 0; font-size: 14px; }
.mf-rows dt, .mf-rows dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mf-rows dt { color: var(--mute); padding-right: 14px; }
.mf-rows dd { font-weight: 600; overflow-wrap: anywhere; }
.mf-rows dt:nth-last-child(2), .mf-rows dd:last-child { border-bottom: 0; }
.mf-rows a { color: var(--acc); text-underline-offset: 3px; }
.mf-nav { font-size: 15px; margin: 18px 0 0; }
.mf-links { margin-top: 8px; }
.mf-tabs button { font-size: 13px; padding: 10px 4px; white-space: nowrap; flex: 1 1 auto; }
.mf-pop .wx, .mf-wxt .wx { width: 20px; height: 20px; flex: none; color: var(--mute); }
.mf-wxt { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 20px; }

#mapfirstApp .st-moved, #mapfirstFilterDlg .st-moved { display: none; }

/* ===== dialogs: light map-app cards, pills, bottom sheet on phone ===== */
#mapfirstFilterDlg, #mapfirstSettingsDlg {
  --card: #fff; --fld: #cdd7e1; --seg: #e8eef5;
  width: min(520px, calc(100vw - 24px)); max-width: none; max-height: 88dvh; margin: auto; padding: 0; border: 0; border-radius: 20px;
  background: var(--mfbg); color: var(--ink); overflow: auto; box-shadow: 0 20px 60px #0007; overscroll-behavior: contain;
}
#mapfirstFilterDlg::backdrop, #mapfirstSettingsDlg::backdrop { background: #0b1620a6; }
.mf-dhead { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px 20px; background: var(--mfbg); border-radius: 20px 20px 0 0; }
.mf-dhead h2 { margin: 0 auto 0 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; min-width: 0; }
#mfDlgClose, #mfSetClose { min-height: 40px; padding: 0 22px; color: #fff; background: var(--acc); border: 0; border-radius: 99px; font-weight: 600; box-shadow: 0 2px 8px #1c4fd855; }
#mfDlgClose:hover, #mfSetClose:hover { background: #1741b3; }
.mf-dbody { position: relative; padding: 4px 16px 24px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; min-height: 0; }

/* shared controls: pills, selects, segmented, chips */
#mapfirstFilterDlg :is(.ctrl-pill, .seg-btn, .chip, .btn, .preset-btn, .cal-quick-btn, .cal-nav, .cal-day) { font-family: inherit; }
#mapfirstFilterDlg .popover-anchor { position: static; flex: 1 1 calc(50% - 4px); min-width: 0; display: block; }
#mapfirstFilterDlg .ctrl-pill { width: 100%; height: 46px; justify-content: flex-start; gap: 8px; padding: 0 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 99px; font-size: 15px; font-weight: 600; box-shadow: 0 1px 4px #12202e1a; overflow: hidden; }
#mapfirstFilterDlg .ctrl-pill span { overflow: hidden; text-overflow: ellipsis; }
#mapfirstFilterDlg .ctrl-pill::after { content: ""; margin-left: auto; flex: none; width: 14px; height: 14px; background: currentColor; opacity: .55; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; }
#mapfirstFilterDlg .ctrl-pill .ic { width: 18px; height: 18px; flex: none; color: var(--acc); }
#mapfirstFilterDlg .ctrl-pill:hover, #mapfirstFilterDlg .ctrl-pill.active { border-color: var(--acc); background: #fff; color: var(--ink); }

#mapfirstFilterDlg .filter-grid { width: 100%; display: grid; grid-template-columns: 1fr; gap: 34px; padding: 34px 0 6px; margin: 0; }
#mapfirstFilterDlg .fgroup { position: relative; gap: 14px; padding: 16px; background: var(--card); border-radius: 16px; box-shadow: 0 1px 3px #12202e14, 0 4px 14px #12202e0d; }
#mapfirstFilterDlg .fgroup__title { position: absolute; left: 6px; top: -25px; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--mute); }
#mapfirstFilterDlg .field { gap: 6px; min-width: 0; }
#mapfirstFilterDlg .field label, #mapfirstFilterDlg .pop-title-row { font-size: 13px; font-weight: 500; color: var(--mute); }
#mapfirstFilterDlg .pop-title-row strong, #mapfirstFilterDlg .popover .pop-title-row strong { color: var(--acc); font-size: 14px; font-weight: 700; }
#mapfirstFilterDlg .field-row { grid-template-columns: 1fr 1fr; gap: 10px; }
#mapfirstFilterDlg .field-row .field:nth-child(3) { grid-column: 1 / -1; }
#mapfirstFilterDlg select { appearance: none; -webkit-appearance: none; width: 100%; height: 44px; padding: 0 38px 0 16px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358677a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat; color: var(--ink); border: 1px solid var(--fld); border-radius: 99px; font: inherit; font-size: 15px; text-overflow: ellipsis; }
#mapfirstFilterDlg select:hover { border-color: #9fb0c3; }
#mapfirstFilterDlg input[type=range] { height: 28px; accent-color: var(--acc); margin: 2px 0 0; }
#mapfirstFilterDlg .segmented, #mapfirstFilterDlg .preset-row { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 2px; padding: 3px; background: var(--seg); border: 0; border-radius: 99px; }
#mapfirstFilterDlg .preset-row { --n: 4; }
#mapfirstFilterDlg :is(.seg-btn, .preset-btn) { min-height: 40px; padding: 0 6px; background: transparent; color: #1d2f44; border: 0; border-radius: 99px; font-size: 14px; font-weight: 600; white-space: nowrap; }
#mapfirstFilterDlg :is(.seg-btn.active, .preset-btn.active) { background: var(--acc); color: #fff; box-shadow: 0 1px 4px #1c4fd866; }
#mapfirstFilterDlg .preset-btn:hover:not(.active) { background: #fff; color: var(--acc); border: 0; }
#mapfirstFilterDlg .chips { gap: 8px; }
#mapfirstFilterDlg .chip { position: relative; min-height: 40px; padding: 0 16px; gap: 0; background: #fff; color: #1d2f44; border: 1px solid var(--fld); border-radius: 99px; font-size: 14px; font-weight: 600; }
#mapfirstFilterDlg .chip input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
#mapfirstFilterDlg .chip:has(input:checked) { background: var(--acc); border-color: var(--acc); color: #fff; }
#mapfirstFilterDlg .chip:has(input:focus-visible) { outline: 3px solid var(--acc); outline-offset: 2px; }
#mapfirstFilterDlg .btn { min-height: 44px; padding: 0 20px; border-radius: 99px; font-size: 14px; font-weight: 600; }
#mapfirstFilterDlg .btn--ghost { background: #fff; color: var(--acc); border: 1.5px solid var(--acc); width: 100%; }
#mapfirstFilterDlg .btn--ghost:hover { background: #eef3ff; }
#mapfirstFilterDlg > .mf-dbody > #btnRefresh { margin-top: 16px; }

/* calendar and drive popovers: white cards right under the pill row, full dialog width */
#mapfirstFilterDlg .popover { position: absolute; left: 16px; right: 16px; top: 58px; width: auto; z-index: 20; padding: 14px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 36px #12202e40; }
#mapfirstFilterDlg .popover.hidden { display: none; }
#mapfirstFilterDlg .cal-quick { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
#mapfirstFilterDlg .cal-quick-btn { min-height: 38px; padding: 0 4px; background: var(--seg); color: #1d2f44; border: 0; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
#mapfirstFilterDlg .cal-quick-btn:hover { background: var(--acc); color: #fff; }
#mapfirstFilterDlg .cal-header { margin-bottom: 8px; }
#mapfirstFilterDlg .cal-month { font-size: 15px; font-weight: 700; }
#mapfirstFilterDlg .cal-nav { width: 38px; height: 38px; display: grid; place-items: center; background: var(--seg); color: #1d2f44; border: 0; border-radius: 50%; font-size: 18px; }
#mapfirstFilterDlg .cal-weekdays span { font-size: 12px; color: var(--mute); }
#mapfirstFilterDlg .cal-days, #mapfirstFilterDlg .cal-weekdays { gap: 2px; }
#mapfirstFilterDlg .cal-day { height: 38px; padding: 0; color: var(--ink); border-radius: 50%; font-size: 14px; }
#mapfirstFilterDlg .cal-day:hover:not(:disabled) { background: var(--seg); border-color: transparent; }
#mapfirstFilterDlg .cal-day.today { border-color: var(--acc); color: var(--acc); }
#mapfirstFilterDlg .cal-day.selected { background: var(--acc); color: #fff; }
#mapfirstFilterDlg .popover--drive { display: flex; flex-direction: column; gap: 12px; }

/* settings: same card language */
#mapfirstSettingsDlg .mf-dbody { display: block; padding-top: 32px; }
#mapfirstSettingsDlg .st { display: grid; gap: 10px; }
#mapfirstSettingsDlg .st-sec { position: relative; padding: 16px; background: var(--card); border-radius: 16px; box-shadow: 0 1px 3px #12202e14, 0 4px 14px #12202e0d; min-width: 0; }
#mapfirstSettingsDlg .st-h { position: absolute; left: 6px; top: -25px; margin: 0; padding: 0; border: 0; font-size: 14px; font-weight: 600; color: var(--mute); }
#mapfirstSettingsDlg .st-sec:is([data-st-sec="theme"], [data-st-sec="lang"]) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; }
#mapfirstSettingsDlg .st-sec:is([data-st-sec="theme"], [data-st-sec="lang"]) .st-h { position: static; font-size: 15px; font-weight: 600; color: var(--ink); flex: none; }
#mapfirstSettingsDlg .st-sec:is([data-st-sec="theme"], [data-st-sec="lang"]) :is(.st-pick, .st-lang) { flex: 0 1 58%; min-width: 0; }
#mapfirstSettingsDlg .st-now { margin: 0 0 12px; font-weight: 600; font-size: 15px; }
#mapfirstSettingsDlg .st-geo { display: flex; gap: 8px; }
#mapfirstSettingsDlg .st-q { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; background: var(--mfbg); color: var(--ink); border: 1px solid var(--fld); border-radius: 99px; font: inherit; font-size: 14px; text-overflow: ellipsis; }
#mapfirstSettingsDlg .st-q::placeholder { color: var(--mute); }
#mapfirstSettingsDlg select { appearance: none; -webkit-appearance: none; width: 100%; height: 44px; padding: 0 38px 0 16px; background: var(--mfbg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358677a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat; color: var(--ink); border: 1px solid var(--fld); border-radius: 99px; font: inherit; font-size: 15px; text-overflow: ellipsis; }
#mapfirstSettingsDlg .st-btn { min-height: 44px; padding: 0 18px; background: var(--acc); border: 0; border-radius: 99px; color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; }
#mapfirstSettingsDlg .st-btn:hover { background: #1741b3; }
#mapfirstSettingsDlg .st-btn[data-st] { width: 100%; margin-top: 10px; background: #fff; color: var(--acc); border: 1.5px solid var(--acc); }
#mapfirstSettingsDlg .st-btn[data-st]:hover { background: #eef3ff; }
#mapfirstSettingsDlg .st-res { list-style: none; margin: 6px 0 0; padding: 0; }
#mapfirstSettingsDlg .st-res button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 2px; font-size: 14px; color: var(--ink); }
#mapfirstSettingsDlg .st-res button:hover { color: var(--acc); }
#mapfirstSettingsDlg .st-cap { margin: 8px 0 0; font-size: 13px; color: var(--mute); }
#mapfirstSettingsDlg .st-cap:empty { display: none; }
#mapfirstSettingsDlg .st-row { display: flex; gap: 8px; }
#mapfirstSettingsDlg .st-row .st-btn { width: 100%; background: #fff; color: var(--acc); border: 1.5px solid var(--acc); }

/* phone: bottom sheet */
@media (max-width: 639px) {
  #mapfirstFilterDlg, #mapfirstSettingsDlg { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: 24px 24px 0 0; }
  #mapfirstFilterDlg[open], #mapfirstSettingsDlg[open] { animation: mfsheet .28s cubic-bezier(.2, .8, .2, 1); }
  #mapfirstFilterDlg[open]::backdrop, #mapfirstSettingsDlg[open]::backdrop { animation: mffade .28s ease; }
  .mf-dhead { padding-top: 20px; border-radius: 24px 24px 0 0; }
  .mf-dhead::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #b5c0cc; }
  .mf-dbody { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@keyframes mfsheet { from { transform: translateY(100%); } }
@keyframes mffade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #mapfirstFilterDlg[open], #mapfirstSettingsDlg[open], #mapfirstFilterDlg[open]::backdrop, #mapfirstSettingsDlg[open]::backdrop { animation: none; }
}

/* compact days preview above the crag cards */
.mf-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 2px 12px 8px; }
.mf-days:empty { display: none; }
.mf-day { min-width: 0; display: grid; justify-items: center; gap: 1px; padding: 5px 2px 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); line-height: 1.15; }
.mf-day span { font-size: 11.5px; color: var(--mute); font-weight: 600; }
.mf-day b { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; }
.mf-day i { font-style: normal; font-size: 11px; font-weight: 600; white-space: nowrap; }
.mf-day[aria-pressed=true] i { color: #fff !important; }
.mf-day .wx { width: 15px; height: 15px; flex: none; color: #d98b00; }
.mf-day[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.mf-day[aria-pressed=true] span { color: #ffffffcc; }
.mf-day[aria-pressed=true] .wx { color: #ffc24d; }
