/* Field UI: large touch targets, high contrast for sunlight, works one-handed. */

:root {
  --bar: #1d232a;
  --bar-text: #f4f6f8;
  --bg: #ffffff;
  --text: #15191e;
  --muted: #5c6670;
  --line: #d9dee3;
  --primary: #0b6bcb;
  --primary-text: #ffffff;
  --danger: #c62828;
  --ok: #1e7e45;

  /* Surfaces: --bg for the sheet, dialogs, cards and inputs; --page behind the plain pages. */
  --page: #f3f5f7;
  --subtle: #eef1f4; /* a quiet fill: source chips, row hover, list dividers */
  --track: #e6e9ec; /* empty thumbnails, progress tracks, chart grid */
  --selected: #e8f1fb; /* the chosen radio, a pressed search hit, the current suggestion */
  --bar-link: #9fd0ff; /* a link on the dark bar */
  --bar-line: #56606a; /* a button outline on the dark bar */
  --toast: #222b33;
  --map-bg: #2b3136;
  --focus-ring: rgb(11 107 203 / .35);
  --pending-ink: #002033; /* text on --pending */

  /* Tones: a light fill with dark ink for chips, notes and chosen answers (every pair >= 6.5:1),
     and a matching outline. One tone per meaning; the state classes map onto them below. */
  --good-bg: #d5f5e3; --good-ink: #145a32; --good-line: #a8e6c1;
  --info-bg: #d6ecfd; --info-ink: #0b4f80;
  --bad-bg: #ffe0e0; --bad-ink: #8e1b1b; --bad-line: #f1b7b7;
  --warn-bg: #ffe8c7; --warn-ink: #7a4100; --warn-line: #ffcf8f;
  --note-bg: #fff4c2; --note-ink: #6b5500;
  --violet-bg: #e8e1f7; --violet-ink: #4527a0; --violet-line: #d3bdf5;
  --neutral-bg: #eceff1; --neutral-ink: #37474f;

  /* Shape */
  --r: 10px; /* buttons, inputs */
  --r-card: 12px; /* cards, chips */
  --r-lg: 16px; /* dialogs, the sheet, bars over the map */
  --shadow-float: 0 3px 8px rgb(0 0 0 / .45); /* buttons and bars over the map */
  --shadow-pop: 0 4px 14px rgb(0 0 0 / .18); /* tooltips */

  /* Map colours (keep in sync with LOOKS in app.js) */
  --todo: #ffd60a;
  --done: #2ecc71;
  --pending: #3fa9f5;
  --cannot: #ff4d4d;
  --not-grave: #9e9e9e;
  --point: #ff8c1a;
  --partial: #ff9f1a; /* inscription legibility; readable and illegible reuse --done and --cannot */
  --no-inscription: #c38fff;

  --sheet-h: 0px; /* how much of the map the sheet covers at the bottom (app.js) */
  --sheet-w: 0px; /* … and on the right, when it is the review's side panel */
  --rv-bar-h: 0px; /* height of the review bar (review.js) */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bar); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Sprite icons only: a bare "svg" rule would also shrink Leaflet's SVG layer (the points). */
svg:has(> use) { width: 24px; height: 24px; flex: none; }
[hidden] { display: none !important; }

/* --- Top bar --- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: 56px; padding: 0 8px 0 14px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bar); color: var(--bar-text);
  box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
#counter { flex: 1; min-width: 0; line-height: 1.15; }
#counter-main { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#counter-points { font-size: 13px; opacity: .8; }
.icon {
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent;
}
#topbar .icon { color: var(--bar-text); }
.pill {
  height: 40px; padding: 0 14px; border: 0; border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
  background: var(--pending); color: var(--pending-ink); font-weight: 700;
}
.pill.failed { background: var(--cannot); color: #fff; }
.pill.busy svg { animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

/* --- Map --- */
#map { position: fixed; inset: 56px 0 0 0; background: var(--map-bg); }
.leaflet-container { font: inherit; }
/* Attribution (required by OpenStreetMap) stays visible above the bottom sheet. */
.leaflet-bottom { bottom: var(--sheet-h); transition: bottom .15s; }
.leaflet-right { right: var(--sheet-w); }
.leaflet-container .leaflet-control-attribution { font-size: 11px; max-width: calc(100vw - 90px); background: rgb(255 255 255 / .75); }
/* Let taps fall through to the plot canvas below (see renderers in app.js). */
.leaflet-gps-pane, .leaflet-points-pane { pointer-events: none; }
.leaflet-points-pane .leaflet-interactive { pointer-events: auto; }

.draft-pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0;
  background: var(--point); border: 3px solid #fff;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgb(0 0 0 / .5);
}
.plot-label {
  background: rgb(0 0 0 / .55); color: #fff; border: 0; border-radius: 4px;
  box-shadow: none; padding: 1px 4px; font-size: 12px; font-weight: 600;
}
.plot-label::before { display: none; }
/* Zone outlines and labels (app.js zoneLayer): under the plots, never tappable. */
.leaflet-zones-pane, .leaflet-zones-pane * { pointer-events: none !important; }
.zone-label {
  background: rgb(29 35 42 / .8); color: #fff; border: 2px solid #fff; border-radius: 8px;
  box-shadow: none; padding: 2px 8px; font-size: 15px; font-weight: 800;
  pointer-events: none;
}
.zone-label::before { display: none; }
.close-up .zone-label { display: none; }

/* --- Floating buttons --- */
#fabs {
  position: fixed; right: calc(var(--sheet-w) + 14px); z-index: 900;
  bottom: calc(var(--sheet-h) + 18px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
  transition: bottom .15s;
}
.fab {
  width: 56px; height: 56px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); color: var(--text);
  box-shadow: var(--shadow-float);
}
.fab svg { width: 28px; height: 28px; }
#fabs #add-btn { background: var(--point); color: #1a0d00; }
#locate-btn.active { color: var(--primary); }
body.adding #fabs #add-btn { display: none; }

/* Small buttons at the top right: layers, back to the cemetery. */
#map-tools {
  position: fixed; top: 68px; right: calc(var(--sheet-w) + 14px); z-index: 900;
  display: flex; flex-direction: column; gap: 10px;
}
.fab.small { width: 44px; height: 44px; }
.fab.small svg { width: 24px; height: 24px; }
body.lite #layers-btn { color: var(--primary); box-shadow: 0 0 0 3px var(--primary), var(--shadow-float); }

/* Banners under the top bar, leaving room for #map-tools (and the card's side panel) on the right. */
.banner {
  position: fixed; top: 64px; left: 12px; right: calc(var(--sheet-w) + 70px); z-index: 950;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 10px 10px 16px; border-radius: 20px;
  background: var(--point); color: #1a0d00; font-weight: 700;
  box-shadow: var(--shadow-float);
}
#add-banner { justify-content: space-between; }
body.reviewing .banner { top: calc(72px + var(--rv-bar-h)); }
#far-banner { background: var(--bar); color: var(--bar-text); }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#far-banner .link { background: var(--bg); color: var(--text); min-height: 36px; }
#demo-tag {
  position: fixed; left: 8px; z-index: 800; pointer-events: none;
  bottom: calc(var(--sheet-h) + 26px); transition: bottom .15s;
  padding: 3px 8px; border-radius: 6px;
  background: rgb(198 40 40 / .9); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.link { border: 0; background: rgb(255 255 255 / .85); border-radius: 16px; padding: 6px 12px; font-weight: 700; }

/* --- Bottom sheet --- */
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  /* dvh: the screen above Safari's toolbar (vh is taller on an iPhone); vh where dvh is unknown.
     At most 62 %, and on a short phone less, so the floating buttons (about 145 px) fit between the sheet
     and the map buttons at the top (which end 166 px down); never below half the screen. */
  max-height: 62vh; max-height: max(50dvh, min(62dvh, 100dvh - 320px)); overflow-y: auto;
  --sheet-pad-b: calc(16px + var(--safe-bottom));
  padding: 10px 16px var(--sheet-pad-b);
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -4px 14px rgb(0 0 0 / .35);
}
.sheet-head { display: flex; align-items: flex-start; gap: 8px; }
.sheet-head > div { flex: 1; min-width: 0; padding-top: 6px; }
.sheet-head h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0; font-size: 15px; }
/* A chip is a short label in a tone; it never breaks inside a word and never shrinks beside a title
   (the title wraps instead); only one longer than its whole row ends in "…". */
.chip {
  display: inline-block; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  padding: 3px 10px; border-radius: var(--r-card); font-size: 13px; font-weight: 700;
  background: var(--tone-bg, var(--neutral-bg)); color: var(--tone-ink, var(--neutral-ink));
}
/* State → tone. Field status, occupancy, review (LOOKS rv*) and lease (LOOKS ls*) states, as in app.js;
   unknown, none and "not a grave" stay neutral. */
.chip.done, .chip.rvConfirmed, .chip.ls-active, .chip.occ-free { --tone-bg: var(--good-bg); --tone-ink: var(--good-ink); }
.chip.pending, .chip.rvPlaced, .chip.occ-occupied { --tone-bg: var(--info-bg); --tone-ink: var(--info-ink); }
.chip.cannot, .chip.ls-expired { --tone-bg: var(--bad-bg); --tone-ink: var(--bad-ink); }
.chip.rvOcr, .chip.ls-expiring { --tone-bg: var(--warn-bg); --tone-ink: var(--warn-ink); }
.chip.todo, .chip.rvPhoto { --tone-bg: var(--note-bg); --tone-ink: var(--note-ink); }
.chip.occ-reserved { --tone-bg: var(--violet-bg); --tone-ink: var(--violet-ink); }
.chip.src { --tone-bg: var(--subtle); --tone-ink: var(--muted); }
.pending-text { color: var(--info-ink); font-weight: 700; }
.hint { color: var(--muted); margin: 6px 0 10px; }
.hint.warn { color: var(--warn-ink); font-weight: 650; }

/* Grave card: the buried, and the registry and OCR blocks (office) */
.people { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 8px; }
.people li { line-height: 1.35; overflow-wrap: anywhere; }
.people li.exhumed { opacity: .65; }
.people .sub { margin-top: 0; }
details.registry, details.ocr, details.lease { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
details.registry summary, details.ocr summary, details.lease summary { min-height: 44px; display: flex; align-items: center; font-weight: 650; cursor: pointer; }
details.registry > .muted, details.ocr > .muted, details.lease > .muted { margin: 0 0 8px; }
/* The lease (D60): status, holder, the office's records. */
details.lease summary { gap: 8px; }
details.lease > p, details.lease > div { margin: 0 0 8px; line-height: 1.4; overflow-wrap: anywhere; }
details.lease h4 { margin: 14px 0 4px; font-size: 15px; color: var(--muted); }
details.lease a, .lease-card a[href^="tel:"] { color: var(--primary); font-weight: 650; }
a[href^="tel:"] { white-space: nowrap; } /* a phone number never breaks over two lines */
.lease-events { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.lease-event { display: flex; align-items: flex-start; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); line-height: 1.35; overflow-wrap: anywhere; }
.lease-event:last-child { border-bottom: 0; }
.lease-event > div { flex: 1; min-width: 0; }
.lease-event .sub { margin-top: 0; }
/* The place (D62): occupancy, the reservation, reserve and record a burial (burial.js). */
.place-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.place-block > * { margin: 0; }
.place-block .row { margin-top: 0; }
.reservation { padding: 8px 12px; border-left: 4px solid var(--no-inscription); border-radius: 6px; background: var(--violet-bg); line-height: 1.4; overflow-wrap: anywhere; }
.reservation .sub { margin-top: 0; }
.reservation a[href^="tel:"] { color: var(--primary); font-weight: 650; }
.field.inline { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.field.inline > span { font-weight: 400; color: var(--muted); font-size: 15px; }
label.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 650; }
label.check input { width: 22px; height: 22px; margin: 0; flex: none; }
.burial-lease { display: grid; gap: 10px; }
.burial-lease .lease-fields { display: grid; gap: 12px; }
.burial-lease .lease-fields[hidden] { display: none; }
.field textarea, dialog textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); font-weight: 400; resize: vertical;
}
.lease-event > .btn { flex: none; }
#lease-dlg small { font-weight: 400; }
details.registry a { color: var(--primary); font-weight: 650; display: inline-block; padding: 4px 0; }
/* OCR readings (D52): one item per photo and model, its people below. */
.ocr-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 10px; }
.ocr-list > li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ocr-list > li:last-child { border-bottom: 0; }
.ocr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; color: var(--muted); }
.ocr-photo { border: 0; background: none; padding: 10px 0; min-height: 44px; color: var(--primary); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.ocr-list .people { margin: 2px 0 0; gap: 4px; }
.ocr-list .hint { margin: 2px 0 0; }

/* Inscription legibility (D50): one tap saves, a tap on the chosen answer takes it back. */
.legibility { margin: 14px 0 4px; }
.choices-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  min-height: 48px; padding: 4px 10px; border-radius: var(--r);
  border: 2px solid var(--line); background: var(--bg); font-weight: 650; line-height: 1.2;
}
/* The chosen answer: colour and a check mark (not colour alone). */
.choice[aria-pressed="true"]::before { content: "✓ "; }
.choice.readable[aria-pressed="true"] { border-color: var(--done); background: var(--good-bg); color: var(--good-ink); }
.choice.partial[aria-pressed="true"] { border-color: var(--partial); background: var(--warn-bg); color: var(--warn-ink); }
.choice.illegible[aria-pressed="true"] { border-color: var(--cannot); background: var(--bad-bg); color: var(--bad-ink); }
.choice.no_inscription[aria-pressed="true"] { border-color: var(--no-inscription); background: var(--violet-bg); color: var(--violet-ink); }

.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.thumbs:empty { display: none; }
.thumb {
  position: relative; flex: none; width: 76px; height: 76px; padding: 0;
  border: 0; border-radius: 8px; overflow: hidden; background: var(--track);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge {
  position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 8px;
  background: var(--pending); color: var(--pending-ink); font-size: 11px; font-weight: 800;
}
.thumb .badge.failed { background: var(--cannot); color: #fff; }

.btn {
  min-height: 48px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 650; text-decoration: none;
}
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.secondary { background: var(--bg); color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--bg); color: var(--danger); border-color: var(--bad-line); }
.btn.big { width: 100%; min-height: 64px; font-size: 19px; border-radius: 14px; }
.btn.big svg { width: 30px; height: 30px; }
.btn.wide { width: 100%; }
.btn.small { padding: 0 12px; font-size: 14px; gap: 4px; min-height: 44px; }
.btn.small svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.row > .btn { flex: 1 1 auto; }
textarea {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--r);
  resize: vertical; background: var(--bg); margin: 4px 0 8px;
}

/* --- Dialogs --- */
dialog {
  width: min(480px, calc(100% - 24px)); max-height: calc(100% - 48px);
  padding: 16px; border: 0; border-radius: var(--r-lg);
  background: var(--bg); color: var(--text);
  box-shadow: 0 8px 30px rgb(0 0 0 / .5);
}
dialog::backdrop { background: rgb(0 0 0 / .55); }
dialog h3 { margin: 0 0 10px; font-size: 19px; }
dialog h4 { margin: 18px 0 6px; font-size: 15px; color: var(--muted); }
/* On phones the layers panel is a sheet at the bottom, in thumb reach. */
dialog.bottom {
  margin: auto auto 0; width: 100%; max-width: 520px; max-height: 85vh; max-height: 85dvh;
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: calc(16px + var(--safe-bottom));
}
dialog fieldset { border: 0; margin: 10px 0 0; padding: 0; }
dialog fieldset:disabled { opacity: .45; }
dialog legend { padding: 0; margin-bottom: 2px; font-size: 15px; font-weight: 650; color: var(--muted); }
.radio.switch { min-height: 60px; background: var(--page); }
.radio.switch span { display: grid; gap: 2px; }
#layers-dlg .legend { margin-top: 8px; padding-left: 6px; }
#ortho-quality { margin: 0 0 4px 34px; }
#ortho-quality legend { font-size: 13px; font-weight: 600; }
#background-layers:disabled #ortho-quality { opacity: 1; } /* the outer fieldset already fades it */
.dlg-head { display: flex; align-items: center; gap: 8px; }
.dlg-head h3 { flex: 1; margin: 0; overflow-wrap: anywhere; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 6px; border-radius: 8px; }
.radio:has(input:checked) { background: var(--selected); font-weight: 650; }
.radio input { width: 22px; height: 22px; margin: 0; }
.menu-list { display: grid; gap: 8px; margin-top: 10px; }
.muted { color: var(--muted); font-size: 14px; }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.sw { width: 26px; height: 16px; border-radius: 3px; border: 2px solid; flex: none; }
.sw.todo { border-color: var(--todo); background: rgb(255 214 10 / .25); }
.sw.done { border-color: var(--done); background: rgb(46 204 113 / .5); }
.sw.pending { border-color: var(--pending); background: rgb(63 169 245 / .5); }
.sw.cannot { border-color: var(--cannot); background: rgb(255 77 77 / .4); }
.sw.notGrave { border-color: var(--not-grave); border-style: dashed; background: rgb(158 158 158 / .25); }
.sw.readable { border-color: var(--done); background: rgb(46 204 113 / .5); }
.sw.partial { border-color: var(--partial); background: rgb(255 159 26 / .5); }
.sw.illegible { border-color: var(--cannot); background: rgb(255 77 77 / .5); }
.sw.no_inscription { border-color: var(--no-inscription); background: rgb(195 143 255 / .5); }
.sw.point { width: 18px; height: 18px; border-radius: 50%; border-color: #fff; background: var(--point); box-shadow: 0 0 0 1px #999; }
.sw.rvNone { border-color: #b0bec5; background: rgb(176 190 197 / .15); }
.sw.rvPhoto { border-color: var(--todo); background: rgb(255 214 10 / .4); }
.sw.rvOcr { border-color: var(--partial); background: rgb(255 159 26 / .55); }
.sw.rvPlaced { border-color: var(--pending); background: rgb(63 169 245 / .5); }
.sw.rvConfirmed { border-color: var(--done); background: rgb(46 204 113 / .6); }
.sw.lsActive { border-color: var(--done); background: rgb(46 204 113 / .5); }
.sw.lsExpiring { border-color: var(--partial); background: rgb(255 159 26 / .6); }
.sw.lsExpired { border-color: var(--cannot); background: rgb(255 77 77 / .55); }
.sw.lsUnknown { border-color: #90a4ae; background: rgb(144 164 174 / .45); }
.sw.lsNone { border-color: #b0bec5; background: rgb(176 190 197 / .15); }
.sw.ocOccupied { border-color: var(--pending); background: rgb(63 169 245 / .5); }
.sw.ocFree { border-color: var(--done); background: rgb(46 204 113 / .6); }
.sw.ocReserved { border-color: var(--no-inscription); background: rgb(195 143 255 / .6); }
.sw.ocUnknown { border-color: #90a4ae; background: rgb(144 164 174 / .45); }
.sw.ocNone { border-color: #b0bec5; background: rgb(176 190 197 / .15); }
.sw.you { width: 16px; height: 16px; border-radius: 50%; border-color: #fff; background: #1e88e5; box-shadow: 0 0 0 4px rgb(30 136 229 / .3); }

/* Queue list */
#queue-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
#queue-list li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
#queue-list img, #queue-list .q-icon {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--track);
  display: grid; place-items: center;
}
.q-name { font-weight: 650; overflow-wrap: anywhere; }
.q-state { font-size: 14px; color: var(--muted); }
.q-state.failed { color: var(--danger); }
.q-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 4px; }
.q-bar > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }
#queue-list .row { grid-column: 2; margin-top: 0; }
#queue-list .row .btn { min-height: 40px; }

/* Full-screen photo viewer */
dialog.full {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  margin: 0; padding: 0; border-radius: 0; background: #000; color: #fff;
}
dialog.full[open] { display: flex; flex-direction: column; }
#viewer-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-bar { padding: 10px 12px calc(12px + var(--safe-bottom)); background: #111; }
#viewer-caption { font-size: 14px; opacity: .85; }
.viewer-bar .btn.secondary { background: #2a2f35; color: #fff; border-color: #444; }
.viewer-bar .btn.danger { background: #2a2f35; color: #ff8a80; border-color: #6d3030; }

/* Search: full screen on phones, a tall card on wider screens */
dialog.sheet-full {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  margin: 0; padding: 0; border-radius: 0;
}
dialog.sheet-full[open] { display: flex; flex-direction: column; }
@media (min-width: 600px) {
  dialog.sheet-full { max-width: 560px; height: calc(100% - 48px); margin: 24px auto; border-radius: var(--r-lg); }
}
.search-head {
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px;
  border-bottom: 1px solid var(--line); color: var(--muted);
}
#search-input { flex: 1; min-width: 0; min-height: 52px; padding: 0 8px; border: 0; background: transparent; font-size: 18px; color: var(--text); }
#search-input:focus-visible { outline: none; }
#search-input::-webkit-search-cancel-button { display: none; } /* the close button is next to it; two crosses looked alike */
#search-status { margin: 10px 16px; }
#search-status:empty { display: none; }
#search-results { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 0 calc(16px + var(--safe-bottom)); }
.hit {
  display: block; width: 100%; min-height: 56px; padding: 10px 16px; text-align: left;
  border: 0; border-bottom: 1px solid var(--subtle); background: none;
}
.hit:active { background: var(--selected); }
.hit-name { font-size: 17px; font-weight: 650; margin-right: 6px; }
.hit .chip { margin-right: 4px; font-size: 12px; }
.hit .sub { display: block; }
.hit-note { margin: 0; padding: 8px 16px 12px; background: var(--page); }
.search-more { padding: 12px 16px; }

/* Toast */
#toast {
  display: flex; align-items: center; gap: 12px;
  /* Centred left of the map buttons (#map-tools), so they stay tappable. */
  position: fixed; left: 12px; right: calc(var(--sheet-w) + 70px); top: 66px; margin: 0 auto; z-index: 2000;
  transform: translateY(-20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 82px - var(--sheet-w)); width: max-content;
  padding: 12px 16px; border-radius: 12px;
  background: var(--toast); color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgb(0 0 0 / .45);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: none; }
#toast.show:has(#toast-action:not([hidden])) { pointer-events: auto; }
#toast-action { flex: none; min-height: 36px; color: var(--text); }
#toast.error { background: var(--danger); }
#toast.ok { background: var(--ok); }
/* While reviewing, below the review bar (like the banners), so a toast with an action never covers its buttons. */
body.reviewing #toast { top: calc(72px + var(--rv-bar-h)); }

/* --- Plain pages (login.html, users.html, …): the document scrolls, not body, so printing and the
   window scroll event see the whole page --- */
body.page { height: auto; overflow: visible; background: var(--page); }
html:has(body.page) { height: auto; overflow: auto; background: var(--page); }
.login {
  max-width: 400px; margin: 0 auto; padding: 48px 20px calc(24px + var(--safe-bottom));
  display: grid; gap: 14px; justify-items: center; text-align: center;
}
.login h1 { margin: 0; font-size: 26px; }
.login p { margin: 0; }
.login form { width: 100%; display: grid; gap: 14px; text-align: left; margin: 10px 0; }
.field, .login label { display: grid; gap: 6px; font-weight: 650; }
/* Text inputs and selects: one look in forms, dialogs, the review search and the finder. */
.field input, .field select, .login input, dialog input:not([type=radio]):not([type=checkbox]), dialog select,
.rv-search, .find-row input {
  width: 100%; min-height: 48px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); font-weight: 400;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus-ring); border-color: var(--primary); }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--bad-bg); color: var(--bad-ink); font-weight: 650; }
dialog form.stack { display: grid; gap: 12px; }
dialog form.stack > * { margin: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* The page header: back to the map, the title, the language button (one row down to 360 px). */
.page-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 6px 12px 6px 16px; background: var(--bar); color: var(--bar-text);
}
.page-head a { color: var(--bar-link); text-decoration: none; font-weight: 650; white-space: nowrap; }
.page-head h1 { flex: 1; min-width: 0; margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.page-head .btn { min-height: 40px; padding: 0 12px; background: transparent; color: inherit; border-color: var(--bar-line); }
.page-main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(24px + var(--safe-bottom)); display: grid; gap: 14px; }
.page-main.wide { max-width: 1100px; }
.cards-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* Cards: one look for list items, report tiles and figures; each sets its own padding and layout. */
.card, .user-card, .lease-card, .rp-card, .rp-tile { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); }
.user-card {
  width: 100%; display: grid; gap: 2px; justify-items: start; text-align: left; padding: 12px 14px;
}
.user-card b { font-size: 17px; }
.user-card.off { opacity: .6; }
body.page #toast { top: 70px; right: 12px; max-width: calc(100% - 24px); }

/* --- Leases page (leases.js) --- */
.leases { display: grid; gap: 12px; }
.leases > p { margin: 0; }
.leases .row { margin-top: 0; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 22px;
  background: var(--bg); font-weight: 650; cursor: pointer;
}
.filter-chip[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.filter-chip.ls-expired:not([aria-pressed="true"]) { border-color: var(--bad-line); }
.filter-chip.ls-expiring:not([aria-pressed="true"]) { border-color: var(--warn-line); }
.filter-chip.ls-active:not([aria-pressed="true"]), .filter-chip.occ-free:not([aria-pressed="true"]) { border-color: var(--good-line); }
.filter-chip.occ-reserved:not([aria-pressed="true"]) { border-color: var(--violet-line); }
.lease-card { display: grid; gap: 6px; padding: 12px 14px; line-height: 1.4; overflow-wrap: anywhere; }
.lease-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lease-card .row { margin-top: 4px; }

/* --- Grave finder (find.js) --- */
.finder > p { margin: 0; }
.demo-strip { padding: 8px 12px; border-radius: var(--r); background: var(--danger); color: #fff; font-weight: 800; }
.find-form { display: grid; gap: 8px; min-width: 0; } /* lets the input shrink to the phone width */
.find-form > p { margin: 0; }
.find-label { font-weight: 650; }
.find-row { display: flex; gap: 8px; }
/* width 0: without it the input keeps its built-in width and a 360 px phone scrolls sideways. */
.find-row input { flex: 1; width: 0; min-width: 0; min-height: 52px; font-size: 18px; }
.find-row .btn { flex: none; min-height: 52px; }
.find-card-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.find-name { font-size: 18px; }
.find-place { font-weight: 650; }
.find-note { color: var(--muted); }
.find-photo { flex: none; }
.find-photo img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--track); }
.find-map-box { display: grid; gap: 8px; scroll-margin-top: 64px; }
.find-map-box > p { margin: 0; }
#find-map { height: min(60vh, 520px); border-radius: var(--r-card); border: 1px solid var(--line); background: var(--track); }
.find-map-place { font-size: 17px; overflow-wrap: anywhere; }
.find-foot { display: grid; gap: 8px; justify-items: start; padding-top: 8px; border-top: 1px solid var(--line); }
.find-foot p { margin: 0; }
.find-foot a { color: var(--primary); font-weight: 650; min-height: 44px; display: inline-flex; align-items: center; }

/* --- Office review (review.js) --- */
/* Keyboard hints only where there is a keyboard and a mouse. */
kbd { display: none; }
@media (hover: hover) and (pointer: fine) {
  kbd {
    display: inline-block; min-width: 1.6em; padding: 0 4px; margin-left: 2px;
    border: 1px solid currentColor; border-radius: 4px; opacity: .7;
    font: 700 12px/1.5 ui-monospace, monospace; text-align: center;
  }
}
#review-bar {
  position: fixed; top: 64px; left: 12px; right: calc(var(--sheet-w) + 70px); z-index: 940;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 6px 6px 6px 14px; border-radius: var(--r-lg);
  background: var(--bar); color: var(--bar-text);
  box-shadow: var(--shadow-float);
}
.rv-bar-main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.rv-counts { display: flex; gap: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rv-counts span { display: inline-flex; align-items: center; gap: 5px; }
.rv-counts .sw { width: 16px; height: 12px; }
.rv-bar-tools { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
#review-zone { min-height: 44px; max-width: 10em; padding: 0 8px; border: 0; border-radius: var(--r); background: var(--bg); color: var(--text); }
#review-next { min-height: 44px; padding: 0 14px; }
#review-exit { width: 44px; height: 44px; color: var(--bar-text); }
/* On a phone the bar is two rows: title, counts, row numbering and exit; then the zone and Next. */
@media (max-width: 599px) {
  #review-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; padding-left: 12px; }
  .rv-bar-tools { display: contents; }
  .rv-bar-main { grid-area: 1 / 1; }
  #review-row { grid-area: 1 / 2; }
  #review-exit { grid-area: 1 / 3; }
  #review-zone { grid-area: 2 / 1; width: 100%; min-width: 0; max-width: none; }
  #review-next { grid-area: 2 / 2 / 3 / 4; }
}

/* The card in review mode: sections, suggestions, people with edit buttons. */
.rv-sec { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.rv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.rv-sec > .muted { margin: 0 0 8px; }
.rv-place .row { margin-top: 6px; }
.rv-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.rv-ok { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--good-ink); font-weight: 650; }
.rv-ok svg, svg.rv-tick { width: 18px; height: 18px; color: var(--ok); vertical-align: -3px; }
.people li.rv-person { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rv-person > div:first-child { flex: 1; min-width: 0; }
.rv-person > .muted { flex: none; padding-top: 2px; }
.rv-person-tools { display: flex; flex: none; margin: -6px -8px 0 0; }
.rv-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 8px; }
.rv-sugg { padding: 8px 10px 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card); }
.rv-sugg.current { border-color: var(--pending); background: var(--selected); }
.rv-sugg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.rv-sugg-head b { flex: 1 1 12em; overflow-wrap: anywhere; }
.rv-sugg-tools { display: flex; align-items: center; gap: 6px; }
.rv-names { margin-top: 4px; font-size: 15px; overflow-wrap: anywhere; }
.rv-names .match { font-weight: 700; background: var(--note-bg); border-radius: 4px; padding: 0 2px; }
.rv-names .exhumed { color: var(--muted); font-style: italic; }
.rv-whys { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rv-why { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 650; }
.rv-why.good { background: var(--good-bg); color: var(--good-ink); }
.rv-why.bad { background: var(--bad-bg); color: var(--bad-ink); }
details.rv-more summary, details.rv-change summary {
  min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; color: var(--primary);
}
details.rv-change { margin-top: 12px; border-top: 1px solid var(--line); }
.rv-hits:empty { display: none; }
.rv-hits { margin-top: 8px; }
.rv-manual { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rv-manual .btn { grid-column: 1 / -1; }

/* Numbering a row (review.js): the bar button, the card, the marks on the map. */
#review-row { min-height: 44px; padding: 0 12px; }
#review-row.on { background: var(--pending); border-color: var(--pending); color: var(--pending-ink); }
@media (max-width: 520px) { #review-row span { display: none; } }
.rn-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-top: 10px; }
.rn-form .rn-dir { grid-column: 1 / -1; }
.rn-status { margin: 12px 0 4px; font-weight: 650; }
.rn-status .bad { color: var(--bad-ink); }
.rn-status .good { color: var(--good-ink); }
.rn-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.rn-list:empty { display: none; }
.rn-item { display: flex; align-items: flex-start; gap: 10px; padding-left: 10px; border: 1px solid var(--line); border-radius: var(--r-card); }
.rn-item.skip { opacity: .65; }
.rn-seq {
  flex: none; min-width: 28px; height: 28px; margin-top: 8px; padding: 0 4px; border-radius: 14px;
  display: grid; place-items: center; background: var(--bar); color: var(--bar-text);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rn-body { flex: 1; min-width: 0; padding: 10px 0 8px; }
.rn-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.rn-new { font-size: 18px; color: var(--primary); }
.rn-item > .icon { flex: none; }
.rn-actions > .btn:last-child { flex-basis: 100%; }
/* The buttons stay in reach while the list scrolls. Chrome sticks them above the card's bottom padding,
   where the form would show through, so they reach over that padding (same height in the end). */
.rn-actions {
  position: sticky; bottom: calc(-1 * var(--sheet-pad-b)); margin-bottom: calc(-1 * var(--sheet-pad-b));
  padding: 8px 0 var(--sheet-pad-b); background: var(--bg);
}
/* In the review a phone keeps half the screen for the map: the grave among its neighbours, and room to
   tap the next one (numbering a row). Below the review bar that is ~160 px on an iPhone 13 in Safari. */
@media (max-width: 899px) { body.reviewing #sheet { max-height: 50vh; max-height: 50dvh; } }
.rn-in {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 3px; padding: 2px; white-space: nowrap;
  border-radius: 14px; background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / .5);
  font: 700 13px/1 system-ui, sans-serif;
}
.rn-dot {
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  display: grid; place-items: center; background: var(--bar); color: #fff; font-size: 12px;
}
.rn-num { padding: 0 5px 0 1px; }
.rn-mark.new .rn-dot { background: var(--primary); }
.rn-mark.new .rn-num { color: var(--primary); }
.rn-mark.anchor .rn-dot { background: var(--ok); }
.rn-mark.bad .rn-dot { background: var(--danger); }
.rn-mark.skip { opacity: .6; }

/* On a wide screen the card is a panel on the right, so the map stays in view (D56, D70). */
@media (min-width: 900px) {
  #sheet {
    top: 56px; left: auto; right: 0; bottom: 0; width: min(440px, 45vw); max-height: none;
    --sheet-pad-b: 16px; border-radius: 0; box-shadow: -4px 0 14px rgb(0 0 0 / .35);
  }
}

/* --- Reports (reports.js, charts.js) --- */
/* Series colours: one source for the HTML bars, the SVG marks, legends and tooltips.
   Checked with the dataviz palette validator on the white card (D64). */
.s-confirmed { --c: #104281; }
.s-numbered, .s-occupied, .s-one { --c: #2a78d6; }
.s-photo { --c: #86b6ef; }
.s-none, .s-unknown { --c: #cfcdc5; }
.s-free { --c: #1baf7a; }
.s-reserved { --c: #6250d6; }
.s-expired { --c: #d03b3b; }
.s-expiring { --c: #eda100; }
.s-active { --c: #0ca30c; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.page-main.reports { max-width: 860px; }
.reports-ui { display: grid; gap: 14px; min-width: 0; transition: opacity .2s; }
.reports-ui.loading { opacity: .55; } /* a refresh keeps the charts, dimmed */
.rp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.rp-bar p { margin: 0; }
.rp-actions { display: flex; gap: 8px; }
.rp-card, .rp-tile {
  display: grid; gap: 10px; align-content: start; min-width: 0; padding: 14px;
}
.rp-card h2 { margin: 0; font-size: 17px; }
.rp-card p { margin: 0; }

/* Key figures: the hero across the top, then two tiles a row (four on a wide screen). */
.rp-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rp-tile { gap: 6px; padding: 12px 14px; }
.rp-hero { grid-column: 1 / -1; }
.rp-tile-label { color: var(--muted); font-size: 14px; font-weight: 650; }
.rp-tile-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.rp-hero .rp-tile-value { font-size: 56px; letter-spacing: -.01em; }
.rp-tile-sub { color: var(--muted); font-size: 14px; }
@media (min-width: 640px) { .rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Meter: blue on a lighter blue track; the dark tick is the target. */
.rp-meter { position: relative; display: block; height: 10px; border-radius: 5px; background: #cde2fb; overflow: hidden; }
.rp-meter > span { display: block; height: 100%; background: #2a78d6; }
.rp-target { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); }

.rp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.rp-legend li { display: inline-flex; align-items: center; gap: 6px; }
.rp-sw { flex: none; display: inline-grid; place-items: center; width: 12px; height: 12px; border-radius: 3px; background: var(--c); color: #fff; }
.rp-sw.icon { width: 16px; height: 16px; border-radius: 4px; }
.rp-sw.s-expiring { color: #0b0b0b; } /* dark ink on the amber */
.rp-sw svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Horizontal bars (HTML): label | bar | value; the whole row is the hit target. */
.hb { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; column-gap: 10px; }
.hb-row {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center;
  min-height: 32px; padding: 0 4px; border-radius: 6px; outline: none;
}
.hb-row:hover, .hb-row.on { background: var(--subtle); }
.hb-row:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
.hb-label { max-width: 11em; font-size: 14px; overflow-wrap: anywhere; }
.hb-bar { display: flex; gap: 2px; height: 18px; border-radius: 0 4px 4px 0; overflow: hidden; }
.hb-seg { flex: 1 1 0; min-width: 2px; background: var(--c); }
.hb-value { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hb-value small { color: var(--muted); font-size: 13px; font-weight: 400; }

/* SVG charts */
.rp-chart { min-width: 0; }
.rp-svg { display: block; width: 100%; height: auto; overflow: visible; font-size: 12px; }
.rp-svg .grid { stroke: var(--track); stroke-width: 1; }
.rp-svg .grid.base { stroke: #c3c8cd; }
.rp-svg .tick { fill: var(--muted); font-variant-numeric: tabular-nums; }
.rp-svg .tick.strong { fill: var(--text); font-weight: 700; }
.rp-svg .seg { fill: var(--c); }
.rp-svg .col-hit { fill: transparent; outline: none; }
.rp-svg .col-hit.on { fill: rgb(21 25 30 / .06); }
.rp-svg .col-hit:focus-visible { stroke: var(--primary); stroke-width: 2; }
.rp-svg .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rp-svg .area { fill: var(--c); opacity: .1; }
.rp-svg .dot { fill: var(--c); stroke: #fff; stroke-width: 2; }
.rp-svg .xh-line { stroke: var(--muted); stroke-width: 1; }
.rp-svg .end-label { fill: var(--text); font-weight: 650; }
.rp-svg .hit-area { fill: transparent; }
.rp-line { touch-action: pan-y; outline: none; } /* a sideways drag moves the crosshair, scrolling still works */
.rp-line:focus-visible { box-shadow: 0 0 0 2px var(--primary); border-radius: 4px; }

/* One tooltip for all charts: the value leads, the series name follows. */
#chart-tip {
  position: fixed; z-index: 1500; max-width: min(300px, calc(100vw - 16px));
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  box-shadow: var(--shadow-pop); font-size: 14px; pointer-events: none;
}
.tip-title { margin-bottom: 4px; color: var(--muted); font-weight: 650; }
.tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.5; }
.tip-row b { min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.tip-key { flex: none; width: 12px; height: 3px; border-radius: 2px; background: var(--c, transparent); }
.tip-note { margin-top: 4px; color: var(--muted); font-size: 13px; }

/* Deliverable: one meter per mandatory attribute. */
.qa { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.qa-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.qa-row .rp-meter { grid-column: 1; }
.qa-label { font-size: 14px; overflow-wrap: anywhere; }
.qa-label code { color: var(--muted); font-size: 12px; }
.qa-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qa-count { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qa-ok { margin-right: 6px; color: #0ca30c; font-weight: 800; }
.qa-all { padding-top: 10px; border-top: 1px solid var(--line); }
.qa-all .qa-label { font-weight: 700; }

.rp-notes { display: grid; gap: 2px; margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 14px; }

/* Table views */
.rp-table summary {
  display: flex; align-items: center; min-height: 44px; width: max-content;
  color: var(--primary); font-weight: 650; cursor: pointer;
}
.rp-table .table-wrap { max-height: 420px; overflow: auto; }
.rp-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-table th, .rp-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--line);
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rp-table th:first-child { text-align: left; font-weight: 400; }
.rp-table thead th { position: sticky; top: 0; background: var(--bg); color: var(--muted); font-weight: 650; }

/* Printed: paper colours, no buttons, every table open (reports.js), no card split over two pages. */
@media print {
  html:has(body.page), body.page { background: #fff; }
  .page-head .btn, .rp-actions, #toast, #chart-tip { display: none !important; }
  .page-head { position: static; background: #fff; color: #000; min-height: 0; padding: 0 0 8px; }
  .page-head a { display: none; }
  .page-main.reports { max-width: none; padding: 0; }
  .rp-card, .rp-tile { break-inside: avoid; }
  .rp-table .table-wrap { max-height: none; overflow: visible; }
  .rp-table summary { display: none; }
  .rp-table thead th { position: static; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
