/* Zasya: civic bulletin style. White + charcoal, one blue accent, ruled lines (two white
   surfaces are told apart by a rule, never by a tint); one sans-serif family, Onest; corners from
   one scale (6 / 10 / 16 px), circles only for the avatar, indicators under 12 px keep 2 px.
   Light is the default theme. */

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --fill: #f3f5f8; /* the quiet second fill: hovers, photos still loading, the map before its tiles */
  --ink: #1c2127;
  --ink-2: #4a525c;
  --muted: #5d6670;
  --rule: #d9dee6;
  --accent: #1d4ed8;
  --accent-hover: #1a43b8;
  --accent-ink: #ffffff;
  --accent-text: #1d4ed8; /* the accent as text and icons (lighter than the fill on dark) */
  --accent-wash: #e8effd;
  --danger: #b42318; /* errors and deleting for good, never the accent: what went wrong, a field that needs fixing */
  --focus: #1c2127;
  /* Severity: one hue, darker = more people reported it. */
  --sev1: #8fb0f5; --sev1-ink: #1c2127;
  --sev2: #5584ec; --sev2-ink: #1c2127;
  --sev3: #2a5fdb; --sev3-ink: #ffffff;
  --sev4: #173a99; --sev4-ink: #ffffff;
  --done: #69717c; --done-ink: #ffffff;
  --pin-edge: #ffffff;
  --overlay: rgba(28, 33, 39, .55);

  --font-body: "Onest", "Segoe UI", sans-serif;
  --font-head: var(--font-body); /* headings and figures: the same Onest, heavier and a little tighter */
  /* corners: sm for tags, pills, inputs, thumbnails and pins; md for buttons, chips, the search
     bar, floating controls, cards and menus; lg for sheets and dialogs */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --ease-sheet: cubic-bezier(.2, .8, .2, 1);
  --header-h: 76px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12161b;
  --panel: #1a1f26;
  --fill: #12161b; /* on dark the page colour itself, a step below the panels */
  --ink: #e8ebef;
  --ink-2: #b8bec7;
  --muted: #949ba4;
  --rule: #2a3038;
  --accent: #6b9cff;
  --accent-hover: #8db3ff;
  --accent-ink: #0b1220;
  --accent-text: #8db3ff;
  --accent-wash: #1b2a45;
  --danger: #f97066;
  --focus: #e8ebef;
  /* On a dark map, brighter = more urgent. */
  --sev1: #3a5ea8; --sev1-ink: #ffffff;
  --sev2: #4f7ee6; --sev2-ink: #12161b;
  --sev3: #7ea3ff; --sev3-ink: #12161b;
  --sev4: #b9cdff; --sev4-ink: #12161b;
  --done: #5d656e; --done-ink: #ffffff;
  --pin-edge: #12161b;
  --overlay: rgba(0, 0, 0, .65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
svg { fill: currentColor; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.5px; line-height: 1.15; margin: 0; }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); line-height: 1.4;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- masthead */
.masthead {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 28px 0 24px;
  background: var(--panel);
  border-bottom: 2px solid var(--ink);
  flex-shrink: 0;
  z-index: 1003; /* above the phone's detail sheet (1002): the account menu hangs over it */
}
.wordmark { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.wordmark strong { font-family: var(--font-head); font-size: 34px; font-weight: 700; letter-spacing: -.3px; line-height: 1; color: var(--accent-text); }
.mark {
  width: 14px; height: 30px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}
.tagline {
  margin: 0 0 0 20px; padding-left: 20px; border-left: 1px solid var(--rule);
  color: var(--ink-2); font-size: 14px; line-height: 1.35; max-width: 220px;
}
/* One row of figures: a figure that doesn't fit next to the account and language controls wraps
   onto a second line that is clipped away ("this week" goes first, then "fixed"). */
.stats {
  display: flex; margin-left: auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end;
  row-gap: 24px; height: calc(28px * 1.05 + 11px * 1.4); overflow: hidden;
}
.stat { padding: 0 22px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; }
.stat:first-child { border-left: 0; }
.stat b { font-family: var(--font-head); font-size: 28px; font-weight: 600; letter-spacing: -.5px; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.stat.open b { color: var(--accent-text); }
.stat .eyebrow, .top-actions .link-btn { white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 14px; padding-left: 22px; border-left: 1px solid var(--rule); height: 40px; flex-shrink: 0; }

/* ---------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: var(--r-md); padding: 8px 14px; font-weight: 600; font-size: 14px; line-height: 1.3;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: var(--panel); }
.btn.on { background: var(--accent-wash); color: var(--accent-text); border-color: var(--accent); }
.btn.on:hover { filter: brightness(1.08); }
/* deleting the account for good: outlined in red, never the accent (as in the app) */
#delBtn { background: transparent; color: var(--danger); border-color: var(--danger); }
#delBtn:hover { background: var(--danger); border-color: var(--danger); color: var(--panel); }
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.link-btn:hover { color: var(--accent-text); }
.seg { display: flex; border: 1px solid var(--ink); border-radius: var(--r-md); overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.seg button.on { background: var(--ink); color: var(--panel); }
.icon-btn { border: 1px solid transparent; background: none; width: 36px; height: 36px; border-radius: var(--r-md); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.icon-btn:hover { border-color: var(--rule); }
.icon-btn svg { width: 20px; height: 20px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

select {
  width: 100%; padding: 7px 30px 7px 10px; border-radius: var(--r-sm); border: 1px solid var(--rule);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center / 11px;
  appearance: none; font-size: 14px; cursor: pointer;
}
select:hover { border-color: var(--ink-2); }

/* ---------- layout: the search and the chips over a narrow ledger on the left, map takes the rest */
.layout {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 452px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
}
.panel {
  grid-area: 2 / 1; display: flex; flex-direction: column; position: relative;
  background: var(--panel); border-right: 1px solid var(--rule); min-height: 0;
}
.map-wrap { grid-area: 1 / 2 / 3 / 3; position: relative; min-width: 0; }
/* z-index: Leaflet's own layers (400-1000) stay inside the map, under the controls laid over it */
#map { position: absolute; inset: 0; z-index: 0; background: var(--fill); }

/* ---------- search bar and quick chips: the column's head here, floating over the map on phones */
.mapbar {
  grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 16px 24px 14px; background: var(--panel); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.fsearch {
  display: flex; align-items: center; gap: 2px; height: 44px; min-width: 0; padding: 0 4px 0 12px;
  background: var(--panel); border: 1px solid var(--ink); border-radius: var(--r-md);
}
.fsearch:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fsearch-ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.fsearch input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; padding: 0 4px; }
.fsearch input::placeholder { color: var(--muted); }
.fsearch input:focus-visible { outline: none; }
.fsearch input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.fsearch .icon-btn { width: 40px; height: 40px; flex-shrink: 0; }
.fsearch-home, .avatar-btn { display: none; }
/* Filters · N, the sort, Open, then the commonest types; inked while on */
.qchips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.qchip-types { display: contents; }
.qchip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--panel); color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; cursor: pointer;
}
.qchip:hover { border-color: var(--ink-2); }
.qchip[aria-pressed="true"], .qchip.active { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.qchip[aria-expanded="true"] { border-color: var(--ink); }
.qchip svg { width: 16px; height: 16px; flex-shrink: 0; }
.qchip .caret { width: 10px; height: 7px; fill: none; }
.qchip[aria-expanded="true"] .caret { transform: rotate(180deg); }
/* the sort menu: all six orders, the chosen one ticked */
.pop-menu {
  position: fixed; z-index: 1004; min-width: 220px; max-width: calc(100vw - 24px); padding: 6px 0;
  background: var(--panel); border: 1px solid var(--ink); border-radius: var(--r-md); overflow: auto;
}
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 16px;
  border: 0; background: none; font-size: 15px; line-height: 1.3; text-align: left; cursor: pointer;
}
.pop-item:hover, .pop-item:focus-visible { background: var(--fill); outline-offset: -2px; }
.pop-item .tick { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-text); visibility: hidden; }
.pop-item[aria-checked="true"] { font-weight: 600; }
.pop-item[aria-checked="true"] .tick { visibility: visible; }
.pop-sep { height: 1px; margin: 6px 0; background: var(--rule); }

/* status and the Filters window's sort: the language switch's segmented look, across the width */
.seg-wide button { flex: 1 1 0; min-width: 0; padding: 6px 8px; font-size: 13px; letter-spacing: .02em; line-height: 1.4; }
.seg-wide button + button { border-left: 1px solid var(--rule); }
.seg-wide button.on + button, .seg-wide button + button.on { border-left-color: var(--ink); }
.seg-wide button:not(.on):hover { background: var(--fill); }
.seg-wide button:focus-visible { outline-offset: -4px; }
.seg-wide button.on:focus-visible { outline-color: var(--panel); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--rule); background: transparent; border-radius: var(--r-md); min-height: 32px;
  padding: 5px 12px; font-size: 13px; line-height: 1.6; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip:hover { border-color: var(--ink-2); }
.chip small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.chip.on small { color: inherit; opacity: .7; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
/* the phone sheet's grip and second line, and the legend line in it: none of them here */
.sheet-handle, .sheet-line, .legend-inline { display: none; }
/* the grip's description: read with the grip (aria-describedby reads hidden text), never on its own */
#sheetA11yHint { display: none; }
.sheet-body { display: contents; }
/* "{n} issues", and a quiet CSV of what the list shows: small, the list is what matters here */
.result-bar { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 14px 24px 12px; border-bottom: 1px solid var(--rule); }
.result-bar h2 { font-size: 26px; white-space: nowrap; }
#count:focus { outline: none; }
.result-csv { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.btn.sm { height: 32px; padding: 0 10px; gap: 6px; font-size: 13px; flex-shrink: 0; }
.btn.sm svg { width: 15px; height: 15px; }

/* ---------- floating map buttons, and where you are */
.map-ctrls { position: absolute; right: 16px; bottom: 32px; z-index: 510; display: flex; flex-direction: column; gap: 8px; }
.map-btn {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  background: var(--panel); color: var(--ink); border: 1px solid var(--ink); border-radius: var(--r-md); cursor: pointer;
}
.map-btn:hover { background: var(--fill); }
.map-btn svg { width: 22px; height: 22px; }
.map-btn[aria-busy="true"] { cursor: progress; }
.map-btn[aria-busy="true"] svg { animation: locate-pulse 1s ease-in-out infinite; }
/* your position (never sent anywhere): a small ink square, not a dot */
.me {
  width: 14px; height: 14px; background: var(--ink); border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--ink); border-radius: 2px; box-sizing: content-box;
}
.me-acc { stroke: var(--ink-2); stroke-opacity: .7; fill: var(--ink-2); fill-opacity: .08; }

/* ---------- the Filters window: centred here, a bottom sheet on phones */
.filters-dlg { max-width: 520px; }
.filters-dlg[open] { display: flex; flex-direction: column; max-height: min(760px, calc(100dvh - 48px)); overflow: hidden; }
.filters-dlg form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 0; gap: 0; }
.filters-dlg p { margin: 0; }
.filters-dlg .btn { align-self: auto; }
.fd-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--rule); }
.fd-head h2 { margin: 0 auto 0 0; font-size: 28px; }
.fd-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 22px; padding: 18px 24px 10px;
}
.fd-sec, .fd-field { display: flex; flex-direction: column; gap: 8px; }
.fd .seg-wide button { min-height: 40px; font-size: 14px; }
.fd select { font-size: 16px; min-height: 44px; } /* 16px: iOS doesn't zoom into it */
.fd-more-types { align-self: flex-start; }
.fd-more summary {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 0;
  border-top: 1px solid var(--rule); font-weight: 600; cursor: pointer; list-style: none;
}
.fd-more summary::-webkit-details-marker { display: none; }
.fd-more summary .caret { width: 12px; height: 8px; flex-shrink: 0; fill: none; }
.fd-more[open] summary .caret { transform: rotate(180deg); }
.fd-more-body { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 12px; }
.fd-radios { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fd-radios legend { padding: 0; margin-bottom: 8px; }
.fd-csv { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.fd-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--ink); background: var(--panel);
}
.fd-foot .btn { min-height: 44px; padding: 10px 18px; font-size: 15px; }
#filtersApply[aria-busy="true"] { cursor: progress; }
#filtersClear:disabled { color: var(--muted); text-decoration: none; cursor: default; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } }
@keyframes locate-pulse { 50% { opacity: .35; } }

/* ---------- list: ruled ledger, rank in the margin, photo on the right */
.list { list-style: none; margin: 0; padding: 0 0 24px; overflow-y: auto; flex: 1; }
.item {
  display: grid; grid-template-columns: 52px 1fr 92px; gap: 0 14px; padding: 16px 24px 16px 0;
  border-bottom: 1px solid var(--rule); cursor: pointer; position: relative;
}
.item::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 3px; background: transparent; }
.item:hover, .item.hover { background: var(--fill); }
.item.selected { background: var(--accent-wash); }
.item.selected::before, .item:hover::before { background: var(--accent); }
.rank {
  font-family: var(--font-head); font-size: 26px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1;
  text-align: right; color: var(--ink); font-variant-numeric: lining-nums;
}
.rank.none { color: transparent; }
.sev { display: block; width: 10px; height: 10px; margin: 8px 0 0 auto; border-radius: 2px; }
.thumb { width: 92px; height: 92px; object-fit: cover; background: var(--fill); display: block; border-radius: var(--r-sm); }
.item-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.tag + .tag::before { content: "/"; margin-right: 8px; color: var(--rule); }
.desc { margin: 2px 0 4px; font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.desc.none { color: var(--muted); font-style: italic; }
.meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; flex-wrap: wrap; }
.meta b, .meta-line b { color: var(--ink); font-weight: 600; }
/* a list row's figures, place and age as one run of text: each part stays whole, and a line
   that wraps breaks after a dot, never before one */
.meta-line { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.meta-line > span { white-space: nowrap; }
.meta-line > span:not(:last-child)::after { content: "\00a0\00b7"; margin-right: 1px; }
.pill { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 0 6px; border: 1px solid currentColor; border-radius: var(--r-sm); line-height: 1.6; }
.pill.fixed { color: var(--ink-2); }
.pill.open { color: var(--accent-text); }
.pill.demo { color: var(--muted); border-style: dashed; }
/* a fix photo is waiting to be checked: quiet, the issue is still open */
.pill.pending { color: var(--ink-2); border-style: dashed; }
.empty, .loading { padding: 48px 24px 48px 66px; color: var(--muted); }

/* ---------- detail */
.detail { position: absolute; inset: 0; background: var(--panel); overflow-y: auto; z-index: 5; }
.detail-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 10px 24px 10px 12px; background: var(--panel); border-bottom: 1px solid var(--rule);
}
.detail-head strong { font-family: var(--font-head); font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
/* the status, "Fix being checked" and demo pills: a pill that doesn't fit moves to a line of its
   own (next to the number, not under the back button) instead of breaking into a tall stack */
.detail-pills { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gallery img.main { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.thumbs { display: flex; gap: 4px; padding: 4px; overflow-x: auto; background: var(--ink); }
.thumbs img { width: 60px; height: 60px; object-fit: cover; cursor: pointer; opacity: .55; flex-shrink: 0; border-radius: var(--r-sm); }
/* the chosen photo: a pale-blue ring (navy on dark), which stands out on the ink strip where the accent can't */
.thumbs img.on { opacity: 1; outline: 2px solid var(--accent-wash); outline-offset: -2px; }
.detail-body { padding: 22px 24px 32px 28px; display: flex; flex-direction: column; gap: 22px; }
.detail-title h2 { font-size: 34px; }
.detail-title .meta { margin-top: 6px; font-size: 14px; }
.figures { display: flex; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.figure { flex: 1; padding: 10px 0 10px 14px; border-left: 1px solid var(--rule); }
.figure:first-child { padding-left: 0; border-left: 0; flex: 1.3; }
.figure b { display: block; font-family: var(--font-head); font-size: 36px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1; font-variant-numeric: lining-nums; }
.figure:first-child b { color: var(--accent-text); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn:first-child { flex: 1.4; }
.actions .btn { flex: 1; }
/* open: whether a fix photo is waiting, or how to say it is fixed (in the app) */
.fix-box { border-left: 3px solid var(--ink); padding: 2px 0 2px 16px; display: flex; flex-direction: column; gap: 6px; }
.fix-box p { margin: 0; font-size: 15px; line-height: 1.5; }
.fix-box strong { font-weight: 600; }
.help { color: var(--muted); font-size: 13px; margin: 0; }
.fix-box .help { font-size: 13px; }
/* fixed: the photo a moderator approved, after the repair (never part of the gallery) */
.after-photo { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.after-photo a { display: block; }
.after-photo img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); background: var(--fill);
}
.after-photo figcaption { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.after-photo figcaption small { color: var(--muted); font-size: 12.5px; }
/* "Report post": as quiet as "Report photo", ruled off at the end of the issue */
.post-flag { border-top: 1px solid var(--rule); padding-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.post-flag .flag-pick { align-self: stretch; }
.post-flag .flagged { color: var(--muted); font-size: 12.5px; }
.post-flag .flagged:focus { outline: none; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-variant-numeric: tabular-nums; }
.section-title { font-size: 22px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.reports { list-style: none; padding: 0; margin: 0; }
.reports li { display: grid; grid-template-columns: 1fr 56px; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.reports img { width: 56px; height: 56px; object-fit: cover; cursor: pointer; border-radius: var(--r-sm); }
.reports p { margin: 0; font-size: 15px; }
.reports small { color: var(--muted); font-size: 12.5px; }
.reports li > div { min-width: 0; }
/* "Report photo": quiet on purpose, it should not compete with the report itself. */
.flag-line { line-height: 1.4; margin-top: 2px; }
.flag-btn { font-size: 12.5px; font-weight: 500; color: var(--muted); text-decoration-color: var(--rule); }
.flag-btn:hover, .flag-btn[aria-expanded="true"] { color: var(--accent-text); text-decoration-color: currentColor; }
.flag-btn[data-delete]:hover { color: var(--danger); } /* deleting one's own report: red, as in the app */
.flag-line .block-btn { margin-left: 14px; }
.flag-pick { grid-column: 1 / -1; border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; display: flex; flex-direction: column; gap: 8px; }
.flag-pick .chips { align-items: center; }
.flag-pick .link-btn { font-size: 13px; color: var(--muted); margin-left: 6px; }
.flag-pick button:disabled { opacity: .5; cursor: progress; }

/* ---------- map pins: square tags with a stem */
.pin {
  --c: var(--sev1); --t: var(--sev1-ink);
  position: relative; width: 100%; height: calc(100% - 7px); background: var(--c); color: var(--t);
  border: 2px solid var(--pin-edge); border-radius: var(--r-sm); display: grid; place-items: center;
  font: 700 12px/1 var(--font-body); box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 5px solid transparent; border-top: 6px solid var(--pin-edge);
}
.pin.l2 { --c: var(--sev2); --t: var(--sev2-ink); }
.pin.l3 { --c: var(--sev3); --t: var(--sev3-ink); }
.pin.l4 { --c: var(--sev4); --t: var(--sev4-ink); }
.pin.ok { --c: var(--done); --t: var(--done-ink); }
/* an open issue whose fix photo is being checked: a small accent dot on the pin's corner */
.pin.pend::before {
  content: ""; position: absolute; top: -5px; right: -5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--pin-edge);
}
.leaflet-marker-icon:hover .pin { transform: translateY(-2px); }
.leaflet-marker-icon.sel .pin { outline: 3px solid var(--ink); outline-offset: 1px; }
.cluster {
  --c: var(--sev1); --t: var(--sev1-ink);
  width: 100%; height: 100%; background: var(--c); color: var(--t); border: 2px solid var(--pin-edge);
  outline: 1px solid var(--c); border-radius: var(--r-sm); display: grid; place-items: center;
  font: 700 14px/1 var(--font-body); box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.cluster.l2 { --c: var(--sev2); --t: var(--sev2-ink); }
.cluster.l3 { --c: var(--sev3); --t: var(--sev3-ink); }
.cluster.l4 { --c: var(--sev4); --t: var(--sev4-ink); }
.cluster.ok { --c: var(--done); --t: var(--done-ink); }
/* bottom: level with the locate button, clear of the map's attribution line under both */
.legend {
  position: absolute; left: 16px; bottom: 32px; z-index: 500; background: var(--panel); border: 1px solid var(--ink);
  border-radius: var(--r-md); padding: 10px 14px 12px; font-size: 13px; line-height: 1.4;
}
.legend .eyebrow { display: block; margin-bottom: 8px; }
.legend-row { display: flex; gap: 2px; }
.legend-row div { display: flex; flex-direction: column; gap: 4px; min-width: 44px; }
.legend-row i { height: 10px; display: block; }
.legend-row span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* the pin's "being checked" dot (.pin.pend), after Fixed */
.legend-row div:has(> .pend-dot) { margin-left: 10px; }
.legend-row i.pend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.leaflet-container { font: inherit; background: var(--fill); }
/* the map in neutral greys: the pins and the accent are its only colour */
.leaflet-tile-pane { filter: grayscale(1) contrast(.92) brightness(1.04); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(1) brightness(.78) contrast(.92); }
.leaflet-bar { border-radius: var(--r-md) !important; overflow: hidden; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a:first-child, .leaflet-touch .leaflet-bar a:last-child { border-radius: 0 !important; }
.leaflet-bar { border: 1px solid var(--ink) !important; box-shadow: none !important; }
.leaflet-bar a { background: var(--panel); color: var(--ink); border-bottom-color: var(--rule); }
.leaflet-bar a:hover { background: var(--fill); color: var(--ink); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--ink-2); }

/* ---------- dialog / toast */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; max-width: 560px; width: calc(100% - 32px); background: var(--panel); color: var(--ink); }
/* the accent rule along the top: a stripe the rounded corners clip (a border-top would taper) */
dialog::before { content: ""; display: block; position: sticky; top: 0; z-index: 3; flex-shrink: 0; height: 4px; background: var(--accent); }
dialog::backdrop { background: var(--overlay); }
dialog form { padding: 28px 32px 24px 28px; display: flex; flex-direction: column; gap: 10px; }
dialog h2 { font-size: 32px; margin-bottom: 6px; }
dialog p { margin: 0 0 10px; }
dialog .btn { align-self: flex-end; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: var(--r-md); transition: .2s; z-index: 2000; font-size: 14px;
  width: max-content; max-width: min(480px, calc(100vw - 32px)); /* one line when it fits, else the full width */
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- smaller screens: the masthead gives way (the map page's phone layout is further down) */
@media (max-width: 1180px) {
  .tagline { display: none; }
}
@media (max-width: 960px) {
  .stat { padding: 0 14px; }
}
@media (max-width: 820px) {
  :root { --header-h: 60px; }
  .masthead { padding: 0 12px 0 16px; }
  .wordmark strong { font-size: 28px; }
  .mark { height: 24px; width: 11px; }
  .stats { display: none; }
  .top-actions { margin-left: auto; border-left: 0; padding-left: 0; gap: 10px; }
}

/* ================================================================ accounts on the public site
   index.html: "Sign in" / the username in the masthead, the account menu that hangs from the
   masthead's rule, and the sign-in window (a <dialog> like "How it works"). */
.top-actions .acct { display: flex; align-items: center; }
.acct-pending { visibility: hidden; } /* until GET /api/auth/me answers */
.nav-btn .nav-ico, .nav-btn-xs .nav-ico { display: none; }
.user-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; position: relative; }
.user-btn .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.user-btn .caret { width: 10px; height: 7px; flex-shrink: 0; fill: none; }
.user-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
/* email not confirmed yet: a small accent square after the name */
.user-btn.warn::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }
@media (max-width: 960px) { .user-btn { max-width: 140px; } }

.user-menu {
  position: fixed; z-index: 1004; width: 300px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--ink); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 0 18px; font-size: 14px; line-height: 1.5;
}
.user-menu:focus { outline: none; } /* focused only to hold the keyboard's place (see openMenu) */
.um-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 0; border-top: 0; }
/* a rule between the rows that show (which ones do depends on the account and the layout) */
.um-row:not([hidden]) ~ .um-row { border-top: 1px solid var(--rule); }
.um-who, .um-email, .um-msg { margin: 0; overflow-wrap: anywhere; }
.um-who { font-size: 15px; }
.um-who b { font-weight: 600; }
.um-email { color: var(--muted); font-size: 13px; }
.um-warn { color: var(--accent-text); }
.um-msg { color: var(--ink-2); font-size: 13px; }
.um-msg.bad { color: var(--danger); font-weight: 600; }
.user-menu .btn { padding: 6px 12px; font-size: 13px; }
.user-menu .link-btn { white-space: normal; text-align: left; }
.user-menu .um-quiet { font-size: 13px; color: var(--muted); }
.user-menu .um-quiet:hover { color: var(--accent-text); }
.user-menu button:disabled, .auth-dlg button:disabled { opacity: .5; cursor: default; }
/* phones: signed out, why to sign in; and the language, theme and legal pages the masthead holds here */
.um-lead { margin: 0; color: var(--ink-2); font-size: 14px; }
.um-pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.um-links { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.um-site { display: none; }
.is-phone .um-site { display: flex; }
.is-phone #inViewRow { display: none; }

/* phones: the round account button at the search bar's end (the initial once signed in) */
.avatar-btn { position: relative; width: 40px; height: 40px; flex-shrink: 0; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar {
  width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%;
  background: var(--panel); color: var(--ink); font: 600 15px/1 var(--font-body);
}
.avatar svg { width: 18px; height: 18px; }
.avatar-btn.signed .avatar { background: var(--ink); color: var(--panel); }
.avatar-btn.warn::after {
  content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 0 2px var(--panel);
}
.avatar-btn[aria-expanded="true"] .avatar { outline: 2px solid var(--ink); outline-offset: 1px; }
.safe-probe { position: fixed; bottom: 0; left: 0; width: 0; height: env(safe-area-inset-bottom, 0px); visibility: hidden; pointer-events: none; }

/* the Like button always shows the count, ruled off from its label */
.like-n { padding-left: 8px; border-left: 1px solid currentColor; font-variant-numeric: lining-nums tabular-nums; }
#likeBtn[aria-busy="true"] { cursor: progress; }

.auth-dlg { max-width: 460px; }
.auth-wrap { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
.auth-head { display: flex; align-items: flex-start; gap: 12px; }
.auth-head h2 { margin: 0 auto 0 0; font-size: 32px; }
.auth-head .icon-btn { margin: -2px -10px 0 0; flex-shrink: 0; }
.auth-why { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; display: flex; flex-direction: column; gap: 2px; }
.auth-why strong { font-family: var(--font-head); font-size: 21px; font-weight: 600; letter-spacing: -.3px; line-height: 1.25; }
.auth-why span { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.auth-tabs { display: flex; gap: 24px; border-bottom: 2px solid var(--ink); }
.auth-tab {
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; cursor: pointer;
  padding: 8px 0 6px; font-size: 15px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.auth-dlg .auth-form { padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-dlg p { margin: 0; }
.auth-dlg .btn { align-self: auto; }
.auth-lead { color: var(--ink-2); font-size: 14px; }
.field-note { font-size: 13px; line-height: 1.45; color: var(--muted); }
.field-note.bad { color: var(--danger); font-weight: 600; }
.field input[aria-invalid="true"] { border-bottom-color: var(--danger); }
.auth-error { color: var(--danger); font-size: 14px; font-weight: 600; }
.auth-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.auth-actions .btn:disabled { cursor: progress; }
.auth-switch {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
  padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2);
}
/* outcome lines: ruled in ink, or in red when something went wrong */
.auth-msg { border-left: 3px solid var(--ink); padding: 2px 0 2px 14px; overflow-wrap: anywhere; }
.auth-msg.bad { border-left-color: var(--danger); }
.auth-msg:focus { outline: none; }
.auth-dlg form[aria-busy="true"] .btn { cursor: progress; }
/* sign-up: "I agree to the Terms of use and the Privacy policy" (the box sits on the first line) */
.terms-check { align-items: flex-start; line-height: 1.5; }
.terms-check input { margin: 3px 0 0; flex-shrink: 0; }
.terms-check input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 1px; }
.terms-check a { color: var(--ink); text-underline-offset: 3px; }
.terms-check a:hover { color: var(--accent-text); }

/* "How it works": who runs the server, and the privacy policy and terms, under a rule */
.about-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; }
dialog .about-foot p { margin: 0; }
.about-contact { color: var(--ink-2); overflow-wrap: anywhere; }
.about-contact .eyebrow { margin-right: 6px; }
.about-contact a { color: var(--ink); text-underline-offset: 3px; }
.about-contact .unset { color: var(--muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
#confirmDlg .legal-links { margin: 0 0 18px; }
.auth-banned { margin: 0; }

/* your own report in the issue's list: "Your report" and a quiet Delete */
.reports .mine-label { color: var(--ink); margin-right: 10px; }
.reports li.mine { box-shadow: inset 3px 0 0 var(--ink); padding-left: 12px; }

/* phones: "How it works" becomes an icon so the masthead fits in one row; the username stays
   (it gives up its caret and is cut short with an ellipsis before anything else has to give) */
@media (max-width: 560px) {
  .top-actions { gap: 8px; flex-shrink: 1; min-width: 0; padding-left: 12px; }
  .top-actions > * { flex-shrink: 0; }
  .top-actions > .acct { flex-shrink: 1; min-width: 0; }
  .nav-btn {
    width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0;
    border: 1px solid transparent; border-radius: var(--r-md); text-decoration: none;
  }
  .nav-btn:hover { border-color: var(--rule); color: var(--ink); }
  .nav-btn .nav-ico { display: block; width: 20px; height: 20px; }
  .nav-btn .nav-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .user-btn { max-width: 100%; min-width: 0; }
  .user-btn .caret { display: none; }
  .user-menu { border-radius: 0 0 var(--r-md) var(--r-md); width: auto; max-width: none; }
  .auth-wrap { padding: 20px 18px 22px; }
  .auth-head h2 { font-size: 28px; }
}
@media (max-width: 400px) {
  .wordmark strong { font-size: 24px; }
  .seg button { padding: 6px 8px; }
  .seg-wide button { padding: 6px 4px; }
}
/* the smallest phones: "Sign in" and the username become icons too */
@media (max-width: 359px) {
  .masthead { padding: 0 10px 0 12px; }
  .wordmark { gap: 8px; }
  .top-actions { gap: 6px; }
  .nav-btn-xs {
    width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0;
    border: 1px solid transparent; border-radius: var(--r-md); text-decoration: none;
  }
  .nav-btn-xs:hover { border-color: var(--rule); color: var(--ink); }
  .nav-btn-xs .nav-ico { display: block; width: 20px; height: 20px; }
  .user-btn[aria-expanded="true"] { border-color: var(--ink); }
  .user-btn.warn::after { position: absolute; top: 5px; right: 5px; }
  .nav-btn-xs .nav-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .seg-wide button { flex: 1 1 auto; padding: 6px 3px; letter-spacing: 0; }
}

/* ================================================================ the map page on phones
   (index.html only: body.map-page). The same media query as PHONE_MQ in app.js: narrow windows,
   and phones turned sideways. A full-screen map; the search bar and the quick chips float at the
   top; the list (or one issue) is a sheet pulled up from the bottom: peek, half, full. app.js sets
   the sheet's height and position, and --sheet-h (how much of it shows) and --mapbar-h on what
   reads them: .map-wrap (the map's controls) and .toast. */
@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
  .map-page { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
  .map-page .masthead { display: none; }
  .map-page .layout { display: block; position: relative; }
  .map-page .map-wrap { position: absolute; inset: 0; }
  .map-page .legend { display: none; }
  .map-page .leaflet-top { top: var(--mapbar-h, 0px); }
  /* the attribution and the locate button ride just above the sheet */
  .map-page .leaflet-bottom { bottom: var(--sheet-h, 80px); transition: bottom .28s var(--ease-sheet); }
  .map-page .map-ctrls { right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(var(--sheet-h, 80px) + 28px); transition: bottom .28s var(--ease-sheet); }
  .map-page .sheet-dragging .leaflet-bottom, .map-page .sheet-dragging .map-ctrls { transition: none; }
  .map-page .panel.snap-full ~ .map-wrap .map-ctrls { visibility: hidden; }

  /* search bar and chips: only they take touches, the map between them gets the rest */
  .map-page .mapbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 530; gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    background: none; border: 0; pointer-events: none;
  }
  .map-page .mapbar > .fsearch { pointer-events: auto; height: 48px; padding-left: 0; }
  .map-page .fsearch-ico { display: none; }
  .map-page .fsearch-home {
    display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 100%; margin-right: 6px; padding: 0;
    border: 0; border-right: 1px solid var(--rule); background: none; cursor: pointer;
  }
  .map-page .fsearch-home .mark { width: 11px; height: 24px; }
  .map-page .avatar-btn { display: grid; }
  .map-page .qchips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; pointer-events: none; }
  .map-page .qchips::-webkit-scrollbar { display: none; }
  .map-page .qchips .qchip { pointer-events: auto; min-height: 40px; border-color: var(--ink); }

  /* the sheet */
  .map-page .panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 520;
    height: calc(100dvh - 120px); transform: translateY(calc(100% - 80px - env(safe-area-inset-bottom, 0px)));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    border: 1px solid var(--ink); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden;
    transition: transform .28s var(--ease-sheet); will-change: transform;
  }
  .map-page .panel.dragging { transition: none; }
  .map-page .panel.held { user-select: none; -webkit-user-select: none; }
  /* peek and half: the whole sheet drags and nothing in it scrolls; full: the list scrolls, the head drags */
  .map-page .panel.snap-peek, .map-page .panel.snap-half { touch-action: none; }
  .map-page .sheet-body { display: block; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .map-page .list { flex: none; overflow: visible; }
  .map-page .panel:not(.snap-full) .detail { overflow: hidden; }
  .map-page .panel.snap-full .sheet-body, .map-page .panel.snap-full .detail { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
  .map-page .sheet-head, .map-page .detail-head { touch-action: none; }
  .map-page .sheet-head { flex-shrink: 0; border-bottom: 2px solid var(--ink); }
  .map-page .sheet-handle { display: grid; place-items: center; width: 100%; height: 20px; padding: 0; border: 0; background: none; cursor: grab; }
  .map-page .sheet-grip { width: 36px; height: 4px; border-radius: 1px; background: var(--muted); }
  .map-page .result-bar { min-height: 60px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 0 16px 8px; border-bottom: 0; }
  .map-page .result-bar h2 { font-size: 21px; max-width: 100%; }
  .map-page .result-csv { display: none; }
  .map-page .sheet-line { display: block; margin: 0; max-width: 100%; color: var(--muted); font-size: 13px; line-height: 1.4; }
  .map-page .sheet-line[hidden] { display: none; }
  .map-page .sheet-line .link-btn { font-size: 13px; }
  .map-page .panel.has-detail .result-bar, .map-page .panel.has-detail .legend-inline { display: none; }
  /* the legend: one line at the top of the list */
  .map-page .legend-inline {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 16px;
    border-bottom: 1px solid var(--rule); font-size: 12px; line-height: 1.4;
  }
  .map-page .legend-inline .legend-row { gap: 4px 10px; flex-wrap: wrap; }
  .map-page .legend-inline .legend-row div { flex-direction: row; align-items: center; gap: 4px; min-width: 0; }
  .map-page .legend-inline .legend-row i { width: 10px; height: 10px; border-radius: 2px; }
  .map-page .legend-inline .legend-row i.pend-dot { border-radius: 50%; }
  /* one issue: over the list, under the grip; its head drags the sheet */
  .map-page .detail { position: absolute; inset: 20px 0 0 0; z-index: 5; }
  .map-page .detail-summary { padding-bottom: 18px; }
  /* rows out of sight are not laid out (a long list is redrawn as the map moves) */
  .map-page .item { grid-template-columns: 40px 1fr 76px; padding-right: 16px; gap: 0 10px; content-visibility: auto; contain-intrinsic-size: auto 110px; }
  .map-page .thumb { width: 76px; height: 76px; }
  .map-page .rank { font-size: 22px; }
  .map-page .detail-body { padding: 20px 16px 32px; }
  .map-page .empty, .map-page .loading { padding: 28px 16px; }
  .map-page .toast { bottom: calc(min(var(--sheet-h, 80px), 50dvh) + 12px); }
  /* the account menu hangs under the search bar (app.js placeMenu) */
  .map-page .user-menu { width: auto; max-width: none; border-top: 1px solid var(--ink); border-radius: var(--r-md); overflow-y: auto; overscroll-behavior: contain; }
  /* the Filters window rises from the bottom */
  .filters-dlg { width: 100%; max-width: none; margin: auto 0 0; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .filters-dlg[open] { max-height: 92dvh; animation: sheet-in .24s var(--ease-sheet); }
}
/* touch screens zoom with two fingers; a narrow window with a mouse keeps the zoom buttons */
@media (max-width: 820px) and (pointer: coarse), (max-height: 500px) and (pointer: coarse) {
  .map-page .leaflet-control-zoom { display: none; }
}
@media (max-width: 359px) {
  .map-page .result-bar h2 { font-size: 19px; }
  .map-page .sheet-line { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-page .panel, .map-page .leaflet-bottom, .map-page .map-ctrls, .toast { transition: none; }
  .filters-dlg[open], .map-btn[aria-busy="true"] svg { animation: none; }
}

/* ================================================================ admin
   Moderator page (admin.html + admin.js). Same tokens and rules as the public
   site; the page scrolls as a document instead of the fixed map layout. */
body.adm { height: auto; min-height: 100%; }
.adm .masthead { position: sticky; top: 0; }
.adm .top-actions { margin-left: auto; }
.adm-label {
  margin: 0 0 0 20px; padding-left: 20px; border-left: 1px solid var(--rule);
  font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; /* gives way before the language and theme buttons do */
}
.adm-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 36px 28px 72px; }
.adm-main h1 { font-size: 36px; }

/* sign-in + "not a moderator" notice */
.adm-login { max-width: 460px; display: flex; flex-direction: column; gap: 16px; }
.adm-login p { margin: 0; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field input {
  padding: 8px 4px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; font-size: 16px; min-width: 0;
}
.field input:focus-visible { outline: none; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }
.adm-login .btn { align-self: flex-start; }
.adm-error, .adm-login .adm-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.adm-error:empty { display: none; }
.adm-notice { max-width: 640px; border-left: 3px solid var(--accent); padding: 2px 0 2px 18px; display: flex; flex-direction: column; gap: 14px; }
.adm-notice p { margin: 0; overflow-wrap: anywhere; }
.adm-notice .btn { align-self: flex-start; }

/* queue header + tabs */
.adm-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-head h1 { margin-right: auto; }
/* Every tab stays in sight: a strip that wraps to a second line when the seven don't fit (the
   Mongolian labels need about 1010px), never a sideways scroll with a hidden scrollbar. */
.adm-tabs { display: flex; flex-wrap: wrap; column-gap: 20px; row-gap: 2px; border-bottom: 2px solid var(--ink); }
.adm-tab {
  display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; flex-shrink: 0;
  border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none;
  padding: 10px 0 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.adm-tab:hover { color: var(--ink); }
.adm-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.adm-tab b { font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: -.3px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.adm-tab b.hot { color: var(--accent-text); }
.adm-help { margin: 12px 0 0; max-width: 72ch; }

/* ledger rows: photo | what it is | what to do */
.adm-list { list-style: none; margin: 6px 0 0; padding: 0; }
.adm-row {
  display: grid; grid-template-columns: 136px minmax(0, 1fr) 184px; gap: 0 22px;
  padding: 18px 0; border-bottom: 1px solid var(--rule); position: relative;
}
.adm-row:focus { outline: none; }
.adm-row:focus-visible::before, .adm-row.busy::before { content: ""; position: absolute; left: -12px; top: 18px; bottom: 18px; width: 3px; background: var(--accent); }
.adm-row.busy { opacity: .55; }
.adm-row.rej { grid-template-columns: 136px minmax(0, 1fr); }
.adm-photo {
  width: 136px; height: 136px; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden;
  background: var(--fill); cursor: zoom-in; display: grid; place-items: center; position: relative; color: var(--muted);
}
.adm-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.adm-photo.loaded img { opacity: 1; }
.adm-photo-msg { display: none; font-size: 12px; line-height: 1.3; padding: 8px; text-align: center; }
.adm-photo.failed { cursor: default; border: 1px dashed var(--rule); }
.adm-photo.failed .adm-photo-msg { display: block; }
.adm-when {
  font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: -.3px; line-height: 1.15;
  font-variant-numeric: lining-nums tabular-nums;
}
.adm-when small { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.adm-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.adm-ids { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.adm-ids b { font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: -.3px; line-height: 1.15; color: var(--ink); }
.adm-ids a { color: var(--ink-2); text-underline-offset: 3px; }
.adm-ids a:hover { color: var(--accent-text); }
.adm-desc { margin: 2px 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.adm-desc.none { color: var(--muted); font-style: italic; }
.adm-flags { font-size: 14px; color: var(--ink-2); }
.adm-flags .eyebrow { color: var(--accent-text); margin-right: 6px; }
.adm-flags b { color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill.warn { color: var(--accent-text); }
.pill.muted { color: var(--muted); }
.adm-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.adm-actions .btn { padding: 6px 12px; font-size: 13px; }
.adm-actions .link-btn { font-size: 13px; align-self: flex-start; margin-top: 4px; color: var(--ink-2); }
.adm-actions .link-btn:hover { color: var(--accent-text); }
.adm-actions button:disabled { cursor: progress; }
.adm-empty { padding: 40px 0; color: var(--muted); }
.adm-empty .link-btn { margin-left: 8px; }
/* no photo to show (a fix marked by the old votes, a post whose photos are all hidden) */
.adm-photo.empty { cursor: default; border: 1px dashed var(--rule); }
.adm-photo.empty .adm-photo-msg { display: block; }

/* Fixes: the issue's earlier photos next to the fix photo, small, each opens full size */
.adm-before { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 2px; }
.adm-before-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; }
.adm-before-item { margin: 0; display: flex; flex-direction: column; gap: 3px; min-width: 56px; }
.adm-before-item .eyebrow { font-size: 10px; letter-spacing: .06em; white-space: nowrap; }
.adm-before .none { color: var(--muted); font-size: 13px; font-style: italic; }
.adm-thumb {
  width: 56px; height: 56px; padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden;
  background: var(--fill); cursor: zoom-in; position: relative; display: block;
}
.adm-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.adm-thumb.loaded img { opacity: 1; }
.adm-thumb.failed { cursor: default; border: 1px dashed var(--rule); }
.adm-stats { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.adm-ai { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.adm-ai span { color: var(--muted); }
/* "Why reject it?": the reasons under the row, as on the public site's "Report photo" */
.adm-reject {
  grid-column: 1 / -1; margin-top: 12px; border-left: 3px solid var(--accent); padding: 2px 0 2px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.adm-reject .chips { align-items: center; }
.adm-reject .link-btn { font-size: 13px; color: var(--muted); margin-left: 6px; }
.adm-reject button:disabled { opacity: .5; cursor: progress; }
/* Fixes tab: reopen any fixed issue by its number */
.adm-reopen { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 4px; max-width: 460px; }
.adm-reopen-row { display: flex; align-items: flex-end; gap: 12px; }
.adm-reopen input {
  width: 180px; min-width: 0; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; font-size: 16px; -moz-appearance: textfield; appearance: textfield;
}
.adm-reopen input::-webkit-outer-spin-button, .adm-reopen input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.adm-reopen input:focus-visible { outline: none; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }
.adm-reopen input[aria-invalid="true"] { border-bottom-color: var(--danger); }
.adm-reopen .btn { padding: 6px 12px; font-size: 13px; }
.adm-reopen .btn:disabled { cursor: progress; opacity: .6; }

/* dialogs: confirm (also the public site's "Delete your report?") + full-size photo */
.adm-dlg-actions, .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
dialog .adm-dlg-actions .btn, dialog .dlg-actions .btn { align-self: auto; }
.adm-photo-dlg { max-width: min(1100px, calc(100% - 32px)); }
.adm-photo-dlg form { padding: 12px; gap: 10px; }
.adm-photo-dlg img { display: block; max-width: 100%; max-height: calc(100vh - 150px); margin: 0 auto; object-fit: contain; background: #000; }
.adm-photo-dlg .adm-dlg-actions { align-items: center; justify-content: space-between; margin: 0; }
.adm-photo-dlg .help { margin: 0; }

/* who is signed in, reporter of a photo, Users tab */
.adm-who { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.adm-reporter { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-size: 14px; color: var(--ink-2); }
.adm-reporter .link-btn { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.adm-reporter .none { color: var(--muted); font-style: italic; }
.adm-search { max-width: 460px; margin: 14px 0 4px; }
.adm-row.usr { grid-template-columns: minmax(0, 1fr) 184px; }
.adm-row.usr .adm-ids b, .adm-email { overflow-wrap: anywhere; }

/* ================================================================ accounts
   Moderator sign-in (admin.html) and the account page (account.html), where the links in
   confirmation and password-reset emails land. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.adm-boot { margin: 0; color: var(--muted); }
.adm-login-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.adm-login .adm-login-actions .btn { align-self: center; }
/* password field with its Show / Hide switch on the same rule */
.pw-wrap { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--ink); }
.pw-wrap:focus-within { border-bottom: 2px solid var(--accent); margin-bottom: -1px; }
.field .pw-wrap input, .field .pw-wrap input:focus-visible { flex: 1; border-bottom: 0; margin-bottom: 0; }
.pw-toggle { flex-shrink: 0; font-size: 13px; color: var(--ink-2); }
/* live password rules: dash = not yet, tick = met, cross = still missing after a try */
.pw-rules-box { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.pw-rules li { display: flex; gap: 8px; }
.pw-rules li::before { content: "\2013"; width: 14px; flex-shrink: 0; text-align: center; font-weight: 700; }
.pw-rules li.ok { color: var(--ink); }
.pw-rules li.ok::before { content: "\2713"; }
.pw-rules li.bad { color: var(--danger); font-weight: 600; }
.pw-rules li.bad::before { content: "\00D7"; }
.pw-rules li.info::before { content: "\2022"; }
/* outcome lines: ruled in ink when it worked, in red when it didn't */
.adm-login .acct-msg { margin: 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--rule); color: var(--ink); }
.adm-login .acct-msg.ok { border-left-color: var(--ink); }
.adm-login .acct-msg.bad { border-left-color: var(--danger); }
.acct-msg:focus { outline: none; }
.adm-login .acct-note { font-size: 14px; }
.acct-foot {
  margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); max-width: 460px; font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 6px 22px;
}

@media (max-width: 820px) {
  .adm-main { padding: 22px 16px 56px; }
  .adm-main h1 { font-size: 30px; }
  .adm-label { margin-left: 12px; padding-left: 12px; }
}
@media (max-width: 680px) {
  .adm-row, .adm-row.rej { grid-template-columns: 88px minmax(0, 1fr); gap: 12px 14px; }
  .adm-row.usr { grid-template-columns: minmax(0, 1fr); }
  .adm-photo { width: 88px; height: 88px; }
  .adm-when { font-size: 18px; }
  .adm-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .adm-actions .btn { flex: 1 1 auto; }
  .adm-actions .link-btn { margin: 2px 14px 0 0; }
  .adm-row:focus-visible::before, .adm-row.busy::before { left: -8px; }
}
@media (max-width: 520px) {
  /* Every tab stays visible: two columns instead of a sideways-scrolling strip. A rule under every
     tab but the last row's (the last tab, and the one before it when it starts that row), for any
     number of tabs; the chosen tab's accent line takes the same height, so nothing moves. */
  .adm-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 0; }
  /* a label too long for its half breaks onto a second line; the count never shrinks */
  .adm-tab { padding: 10px 0 7px; justify-content: space-between; margin-bottom: 0; white-space: normal; text-align: start; }
  .adm-tab span { min-width: 0; overflow-wrap: anywhere; }
  .adm-tab b { flex-shrink: 0; }
  .adm-tab:not(:last-child):not(:nth-last-child(2):nth-child(odd)):not([aria-selected="true"]) {
    border-bottom: 1px solid var(--rule); padding-bottom: 9px;
  }
}
@media (max-width: 400px) {
  .adm .wordmark strong { font-size: 24px; }
  .adm-label { letter-spacing: .05em; }
}

/* ================================================================ privacy and terms
   privacy.html, terms.html (+ legal.js): a document in the moderator page's frame. Each page
   holds its text in both languages; <html lang> (set before first paint by theme-init.js) shows
   one of them. */
html[lang="en"] .legal[lang="mn"], html:not([lang="en"]) .legal[lang="en"] { display: none; }
.legal { max-width: 760px; }
.legal h1 { font-size: 40px; }
.legal .updated { display: block; margin: 10px 0 0; }
.legal .lead { margin: 22px 0 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.legal h2 { font-size: 24px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.legal h3 { font-size: 19px; letter-spacing: -.3px; margin: 22px 0 6px; }
.legal p { margin: 0 0 12px; }
/* Every entry is numbered N.M in the markup (copyable, so people can refer to "6.3"); the
   number hangs in the left margin so wrapped lines align with the text. */
.legal .clauses { list-style: none; margin: 0 0 12px; padding: 0; }
.legal .clauses li { margin: 0 0 8px; }
.legal .clauses li, .legal .clause { position: relative; padding-left: 3.2em; }
.legal .clause-no { position: absolute; left: 0; top: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.legal strong { font-weight: 600; }
.legal a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal a:hover { color: var(--accent-text); }
.legal code { font-size: 14px; overflow-wrap: anywhere; }
/* who to write to: ruled in the accent */
.legal-contact { margin: 18px 0 0; border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; overflow-wrap: anywhere; }
.legal-contact .eyebrow { display: block; }
.legal-contact .unset { color: var(--muted); }
/* "On this server right now": live settings from /api/meta, a ruled two-column list */
.legal-now { display: grid; grid-template-columns: auto 1fr; gap: 0 18px; margin: 4px 0 14px; font-size: 15px; }
.legal-now dt, .legal-now dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.legal-now dt { color: var(--ink-2); }
.legal-now .clause-no { position: static; display: inline-block; min-width: 3.2em; }
.legal-now dd { font-weight: 600; overflow-wrap: anywhere; }
.legal-page .acct-foot { max-width: 760px; }

@media (max-width: 820px) {
  .legal h1 { font-size: 32px; }
  .legal .lead { font-size: 17px; }
  .legal h2 { font-size: 22px; margin-top: 32px; }
}
@media (max-width: 480px) {
  .legal-page .adm-label { display: none; } /* the page's heading says it, and the masthead has no room */
  .legal-now { grid-template-columns: 1fr; }
  .legal-now dt { border-bottom: 0; padding-bottom: 0; }
}
