/* ============================================================================
   Cairn — v2 interface overlay.

   ADDITIVE ONLY. Load AFTER theme.css:
       <link rel="stylesheet" href="theme.css">
       <link rel="stylesheet" href="theme-v2.css">

   Nothing here changes a colour token. The palette in theme.css was contrast
   verified on 6 Jul 2026 and is reused untouched. This file adds:
     - a named type scale (the app currently sets ~14 ad-hoc inline sizes)
     - tabular figures on numeric readouts
     - a stronger focus ring that survives on dark panels
     - one status-pill vocabulary
     - the v2 sign-in layout
     - the v2 project card / filter styling
     - the v2 data-tree and measurement styling for the viewer

   Deleting this file and its <link> restores the current appearance exactly.
   ============================================================================ */

:root{
  /* type scale — named, so density stays consistent across pages */
  --fs-micro:10.5px; --fs-tiny:11px; --fs-small:11.5px; --fs-cap:12px;
  --fs-body:13px; --fs-md:15px; --fs-lg:19px; --fs-xl:26px;
  --track-label:.07em;
  /* two-tone focus ring: an inner ring in the page colour separates the outer
     accent ring from the control, so it stays visible on every panel shade.
     The existing 2px outline disappears against --bg-elev2. */
  --focus:0 0 0 2px var(--bg-app),0 0 0 4px var(--accent);
  --warning-soft:rgba(201,156,76,0.13); --info-soft:rgba(123,163,189,0.13);
}
[data-theme="light"]{
  --warning-soft:rgba(124,89,21,0.12); --info-soft:rgba(55,100,134,0.12);
}

/* Every number in this product is a measurement. Tabular figures stop
   coordinate readouts and counts reflowing as digits change, which is the
   cheapest precision cue available. */
.mono,.num,.v,.val,.ms-value,.statusbar .v,.point-coordinate-value,
.pcard .kv .v,.titem .val,dl.kv dd{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1,"zero" 1;
}

:focus-visible{outline:none;box-shadow:var(--focus);border-radius:var(--r2);}

.label-cap{font-size:var(--fs-micro);letter-spacing:var(--track-label);
  text-transform:uppercase;color:var(--text-3);font-weight:600;}

/* NEW — the square grid backdrop used on sign-in and the projects header. */
.gridbg{position:relative;}
.gridbg::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background-image:linear-gradient(var(--border-soft) 1px,transparent 1px),
                   linear-gradient(90deg,var(--border-soft) 1px,transparent 1px);
  background-size:44px 44px;opacity:.55;
  mask-image:radial-gradient(130% 100% at 28% 26%,#000 18%,transparent 76%);
  -webkit-mask-image:radial-gradient(130% 100% at 28% 26%,#000 18%,transparent 76%);}
.gridbg>*{position:relative;z-index:1;}

/* NEW — one status vocabulary, used identically on every page. */
.pill{display:inline-flex;align-items:center;gap:6px;height:21px;padding:0 8px;
  border-radius:999px;font-size:var(--fs-tiny);font-weight:600;white-space:nowrap;
  border:1px solid transparent;}
.pill .dot{width:6px;height:6px;border-radius:50%;background:currentColor;flex:none;}
.pill .dot.pulse{animation:cairn-pulse 1.6s ease-in-out infinite;}
.pill-ok{background:var(--success-soft);color:var(--success);
  border-color:color-mix(in srgb,var(--success) 35%,transparent);}
.pill-warn{background:var(--warning-soft);color:var(--warning);
  border-color:color-mix(in srgb,var(--warning) 38%,transparent);}
.pill-err{background:var(--danger-soft);color:var(--danger);
  border-color:color-mix(in srgb,var(--danger) 38%,transparent);}
.pill-info{background:var(--info-soft);color:var(--info);
  border-color:color-mix(in srgb,var(--info) 35%,transparent);}
.pill-idle{background:var(--bg-elev);color:var(--text-3);border-color:var(--border);}
@keyframes cairn-pulse{0%,100%{opacity:1}50%{opacity:.35}}
@keyframes cairn-shimmer{0%{background-position:-380px 0}100%{background-position:380px 0}}
@media (prefers-reduced-motion:reduce){
  .pill .dot.pulse,.sk{animation:none!important;}
}

/* ============================ SIGN IN ==================================== */
/* min-height, NOT height (5 Aug 2026). theme.css sets `html,body{height:100%}`
   globally for the viewer shell; inheriting it here locked the sign-in grid to
   exactly the viewport, so on a landscape phone (812x375) both rows were
   compressed to fit, .lg-left's overflow:hidden clipped ~250px of copy, and
   scrollHeight equalled clientHeight — the page could not scroll at all, which
   is what put the submit button out of reach behind the on-screen keyboard.
   With min-height the grid grows to its content and overflow-y:auto finally
   has something to scroll. 100dvh follows the mobile URL bar; the 100vh line
   above it is the fallback for browsers without dvh. */
body.v2-login{display:grid;grid-template-columns:minmax(0,1fr) minmax(410px,460px);
  height:auto;min-height:100vh;min-height:100dvh;overflow-y:auto;
  align-items:stretch;justify-content:stretch;}
.lg-left{background:var(--bg-app);border-right:1px solid var(--border);
  padding:40px 44px;display:flex;flex-direction:column;min-width:0;}
.lg-logo{display:flex;align-items:center;gap:13px;}
.lg-logo img{height:34px;width:auto;max-width:210px;object-fit:contain;object-position:left center;}
.lg-tag{margin-top:26px;font-size:var(--fs-md);color:var(--text-2);letter-spacing:.005em;}
.lg-tag b{color:var(--text-1);font-weight:600;}
.lg-copy{margin-top:auto;padding-top:40px;display:flex;flex-direction:column;gap:20px;max-width:56ch;}
.lg-copy section{border-left:2px solid var(--border-strong);padding-left:14px;}
.lg-copy h2{margin:0 0 5px;font-size:var(--fs-micro);letter-spacing:var(--track-label);
  text-transform:uppercase;color:var(--accent);font-weight:600;}
.lg-copy p{margin:0;font-size:var(--fs-cap);line-height:1.6;color:var(--text-2);}
.lg-foot{margin-top:34px;padding-top:18px;border-top:1px solid var(--border-soft);
  display:flex;flex-wrap:wrap;align-items:center;gap:16px;font-size:var(--fs-tiny);color:var(--text-3);}
.lg-foot .ver{font-family:var(--font-mono);font-variant-numeric:tabular-nums;}
.lg-foot a{color:var(--text-2);text-decoration:none;border-bottom:1px solid var(--border-strong);padding-bottom:1px;}
.lg-foot a:hover{color:var(--accent);border-color:var(--accent);}

.lg-right{background:var(--bg-chrome);display:flex;flex-direction:column;
  justify-content:center;padding:40px 48px;overflow-y:auto;}
.lg-card{width:100%;max-width:360px;margin:0 auto;}
.lg-h{font-size:var(--fs-lg);font-weight:600;letter-spacing:-.015em;margin:0 0 6px;}
.lg-sub{font-size:var(--fs-cap);color:var(--text-2);line-height:1.55;margin:0 0 22px;}
.fgroup{margin-bottom:14px;}
.fgroup label{display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  margin-bottom:6px;font-size:var(--fs-cap);font-weight:500;color:var(--text-2);}
.fgroup .hint{font-size:var(--fs-tiny);color:var(--text-3);font-weight:400;}
.fgroup input{width:100%;height:38px;background:var(--bg-elev);border:1px solid var(--border);
  border-radius:var(--r2);color:var(--text-1);padding:0 12px;outline:none;font-size:var(--fs-body);
  transition:border-color .12s,box-shadow .12s;}
.fgroup input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);}
.fgroup input::placeholder{color:var(--text-3);}
.pw-wrap{position:relative;}
.pw-wrap input{padding-right:44px;}
.pw-reveal{position:absolute;right:4px;top:4px;width:30px;height:30px;border:none;
  border-radius:var(--r2);background:transparent;color:var(--text-3);cursor:pointer;
  display:flex;align-items:center;justify-content:center;}
.pw-reveal:hover{color:var(--text-1);background:var(--bg-hover);}
.lg-alert{display:flex;gap:10px;align-items:flex-start;border-radius:var(--r3);
  padding:11px 13px;font-size:var(--fs-cap);line-height:1.5;margin-bottom:16px;border:1px solid;}
.lg-alert svg{flex:none;margin-top:1px;}
.lg-alert .t{color:var(--text-1);font-weight:600;display:block;margin-bottom:2px;}
.alert-err{background:var(--danger-soft);border-color:color-mix(in srgb,var(--danger) 40%,transparent);color:var(--text-1);}
.alert-err svg{color:var(--danger);}
.alert-warn{background:var(--warning-soft);border-color:color-mix(in srgb,var(--warning) 40%,transparent);color:var(--text-1);}
.alert-warn svg{color:var(--warning);}
.alert-info{background:var(--info-soft);border-color:color-mix(in srgb,var(--info) 35%,transparent);color:var(--text-2);}
.alert-info svg{color:var(--info);}
.lg-actions{display:flex;flex-direction:column;gap:10px;margin-top:20px;}
.lg-actions button{height:40px;border:1px solid transparent;border-radius:var(--r2);
  background:var(--accent);color:var(--accent-fg);font-size:var(--fs-body);font-weight:600;cursor:pointer;}
.lg-actions button:hover{background:var(--accent-hover);}
.lg-actions button:disabled{opacity:.55;cursor:wait;}
.lg-links{display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-top:16px;font-size:var(--fs-small);}
.linkbtn{background:none;border:none;padding:0;color:var(--accent);
  font-size:var(--fs-small);font-weight:500;cursor:pointer;text-align:left;}
.linkbtn:hover{text-decoration:underline;}
@media (max-width:1000px){
  body.v2-login{grid-template-columns:1fr;}
  .lg-left{border-right:none;border-bottom:1px solid var(--border);padding:28px 24px;}
  .lg-copy{padding-top:26px;}
  .lg-right{padding:28px 24px 56px;}
}
/* Phones and small tablets: the job here is to SIGN IN, so the form comes
   first and the marketing panel becomes a short header underneath it.
   `order` on the grid items rather than reordering the markup, so the DOM
   order (and therefore the tab order for a keyboard/screen reader arriving at
   the page) still starts with the branding, and nothing about the desktop
   layout changes. */
@media (max-width:640px){
  body.v2-login{grid-template-rows:auto auto;}
  .lg-right{order:1;padding:24px 18px 28px;justify-content:flex-start;}
  .lg-left{order:2;border-bottom:none;border-top:1px solid var(--border);padding:22px 18px 32px;}
  .lg-logo{order:0;}
  .lg-logo img{height:28px;}
  /* The three explanatory sections are useful on a desktop and are noise on a
     375px screen where the form is what was asked for. The tagline stays. */
  .lg-copy{display:none;}
  .lg-tag{margin-top:14px;font-size:var(--fs-cap);}
  .lg-foot{margin-top:18px;padding-top:14px;gap:10px;}
  .lg-card{max-width:none;}
  /* 16px is the threshold below which iOS Safari zooms the page on focus —
     that zoom is itself a horizontal-overflow source. */
  .fgroup input{font-size:16px;height:44px;}
  .lg-actions button{height:46px;}
  .pw-reveal{width:36px;height:36px;top:4px;right:4px;}
}
/* Short viewports (landscape phones): never let the branding push the form
   off-screen, and keep the whole page scrollable. */
@media (max-height:520px) and (max-width:1000px){
  .lg-right{order:1;padding:18px 18px 24px;justify-content:flex-start;}
  .lg-left{order:2;padding:18px;}
  .lg-copy{display:none;}
  .lg-h{margin-bottom:2px;}
  .lg-sub{margin-bottom:14px;}
}

/* ============================== DASHBOARD ================================
   The project rows are generated by src/dash/project-list.ts and carry inline
   font sizes, so this section deliberately does NOT fight them with
   !important. It improves the frame around the rows: spacing, hover, the
   thumbnail, the status badge and the column headings. Changing the columns
   themselves needs project-list.ts edited and the bundle rebuilt.
   ======================================================================== */
.v2-dash .dash-head{height:64px;}
.v2-dash .project-page-title>div:first-child{font-size:var(--fs-md);letter-spacing:-.012em;}
.v2-dash .th{font-size:var(--fs-micro);letter-spacing:var(--track-label);padding:10px 18px;}
.v2-dash .tbl{border-radius:var(--r4);overflow:hidden;}
.v2-dash .tr:not(.th){padding:13px 18px;transition:background .1s,box-shadow .1s;}
.v2-dash .tr:not(.th):hover{background:var(--bg-hover);}
.v2-dash .tr:not(.th):focus-visible{box-shadow:inset 0 0 0 2px var(--accent);}
.v2-dash .thumb{width:78px;height:50px;border-radius:var(--r2);}
/* the generated status chip: give it the same pill vocabulary as everywhere else */
.v2-dash .badge{height:21px;padding:0 9px;border:1px solid transparent;border-radius:999px;
  font-size:var(--fs-tiny);letter-spacing:.01em;}
.v2-dash .badge-ready{border-color:color-mix(in srgb,var(--success) 35%,transparent);}
.v2-dash .badge-error{border-color:color-mix(in srgb,var(--danger) 38%,transparent);}
.v2-dash .prog{height:4px;}
.v2-dash .dropzone{border-radius:var(--r4);}
.v2-dash .chip{font-size:var(--fs-micro);letter-spacing:.02em;}
/* filter segment reads as filter chips rather than a tab strip */
.v2-dash #filter button{height:27px;padding:0 12px;border-radius:999px;font-size:var(--fs-small);}
.v2-dash #filter{background:transparent;border:none;padding:0;gap:6px;}
.v2-dash #filter button[aria-pressed="true"]{background:var(--bg-active);
  color:var(--accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 45%,transparent);}
.v2-dash #filter button[aria-pressed="false"]{box-shadow:inset 0 0 0 1px var(--border);}
/* map pane */
.v2-dash #map-body.project-map #map{border-radius:var(--r4);}
.v2-dash #map-body .map-caption{font-size:var(--fs-micro);line-height:1.5;}

/* --------------------------------------------------------------------------
   THE BASEMAP CAVEAT, BELOW THE MAP (2 September 2026).

   Until then this was `.v2-dash #map .map-basemap-note`: a bordered,
   opaque chip pinned to the pane's bottom-left corner, in the zoom controls'
   chip vocabulary. The owner rejected it -- it covered the geography it
   exists to describe -- and asked for the same information as a small note
   under the map, with the caption about scanner origins. So it is now a
   second sentence in `#map-body .map-caption`, in the caption's own type, and
   nothing is drawn in the pane for it. src/dash/map.ts still writes the
   three wordings (Full / Approximate / not installed) into the span.

   The 23 August 2026 measurement that used to sit here -- a marker under this
   chip was entirely invisible until the markers moved to their own pan layer
   -- is recorded with the .map-scale rule below, where the ladder it describes
   still lives; this element is no longer on the ladder.
   -------------------------------------------------------------------------- */
.v2-dash #map-body .map-basemap-note{color:var(--text-3);}
.v2-dash #map-body .map-basemap-note b{font-weight:600;color:var(--text-2);}

/* --------------------------------------------------------------------------
   THE LITE MAP'S FURNITURE (23 Aug 2026) — graticule, project extent, scale
   bar, north indicator.

   WHY THEY EXIST. Removing the third-party tiles left a pane in which pan
   and zoom moved the markers against nothing at all, so a reader could not
   tell whether they had zoomed, how far, or where they were. These four are
   what restore that, drawn entirely locally: no imagery, no request, no
   dependency.

   TWO GROUPS, AND THE SPLIT IS WHAT LETS A LOCAL BASEMAP LAND LATER WITHOUT
   REPLACING ANY OF IT. .map-graticule and .map-extent live INSIDE the pan
   layer, as siblings of .tile-layer and after it, so tiles will paint
   underneath them and the dark-theme invert filter further down never
   reaches them. .map-scale and .map-north are viewport CHROME pinned to the
   corners, like the zoom controls and the basemap note, and chrome sits over
   a basemap on every map ever drawn.

   Geometry — path data, the rule's pixel length — is written by
   src/dash/map.ts, because geometry is data. Everything visual is here:
   brief 2 item 1, a renderer never writes inline font-size.
   -------------------------------------------------------------------------- */
.v2-dash #map .map-graticule{color:var(--text-3);}
/* 45% of --text-3 over the --bg-elev2 ground measures about 1.8:1 dark and
   2.0:1 light: a grid you can see the markers move against, without a grid
   that competes with them. 1.10:1 is the contrast the owner reported as no
   map at all. */
.v2-dash #map .map-graticule-lines{
  fill:none;stroke:color-mix(in srgb,currentColor 45%,transparent);
  stroke-width:1;shape-rendering:crispEdges;
}
/* QUIETER OVER A STREET MAP (3 September 2026). The 45% above was measured
   for a grid over the Lite map's flat land, where it is the only thing that
   registers movement. Over the Full map's streets, buildings and names the
   same grid competes with the geography it exists to orient, so once the
   Full tier has painted -- map.ts latches `.map-full-painted` on the pane at
   the moment it covers the Lite layer -- the lines drop to a hint. Never
   removed: the interval they draw is still what the scale chip reports. */
.v2-dash #map.map-full-painted .map-graticule-lines{
  stroke:color-mix(in srgb,currentColor 18%,transparent);
}
/* The extent borrows the live marker's own sage and is dashed, so it reads
   as "the ground these scans cover" rather than as a boundary somebody
   surveyed. */
.v2-dash #map .map-extent{
  fill:color-mix(in srgb,var(--accent) 8%,transparent);
  stroke:color-mix(in srgb,var(--accent) 70%,transparent);
  stroke-width:1.5;stroke-dasharray:5 4;
}
/* Scale bar, bottom-right: the corner opposite the basemap note, and the
   conventional place for one. Its length and its label are rewritten on
   every reconciliation — only the chrome is here.

   z-index 3 IS LOAD-BEARING and is one rung of a ladder that spans two
   files: geography (auto) < this chip and .map-north (3) < the marker layer
   .map-marks (4) < the zoom controls (5), the last two written by
   src/dash/map.ts. Raising this above 4 puts the chip back on top of the
   markers, which is the defect that was fixed on 23 August 2026 — see the
   .map-basemap-note block above for the measurement. */
.v2-dash #map .map-scale{
  position:absolute;right:10px;bottom:10px;z-index:3;pointer-events:none;
  display:flex;flex-direction:column;align-items:flex-end;gap:3px;
  padding:6px 8px 5px;border:1px solid var(--border-strong);
  border-radius:var(--r2);background:var(--bg-chrome);box-shadow:var(--shadow-1);
}
.v2-dash #map .map-scale-rule{
  box-sizing:border-box;height:6px;min-width:20px;
  border:1px solid var(--text-2);border-top:0;
}
.v2-dash #map .map-scale-text{
  display:flex;gap:8px;align-items:baseline;
  font-size:var(--fs-micro);line-height:1.2;color:var(--text-2);
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.v2-dash #map .map-scale-grid{color:var(--text-3);font-weight:400;}
.v2-dash #map .map-scale-distance{font-weight:600;}
/* The map-data credit, the scale chip's last line (J4, 4 October 2026). The
   chip stays click-through; only the link takes pointer events back, so it can
   be followed while a drag, a wheel or a marker click through the rest of the
   chip still reaches the map, and a marker (rung 4) still paints over it. */
.v2-dash #map .map-credit{font-size:var(--fs-micro);line-height:1.2;color:var(--text-3);white-space:nowrap;}
.v2-dash #map .map-credit[hidden],.v2-dash #map .map-credit [hidden]{display:none;}
.v2-dash #map .map-credit a{color:inherit;text-decoration:underline;pointer-events:auto;}
/* North, top-right, opposite the zoom controls. Static by design: this is an
   unrotated Web Mercator projection with no rotation control, so a needle
   that swung about would be asserting something untrue.

   z-index 3: the same rung of the same two-file ladder as .map-scale above,
   and load-bearing for the same reason. */
.v2-dash #map .map-north{
  position:absolute;right:10px;top:10px;z-index:3;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;gap:1px;
  width:30px;padding:4px 0 3px;border:1px solid var(--border-strong);
  border-radius:var(--r2);background:var(--bg-chrome);box-shadow:var(--shadow-1);
  font-size:var(--fs-micro);font-weight:600;line-height:1;color:var(--text-2);
}
.v2-dash #map .map-north svg{display:block;fill:var(--text-2);}

/* --------------------------------------------------------------------------
   THE LITE GEOGRAPHIC BASEMAP (23 Aug 2026).

   The furniture above answers "have I moved, and how far". It does not answer
   "where in the world is this", which is what the owner rejected the previous
   round for. This block styles the layer that does: land, coastline, state
   boundaries, major highways and town labels, decoded from one binary asset
   served by this installation and drawn by src/dash/map.ts.

   A PALETTE OF ITS OWN, IN BOTH THEMES, RATHER THAN AN INVERTED COPY. The
   dark-theme filter further down is scoped to .tile-layer, which is where
   third-party raster imagery used to go — imagery you cannot restyle, so you
   invert it. This layer is vector and locally drawn, so it is simply given
   the right colours twice. That is why it sits outside .tile-layer.

   WHY SEA AND LAND ARE BOTH QUIET. Two competing requirements: a reader must
   be able to recognise the coastline at a glance, and the project markers must
   stay the most prominent thing in the pane. So the land/sea contrast is
   carried by hue as much as by lightness, and neither colour approaches the
   marker's sage or the extent's dashed accent.

   The tokens are declared on #map rather than :root because nothing outside
   this pane has any use for them.
   -------------------------------------------------------------------------- */
.v2-dash #map{
  --map-sea:#20252B;
  --map-land:#42453F;
  --map-coast:#7C8A93;
  --map-admin:#61666C;
  --map-road:#8B7B5D;
  --map-place:#C6CACE;
  --map-place-dot:#9BA1A7;
  --map-place-halo:#22262B;
}
[data-theme="light"] .v2-dash #map{
  --map-sea:#C9DCE6;
  --map-land:#F4EFE2;
  --map-coast:#7E96A3;
  --map-admin:#AC9F84;
  --map-road:#C08F45;
  --map-place:#453C31;
  --map-place-dot:#6F6350;
  --map-place-halo:#F4EFE2;
}
/* The sea is the layer's own background rather than the pane's, because #map
   carries its ground colour as an inline token and an inline style wins. The
   element is bled 320px on every side, which is more than the 192px a drag
   travels before it rebases, so the sea always reaches the pane's edges. */
.v2-dash #map .map-basemap{background:transparent;}
.v2-dash #map .map-basemap-on{background:var(--map-sea);}
.v2-dash #map .map-base-land{fill:var(--map-land);stroke:none;}
/* non-scaling-stroke is also set as an attribute in map.ts: without it every
   width here is multiplied by the zoom scale. Repeated in CSS so a reader of
   the stylesheet is not left thinking these are absolute. */
.v2-dash #map .map-base-coast{
  fill:none;stroke:var(--map-coast);stroke-width:1.1;
  stroke-linejoin:round;vector-effect:non-scaling-stroke;
}
/* SOLID, NOT DASHED (2 September 2026), and the reason is measured rather
   than aesthetic. This stroke carried `stroke-dasharray:6 4`, and a dash is
   generated along the WHOLE length of the path before anything is clipped to
   the pane: at z16 the state boundaries are millions of pixels long, so every
   reconciliation of the Lite map dashed them all, into a composited layer,
   under whatever was above. Measured in a headless Chromium at 1920x1080 on
   the Lite tier alone: the worst frame per zoom step or drag commit was 190
   to 250 ms with the dash and 47 to 70 ms without it, with every other path
   unchanged. A solid hairline reads as a boundary just as well. */
.v2-dash #map .map-base-admin{
  fill:none;stroke:var(--map-admin);stroke-width:1;
  vector-effect:non-scaling-stroke;
}
.v2-dash #map .map-base-road{
  fill:none;stroke:var(--map-road);stroke-width:1.2;
  stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke;
}
/* THE CAVEAT, IN A NARROW COLUMN. A container query rather than a viewport
   one, because what matters is the map COLUMN's width and that is a
   split-view column whose width does not follow the window's. #map-body is
   the container; inline-size containment is safe there because its width
   comes from the dashboard grid rather than from its contents.

   Below 360 px the caveat keeps its heading and drops to its shortest true
   form. It does not disappear: a statement that vanishes exactly where the
   layout is tightest would be missing on the layout most likely to be a
   surveyor's second monitor.
   -------------------------------------------------------------------------- */
.v2-dash #map-body{container-type:inline-size;}
.v2-dash #map-body .map-basemap-note .short{display:none;}
@container (max-width: 360px){
  .v2-dash #map-body .map-basemap-note .long{display:none;}
  .v2-dash #map-body .map-basemap-note .short{display:inline;}
}
/* Town labels. Placed in screen pixels rather than inside the scaled geometry
   group — see map.ts — so these sizes are real px at every zoom. The halo is
   paint-order rather than a shadow so the text stays legible over a road or a
   coastline without a blur that reads as a glow. */
.v2-dash #map .map-base-place text{
  font-family:var(--font-sans);font-size:10.5px;font-weight:600;
  fill:var(--map-place);stroke:var(--map-place-halo);stroke-width:2.5px;
  paint-order:stroke fill;dominant-baseline:auto;
}
.v2-dash #map .map-base-place circle{
  fill:var(--map-place-dot);stroke:var(--map-place-halo);stroke-width:1;
}

/* --------------------------------------------------------------------------
   THE FULL OFFLINE BASEMAP (24 Aug 2026).

   Vector tiles from a map package installed on this server, drawn by
   src/dash/map.ts and src/dash/vectortile.ts. Same argument as the Lite block
   above and the same tokens where the two draw the same thing: this is
   locally-drawn vector geometry, so it gets a real palette in both themes
   rather than an inverted copy of one. The dark-theme invert filter is scoped
   to .tile-layer and never reaches here.

   WHAT CHANGES WHEN A PACKAGE IS INSTALLED. The Lite package's roads and town
   labels are switched off, because the vector layer draws the same roads at a
   detail this coarse one cannot and the same towns with better placement. Its
   LAND and COASTLINE stay: pan outside the installed package's extent and the
   country is still there, which is the difference between "this package does
   not cover here" and "the map is broken".

   ROAD WIDTHS ARE non-scaling-stroke, set as an attribute in map.ts as well
   as here, so a width below is real CSS pixels at every zoom. Without it a
   residential street is a hairline at z14 and forty pixels wide at z19.

   THE HIERARCHY IS CARRIED BY WIDTH, NOT BY COLOUR, and that is deliberate.
   A surveyor is reading this map to find a street name and to see how their
   site sits against the block around it. Four road colours would compete with
   the project marker's sage and the extent's dashed accent, which are the two
   things that must stay the most prominent marks in the pane. So the roads
   are one hue at four widths, and the only saturated things on the map remain
   Cairn's own.
   -------------------------------------------------------------------------- */
.v2-dash #map{
  --map-vec-building:#4C5057;
  --map-vec-water:#1B3A4B;
  --map-vec-landuse:#3B4A3C;
  --map-vec-street:#8E949B;
  --map-vec-street-major:#B3A483;
  --map-vec-path:#6A6F76;
  --map-vec-rail:#767C84;
  --map-vec-label:#E4E7EA;
  --map-vec-label-halo:#20252B;
}
[data-theme="light"] .v2-dash #map{
  --map-vec-building:#DCD3C0;
  --map-vec-water:#BBD5E2;
  --map-vec-landuse:#DCE6D2;
  --map-vec-street:#FFFFFF;
  --map-vec-street-major:#F6E2B8;
  --map-vec-path:#C8BFA9;
  --map-vec-rail:#A99F8B;
  --map-vec-label:#2E2A24;
  --map-vec-label-halo:#F4EFE2;
}
.v2-dash #map .map-vector{background:transparent;}
/* Full now paints through MapLibre/WebGL. Only the three structural rules it
   needs are kept here instead of importing MapLibre's 80 kB control stylesheet:
   Cairn disables every MapLibre control and owns all interaction itself. The
   host covers exactly the pane and is NOT bled: it sits outside the translated
   pan layer and is driven each drag frame instead (full-basemap.ts's header
   has the measurement), and MapLibre's own ResizeObserver follows this box. */
.v2-dash #map .map-vector-webgl{position:absolute;inset:0;overflow:hidden;}
.v2-dash #map .map-vector-webgl .maplibregl-canvas-container,
.v2-dash #map .map-vector-webgl .maplibregl-canvas{position:absolute;inset:0;}
.v2-dash #map .map-vector-webgl .maplibregl-canvas{outline:none;}
/* The Full package also backs the 3D viewer's overview. Its canvas sits below
   the existing transparent plan canvas, so Cairn retains station picking,
   click-to-jump and the camera wedge while MapLibre paints only geography. */
.minimap-basemap-webgl{position:absolute;inset:0;z-index:0;overflow:hidden;
  border-radius:var(--r3);opacity:.72;pointer-events:none;}
.minimap-basemap-webgl .maplibregl-map,
.minimap-basemap-webgl .maplibregl-canvas-container,
.minimap-basemap-webgl .maplibregl-canvas{position:absolute;inset:0;width:100%;height:100%;}
#minimap-wrap.has-roadmap #minimap{background:transparent!important;}
#minimap-wrap.minimap-collapsed .minimap-basemap-webgl{display:none;}
/* The road map's OpenStreetMap credit (J4, 4 October 2026): bottom-right of
   the overview, on the toggles' rung so it sits over the plan canvas and its
   link can be clicked; hidden with the road map (minimap-roadmap.ts mirrors
   the toggle) and with the collapsed overview. */
#minimap-wrap .minimap-osm-credit{position:absolute;right:3px;bottom:2px;z-index:6;
  max-width:calc(100% - 6px);padding:0 3px;border-radius:2px;
  background:color-mix(in srgb,var(--bg-panel) 72%,transparent);
  font-size:8px;line-height:1.2;text-align:right;color:var(--text-2);text-decoration:none;}
#minimap-wrap .minimap-osm-credit[hidden],
#minimap-wrap.minimap-collapsed .minimap-osm-credit{display:none;}
/* EVERY CLASS BELOW DECLARES BOTH `fill` AND `stroke`, and there is no shared
   `path{fill:none;stroke:none}` reset above them. There was, for about an
   hour, and it made the whole layer invisible while every path carried
   correct data -- `.v2-dash #map .map-vector path` has a TYPE selector in it
   and therefore outranks `.v2-dash #map .map-vec-street-minor`, so the reset's
   `stroke:none` won every road. Measured in the real pane: 65 paths with
   between 400 and 741,000 bytes of path data each, 75 labels drawn over them,
   and nothing but the labels visible.
   Specificity is not a tie-break to be relied on; declaring both properties on
   each class is. */
.v2-dash #map .map-vector path{vector-effect:non-scaling-stroke;}
.v2-dash #map .map-vec-land{fill:var(--map-vec-landuse);stroke:none;opacity:.5;}
.v2-dash #map .map-vec-water{fill:var(--map-vec-water);stroke:none;}
.v2-dash #map .map-vec-building{fill:var(--map-vec-building);stroke:none;opacity:.7;}
.v2-dash #map .map-vec-street-area{fill:var(--map-vec-street);stroke:none;opacity:.4;}
.v2-dash #map .map-vec-waterline{
  fill:none;stroke:var(--map-vec-water);stroke-width:1.4;stroke-linecap:round;
}
.v2-dash #map .map-vec-path{
  fill:none;stroke:var(--map-vec-path);stroke-width:.8;stroke-dasharray:2.5 2.5;
}
.v2-dash #map .map-vec-street-minor{
  fill:none;stroke:var(--map-vec-street);stroke-width:1.1;
  stroke-linecap:round;stroke-linejoin:round;
}
.v2-dash #map .map-vec-street-tertiary{
  fill:none;stroke:var(--map-vec-street);stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;
}
.v2-dash #map .map-vec-street-secondary{
  fill:none;stroke:var(--map-vec-street-major);stroke-width:2.3;
  stroke-linecap:round;stroke-linejoin:round;
}
.v2-dash #map .map-vec-street-primary{
  fill:none;stroke:var(--map-vec-street-major);stroke-width:3;
  stroke-linecap:round;stroke-linejoin:round;
}
.v2-dash #map .map-vec-street-motorway{
  fill:none;stroke:var(--map-vec-street-major);stroke-width:3.8;
  stroke-linecap:round;stroke-linejoin:round;
}
.v2-dash #map .map-vec-rail{
  fill:none;stroke:var(--map-vec-rail);stroke-width:1.2;stroke-dasharray:6 4;
}
/* LABELS. Positioned in pane pixels rather than inside the scaled tile
   groups — see map.ts — so these sizes are real px at every zoom, and the
   halo is paint-order rather than a shadow so a name stays legible crossing a
   road without a blur that reads as a glow. */
.v2-dash #map .map-vec-label-street text{
  font-family:var(--font-sans);font-size:11px;font-weight:600;
  fill:var(--map-vec-label);stroke:var(--map-vec-label-halo);stroke-width:2.6px;
  paint-order:stroke fill;letter-spacing:.01em;
}
.v2-dash #map .map-vec-label-place text{
  font-family:var(--font-sans);font-size:12px;font-weight:700;
  fill:var(--map-vec-label);stroke:var(--map-vec-label-halo);stroke-width:3px;
  paint-order:stroke fill;
}
.v2-dash #map .map-vec-label-place circle{
  fill:var(--map-vec-label);stroke:var(--map-vec-label-halo);stroke-width:1;
}
/* The Lite package's own roads and towns, once a Full package is installed.
   Not removed from the DOM: the same page can lose the package (an operator
   renames the file and reloads) and the Lite layer has to come straight back
   without rebuilding a couple of hundred thousand vertices. */
.v2-dash #map .map-basemap-full .map-base-road,
.v2-dash #map .map-basemap-full .map-base-places{display:none;}
/* And the whole Lite layer once the Full map has painted its first complete
   frame: an opaque WebGL canvas hides every pixel of it, while re-rasterising
   its 18,000-segment land, coast and boundary paths on every reconciliation
   was the single largest frame cost on the Full tier. map.ts applies and
   lifts this class (coverLite); see its comment for the measurement. */
.v2-dash #map .map-basemap-covered{display:none;}

/* --------------------------------------------------------------------------
   TEMPORARY dark basemap (brief 2 item 4, 29 Jul 2026).

   Standard OSM raster tiles are light and fight the dark chrome. Protomaps —
   the real fix, a self-hosted vector basemap with a dark flavour tuned to
   these tokens — is blocked on download approval (CHANGE-CHECKLIST §E.5), so
   this filters the raster tiles in place. No new dependency, no network call.

   REPLACE THIS when the .pmtiles basemap lands: the dark flavour then comes
   from the map style itself and this whole block should be deleted, along
   with nothing else — the .tile-layer element it targets is still the right
   place for tiles.

   Scoped to the dark theme only. In the light theme the tiles already suit
   the chrome, and inverting them there would produce a dark map on a light
   page, which is the exact problem this is meant to solve, upside down.

   Applied to .tile-layer, NOT the pan layer: project markers are siblings of
   this element (see src/dash/map.ts), so they keep their true colours. Invert
   plus a 180deg hue rotation is what keeps land/water plausible rather than
   photo-negative; the brightness/contrast/saturate trim stops the result
   glaring against --bg-panel.
   -------------------------------------------------------------------------- */
[data-theme="dark"] .v2-dash #map .tile-layer{
  filter:invert(1) hue-rotate(180deg) brightness(.86) contrast(1.08) saturate(.55);
}
/* empty state */
.v2-dash .empty{border-style:dashed;}
.v2-dash .empty .ic{width:64px;height:64px;}

/* =============================== VIEWER ==================================
   The docked panel keeps its existing behaviour: the .handle collapse, the
   #scan-resize-handle drag, #dock-left rail-only mode and the floating trays
   are all untouched. This section restyles the group headings, the counts and
   the measurement warning only.
   ======================================================================== */
/* Group headings follow the reference's .thead: sentence case, not the
   uppercase tracking the panel used to carry. The label reads as a name
   ("Scan stations"), the count as data beside it. */
.v2-viewer .pcollapse{font-size:var(--fs-small);letter-spacing:.02em;padding:7px 8px;
  font-weight:600;text-transform:none;color:var(--text-2);}
.v2-viewer .pgroup{border-bottom:none;}
.v2-viewer .pbody{padding-left:8px;}
/* Counts sit plain at the right, as in the reference — the pill treatment
   read as a badge and fought the row it belonged to. */
.v2-count{margin-left:auto;font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:var(--fs-micro);color:var(--text-3);padding-left:8px;}
.v2-count.warn{color:var(--warning);}
.v2-count.err{color:var(--danger);}
.v2-viewer .pcollapse:hover .v2-count{color:var(--text-2);}

/* (The Section/Measure/Colour/Views rail captions the reference shows were
   built and then removed at John's request — the icons and their tooltips
   carry it, and the words crowded a 46px rail.) */

/* Panel title. The docked panel had no heading at all, so nothing named what
   the tree was. Matches the reference's .dock-hd. */
.v2-viewer .dock-hd{height:36px;flex:none;display:flex;align-items:center;gap:8px;
  padding:0 12px;border-bottom:1px solid var(--border);position:sticky;top:0;
  background:var(--bg-panel);z-index:2;}
.v2-viewer .dock-hd .label{flex:1;font-size:var(--fs-micro);
  letter-spacing:var(--track-label);text-transform:uppercase;color:var(--text-3);font-weight:600;}
.v2-viewer .sec-label{font-size:var(--fs-micro);letter-spacing:var(--track-label);}

/* Measurement warning. Same element, same id, same text written by the
   bundle — restyled into the standing warning treatment used elsewhere.
   theme.css already gives it a border and tint; this adds the accent edge,
   the heading weight and readable line length. */
.v2-viewer #measure-warning{
  border-left:3px solid var(--warning)!important;
  border-radius:var(--r2)!important;
  padding:10px 11px!important;
  font-size:var(--fs-small)!important;
  line-height:1.5!important;
  color:var(--text-2)!important;
}
.v2-viewer .client-measure-note{
  border:1px solid color-mix(in srgb,var(--warning) 34%,transparent);
  border-left:3px solid var(--warning);
  background:var(--warning-soft);
  border-radius:var(--r2);padding:9px 10px;font-size:var(--fs-small);line-height:1.5;
}
/* measurement rows: tabular figures and a calmer value colour ramp */
.v2-viewer .ms{padding:8px;border-radius:var(--r2);}
.v2-viewer .ms-value,.v2-viewer .point-coordinate-value .coord-number{
  font-variant-numeric:tabular-nums;}
.v2-viewer .pl-tool{font-size:var(--fs-small);border-radius:var(--r2);}
/* status bar: tabular figures stop the coordinate readout jittering */
.v2-viewer .statusbar{font-size:var(--fs-tiny);}
.v2-viewer .statusbar .v{font-variant-numeric:tabular-nums;}
/* keycaps already look right; just tighten the type */
.v2-viewer .keycap{font-size:var(--fs-tiny);}

/* ---- Documents control, left rail, above the theme toggle -----------------
   John, 7 September 2026. It moved here from the bottom-right of the projects
   map, and the button lost its own rule in the move: it is a `.rail-btn` now,
   styled by theme.css exactly like Projects and Share links, so it cannot
   drift away from the neighbours it is meant to match. Both themes come free
   for the same reason -- every colour it uses is a rail token.

   THE PANEL IS FIXED, NOT ABSOLUTE, AND THAT IS THE WHOLE TRICK. The rail is a
   56px column hard against the left edge, and theme.css sets
   `body{overflow:hidden}`; an absolutely positioned panel would be clipped by
   the rail opening rightwards, by the viewport's bottom edge on a short
   window, or by that body overflow. A fixed panel resolves against the
   viewport instead -- no ancestor of .rail sets transform, filter,
   perspective, backdrop-filter, will-change or contain, which are the only
   properties that would shrink its containing block. `left` clears the 56px
   rail and its 1px border; `bottom` sits it just above the rail's own 12px
   floor padding, so it reads as flying out of the bottom of the rail and stays
   fully visible at any window height that can hold it at all.

   z-index matches `.menu` in theme.css (60), which is this tree's popup layer:
   above the dashboard, below .ctx (200), .scrim (300) and .toast (400). */
.docs-menu-panel{position:fixed;left:64px;bottom:14px;z-index:60;
  display:flex;flex-direction:column;min-width:168px;padding:5px;
  border:1px solid var(--border-strong);border-radius:var(--r3);
  background:var(--bg-panel);box-shadow:var(--shadow-pop);}
.docs-menu-item{padding:7px 10px;border-radius:var(--r2);text-decoration:none;
  color:var(--text-2);font-size:var(--fs-small);white-space:nowrap;}
.docs-menu-item:hover{background:var(--bg-elev2);color:var(--accent);}
