/*
 * HAR SHALOM — the cemetery map: the aerial photo, the section outlines and numbers, every
 * grave as a dot, the chosen grave's red dot and gold pin, the zoom buttons, the name tip.
 *
 * File     public/harshalom/static/map.css   (linked by app/harshalom/find/page.tsx,
 *          app/harshalom/map/page.tsx and app/harshalom/plot/[code]/page.tsx)
 * Version  0.016 · 2026-12-03 · harshalom/0.035-saved (the count of the CHANGELOG's entries; no line
 *          before 0.013: 0.018-pages3 wrote 0.013, 0.019-levels2 wrote 0.014 beside it, merged here)
 * Owner    lane S (Search a Name, the full map, the grave view, grave pages, the plan)
 * Markup   app/harshalom/find/_parts/HsMap.tsx   Behaviour  static/js/map.js
 *
 * The map fills the box its page gives it (.hs-mapcard is a column; .hs-map takes what is
 * left). The canvas is fitted to the box by CSS (container units: the whole cemetery, north
 * up, never stretched) and moved by map.js with one transform; it sets --hs-inv = 1/zoom, so
 * the labels, the pin and the red dot scale back to their own size.
 *
 * LIGHT (owner, 29 Oct 2026): a white frame, white number pills, thin bright outlines on the
 * photo, no dark overlays.
 *
 * Static file: no PostCSS, no nesting, no @import; every rule under .hs (BUILD_CONTRACT 5).
 *
 * CHANGELOG (Rule 45)
 *   2026-11-11 harshalom/0.019-levelsB (release 0.019, lane B: the levels' look) — zooming in reaches the
 *     section's layout, then the graves' names, then the stones (the owner, 11 Nov: "When I zoom in, I
 *     should get the full section ... the layout and ... the tombstones"; that night: "I only have last
 *     names"). The block "THE LEVELS (0.019" at the end of this file, appended; no rule above it changes.
 *     The photo fades to the grounds (gone before it is drawn past about 1.35x its pixels), each section
 *     a white sheet with its row letters, plot numbers and its number; each grave a cream card that
 *     writes its WHOLE name, Hebrew and English, as soon as its own box can hold it at 10.5 px or more
 *     (its family name only until then); at the stones, the matzeiva photo, the name, the date, Row ·
 *     Plot; the "‹ Cemetery" pill. The chosen section stays gold through the change, which starts with
 *     no jump from 0.018's colours. Every rule needs a class only the levels' engine (static/js/map.js,
 *     lane A) puts on the page, so a map without levels is drawn as in 0.018; the look is the screen's
 *     only, so paper keeps 0.018's whole-cemetery map at every level (with the levels on, the graves'
 *     dots print at their whole-cemetery size, r 8, not the screen's zoomed one: measured in Chrome,
 *     paper at every level equals 0.018's paper of the whole cemetery to the pixel at 320, 390 and
 *     820, and to 12 edge pixels of one colour step at 1440 and 1920, as at the whole-cemetery view).
 *     Through the levels the canvas is painted each frame, never promoted: promoted at the stones it
 *     was rastered at 90x, and zooming back out took 1.2-1.5 s a frame at 4x CPU on a phone (now 83 ms
 *     at worst). Tests: lib/harshalom/__tests__/hs019-levels-look.
 *   2026-11-12 harshalom/0.019-levels2 (after levelsB above, the same release; the checkers of lanes A
 *     and B) — in the levels' block only. The graves' cards are painted over the pinned row letters and
 *     plot numbers (.hs-lv__g z-index 1: in Chrome a chip sat across a name in 9 of 27 stills at 390 and 12
 *     of 27 at 1440; now 0 and 0). A stone's card too narrow for its photo and its date (half a shared
 *     plot) is drawn the way map.js chose: the date on two lines (.lv-dt2, its Hebrew then its English),
 *     without the photo (.lv-noph) or without the date (.lv-nodt). The pools' numbers (--lv-codes,
 *     --lv-axes) are registered not to pass down to every label (@property).
 *   2026-12-03 harshalom/0.035-saved (release 0.035, PR #8751; the owner's Galaxy S25, installed app, Section 9:
 *     "the cards with the write-ups and the names... it's chopped up in the bottom, you don't see it") — two
 *     faults on a phone. (1) The stones' cards: "Row K · Plot 21" was drawn as half a line. It came in by a
 *     max-height of --lv-rp x 18 px, so wherever the map stood between Row · Plot's ramp ends (a zoom between
 *     levels; where a finger left it on his phone) the line was cut through, and a line with overflow hidden
 *     shrank to a sliver when a card's lines ran taller than the card. Now each line keeps its height and is
 *     drawn whole or not at all: Row · Plot takes its whole line past --lv-rp 0.75 (where map.js's fit keeps a
 *     line for it) and fades in from there; a line that does not fit wraps whole out of the text column (Row ·
 *     Plot first, then the date; the grave's sheet shows both). Measured in Chrome at 360/375/390/412 through
 *     a zoom in and out of Section 9 sampled through each ease: 255 lines cut before (every one
 *     Row · Plot), 0 after. (2) The full-screen map on a phone: a grave's sheet stopped the call bar's
 *     height above the foot though the map covers the call bar, and the "‹ Cemetery" pill showed in that
 *     strip where Directions and Share come; the sheet now reaches the foot, and the pill is not drawn
 *     while a sheet is open (visibility only: nothing moves, plan.css R3-01).
 *     Tests: lib/harshalom/__tests__/hs035-map-cards-sheet.
 *   2026-11-11 harshalom/0.018-pages3 (0.013) — M2 (the check of lane pages2, 11 Nov): on a phone a map
 *     card is never shorter than what it holds. Its page gives it a screen's height (find.css: the
 *     Cemetery Map calc(100dvh - 270px - the call bar), at least 360px; Search a Name's map 190px,
 *     at least 380px; plot.css: a grave's page 72dvh), while the map in it keeps 300px: at 320x640
 *     and 375x667 the note and the aerial-photo credit ran 32 and 74px past the card's foot, over the
 *     footer's address line, and the install strip's room (--hs-callbar-h, 0.018 lane pages2) took
 *     360x740 there too (credit 66px out). The card now grows to hold them (min-height: min-content,
 *     where a page sets its height: the bare map, Search a Name's map, a grave's page); where it
 *     holds them already, nothing changes. Not on a short screen held sideways (the map there is as
 *     tall as the screen leaves, below) and not on paper.
 *   2026-11-11 harshalom/0.016-print (release 0.016, lane print) — print rules only: the map's key keeps
 *     its colours on paper with Chrome's default "Background graphics" off (print-color-adjust: exact
 *     on the note's dot key, its two box keys and the side legend's swatches, as the map itself has).
 *     The live check of 0.015 found the cream "a grave" box printed as an empty outline, the same as
 *     "a plot", and the red dot as a grey ring. Nothing else on paper or on the screen changes.
 *   2026-11-11 release 0.015 lead (the map checker of the fixes) — a phone: the side's views are not
 *     drawn; "Boxes" is the sections strip's first chip (.hs-browse__chip--boxes, shown only under
 *     700 px). The strip had been narrowed to make room for it under the year, and Tab went out of the
 *     screen's order. .hs-mapcard__box: the boxes' key in the note under the map (HsMap.tsx).
 *   2026-11-11 harshalom/0.015-fix2-map (second review: regression findings 0, 1, 2 and 6, integration
 *     finding 3) — once the survey is loaded nothing above the Cemetery Map moves and the map keeps its
 *     0.014 size. A phone: the views no longer sit beside the title (that row grew 23 → 52 px, so the
 *     map and its + − slid 29 px down under the grave's sheet) nor in the year's grid column (the name
 *     box lost 32 px and its placeholder was cut at 320/360): the one link that leaves the page,
 *     "Boxes", ends the sections strip, in the year's column under it, as tall as a section chip, so
 *     the strip's row keeps its height. A tablet (700-1199px): the side's views gave an iPad on its
 *     side (1024x768) an inner scroll; there "Boxes" is a button at the foot of the map's + − ⤢ gutter
 *     (.hs-map__views, HsMapPanel `views`; on the left with the gutter on a phone held sideways), and
 *     the side's views are not drawn. A computer keeps the side's two views. The legend's grave key
 *     shows a filled box beside the dot (one key fewer). On a touch screen under 1200px the views'
 *     links are 44 px tall (they were 40). Nothing changes before the survey is loaded.
 *   2026-11-11 harshalom/0.015-survey, review fix 1 — a grave's printout kept the screen's 7-8x zoom
 *     values map.js writes inline (--hs-k, --hs-u), so with the survey loaded the section numbers
 *     printed at 35%, the outlines as hairlines and the plot lines as a white hatch. Paper now resets
 *     both to 1 (!important, beside --hs-inv) and draws the gridded strokes with non-scaling-stroke,
 *     so every line is its 0.014 width on any paper map (the gold section outline 2.6 px), the
 *     numbers print at full strength, the plot lines not at all and the row lines softly; the red
 *     dot carries the chosen box's gold as a ring (the box is about 2 x 1 px on a grave's paper map).
 *   2026-11-11 harshalom/0.015-survey, lane survey-layout — every plot a box (the owner, 11 Nov: "full
 *     grids"): the surveyed grid map.js draws into .hs-map__grid — the edges between rows (soft from
 *     the whole-cemetery view), the edges between plots (they come in as you zoom: --hs-k, set by
 *     map.js), the plots with a grave filled cream, the chosen grave's box gold; on a gridded map
 *     (.hs-map.has-grid) every stroke is SVG units x --hs-u (map.js) so lines, outlines and the dots'
 *     rings stay their screen width at any zoom, and the red dot is 8px so it sits inside its
 *     8 ft x 3 ft box; the second note; the two views (.hs-views) and the legend's two keys.
 *     Nothing changes on a map without the grid (before the survey is loaded).
 *   2026-11-06 harshalom/0.013-site (audit 6 Nov, B-F9) — the grave menu's look (.hs-ctx and its touch and
 *     print rules) moved, whole, to hs.css: the yahrzeit page's names open it too, and it has no map sheet.
 *   2026-11-02 fix/hs-v32-site — the gold pin's label slides sideways by --hs-pin-dx (map.js
 *     keepPinLabelIn) so it stays whole inside the view: "ow A · Plot 23 (2)" on the phone map (live check).
 *   2026-11-02 fix/harshalom-v3-polish — a phone held sideways (landscape, under 500px tall, below a
 *     computer): the + − ⤢ gutter sits on the LEFT, so the feedback button in the bottom-right
 *     corner no longer lands on "Zoom in" (live check, 844x390).
 *   2026-11-02 feat/harshalom-v3-audit, review fix F1 — on paper the photo fills the map's box (the
 *     screen's button gutter no longer narrows it on paper under 1200px; R3-02).
 *   2026-11-02 feat/harshalom-v3-audit, lane L3m — below a computer (<= 1199px) the + − ⤢ buttons
 *     sit in a gutter beside the photo, never on it (audit V-07: they covered sections 16, 14, 12);
 *     a short landscape screen (a phone on its side, a short window) gets a map as tall as the
 *     screen leaves, not a stamp (V-07; an iPad's pane width is find.css / plot.css, lane L3);
 *     print: the map fits the page, no buttons, no tip, no menu (V-16); the grave menu (.hs-ctx:
 *     Open grave · Tehillim · Share link · Directions, V-33) and the tap tip's "תהלים"; search
 *     results lit on the map (.is-mark, .is-lit: self.hsMap.mark / setHot for lane L3); the 13 px
 *     text and 44 px touch floors on the tip, the pin's label, the note and the map's labels.
 *   2026-10-29 feat/harshalom-v2-light, fix lane "find" — the v2 reviews: a dot outside the chosen
 *     year of passing is switched off (.hs-map__d.is-off, owner item 8); the + − ⤢ buttons and the
 *     tip's "Open" are 44 px on a phone, a tablet and any touch screen.
 *   2026-10-29 feat/harshalom-v2-light, lane S — created (moved out of find.css and rewritten:
 *     dots, smooth zoom and pan, the tip, light).
 */

.hs .hs-mapcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-r);
  background: var(--hs-surface);
  box-shadow: var(--hs-shadow);
}

.hs .hs-mapcard__h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0 2px;
  font-family: var(--hs-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--hs-accent-ink);
}

.hs .hs-mapcard__yi {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--hs-muted);
}

.hs .hs-mapcard__note,
.hs .hs-mapcard__credit {
  margin: 0 2px;
  font-size: var(--hs-fs-min, 13px);
  line-height: 1.4;
  color: var(--hs-muted);
}

.hs .hs-mapcard__credit {
  color: var(--hs-faint);
}

.hs .hs-mapcard__key {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--hs-dot);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  vertical-align: -1px;
}

/* ── the map box ────────────────────────────────────────────────────────── */

.hs .hs-map {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  border: 1px solid var(--hs-line);
  border-radius: 8px;
  background: #eef0ea;
  overflow: hidden;
}

.hs .hs-map__view {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  container-type: size;
  outline: none;
  /* A held finger is the grave menu (map.js), not the phone's own link preview. */
  -webkit-touch-callout: none;
}

.hs .hs-map[data-js] .hs-map__view {
  cursor: grab;
  touch-action: none;
}

/* The whole cemetery: one finger scrolls the page; two zoom. */
.hs .hs-map[data-js] .hs-map__view.is-fit {
  touch-action: pan-y;
}

.hs .hs-map__view.is-dragging {
  cursor: grabbing;
}

.hs .hs-map__view.is-ondot {
  cursor: pointer;
}

.hs .hs-map__view:focus-visible {
  box-shadow: inset 0 0 0 2px var(--hs-accent);
}

.hs .hs-map__canvas {
  --hs-inv: 1;
  position: relative;
  width: 100%;
  width: min(100cqw, calc(100cqh * var(--hs-map-arn, 0.5695)));
  aspect-ratio: var(--hs-map-arn, 0.5695);
  transform-origin: 0 0;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
}

.hs .hs-map__canvas.is-anim {
  transition: transform 0.28s ease;
}

.hs .hs-map__canvas picture {
  position: absolute;
  inset: 0;
}

.hs .hs-map__photo {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
}

.hs .hs-map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ── the sections ───────────────────────────────────────────────────────── */

.hs .hs-map__sec polygon {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.4px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition:
    fill 0.12s ease,
    stroke 0.12s ease;
}

.hs .hs-map__sec.has polygon {
  stroke: #fff;
}

.hs .hs-map__sec:hover polygon {
  fill: rgba(255, 255, 255, 0.2);
}

.hs .hs-map__sec:focus-visible {
  outline: none;
}

.hs .hs-map__sec:focus-visible polygon {
  stroke: var(--hs-gold);
  stroke-width: 3px;
}

.hs .hs-map__sec.is-sel polygon {
  fill: rgba(245, 200, 76, 0.16);
  stroke: #f5c84c;
  stroke-width: 2.6px;
}

/* ── every grave a dot ──────────────────────────────────────────────────── */

.hs .hs-map__dots {
  pointer-events: none;
}

.hs .hs-map__d {
  fill: var(--hs-dot);
  stroke: #fff;
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
}

.hs .hs-map__d.is-off {
  display: none;
}

.hs .hs-map__d.is-hot {
  fill: #f5c84c;
  stroke: var(--hs-ink);
  stroke-width: 1.6px;
}

/* Search results on the map (self.hsMap.mark, lane L3): the found graves stand out, the rest step
   back; one of them lit (self.hsMap.setHot: the result under the pointer). */
.hs .hs-map__dots.has-marks .hs-map__d {
  opacity: 0.35;
}

.hs .hs-map__dots.has-marks .hs-map__d.is-mark,
.hs .hs-map__dots .hs-map__d.is-lit,
.hs .hs-map__dots .hs-map__d.is-hot {
  opacity: 1;
}

.hs .hs-map__d.is-mark {
  stroke: #fff;
  stroke-width: 2.4px;
}

.hs .hs-map__d.is-lit {
  fill: #f5c84c;
  stroke: var(--hs-ink);
  stroke-width: 2.4px;
}

/* ── every plot a box (0.015: the survey; static/js/map.js draws the layer) ── */

.hs .hs-map__grid {
  pointer-events: none;
}

/* Every stroke on a gridded map is drawn in the SVG's own units times --hs-u (map.js: the units in
   one screen pixel at this zoom), so a line is the same width at every zoom in every browser: the
   canvas's CSS zoom scales strokes, non-scaling-stroke or not. 2.4 (about 1000 units / 420 px) is
   the whole-cemetery view before map.js has measured. */
.hs .hs-map__gr,
.hs .hs-map__gp {
  fill: none;
  stroke: #fff;
  stroke-width: calc(var(--hs-u, 2.4) * 1px);
}

/* The edges between rows show softly from the whole-cemetery view; the edges between plots (3 ft
   apart, 2 px at that view) come in as you zoom, so the grid never turns into a grey wash. --hs-k is
   the zoom (map.js); a browser without clamp() keeps the first value. */
.hs .hs-map__gr {
  opacity: 0.3;
  opacity: clamp(0.22, calc(0.12 + var(--hs-k, 1) * 0.1), 0.85);
}

.hs .hs-map__gp {
  opacity: 0;
  opacity: clamp(0, calc((var(--hs-k, 1) - 1.8) * 0.32), 0.8);
}

/* A plot with a grave: filled, so the occupied plots read at a glance. */
.hs .hs-map__gf {
  fill: rgba(255, 242, 204, 0.82);
  stroke: none;
}

/* The chosen grave's box, its red dot inside it. */
.hs .hs-map__gs {
  fill: rgba(245, 200, 76, 0.55);
  stroke: #f5c84c;
  stroke-width: calc(var(--hs-u, 2.4) * 2.5px);
  stroke-linejoin: round;
}

.hs .hs-map.has-grid .hs-map__dot {
  width: 8px;
  height: 8px;
}

/* On a gridded map the outlines and the dots' rings keep their screen width too (as at the
   whole-cemetery view), so a zoomed section is not edged by a band wider than a row of boxes. */
.hs .hs-map.has-grid .hs-map__sec polygon {
  stroke-width: calc(var(--hs-u, 2.4) * 1.4px);
  vector-effect: none;
}

.hs .hs-map.has-grid .hs-map__sec.is-sel polygon {
  stroke-width: calc(var(--hs-u, 2.4) * 2.6px);
}

.hs .hs-map.has-grid .hs-map__sec:focus-visible polygon {
  stroke-width: calc(var(--hs-u, 2.4) * 3px);
}

.hs .hs-map.has-grid .hs-map__d {
  stroke-width: calc(var(--hs-u, 2.4) * 1.2px);
  vector-effect: none;
}

.hs .hs-map.has-grid .hs-map__d.is-hot,
.hs .hs-map.has-grid .hs-map__d.is-lit,
.hs .hs-map.has-grid .hs-map__d.is-mark {
  stroke-width: calc(var(--hs-u, 2.4) * 2px);
}

.hs .hs-mapcard__note--grid {
  color: var(--hs-ink);
}

/* Zoomed into the boxes, a section's number pill steps back so the boxes under it can be read (the
   pin and the side still name the section). */
.hs .hs-map.has-grid .hs-map__label {
  opacity: clamp(0.35, calc((6 - var(--hs-k, 1)) * 0.4), 1);
}

/* ── the numbers, the entrance, A1 (they keep their size when zoomed) ───── */

.hs .hs-map__labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hs .hs-map__label {
  position: absolute;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  color: var(--hs-accent-ink);
  font-size: var(--hs-fs-min, 13px);
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  transform: translate(-50%, -50%) scale(var(--hs-inv));
}

.hs .hs-map__label.is-sel {
  background: var(--hs-accent);
  color: #fff;
}

.hs .hs-map__entrance {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%) scale(var(--hs-inv));
  transform-origin: 50% 100%;
  pointer-events: none;
}

.hs .hs-map__entrance-tag {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  color: var(--hs-accent-ink);
  font-size: var(--hs-fs-min, 13px);
  font-weight: 700;
  white-space: nowrap;
}

.hs .hs-map__entrance-arrow {
  color: #fff;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.hs .hs-map__a1 {
  position: absolute;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--hs-accent);
  font-size: var(--hs-fs-min, 13px);
  font-weight: 700;
  line-height: 16px;
  transform: translate(-50%, -50%) scale(var(--hs-inv));
  pointer-events: none;
}

.hs .hs-map__a1[hidden],
.hs .hs-map__dot[hidden],
.hs .hs-map__pin[hidden] {
  display: none;
}

/* ── the chosen grave: the red dot and the gold pin ─────────────────────── */

.hs .hs-map__dot {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hs-dot);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%) scale(var(--hs-inv));
  pointer-events: none;
}

.hs .hs-map__dot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--hs-dot);
  border-radius: 50%;
  animation: hs-map-pulse 1.6s ease-out infinite;
}

@keyframes hs-map-pulse {
  from {
    opacity: 1;
    transform: scale(0.4);
  }
  to {
    opacity: 0;
    transform: scale(1.4);
  }
}

.hs .hs-map__pin {
  position: absolute;
  z-index: 3;
  width: 30px;
  height: 42px;
  transform: translate(-50%, -100%) scale(var(--hs-inv));
  transform-origin: 50% 100%;
  pointer-events: none;
}

/* Standing on an exact dot: smaller, its tip just above the dot. */
.hs .hs-map__pin--dot {
  width: 24px;
  height: 34px;
  transform: translate(-50%, calc(-100% - 9px)) scale(var(--hs-inv));
  transform-origin: 50% calc(100% + 9px);
}

.hs .hs-map__pin.is-drop .hs-map__pin-svg {
  animation: hs-map-drop 0.35s ease-out;
}

@keyframes hs-map-drop {
  from {
    opacity: 0;
    transform: translateY(-60%);
  }
}

.hs .hs-map__pin-svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.hs .hs-map__pin-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--hs-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--hs-shadow);
  color: var(--hs-accent-ink);
  line-height: 1.25;
  white-space: nowrap;
  /* v3.2: --hs-pin-dx (map.js keepPinLabelIn) slides it sideways near the view's edge, so it is whole */
  transform: translateX(calc(-50% + var(--hs-pin-dx, 0px)));
}

.hs .hs-map__pin-label b {
  font-size: var(--hs-fs-min, 13px);
}

.hs .hs-map__pin-label small {
  font-size: var(--hs-fs-min, 13px);
  color: var(--hs-muted);
}

.hs .hs-map__pin-label small[hidden] {
  display: none;
}

/* ── the buttons and the name tip ───────────────────────────────────────── */

.hs .hs-map__ctl {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hs .hs-map__ctl[hidden] {
  display: none;
}

.hs .hs-map__zbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--hs-line-2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--hs-shadow);
  color: var(--hs-accent-ink);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.hs .hs-map__zbtn:hover:not(:disabled) {
  border-color: var(--hs-accent);
  background: var(--hs-accent-soft);
}

.hs .hs-map__zbtn:disabled {
  color: var(--hs-faint);
  cursor: default;
}

.hs .hs-map__tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  max-width: 250px;
  padding: 6px 10px;
  border: 1px solid var(--hs-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  color: var(--hs-ink);
  line-height: 1.3;
  pointer-events: none;
}

.hs .hs-map__tip[hidden] {
  display: none;
}

.hs .hs-map__tip.is-touch {
  pointer-events: auto;
}

.hs .hs-map__tip-he {
  font-family: var(--hs-serif);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.hs .hs-map__tip-en {
  font-size: 13px;
  font-weight: 600;
}

.hs .hs-map__tip-loc {
  font-size: var(--hs-fs-min, 13px);
  color: var(--hs-accent);
}

/* The mouse's tip: how to reach the grave menu (owner item 7). */
.hs .hs-map__tip-hint {
  margin-top: 2px;
  font-size: var(--hs-fs-min, 13px);
  color: var(--hs-muted);
}

/* The tap's tip: "תהלים" and "Open". */
.hs .hs-map__tip-acts {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.hs .hs-map__tip-t {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--hs-line-2);
  border-radius: 8px;
  background: var(--hs-surface);
  color: var(--hs-accent-ink);
  font-family: var(--hs-serif);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.hs .hs-map__tip-open {
  align-self: flex-end;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--hs-accent);
  border-radius: 8px;
  background: var(--hs-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

@media (min-width: 700px) {
  .hs .hs-map__zbtn {
    width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs .hs-map__canvas.is-anim {
    transition: none;
  }

  .hs .hs-map__dot::after,
  .hs .hs-map__pin.is-drop .hs-map__pin-svg {
    animation: none;
  }
}

/* ── print (audit V-16): the map as it is on the screen, fitted to the page; no buttons ──────── */

@media print {
  .hs .hs-map__ctl,
  .hs .hs-map__tip {
    display: none !important;
  }

  .hs .hs-mapcard {
    padding: 0;
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  /* The photo's own shape, as wide as the page, never taller than one page. */
  .hs .hs-map {
    flex: none;
    width: min(100%, calc(9in * var(--hs-map-arn, 0.5695)));
    height: auto;
    min-height: 0;
    margin-inline: auto;
    aspect-ratio: var(--hs-map-arn, 0.5695);
    border-color: #999;
    break-inside: avoid;
  }

  /* No button gutter on paper: the screen's (<= 1199px, below) comes later in this file and matched
     paper as wide, so the photo printed narrower than its box (review R3-02). */
  .hs .hs-map[data-js] .hs-map__view,
  .hs .hs-mapcard .hs-map[data-js] .hs-map__view {
    right: 0;
  }

  /* Paper is not the screen's box: the whole cemetery, with the chosen grave's pin and red dot
     (placed in percent, so they land right), the numbers at their own size.
     0.015 (review fix 1): map.js also writes the screen's zoom (--hs-k) and the SVG units in one
     screen pixel (--hs-u) on the canvas. Paper is drawn at 1x, so both are reset here (a stylesheet
     !important beats map.js's plain inline value): --hs-k 1 brings the section numbers back to full
     strength and hides the plot lines, as at the whole-cemetery view. --hs-u 1, with the strokes
     below back on non-scaling-stroke (paper has no transform to undo it), draws every line at its
     own width in CSS px on any paper map: map.js's units-per-pixel is the SVG's 1000 units over the
     map's printed width, which is about 180 px on a grave's page and about 490 px on the map page,
     so no one fixed number of units is right on both. */
  .hs .hs-map__canvas {
    --hs-inv: 1 !important;
    --hs-k: 1 !important;
    --hs-u: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hs .hs-map__gr,
  .hs .hs-map__gp,
  .hs .hs-map__gs,
  .hs .hs-map.has-grid .hs-map__sec polygon,
  .hs .hs-map.has-grid .hs-map__d {
    vector-effect: non-scaling-stroke;
  }

  /* The chosen grave's gold box. On paper the whole cemetery is about 2 inches wide on a grave's
     page, so a plot (8 ft x 3 ft) is about 2 x 1 px and lies under the red dot (14 px with its
     rings), and the section's number pill can sit over it too. So on paper the red dot carries the
     box's gold as a ring, drawn above everything, whenever the chosen grave has a lit box. */
  .hs .hs-map.has-grid:has(.hs-map__gs[d]) .hs-map__dot {
    box-shadow:
      0 0 0 2px #fff,
      0 0 0 4.5px #f5c84c,
      0 0 0 5.5px rgba(0, 0, 0, 0.35);
  }

  .hs .hs-map,
  .hs .hs-map__canvas,
  .hs .hs-map__label,
  .hs .hs-map__dot,
  .hs .hs-map__d,
  .hs .hs-map__pin-label {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* The key under the map (0.016): the note's red dot, its cream "a grave" box and white "a plot" box,
     and the side legend's swatches wherever they print, keep their colours on paper as the map above
     does. Chrome prints with "Background graphics" off unless it is ticked, and then dropped their
     fills: the grave's box printed as an empty outline, the same as a plot's, and the dot as a grey
     ring. (print-color-adjust is inherited; these swatches have no children.) */
  .hs .hs-mapcard__key,
  .hs .hs-mapcard__box,
  .hs .hs-mapside__k {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hs .hs-map__dot::after {
    animation: none;
    display: none;
  }
}

/* ── the grave menu (.hs-ctx): its look lives in hs.css since 0.013 (audit B-F9), because the yahrzeit
   page's names open it too and that page has no map sheet. ─────────────────────────────────────── */

/* ── touch: the buttons at least 44 px (DESIGN_V2: phone and tablet, any coarse pointer) ── */

@media (max-width: 1199px), (pointer: coarse) {
  .hs .hs-map__zbtn {
    width: var(--hs-tap, 44px);
    height: var(--hs-tap, 44px);
  }

  .hs .hs-map__tip-open,
  .hs .hs-map__tip-t {
    min-height: var(--hs-tap, 44px);
  }
}

/* ── phone and tablet: the + − ⤢ buttons in a gutter beside the photo, never on it (audit V-07) ──
   The view (where the photo is fitted and moved) stops short of the right edge; the buttons stand
   in that strip. Only once map.js runs: with no JavaScript there are no buttons. */

@media (max-width: 1199px) {
  .hs .hs-map[data-js] .hs-map__view {
    right: calc(var(--hs-tap, 44px) + 8px);
  }

  .hs .hs-map__ctl {
    top: 4px;
    right: 4px;
  }
}

/* ── a phone held sideways (2026-11-02, fix/harshalom-v3-polish): the gutter and its + − ⤢ move to
   the LEFT edge. On a screen this short the column fills most of the right edge, and the
   platform's feedback button, which docks bottom-right and may rise only half the screen, landed
   on "Zoom in" (the live check, 844x390). Left is where a map's zoom usually sits anyway. ── */

@media (orientation: landscape) and (max-height: 500px) and (max-width: 1199px) {
  .hs .hs-map[data-js] .hs-map__view {
    right: 0;
    left: calc(var(--hs-tap, 44px) + 8px);
  }

  .hs .hs-map__ctl {
    right: auto;
    left: 4px;
  }
}

/* ── a short screen on its side (a phone held sideways, an iPad in landscape at 768 tall or a
   desktop window that is short): the map as tall as the screen leaves, not a stamp (V-07). The
   explanatory note gives way (the full map has its legend beside it). ── */

@media (orientation: landscape) and (max-height: 560px) {
  .hs .hs-mapcard {
    gap: 4px;
    padding: 6px;
  }

  .hs .hs-mapcard__note {
    display: none;
  }

  .hs .hs-map[data-hs-map] {
    flex: 1 1 auto;
    width: 100%;
    height: max(220px, calc(100dvh - var(--hs-sticky-top, 0px) - var(--hs-callbar-h, 0px) - 56px));
    min-height: 220px;
    aspect-ratio: auto;
    margin-inline: 0;
  }
}

/* 0.013 (lane pages3, M2): on a phone a map card is never shorter than what it holds. Its page sets
   its height to fill the screen (find.css: the Cemetery Map and Search a Name's map; plot.css: a
   grave's page) while the map in it keeps 300px (.hs-map, above), so on a short phone, or with the
   install strip's room in --hs-callbar-h, the notes and the aerial-photo credit ran past its foot and
   over the footer. It grows to hold them instead; where it holds them, its page's height stands.
   (Here, after the screen's own rules: hs015-survey-review.test.tsx reads those before the first
   @media block.)
   The page sheets set that height on these selectors; each here outweighs its page's (find.css and
   plot.css load beside this file in either order). Not on a short screen held sideways, where the
   map is as tall as the screen leaves (above), and not on paper. */
@media screen and (max-width: 699px) and (orientation: portrait),
  screen and (max-width: 699px) and (min-height: 561px) {
  .hs.hs-findpage .hs-find__map .hs-mapcard,
  .hs.hs-mappage .hs-find--map .hs-find__map .hs-mapcard,
  .hs.hs-plotpage .hs-plot__map .hs-mapcard {
    min-height: min-content;
  }
}

/* ── the two views: the aerial map | Section by Section (0.015; HsViews.tsx) ── */
/* Linked by the map page and by /harshalom/sections. A segmented pair of plain links. */

.hs .hs-views {
  display: flex;
  gap: 0;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--hs-line);
  border-radius: 999px;
  background: var(--hs-surface);
}

.hs .hs-views__a {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--hs-accent-ink);
  font-size: var(--hs-fs-sm, 14px);
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
}

.hs .hs-views__a:hover {
  background: var(--hs-accent-soft, rgba(44, 81, 64, 0.08));
}

.hs .hs-views__a:focus-visible {
  outline: 2px solid var(--hs-accent);
  outline-offset: 1px;
}

.hs .hs-views__a.is-on {
  background: var(--hs-accent);
  color: #fff;
}

.hs .hs-views__w {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hs .hs-views__yi {
  font-size: var(--hs-fs-min, 13px);
  font-weight: 600;
  opacity: 0.85;
}

.hs .hs-views__s {
  display: none;
}

/* The legend once the boxes are drawn: a plot's box (its own key), and a plot with a grave's filled
   box (beside the grave key's dot, 0.015 fix2: one key fewer, so the legend keeps 0.014's lines). */
.hs .hs-mapside__k--box {
  width: 16px;
  height: 7px;
  border: 1px solid #8a8f88;
  border-radius: 1px;
  background: #fff;
}

.hs .hs-mapside__k--full {
  width: 16px;
  height: 7px;
  border: 1px solid #8a8f88;
  border-radius: 1px;
  background: rgb(255, 236, 184);
}

/* A touch screen under a computer's width (an iPad), and any touch screen: 44 px to touch, as every
   control on the site (0.015 fix2, the second review: the views' links were 40 px on an iPad). */
@media (max-width: 1199px), (pointer: coarse) {
  .hs .hs-views__a {
    min-height: var(--hs-tap, 44px);
  }
}

/* The Cemetery Map's "Boxes" button in the + − ⤢ gutter (HsMapPanel `views`): a tablet only, below. */
.hs .hs-map__views {
  display: none;
}

/* The phone's "Boxes" chip at the start of the sections strip (map/page.tsx): a phone only, below. */
.hs .hs-browse__chip--boxes {
  display: none;
}

/* The boxes' key in the note under the map (HsMap.tsx), the size of the note's dot key. */
.hs .hs-mapcard__box {
  width: 14px;
  height: 7px;
  vertical-align: 0;
}

/* A phone: the short words, 44 px to touch (Section by Section: beside its title, sections.css). */
@media (max-width: 699px) {
  .hs .hs-views {
    margin: 0;
  }

  .hs .hs-views__a {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 4px 10px;
    gap: 5px;
  }

  .hs .hs-views__w {
    display: none;
  }

  .hs .hs-views__s {
    display: inline;
  }

  /* The Cemetery Map (0.015, after the fix check): nothing above the map moves. The side's views are
     not drawn; the one link that leaves this page ("Boxes"; the map is the page you are on) is the
     sections strip's FIRST chip (map/page.tsx), as wide as a section chip. So the title's row, the
     name box and the year are 0.014's to the pixel, the strip keeps 0.014's width and its half-shown
     last chip (it scrolls), and Tab meets the controls in the screen's order. */
  .hs .hs-mapside > .hs-views {
    display: none;
  }

  .hs .hs-mapside .hs-browse__chip--boxes {
    display: flex;
    border-color: var(--hs-accent);
  }
}

/* A tablet (700-1199px): the side's views took height an iPad on its side (1024x768) does not have,
   so the map carries "Boxes" at the foot of its + − ⤢ gutter instead, a button like the zoom
   buttons (the word under the icon), and the side's views are not drawn. With a grave open on a
   tablet the grave is over the side, not the map, so it stays in view. */
@media (min-width: 700px) and (max-width: 1199px) {
  .hs .hs-mapside > .hs-views {
    display: none;
  }

  .hs .hs-map__views {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 5;
    display: block;
  }

  .hs .hs-map__views .hs-views {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }

  .hs .hs-map__views .hs-views__a.is-on,
  .hs .hs-map__views .hs-views__w {
    display: none;
  }

  .hs .hs-map__views .hs-views__a {
    flex: none;
    flex-direction: column;
    gap: 2px;
    width: var(--hs-tap, 44px);
    min-height: 56px;
    padding: 6px 0 5px;
    border: 1px solid var(--hs-line-2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--hs-shadow);
    font-size: var(--hs-fs-min, 13px);
    line-height: 1.1;
  }

  .hs .hs-map__views .hs-views__a:hover {
    border-color: var(--hs-accent);
    background: var(--hs-accent-soft, rgba(44, 81, 64, 0.08));
  }

  .hs .hs-map__views .hs-views__s {
    display: inline;
  }
}

/* A short screen (a phone held sideways): the map runs past the screen's foot until the page is
   scrolled, so the button stands under the + − ⤢, 12 px apart, where they are seen together. */
@media (min-width: 700px) and (max-width: 1199px) and (max-height: 560px) {
  .hs .hs-map__views {
    top: calc(4px + 3 * var(--hs-tap, 44px) + 2 * 4px + 12px);
    bottom: auto;
  }
}

/* A phone held sideways: the gutter is on the left (above), and the button with it. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1199px) {
  .hs .hs-map__views {
    right: auto;
    left: 4px;
  }
}

@media print {
  .hs .hs-views,
  .hs .hs-map__views {
    display: none;
  }
}

/* ── THE LEVELS (0.019, lane B: the look) ──────────────────────────────────────────────────────────────
   The owner, 11 Nov 2026: "When I zoom in, I should get the full section ... I should get to the layout
   and to the tombstones ... it should transition to the next level if I zoom in. But very, very smooth
   and very clear." And that night: "I only have last names." One map, four levels: the cemetery (the
   photo), the section (its layout: a white sheet, every plot a box, the row letters and plot numbers),
   the names, the stones (the matzeiva photo, the whole name, the date). Design: hs018 zoom-design
   SPEC.md. static/js/map.js (lane A) moves the camera and writes the numbers named below; this block
   only draws them.

   Nothing changes without the levels. Every rule here needs a class only the levels' engine puts on the
   page: .lv-on, .lv-paper, .lv-no-t1/2/3 on .hs-map, .is-still on the canvas, the .hs-lv layer and its
   .hs-lv__* parts (an empty .hs-lv slot is not drawn at all). A map without levels (the office's field
   seat, a page before the survey, the photo below the first threshold) carries none of them and is
   drawn as in 0.018. The look is for the screen only: paper keeps 0.018's whole-cemetery map at every
   level (the print block at the end hides the layer and resets the two numbers map.js writes).

   The contract with map.js (the class and variable names of hs018 zoom-design/proto/levels.css):
     on .hs-map, each frame    --lv-lay    0..1  the photo gives way, the sections become sheets, the turn
                               --lv-cards  0..1  a grave's box is a card over its red dot
                               --lv-t1, --lv-t2  the names: the family name, then the whole name
                               --lv-t3     0..1  the stones' cards
                               --lv-codes, --lv-axes, --lv-en1, --lv-rp   0..1
     on .hs-map__canvas        --hs-ra     minus the map's turn: a label in the canvas stays upright
     on each card .hs-lv__g    --f1 / --f2 / --f3  the scale its family name / whole name / stone card is
                               drawn at (the whole text inside its box); --hs-ar on its photo
   The sizes map.js's fit measures with (the page's own font family):
     family name   Hebrew 700 13.5px, English 600 11.5px; line-height 1.15; 4 px each side
     whole name    Hebrew 700 13.5px on at most two balanced lines, English 600 12px on one line;
                   line-height 1.12 (Hebrew) and 1.15 (English); padding 2px 5px: it needs
                   44.1 x f2 + 4 px of height and 10 px of width beside the text
     stone card    Hebrew 700 14px (two balanced lines at most), English 600 12.5px, the date 400
                   11.5px, Row · Plot 400 11px; line-height 1.15; padding 4px 5px 4px 4px, 5 px after
                   the photo (7 px on the left without one): 14 px beside the text with a photo, 12
                   without; the photo as tall as the card's inside, at most 34% of its width
   WHOLE NAMES AS EARLY AS THEY CAN BE READ (the owner's "only last names"): through the names each card
   shows its WHOLE name, Hebrew and English, as soon as its --f2 reaches 0.78 (the Hebrew drawn at 10.5 px
   or more; fully at 0.82), and its family name only while its own box truly cannot hold the whole name.
   The choice is each card's own, not one zoom for every grave: a short name is whole long before a
   long one. A name is never broken word by word (the Hebrew wraps to two balanced lines at most).
   ───────────────────────────────────────────────────────────────────────────────────────────────────── */

/* The labels' pools fade as a whole (0.019 levels2): their number is read by the pool itself, never by a
   label in it, so it does not pass down to every label (a label is not styled again when it changes). */
@property --lv-codes {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

@property --lv-axes {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

@media screen {
  /* Level 1 → 2: the photo gives way to the grounds (the site's soft green) and is gone before it is
     drawn past about 1.35x its own pixels; the sections become white sheets. */
  .hs .hs-map.lv-on .hs-map__view {
    background: rgb(
      calc(238 - 4 * var(--lv-lay, 0)),
      calc(240 + 2 * var(--lv-lay, 0)),
      calc(234 + 3 * var(--lv-lay, 0))
    );
  }

  .hs .hs-map.lv-on .hs-map__photo {
    opacity: clamp(0, calc(1 - 1.3 * var(--lv-lay, 0)), 1);
  }

  /* gone: not painted at all (a phone's GPU is spared the blur) */
  .hs .hs-map.lv-paper .hs-map__photo {
    visibility: hidden;
  }

  /* At rest (map.js, 220 ms after the last move) the canvas is painted sharp at this zoom. Through the
     levels it is never promoted at all: a canvas promoted at the stones (90x) is rastered at 90x, and
     zooming back out then redrew a raster 30x too large every frame: 1.2-1.5 s frames at 4x CPU on a
     phone (measured; 83 ms at worst without it). Painted each frame instead, it is sharp at every zoom. */
  .hs .hs-map__canvas.is-still,
  .hs .hs-map.lv-on .hs-map__canvas {
    will-change: auto;
  }

  /* The sheets follow the zoom frame by frame (no 0.12 s lag behind it); a section's states keep
     their meaning through the change: the one you chose stays gold, the one in focus too. */
  .hs .hs-map.lv-on .hs-map__sec polygon {
    fill: rgba(255, 255, 255, calc(0.04 + 0.96 * var(--lv-lay, 0)));
    stroke: rgba(
      calc(255 - 150 * var(--lv-lay, 0)),
      calc(255 - 124 * var(--lv-lay, 0)),
      calc(255 - 140 * var(--lv-lay, 0)),
      calc(0.85 + 0.15 * var(--lv-lay, 0))
    );
    transition: none;
  }

  .hs .hs-map.lv-on .hs-map__sec.has polygon {
    stroke: rgb(
      calc(255 - 150 * var(--lv-lay, 0)),
      calc(255 - 124 * var(--lv-lay, 0)),
      calc(255 - 140 * var(--lv-lay, 0))
    );
  }

  .hs .hs-map.lv-on .hs-map__sec:hover polygon {
    fill: rgba(255, 255, 255, calc(0.2 + 0.8 * var(--lv-lay, 0)));
  }

  .hs .hs-map.lv-on .hs-map__sec:focus-visible polygon {
    stroke: var(--hs-gold);
  }

  .hs .hs-map.lv-on .hs-map__sec.is-sel polygon {
    fill: rgba(
      calc(245 + 10 * var(--lv-lay, 0)),
      calc(200 + 53 * var(--lv-lay, 0)),
      calc(76 + 169 * var(--lv-lay, 0)),
      calc(0.16 + 0.84 * var(--lv-lay, 0))
    );
    stroke: rgb(
      calc(245 - 28 * var(--lv-lay, 0)),
      calc(200 - 36 * var(--lv-lay, 0)),
      calc(76 - 76 * var(--lv-lay, 0))
    );
  }

  /* A clicked section's link holds focus, and the browser rings the link's box on the PHOTO, which the
     turn tilts against the boxes: no ring on the plan (keyboard focus still shows as the gold stroke). */
  .hs .hs-map.lv-on .hs-map__sec:focus {
    outline: none;
  }

  /* every plot a box: the lines turn from the photo's white to a warm grey on the sheet */
  .hs .hs-map.lv-on .hs-map__gr,
  .hs .hs-map.lv-on .hs-map__gp {
    stroke: rgb(
      calc(255 - 62 * var(--lv-lay, 0)),
      calc(255 - 66 * var(--lv-lay, 0)),
      calc(255 - 78 * var(--lv-lay, 0))
    );
  }

  .hs .hs-map.lv-on .hs-map__gr {
    opacity: max(clamp(0.22, calc(0.12 + var(--hs-k, 1) * 0.1), 0.85), calc(var(--lv-lay, 0) * 0.95));
  }

  .hs .hs-map.lv-on .hs-map__gp {
    opacity: max(clamp(0, calc((var(--hs-k, 1) - 1.8) * 0.32), 0.8), calc(var(--lv-lay, 0) * 0.9));
  }

  .hs .hs-map.lv-on .hs-map__gf {
    fill: rgba(255, calc(242 - 6 * var(--lv-lay, 0)), calc(204 - 25 * var(--lv-lay, 0)), calc(0.82 + 0.16 * var(--lv-lay, 0)));
  }

  /* The photo's labels step back as the plan comes (the plan names its own sections), upright
     meanwhile; the chosen grave's red dot and pin give way to its card. */
  .hs .hs-map.lv-on .hs-map__label {
    opacity: min(clamp(0.35, calc((6 - var(--hs-k, 1)) * 0.4), 1), calc(1 - var(--lv-lay, 0)));
    transform: translate(-50%, -50%) rotate(var(--hs-ra, 0rad)) scale(var(--hs-inv));
  }

  .hs .hs-map.lv-on .hs-map__entrance {
    opacity: calc(1 - var(--lv-lay, 0));
    transform: translate(-50%, -100%) rotate(var(--hs-ra, 0rad)) scale(var(--hs-inv));
  }

  .hs .hs-map.lv-on .hs-map__a1 {
    opacity: calc(1 - var(--lv-lay, 0));
    transform: translate(-50%, -50%) rotate(var(--hs-ra, 0rad)) scale(var(--hs-inv));
  }

  .hs .hs-map.lv-on .hs-map__dot {
    opacity: calc(1 - var(--lv-cards, 0));
    transform: translate(-50%, -50%) rotate(var(--hs-ra, 0rad)) scale(var(--hs-inv));
  }

  .hs .hs-map.lv-on .hs-map__pin {
    opacity: calc(1 - var(--lv-cards, 0));
    transform: translate(-50%, -100%) rotate(var(--hs-ra, 0rad)) scale(var(--hs-inv));
  }

  .hs .hs-map.lv-on .hs-map__pin--dot {
    transform: translate(-50%, calc(-100% - 9px)) rotate(var(--hs-ra, 0rad)) scale(var(--hs-inv));
  }

  /* ── the layer of names and cards: screen pixels over the canvas, sharp at every zoom ── */

  .hs .hs-lv {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    contain: strict;
  }

  .hs .hs-lv:empty,
  .hs .hs-lv[hidden],
  .hs .hs-lv [hidden] {
    display: none;
  }

  .hs .hs-lv__code,
  .hs .hs-lv__ax,
  .hs .hs-lv__chip,
  .hs .hs-lv__num,
  .hs .hs-lv__g {
    position: absolute;
    top: 0;
    left: 0;
  }

  /* an empty plot says its code ("J16"), faintly: a hint under the names, never competing with them
     (the row letters and plot numbers carry the place) */
  .hs .hs-lv__codes {
    opacity: var(--lv-codes, 0);
  }

  .hs .hs-lv__code {
    color: #a8a395;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
  }

  /* the row letters along the top and the plot numbers down the side (pinned to the map's edges once
     the section's own edges are scrolled away) */
  .hs .hs-lv__axes {
    opacity: var(--lv-axes, 0);
  }

  /* 12 px with 2 px each side: a row letter fits its column at the section level (a box 15 px wide on a
     phone), where 13 px letters touched */
  .hs .hs-lv__ax {
    padding: 0 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0 0 1px rgba(44, 81, 64, 0.1);
    color: var(--hs-accent-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    white-space: nowrap;
  }

  /* the section's number, large and faint on its own sheet */
  .hs .hs-lv__chips {
    opacity: calc(var(--lv-axes, 0) * (1 - var(--lv-cards, 0)));
  }

  .hs .hs-lv__num {
    color: rgba(44, 81, 64, 0.1);
    font-family: var(--hs-serif);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  .hs .hs-lv__chip {
    padding: 2px 10px;
    border: 1px solid var(--hs-line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    color: var(--hs-accent-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
  }

  /* a grave: its box becomes a cream card (the key's "a grave"), over its red dot. z-index 1 (0.019,
     levels2): the cards are painted above the pinned row letters and plot numbers, which the layer
     draws after them (and which fade as a group); a ruler pinned to the map's edge shows between the
     cards, never across a name (the checker found a chip over a name in 14 of 36 stills at 390). */
  .hs .hs-lv__g {
    --lv-w: clamp(0, calc((var(--f2, 0) - 0.78) * 25), 1);
    z-index: 1;
    box-sizing: border-box;
    display: block;
    overflow: hidden;
    border: 1px solid #dcc380;
    border-radius: 4px;
    background: #fff4d2;
    box-shadow: 0 1px 2px rgba(80, 60, 10, 0.12);
    color: var(--hs-ink);
    text-decoration: none;
    opacity: var(--lv-cards, 0);
    pointer-events: auto;
    cursor: pointer;
    contain: layout paint;
  }

  .hs .hs-lv__g:hover {
    border-color: #c9a53f;
    background: #fff0c2;
  }

  /* the grave you chose: lit gold, as its box on the photo */
  .hs .hs-lv__g.is-sel {
    border: 2px solid #d9a400;
    background: #fff0bd;
    box-shadow: 0 0 0 3px rgba(245, 200, 76, 0.5);
  }

  .hs .hs-lv__g:focus-visible {
    outline: 3px solid var(--hs-accent);
    outline-offset: 1px;
  }

  .hs .hs-lv__t1,
  .hs .hs-lv__t2,
  .hs .hs-lv__t3 {
    position: absolute;
    inset: 0;
    display: flex;
    box-sizing: border-box;
  }

  /* The names: the family name and the whole name share the names' stage (--lv-t1 + --lv-t2); each card
     takes its whole name the moment it can be read whole (--lv-w from its own --f2). */
  .hs .hs-lv__t1 {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: calc((var(--lv-t1, 0) + var(--lv-t2, 0)) * (1 - var(--lv-w, 0)));
    line-height: 1.15;
    white-space: nowrap;
  }

  .hs .hs-lv__t2 {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    opacity: calc((var(--lv-t1, 0) + var(--lv-t2, 0)) * var(--lv-w, 0));
    line-height: 1.12;
    text-align: center;
  }

  .hs .hs-map.lv-no-t1.lv-no-t2 .hs-lv__t1,
  .hs .hs-map.lv-no-t1.lv-no-t2 .hs-lv__t2,
  .hs .hs-map.lv-no-t3 .hs-lv__t3 {
    visibility: hidden;
  }

  .hs .hs-lv__he {
    font-weight: 700;
  }

  .hs .hs-lv__en {
    color: #4d5249;
    font-weight: 600;
    white-space: nowrap;
  }

  .hs .hs-lv__t1 .hs-lv__he {
    font-size: calc(13.5px * var(--f1, 1));
  }

  .hs .hs-lv__t1 .hs-lv__en {
    max-height: calc(var(--lv-en1, 0) * 18px);
    overflow: hidden;
    opacity: var(--lv-en1, 0);
    font-size: calc(11.5px * var(--f1, 1));
  }

  .hs .hs-lv__t2 .hs-lv__he {
    font-size: calc(13.5px * var(--f2, 1));
    text-wrap: balance;
  }

  .hs .hs-lv__t2 .hs-lv__en {
    font-size: calc(12px * var(--f2, 1));
    line-height: 1.15;
  }

  /* Level 4: the stone's card: the matzeiva photo, the whole name, the date of passing, Row · Plot */
  .hs .hs-lv__t3 {
    flex-direction: row;
    align-items: stretch;
    gap: 5px;
    padding: 4px 5px 4px 4px;
    opacity: var(--lv-t3, 0);
    background: #fffaf0;
  }

  .hs .hs-lv__g.is-sel .hs-lv__t3 {
    background: #fff6dc;
  }

  .hs .hs-lv__g:not(.has-ph) .hs-lv__t3 {
    padding-left: 7px;
  }

  .hs .hs-lv__ph {
    flex: none;
    height: 100%;
    max-width: 34%;
    aspect-ratio: var(--hs-ar, 0.6);
    border-radius: 3px;
    background: #ebe4d2;
    box-shadow: 0 0 0 1px rgba(80, 60, 10, 0.14);
    object-fit: cover;
  }

  .hs .hs-lv__tx {
    display: flex;
    flex: 1;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    min-width: 0;
    margin-block: -3px;
    overflow: hidden;
    line-height: 1.15;
  }

  /* 0.035 (the owner's phone, 3 Dec: "chopped up in the bottom"): every line of a stone's card is whole
     or not drawn. Each line keeps its own height (flex: none; a line with overflow: hidden, Row · Plot,
     used to shrink to a sliver when the lines ran taller than the card, as a phone's fonts do), and a
     line that does not fit wraps whole into a second column, one column's width to the right, outside
     the column (overflow: hidden), so it is not drawn at all; Row · Plot goes first, then the date (the
     grave's sheet shows both). The column reaches 3 px into the card's padding (margin-block above),
     the room a line at its largest (--f3 1.22) may take beyond what map.js's fit keeps for it. */
  .hs .hs-lv__tx > * {
    box-sizing: border-box;
    flex: none;
    width: 100%;
  }

  .hs .hs-lv__t3 .hs-lv__he {
    font-size: calc(14px * var(--f3, 1));
    text-align: right;
    text-wrap: balance;
  }

  .hs .hs-lv__t3 .hs-lv__en {
    color: var(--hs-ink);
    font-size: calc(12.5px * var(--f3, 1));
  }

  .hs .hs-lv__dt {
    color: var(--hs-muted);
    font-size: calc(11.5px * var(--f3, 1));
    white-space: nowrap;
  }

  /* A stone's card too narrow for its photo and its date on one line (0.019 levels2: a shared plot's half
     box at the stones floored its text and the date ran past the card). map.js draws it the first way
     that reads: the date on two lines (its Hebrew, then its English), without the photo, or without the
     date, so nothing is ever drawn past the card. */
  .hs .hs-lv__g.lv-dt2 .hs-lv__dt-h,
  .hs .hs-lv__g.lv-dt2 .hs-lv__dt-e {
    display: block;
  }

  .hs .hs-lv__g.lv-dt2 .hs-lv__dt-s,
  .hs .hs-lv__g.lv-noph .hs-lv__ph,
  .hs .hs-lv__g.lv-nodt .hs-lv__dt {
    display: none;
  }

  .hs .hs-lv__g.lv-noph .hs-lv__t3 {
    padding-left: 7px;
  }

  /* Row · Plot is whole or not drawn (0.035): it came in by a max-height of --lv-rp x 18 px, so between
     its ramp's ends (a zoom between two levels, and where a finger left the map on the owner's phone) it
     was drawn as half a line, "Row K · Plot 21" cut through. Now it takes its whole line (2em: its line is
     1.15em at any --f3) once --lv-rp passes 0.75, where map.js's fit (fitNames: rpH, the least of
     --lv-rp x 18 px and its line) already keeps a whole line for it, and fades in from there. */
  .hs .hs-lv__rp {
    max-height: calc(clamp(0, calc((var(--lv-rp, 0) - 0.75) * 1000), 1) * 2em);
    overflow: hidden;
    opacity: clamp(0, calc((var(--lv-rp, 0) - 0.75) * 4), 1);
    color: var(--hs-accent);
    font-size: calc(11px * var(--f3, 1));
    font-weight: 600;
    white-space: nowrap;
  }

  /* measuring a card's natural widths, once (when map.js measures in the page, not on a canvas) */
  .hs .hs-lv__g.is-measure {
    width: auto !important;
    height: auto !important;
    visibility: hidden;
    contain: none;
  }

  .hs .hs-lv__g.is-measure .hs-lv__t1,
  .hs .hs-lv__g.is-measure .hs-lv__t2,
  .hs .hs-lv__g.is-measure .hs-lv__t3,
  .hs .hs-lv__g.is-measure .hs-lv__tx {
    position: static;
    display: block;
    width: max-content;
  }

  .hs .hs-lv__g.is-measure .hs-lv__he,
  .hs .hs-lv__g.is-measure .hs-lv__en,
  .hs .hs-lv__g.is-measure .hs-lv__dt {
    display: inline-block;
    width: auto;
    max-height: none;
    white-space: nowrap;
  }

  .hs .hs-lv__g.is-measure .hs-lv__tx {
    margin-block: 0;
    overflow: visible;
  }

  /* where you are, and the way back up: "‹ Cemetery · Section 18 · חלקה 18 · Row C" */
  .hs .hs-lv__where {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 76px);
    padding: 2px 12px 2px 2px;
    border: 1px solid var(--hs-line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: var(--hs-accent-ink);
    font-size: var(--hs-fs-min, 13px);
    font-weight: 700;
    white-space: nowrap;
  }

  .hs .hs-lv__where[hidden] {
    display: none;
  }

  .hs .hs-lv__where-t {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hs .hs-lv__up {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 0 12px 0 8px;
    border: 0;
    border-radius: 999px;
    background: var(--hs-accent-soft);
    color: var(--hs-accent);
    font: inherit;
    cursor: pointer;
  }

  .hs .hs-lv__up:hover {
    background: #dcebe2;
  }

  .hs .hs-lv__up:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: 2px;
  }

  .hs .hs-lv__up-i {
    font-size: 18px;
    line-height: 1;
  }
}

/* a touch screen: the way back up is 44 px tall (DESIGN_V2's floor) */
@media screen and (pointer: coarse) {
  .hs .hs-lv__up {
    min-height: var(--hs-tap, 44px);
  }
}

/* Paper keeps 0.018's map at every level: the whole cemetery at 1x, upright, the photo on (map.css
   resets --hs-k, --hs-u and --hs-inv above; the levels' rules are the screen's only). */
@media print {
  .hs .hs-lv,
  .hs .hs-lv__where {
    display: none !important;
  }

  .hs .hs-map {
    --lv-lay: 0 !important;
    --lv-cards: 0 !important;
  }

  .hs .hs-map__canvas {
    --hs-ra: 0rad !important;
  }

  /* Paper draws the whole cemetery at 1x, so the graves' dots are drawn as there: r 8, as the page
     draws them (HsMap.tsx). map.js shrinks them as the screen zooms in (gridDotRadius), which at the
     names (20-50x) leaves them too small to see on paper. */
  .hs .hs-map.lv-on .hs-map__d {
    r: 8px;
  }
}

/* ── END OF THE LEVELS (0.019, lane B) ── */

/* ── FULL-SCREEN MAP TAKEOVER (0.020–0.021: 100% edge-to-edge 100vw × 100dvh) ── */

.hs .hs-map__fsbtn {
  font-size: 18px;
}

.hs .hs-map__fsbtn[aria-pressed='true'] {
  border-color: var(--hs-accent);
  background: var(--hs-accent-soft);
  color: var(--hs-accent);
}

.hs .hs-map__fsexit {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--hs-tap, 44px);
  padding: 6px 14px;
  border: 1.5px solid var(--hs-accent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  color: var(--hs-accent-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.hs .hs-map__fsexit[hidden] {
  display: none !important;
}

.hs .hs-map__fsexit:hover {
  background: var(--hs-accent-soft);
}

@media screen {
  body:has(.hs.hs-map-fullscreen) {
    overflow: hidden;
  }

  .hs .hs-mapcard.is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #eef0ea !important;
    box-shadow: none !important;
  }

  .hs .hs-mapcard.is-fullscreen .hs-map,
  .hs .hs-mapcard.is-fullscreen .hs-map[data-js] {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .hs .hs-mapcard.is-fullscreen .hs-map[data-js] .hs-map__view {
    inset: 0 !important;
  }

  .hs .hs-mapcard.is-fullscreen .hs-map__ctl {
    top: max(12px, env(safe-area-inset-top)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    left: auto !important;
  }

  .hs .hs-mapcard.is-fullscreen .hs-lv__where {
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
  }

  .hs .hs-mapcard.is-fullscreen .hs-mapcard__h,
  .hs .hs-mapcard.is-fullscreen .hs-mapcard__note,
  .hs .hs-mapcard.is-fullscreen .hs-mapcard__credit,
  .hs .hs-mapcard.is-fullscreen .hs-map__views {
    display: none !important;
  }

  /* Keep an opened grave/section sheet or plot modal reachable above the full-screen map */
  .hs.hs-map-fullscreen .hs-find__detail.is-open,
  .hs.hs-map-fullscreen .hs-plan.is-sheet {
    z-index: 10000 !important;
  }
}

/* 0.035 (the owner's phone, 3 Dec, Section 9): a phone with a grave's or a section's sheet open. On the
   full-screen map the sheet still stopped the call bar's height above the screen's foot (bottom:
   var(--hs-callbar-h), find.css), though the full-screen map covers the call bar; in that strip the map's
   "‹ Cemetery | Section 9 · חלקה 9" pill showed, right where the sheet's Directions and Share buttons
   come, so they looked covered and were cut by the sheet's edge. Now, on the full-screen map, the sheet
   reaches the screen's foot (its end clear of the phone's own bar: safe-area), and while any sheet is
   open on a phone the pill is not drawn (visibility only: it keeps its place and size, so nothing moves
   under a finger, as plan.css's R3-01 asks); "Back to the map" is the sheet's own way back, and the pill
   comes back the moment the sheet closes. */
@media screen and (max-width: 699px) {
  .hs.hs-map-fullscreen .hs-find__detail.is-open {
    bottom: 0;
    padding-bottom: calc(18px + var(--hs-launcher-room, 0px) + env(safe-area-inset-bottom));
  }

  .hs.hs-detail-open .hs-lv__where,
  .hs.hs-plan-open .hs-lv__where {
    visibility: hidden;
  }
}

@media screen and (min-width: 700px) {
  .hs.hs-map-fullscreen .hs-find__detail.is-open {
    position: fixed !important;
    top: max(68px, calc(env(safe-area-inset-top) + 60px)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    right: auto !important;
    bottom: auto !important;
    width: min(400px, calc(100vw - 84px)) !important;
    max-height: calc(100dvh - 84px) !important;
    overflow-y: auto !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18) !important;
  }
}

@media print {
  .hs .hs-map__fsexit {
    display: none !important;
  }
}


