/* JHWH Atlas – modern, plain, photo-first */
:root {
  /* Theme 5 = original scheme (default); themes 1-4 below (D53) */
  --bg: #ffffff;
  --page: #f1f1f1;
  --surface: #f5f6f8;
  --surface-2: #eceef2;
  --text: #1b2330;
  --muted: #465060;
  --border: #e1e4ea;
  --accent: #1f4e8c;
  --accent-soft: #e7eef8;
  --on-accent: #fff;
  --pin-own: #c2410c;
  --pin-foreign: #2b7bb9;
  --pin-none: #9333ea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --header-h: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-hebrew: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
}
/* Themes 1-4: three base colours (lightest = background); the rest is derived */
:root[data-theme="1"] { --c-bg: #ffffff; --c-text: #0d4f5c; --c-accent: #e8731a; --on-accent: #0d4f5c; }
:root[data-theme="2"] { --c-bg: #ffffff; --c-text: #15151f; --c-accent: #c4509a; --on-accent: #fff; }
:root[data-theme="3"] { --c-bg: #f7f4ee; --c-text: #2e3236; --c-accent: #e85d04; --on-accent: #2e3236; }
:root[data-theme="4"] { --c-bg: #ffffff; --c-text: #141f3d; --c-accent: #a9302b; --on-accent: #fff; }
/* Theme 6: dark "night" (midnight, parchment, amber + teal and coral). Theme 7: light "sorbet" (raspberry, teal, sun on warm white). Both use three accents. */
:root[data-theme="6"] { --c-bg: #121821; --c-text: #ece7da; --c-accent: #f4b146; --c-accent-2: #4fd1c5; --c-accent-3: #ff7a9c; --on-accent: #121821; color-scheme: dark; }
:root[data-theme="7"] { --c-bg: #fffaf5; --c-text: #231942; --c-accent: #e63e78; --c-accent-2: #0a9d8f; --c-accent-3: #f2a100; --on-accent: #fff; }
:root[data-theme="6"], :root[data-theme="7"] { --pin-foreign: var(--c-accent-2); --pin-none: var(--c-accent-3); }
:root[data-theme="6"] .site-header, :root[data-theme="7"] .site-header { border-bottom: 3px solid; border-image: linear-gradient(90deg, var(--c-accent), var(--c-accent-2), var(--c-accent-3)) 1; }
:root[data-theme="6"] .page h2, :root[data-theme="7"] .page h2 { color: var(--c-accent-2); }
:root[data-theme="6"] .chip.photo-foreign, :root[data-theme="7"] .chip.photo-foreign { background: color-mix(in srgb, var(--c-bg) 84%, var(--c-accent-2)); border-color: var(--c-accent-2); }
:root[data-theme="6"] .chip.photo-none, :root[data-theme="7"] .chip.photo-none { background: color-mix(in srgb, var(--c-bg) 84%, var(--c-accent-3)); border-color: var(--c-accent-3); color: var(--text); }
:root[data-theme="6"] .tile a:hover, :root[data-theme="7"] .tile a:hover, :root[data-theme="6"] .tile.is-hover a, :root[data-theme="7"] .tile.is-hover a { border-color: var(--c-accent-2); }
:root[data-theme="6"] .select.is-set, :root[data-theme="7"] .select.is-set { border-color: var(--c-accent-2); color: var(--c-accent-2); background-color: color-mix(in srgb, var(--c-bg) 86%, var(--c-accent-2)); }
:root[data-theme="6"] .site-footer a:hover, :root[data-theme="7"] .site-footer a:hover { color: var(--c-accent-3); }
:root[data-theme="1"], :root[data-theme="2"], :root[data-theme="3"], :root[data-theme="4"], :root[data-theme="6"], :root[data-theme="7"] {
  --bg: var(--c-bg);
  --page: var(--c-bg);
  --surface: color-mix(in srgb, var(--c-bg) 94%, var(--c-text));
  --surface-2: color-mix(in srgb, var(--c-bg) 89%, var(--c-text));
  --text: var(--c-text);
  --muted: color-mix(in srgb, var(--c-text) 78%, var(--c-bg));
  --border: color-mix(in srgb, var(--c-bg) 80%, var(--c-text));
  --accent: var(--c-accent);
  --accent-soft: color-mix(in srgb, var(--c-bg) 84%, var(--c-accent));
  --pin-own: var(--c-accent);
  --pin-foreign: var(--c-text);
  --pin-none: color-mix(in srgb, var(--c-text) 45%, var(--c-bg));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--page); line-height: 1.55; font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
[dir="rtl"], .hebrew { font-family: var(--font-hebrew); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand svg { width: 46px; height: 46px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: .2px; }
.brand-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.badge-new { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 13px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.badge-new .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.badge-new.is-active { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-size: 14px; white-space: nowrap; color: var(--text); text-decoration: none !important; }
.btn:hover { background: var(--surface); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.nav-link { font-size: 14px; color: var(--text); padding: 7px 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: 7px 10px; font-size: 13px; line-height: 1.3; color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }

/* Filter bar */
.filterbar { border-bottom: 1px solid var(--border); background: var(--bg); }
.filterbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: var(--bg); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.filters { display: contents; }
.select { padding: 8px 30px 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6474' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; cursor: pointer; font-size: 14px; max-width: 220px; }
.select.is-set { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent); }
.select:disabled { opacity: .45; cursor: default; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); margin: 0; }
.link-reset { font-size: 14px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px; }
.filter-toggle { display: none; }

/* Map */
.map-outer { padding-top: 16px; }
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.filterbar { border-bottom: 0; }
#map { height: min(62vh, 640px); min-height: 380px; background: var(--surface); }
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; gap: 12px; padding: 6px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-radius: 8px; box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px rgba(0,0,0,.15); margin-right: 5px; vertical-align: -1px; }
.legend-dot.own { background: var(--pin-own); }
.legend-dot.foreign { background: var(--pin-foreign); }
.legend-dot.none { background: var(--pin-none); }
.maplibregl-popup-content { padding: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-family: var(--font); }
.popup { width: 220px; }
.popup img { width: 100%; height: 120px; object-fit: cover; }
.popup-body { padding: 10px 12px 12px; }
.popup-title { font-weight: 600; font-size: 14px; line-height: 1.3; margin: 0 0 2px; }
.popup-meta { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.popup a { font-size: 13.5px; font-weight: 500; }
.popup .popup-title a { font-size: inherit; font-weight: inherit; color: var(--text); }
.popup .popup-title a:hover { color: var(--accent); text-decoration: underline; }

/* Results */
.results { padding: 14px 0 40px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.results-count { font-size: 14px; color: var(--muted); margin: 0; }
.sheet-handle { display: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.tile a { display: block; color: inherit; text-decoration: none !important; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); transition: box-shadow .15s, border-color .15s; }
.tile a:hover, .tile.is-hover a { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--bg) 65%, var(--text)); }
.tile-img { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--bg) 60%, var(--text)); font-family: var(--font-hebrew); font-size: 34px; }
.tile-body { padding: 10px 12px 12px; }
.tile-title { font-weight: 600; font-size: 15px; line-height: 1.3; margin: 0 0 4px; }
.tile-meta { font-size: 13px; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 6px; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }

/* Detail page */
.detail { padding: 24px 0 60px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 14px; }
.detail h1 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; margin: 0 0 6px; font-weight: 680; }
.detail-meta { color: var(--muted); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.chip.photo-own { background: var(--accent-soft); border-color: color-mix(in srgb, var(--bg) 60%, var(--accent)); color: var(--text); }
.chip.photo-foreign { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.chip.photo-none { background: var(--surface); color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); cursor: zoom-in; border: 0; padding: 0; width: 100%; display: block; }
.gallery-main img { width: 100%; max-height: 560px; object-fit: contain; background: #111; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: 8px; padding: 0; overflow: hidden; cursor: pointer; flex: none; background: none; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--accent); }
.gallery-thumbs img { width: 84px; height: 64px; object-fit: cover; }
.photo-credit { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.no-photo { padding: 40px 20px; text-align: center; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.no-photo .hebrew { font-size: 48px; color: color-mix(in srgb, var(--bg) 60%, var(--text)); display: block; margin-bottom: 8px; }
.facts { margin: 0 0 24px; }
.facts dt { font-size: 13px; color: var(--muted); margin-top: 14px; }
.facts dd { margin: 2px 0 0; font-size: 16px; }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1em; }
.mt-note { font-size: 13px; color: var(--muted); font-style: italic; }
.section-title { font-size: 18px; margin: 32px 0 10px; font-weight: 650; }
#minimap { height: 240px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.side-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.side-card h2 { font-size: 15px; margin: 0 0 10px; }
.nearby { list-style: none; margin: 0; padding: 0; }
.nearby li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14.5px; }
.nearby li:first-child { border-top: 0; }
.nearby .dist { color: var(--muted); white-space: nowrap; }
.sources { font-size: 14.5px; word-break: break-word; }
.report-box { margin: 18px 0 0; padding: 12px 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--bg) 70%, var(--accent)); border-left: 4px solid var(--accent); border-radius: var(--radius); font-size: 14.5px; }
.report-box a { font-weight: 600; }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(10, 12, 16, .94); color: #fff; }
dialog.lightbox::backdrop { background: rgba(10, 12, 16, .94); }
.lb-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.lb-inner img { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.lb-btn { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; cursor: pointer; font-size: 22px; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.24); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 14px; opacity: .8; }

/* Static pages */
.page { padding: 32px 0 60px; }
.page h1 { font-size: 30px; margin: 0 0 18px; }
.page h2 { font-size: 20px; margin: 28px 0 8px; }
.placeholder { background: #fff7d6; border: 1px dashed #d8b24a; padding: 2px 6px; border-radius: 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 18px; padding-bottom: 18px; }
.site-footer a { color: var(--muted); }
.theme-switch { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-switch button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; background: linear-gradient(135deg, var(--s-bg) 0 50%, var(--s-text) 50% 75%, var(--s-accent) 75% 100%); }
.theme-switch button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tutorial */
.tour-hint { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: 280px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; font-size: 14px; }
.tour-hint p { margin: 0 0 10px; }
.tour-hint .row { display: flex; gap: 8px; justify-content: flex-end; }
.tour-hint .x { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; }
.tour-focus { position: relative; z-index: 45; outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.tour-shade { position: fixed; inset: 0; background: rgba(15, 20, 30, .35); z-index: 40; }
.tour-bubble { position: fixed; z-index: 60; width: min(320px, calc(100vw - 32px)); background: var(--bg); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.2); padding: 16px; font-size: 15px; }
.tour-bubble .count { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.tour-bubble p { margin: 0 0 12px; }
.tour-bubble .row { display: flex; justify-content: space-between; gap: 8px; }

/* Mobile */
@media (max-width: 767px) {
  :root { --header-h: 54px; }
  .wrap { padding: 0 16px; }
  .brand svg { width: 38px; height: 38px; }
  .brand-name { white-space: nowrap; font-size: 16px; }
  .brand-count { font-size: 11.5px; }
  .brand { gap: 8px; flex: 1 1 128px; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; }
  .brand-text { overflow: hidden; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 4px; }
  .header-actions { flex: none; margin-left: auto; }
  .header-actions .btn-label { display: none; }
  .header-actions .btn { padding: 6px 7px; }
  .site-header .wrap { gap: 10px; }
  .header-actions { gap: 5px; }
  .badge-new { padding: 6px 7px; }
  .badge-new .dot { display: none; }
  .lang-switch a { padding: 6px 7px; }
  .badge-new { font-size: 12px; }
  .filterbar .wrap { flex-wrap: nowrap; }
  .search { max-width: none; }
  .filter-toggle { display: inline-flex; }
  .filters { display: none; }
  .filters.is-open { display: flex; flex-direction: column; gap: 8px; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); padding: 12px 16px 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 20; }
  .filters.is-open .select { max-width: none; width: 100%; }
  .filterbar { position: relative; }
  body.page-map { overflow: hidden; }
  .page-map #map { height: calc(100dvh - var(--header-h) - 58px); min-height: 0; }
  .map-outer { padding: 0; }
  .map-wrap { border-radius: 0; border: 0; border-top: 1px solid var(--border); }
  .page-map .site-footer { display: none; }
  .page-map .map-legend { bottom: 76px; }
  .page-map .results { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bg); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.12); padding: 0 0 12px; max-height: 64px; overflow: hidden; transition: max-height .25s ease; }
  .page-map .results.is-open { max-height: 72dvh; overflow-y: auto; }
  .sheet-handle { display: block; width: 100%; background: none; border: 0; padding: 8px 16px 6px; cursor: pointer; }
  .sheet-handle::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 8px; }
  .results-head { margin-bottom: 8px; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile a { display: flex; }
  .tile-img { width: 108px; flex: none; aspect-ratio: auto; min-height: 84px; }
  .tile-img img { position: absolute; inset: 0; }
  .detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .tour-hint { left: 16px; right: 16px; width: auto; bottom: 80px; }
}

/* Link tile: photo that is only linked, not embedded */
.link-tile { padding: 28px 20px; text-align: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.link-tile .hebrew { font-size: 44px; color: color-mix(in srgb, var(--bg) 60%, var(--text)); display: block; }
.link-tile p { margin: 8px 0; color: var(--muted); }
.link-tile-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.photo-credit a { text-decoration: underline; }
.btn-lg { padding: 11px 20px; font-size: 16px; font-weight: 600; }

/* Contribution form */
.form { max-width: 640px; }
.form-group { margin: 0 0 18px; border: 0; padding: 0; }
.form-group > label, .form legend { display: block; font-weight: 600; margin: 0 0 6px; padding: 0; }
.form input[type="text"], .form input[type="email"], .form select, .form textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font: inherit; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form input[type="file"] { width: 100%; }
.choice { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-weight: 400; cursor: pointer; }
.choice input { margin-top: 5px; flex: none; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status.is-ok { color: #166534; }
.form-status.is-error { color: #b91c1c; }
[hidden] { display: none !important; }

.form .is-invalid { border-color: #b91c1c; outline: 2px solid #fecaca; }
.form input[type="checkbox"].is-invalid { outline-offset: 2px; }
.thanks-lead { font-size: 22px; font-weight: 650; }
.thanks-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Tablets (768-1023 px wide, or any touch-first device from 768 px): filters in a left sidebar (about 20 %), map next to it */
@media (min-width: 768px) and (max-width: 1023px), (min-width: 768px) and (pointer: coarse) and (hover: none) {
  .map-layout { display: grid; grid-template-columns: max(200px, 20%) minmax(0, 1fr); align-items: start; }
  .page-map .filterbar { position: sticky; top: var(--header-h); height: calc(100dvh - var(--header-h)); overflow-y: auto; border-right: 1px solid var(--border); border-bottom: 0; }
  .page-map .filterbar .wrap { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; padding: 14px 12px; max-width: none; }
  .page-map .search { flex: none; max-width: none; }
  .page-map .filters { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .page-map .filters .select { width: 100%; max-width: none; }
  .page-map .filters .toggle { align-self: flex-start; }
  .page-map .link-reset { align-self: flex-start; padding: 2px 0; }
  .page-map .map-outer { padding: 12px 16px 12px 12px; max-width: none; margin: 0; }
  .page-map #map { height: calc(100dvh - var(--header-h) - 24px); min-height: 300px; }
}

.map-error { height: 100%; display: grid; place-content: center; text-align: center; padding: 20px; color: var(--muted); background: var(--surface); }
.map-error-detail { font-size: 12px; opacity: .8; word-break: break-word; max-width: 60ch; }

/* Share button, toast */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.share-dialog { width: min(480px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: var(--bg); color: var(--text); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.share-dialog::backdrop { background: rgba(15, 20, 30, .45); }
.share-dialog h2 { font-size: 18px; margin: 0 0 8px; }
.share-dialog p { margin: 0 0 12px; font-size: 14.5px; color: var(--muted); }
.share-dialog textarea { width: 100%; font: inherit; font-size: 14.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; resize: vertical; }
.share-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Roadmap boxes */
.rm-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px 18px; margin: 0 0 18px; }
.rm-box > h2 { margin: 0 0 12px; font-size: 20px; padding-bottom: 8px; border-bottom: 3px solid var(--accent); }
.rm-box h3 { font-size: 15px; margin: 16px 0 4px; color: var(--accent); }
.rm-box h3:first-of-type { margin-top: 0; }
.rm-box ul { margin: 0; padding-left: 20px; }
.rm-box li { margin: 3px 0; }
.rm-date { display: inline-block; font-size: 13px; font-weight: 600; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.no-photo .btn { margin-left: 8px; }

/* Photo tips on the contribution form */
.tips { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; font-size: 14.5px; }
.tips[hidden] { display: none; }
.tips-title { font-size: 16px; margin: 0 0 6px; }
.tips ul { margin: 0; padding-left: 20px; }
.tips li { margin: 4px 0; }
.credit-box { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; }

/* Contributors page (D56): top ten tinted from 100 % (rank 1) down to 10 % (rank 10) of the accent colour */
.c-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0 0 16px; }
.c-stats li { background: var(--surface); border-radius: var(--radius); padding: 8px 14px; color: var(--muted); }
.c-stats strong { font-size: 22px; color: var(--text); margin-right: 4px; }
.c-list { list-style: none; margin: 0 0 8px; padding: 0; }
.c-row { display: grid; grid-template-columns: 2.2em minmax(0, 190px) 2.5em minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 12px; border-radius: 8px; margin: 2px 0; }
.c-rank { text-align: right; color: var(--muted); font-size: 13px; }
.c-row.top { background: color-mix(in srgb, var(--accent) var(--tint), var(--bg)); }
.c-row.top.strong { color: var(--on-accent); }
.c-row.top.strong .c-rank { color: inherit; }
.c-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-count { font-weight: 600; text-align: right; }
.c-links { display: flex; flex-wrap: wrap; gap: 4px; }
.c-links a { min-width: 24px; text-align: center; font-size: 12.5px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--accent); }
.c-anon { margin-top: 18px; color: var(--muted); }
.c-remove { font-size: 14px; color: var(--muted); }
@media (max-width: 767px) {
  .c-row { grid-template-columns: 2em minmax(0, 1fr) 2.5em; }
  .c-links { grid-column: 2 / -1; }
}
