/* ═══════════════════════════════════════════════════════════════════════════
   The Annotator, on this map's chrome.

   The DSOC Studio Annotator is its own application with its own dark palette.
   Ported here it has to belong to THIS page, so everything structural is
   written against the theme tokens and flips with the theme. What does NOT
   flip is the brush colours themselves: a warm front is red on a light
   basemap and red on a dark one, the same rule the SPC fills follow.
   ═══════════════════════════════════════════════════════════════════════════ */

/* THE TWO NUMBERS EVERYTHING BELOW THE HEADER HANGS OFF.

   --hdr-h is MEASURED and written by js/ui/chrome.js, because the header bar
   is not a fixed height: its badges wrap, and the safe-area inset is part of
   its padding. The 42px here is only a value to lay out with before the
   first measurement lands, and it is wrong on every display I have seen —
   55px is typical, which is why the status HUD used to sit thirteen pixels
   UNDER the header rather than against it.

   --annot-bar-h is 0 until the Annotator is open, and its toolbar's height
   after that. Adding the two gives "flush with whatever is above me", which
   is the rule the HUD, the brushes panel and the camera column all follow. */
:root { --hdr-h: 42px; --annot-bar-h: 0px; }
/* The toolbar scales down to fit a narrow window, as the Annotator's does,
   and js/ui/annotbar.js publishes the height it ends up at. */
body.annot-bar-open { --annot-bar-h: var(--annot-bar-open-h, 46px); }

/* ── The overlay the marks are drawn on ─────────────────────────────────── */

.annot-svg {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;      /* the pane above the map must not eat clicks */
}
/* A drawing tool is armed: say so with the cursor over the whole map, not
   just over the marks already on it. */
.leaflet-container.annot-drawing,
.leaflet-container.annot-drawing .leaflet-interactive { cursor: crosshair; }
.leaflet-container.annot-erasing,
.leaflet-container.annot-erasing .leaflet-interactive { cursor: crosshair; }
.leaflet-container.annot-pan,
.leaflet-container.annot-pan .leaflet-interactive { cursor: grab; }

/* While the Annotator is open a county is not a link to its forecast, so it
   should not wear the pointer that says it is. */
body.annot-bar-open .leaflet-counties-pane .leaflet-interactive { cursor: inherit; }

/* Selection and edit handles: the Annotator's red ring and white squares,
   its blue rotate knob. These are the only parts of the overlay that take
   the pointer. */
.annot-svg .annot-sel { stroke: #be141b; stroke-width: 1.5; fill: none; stroke-dasharray: 5 3; pointer-events: none; }
.annot-svg .annot-rh { fill: #fff; stroke: #be141b; stroke-width: 1.5; cursor: pointer; pointer-events: all; }
.annot-svg .annot-roth { fill: #3575ff; stroke: #fff; stroke-width: 1; cursor: crosshair; pointer-events: all; }
.annot-svg .annot-rotl { stroke: #3575ff; stroke-width: 1; stroke-dasharray: 3 2; pointer-events: none; }

/* The eraser's footprint, following the cursor at the size it will take. */
.annot-eraser-cursor {
  position: absolute; z-index: 700;
  border: 1.5px solid #be141b; border-radius: 50%;
  background: rgba(190, 20, 27, .08);
  pointer-events: none;
  mix-blend-mode: difference;
}
.annot-eraser-cursor[hidden] { display: none; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */

#annot-bar {
  position: absolute;
  top: var(--hdr-h);          /* flush under the header, whatever it measures */
  left: 0; right: 0;
  z-index: 402;
  height: 46px;
  overflow: hidden;
  background: var(--overlay-strong);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-strong);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s;
}
/* The row the bar scales. Laid out at its natural width, then shrunk as one
   piece from its top-left corner. */
.ab-inner {
  display: flex; align-items: center; gap: 2px;
  height: 46px; width: max-content;
  padding: 0 8px;
  transform-origin: 0 0;
}
#annot-bar.collapsed {
  transform: translateY(calc(-100% - 46px));
  visibility: hidden;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .28s;
}

.ab-grp {
  display: flex; align-items: center; gap: 3px;
  padding: 0 7px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  height: 28px;
}
.ab-grp:last-child { border-right: 0; }
.ab-end { margin-left: auto; }

.ab-brand {
  font: 800 9px/1 var(--font-display);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-right: 4px;
}
.ab-lbl {
  font: 600 9px/1 var(--font-display);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.ab-unit { font-size: 9px; color: var(--muted); }

.ab-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text);
  font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.ab-btn:hover:not(:disabled) { background: var(--sunken); border-color: var(--border); }
.ab-btn.on {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.ab-btn:disabled { opacity: .3; cursor: default; }
.ab-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ab-danger:hover:not(:disabled) { color: var(--accent); }
.ab-ok:hover { color: var(--green); }
/* Armed for a second click: clearing everything asks once. */
.ab-btn.armed { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.ab-color {
  width: 26px; height: 24px; padding: 1px;
  background: none; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 5px;
}
.ab-num {
  width: 44px; height: 22px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font: 500 10px/1 var(--font-mono);
  text-align: center;
}
.ab-sel {
  height: 22px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font: 500 10px/1 var(--font-display);
  padding: 0 4px; cursor: pointer;
}
.ab-range { width: 72px; accent-color: var(--accent); cursor: pointer; }
.ab-range-s { width: 48px; }
.ab-num-s { width: 36px; }
.ab-sub { display: inline-flex; align-items: center; gap: 3px; margin: 0 3px; }
.ab-sub[hidden], .ab-grp[hidden], .ab-btn[hidden], .ab-color[hidden] { display: none; }
.ab-small { font-size: 11px; }
.ab-warn:hover { color: var(--amber); }

/* The Radar/Sat strip sits flush under whatever is above it: the header when
   the Annotator is closed, the Annotator's toolbar when it is open. Its tab
   is inset the same 4px below it as it always was. */
#status-hud   { top: calc(var(--hdr-h) + var(--annot-bar-h)) !important; }
#hud-collapse { top: calc(var(--hdr-h) + var(--annot-bar-h) + 4px) !important; }

/* ── Side panel ──────────────────────────────────────────────────────────── */

#annot-panel {
  position: absolute;
  top: calc(var(--hdr-h) + var(--annot-bar-h));
  right: 12px;
  z-index: 401;
  width: 268px;
  max-height: calc(100% - var(--hdr-h) - var(--annot-bar-h) - 54px);
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--overlay-strong);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--overlay-shadow);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s, top .28s;
}
#annot-panel.collapsed {
  transform: translateX(calc(100% + 16px));
  visibility: hidden;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .28s;
}

#annot-panel-collapse {
  position: absolute;
  top: calc(var(--hdr-h) + var(--annot-bar-h) + 4px);
  right: 0;
  z-index: 403;
  width: 17px; min-height: 86px;
  border-radius: 6px 0 0 6px;
  background: var(--overlay-strong); backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); border-right: 0;
  color: var(--accent); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: -2px 0 12px var(--accent-glow);
  transition: top .28s cubic-bezier(.4, 0, .2, 1), color .15s, background .15s;
}
#annot-panel-collapse:hover { color: var(--on-accent); background: var(--accent); }
#annot-panel-collapse:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#annot-panel-collapse .rc-label {
  writing-mode: vertical-rl;
  font: 800 8px/1 var(--font-display);
  letter-spacing: .14em; text-transform: uppercase;
}
#annot-panel-collapse .rc-chev { font-size: 12px; }
#annot-panel-collapse[aria-expanded="true"] .rc-chev { transform: rotate(180deg); }

/* The cameras tab drops below the Annotator's — the pair on this edge read
   top to bottom in the same order as the panels they open. 94px is the
   Annotator tab's height plus the gap. */
#right-collapse { top: calc(var(--hdr-h) + var(--annot-bar-h) + 98px) !important; }
#right-stack    { top: calc(var(--hdr-h) + var(--annot-bar-h)) !important; }


/* ── Panel contents ──────────────────────────────────────────────────────── */

.ap-sect { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.ap-sect[hidden] { display: none; }

/* The three folding sections, as the Annotator folds them. */
.ap-panel { border-bottom: 1px solid var(--border); }
.ap-phdr {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.ap-phdr:hover { background: var(--sunken); }
.ap-phdr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ap-parrow { color: var(--muted); font-size: 11px; transition: transform .15s; }
.ap-panel.closed .ap-parrow { transform: rotate(-90deg); }
.ap-pbody { padding: 0 10px 9px; }
.ap-panel.closed .ap-pbody { display: none; }

.ap-title {
  font: 800 9px/1 var(--font-display);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.ap-rlbl {
  font: 700 8px/1 var(--font-display);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.ap-mini { font-size: 9px; color: var(--muted); }
.ap-cap { margin: 7px 0 4px; text-transform: uppercase; letter-spacing: .08em; }

/* Eraser settings */
.ap-eraser {
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--sunken);
  padding: 6px 7px; margin-bottom: 7px;
  transition: opacity .15s;
}
.ap-eraser.dim { opacity: .45; }
.ap-eraser-hd {
  font: 700 9px/1 var(--font-display);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.ap-e-row { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.ap-e-row:last-child { margin-bottom: 0; }
.ap-e-lbl { width: 46px; font-size: 9px; color: var(--muted); }
.ap-e-range { flex: 1; accent-color: var(--amber); cursor: pointer; min-width: 0; }
.ap-e-num, .ap-n {
  width: 40px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 3px;
  font: 500 10px/1 var(--font-mono); text-align: center; padding: 2px 0;
}
.ap-n-w { width: 48px; }
.ap-u { font-size: 9px; color: var(--muted); }

/* Layer rows: visibility, colour, name, up, down, delete, then opacity. */
.ap-l {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  padding: 4px 5px; border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
}
.ap-l:hover { background: var(--sunken); }
.ap-l.on { border-color: var(--accent); background: var(--accent-soft); }
.ap-l.drag-over { border-top: 2px solid var(--focus); }
.ap-l.dragging { opacity: .4; }
.ap-l-vis, .ap-l-mv, .ap-l-del {
  background: none; border: 0; cursor: pointer; padding: 0 1px;
  color: var(--text); font-size: 11px; line-height: 1;
}
.ap-l-mv { font-size: 8px; color: var(--muted); }
.ap-l-mv:hover { color: var(--text); }
.ap-l-mv.dim { opacity: .15; }
.ap-l-del { color: var(--muted); font-size: 12px; }
.ap-l-del:hover { color: var(--accent); }
.ap-l-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.ap-l-name { flex: 1; min-width: 0; font-size: 11px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-l-rename {
  flex: 1; min-width: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--accent); border-radius: 3px;
  font: 500 11px/1.2 var(--font-display); padding: 1px 4px;
}
.ap-l-oprow { display: flex; align-items: center; gap: 3px; width: 100%; padding: 2px 0 0 19px; cursor: default; }
.ap-l-oplbl { font-size: 8px; color: var(--muted); width: 16px; }
.ap-l-op { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; }
.ap-l-opn {
  width: 36px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 3px;
  font: 500 9px/1 var(--font-mono); text-align: center; padding: 1px 0;
}

.ap-addrow { display: flex; gap: 4px; margin-top: 6px; }
.ap-add {
  flex: 1; padding: 4px 6px;
  background: transparent; border: 1px dashed var(--border-strong);
  border-radius: 4px; color: var(--muted2);
  font: 600 10px/1 var(--font-display); cursor: pointer;
}
.ap-add:hover:not(:disabled) { border-style: solid; color: var(--text); border-color: var(--accent); }
.ap-add:disabled { opacity: .35; cursor: default; }
.ap-del:hover:not(:disabled) { color: var(--accent); }

/* Brush list */
.ap-bgrp {
  font: 700 8px/1 var(--font-display);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 7px 0 3px;
}
.ap-bgrp:first-child { margin-top: 0; }
.ap-brush {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 2px 4px; margin-bottom: 1px;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  cursor: pointer; text-align: left;
}
.ap-brush:hover { background: var(--sunken); }
.ap-brush.on { border-color: var(--accent); background: var(--accent-soft); }
/* The Lines brushes draw themselves in `currentColor` (see brushSwatchColor).
   This is where that resolves, so they follow the panel into either theme. */
.ap-bswatch { width: 78px; height: 18px; flex-shrink: 0; color: var(--text); }
.ap-bname { font-size: 10px; color: var(--text); }

/* Readouts */
.ap-brushnow { font: 600 12px/1.2 var(--font-display); color: var(--text); margin-bottom: 4px; }
.ap-prev {
  width: 100%; height: 34px;
  color: var(--text);
  background: var(--sunken); border: 1px solid var(--border); border-radius: 4px;
  margin-bottom: 7px;
}
.ap-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--muted); padding: 2px 0;
}
.ap-row > span:last-child { color: var(--text); font-family: var(--font-mono); }
.ap-colcell { display: flex; align-items: center; gap: 5px; }
.ap-colcell i { width: 13px; height: 13px; border-radius: 2px; border: 1px solid var(--border-strong); }

/* Fill */
.ap-fill-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ap-fill-sw {
  width: 32px; height: 32px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 5px; cursor: pointer;
}
.ap-fill-sw.none { border-color: var(--accent); }
.ap-fill-meta { flex: 1; min-width: 0; }
.ap-fill-meta > div:last-child { font: 500 11px/1.2 var(--font-mono); color: var(--text); }
.ap-btn {
  padding: 4px 8px;
  background: var(--sunken); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font: 500 10px/1 var(--font-display);
  cursor: pointer; white-space: nowrap;
}
.ap-btn:hover { border-color: var(--accent); }
.ap-btn.ok { color: var(--green); }
.ap-btn-s { padding: 2px 5px; }
.ap-kv { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 10px; color: var(--muted); }
.ap-kv[hidden] { display: none; }
.ap-kv input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; }
.ap-k { width: 44px; flex-shrink: 0; }
.ap-v { font: 500 10px/1 var(--font-mono); color: var(--text); min-width: 30px; }
.ap-cin {
  width: 24px; height: 22px; padding: 1px; flex-shrink: 0;
  background: none; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 3px;
}
.ap-selc {
  height: 22px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font: 500 10px/1 var(--font-display); padding: 0 4px; cursor: pointer;
}

/* Swatches */
.ap-swatches { display: flex; flex-wrap: wrap; gap: 3px; }
.ap-sw {
  width: 20px; height: 20px; border-radius: 3px;
  border: 1px solid var(--border-strong); cursor: pointer; padding: 0;
  transition: transform .1s;
}
.ap-sw:hover { transform: scale(1.2); }
.ap-sw-s { width: 18px; height: 18px; }
.ap-sw.on { outline: 2px solid var(--focus); outline-offset: 1px; }

.ap-selinfo { font-size: 11px; color: var(--text); }

/* Shortcuts */
.ap-keys { display: flex; flex-direction: column; gap: 3px; }
.ap-kbrow { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted2); }
.ap-kbrow kbd {
  font: 500 9px/1.3 var(--font-mono); color: var(--text); text-align: right;
  background: var(--sunken); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px;
}

/* Status, in place of the Annotator's status bar. */
.ap-status {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  padding: 7px 10px;
  font: 500 9px/1.3 var(--font-mono); color: var(--muted);
}
.ap-msg.ok { color: var(--green); }
.ap-msg.warn { color: var(--amber); }

/* ── The floating text box ───────────────────────────────────────────────── */

/* White on purpose, whatever the theme: the box previews the label in its
   own colour and size, and the Annotator previews it on white. */
.annot-txtov {
  position: fixed; z-index: 1200;
  display: flex; flex-direction: column; gap: 4px;
  padding: 5px;
  background: var(--overlay-strong);
  border: 1px solid var(--border-strong); border-radius: 6px;
  box-shadow: var(--overlay-shadow);
}
.annot-txtov[hidden] { display: none; }
.annot-txtov .tx-preset {
  background: #fff; color: #000;
  border: 2px solid #be141b; border-radius: 3px;
  padding: 3px 4px; font-size: 10px; font-weight: 700;
  text-align: center; text-align-last: center; cursor: pointer;
}
.annot-txtov .tx-fld {
  min-width: 180px; min-height: 34px;
  background: #fff; color: #000;
  border: 2px solid var(--accent); border-radius: 4px 4px 0 0;
  font: 16px Arial, Helvetica, sans-serif;
  padding: 5px 8px; resize: both; outline: none;
}
.annot-txtov .tx-opts { display: flex; align-items: center; gap: 5px; }
.annot-txtov select,
.annot-txtov .tx-size {
  background: #fff; color: #000;
  border: 1px solid #ccc; border-radius: 3px;
  padding: 2px 4px; font-size: 10px; cursor: pointer;
}
.annot-txtov .tx-size { width: 44px; text-align: center; cursor: text; }
.annot-txtov input[type=color] {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid #ccc; border-radius: 3px; background: none; cursor: pointer;
}
.annot-txtov .tx-framecol { width: 18px; height: 18px; }
.annot-txtov .tx-framecol[hidden] { display: none; }
.annot-txtov .tx-unit { font-size: 9px; color: var(--muted); }
.annot-txtov .tx-framelbl { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text); cursor: pointer; margin-left: 4px; }

/* ── Narrow screens ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  #annot-panel { width: min(268px, calc(100vw - 40px)); }
}

/* ── Capture box (js/ui/capture.js) ──────────────────────────────────────── */

/* For the one frame the picture is taken from, the Annotator's editing
   chrome steps out of it. Visibility, not display, so nothing reflows and
   the map does not move under the box. */
body.annot-capturing #annot-bar,
body.annot-capturing #annot-panel,
body.annot-capturing #annot-panel-collapse,
body.annot-capturing .annot-txtov,
body.annot-capturing .annot-eraser-cursor,
body.annot-capturing .annot-svg .annot-sel,
body.annot-capturing .annot-svg .annot-rh,
body.annot-capturing .annot-svg .annot-roth,
body.annot-capturing .annot-svg .annot-rotl,
body.annot-capturing .annot-svg .annot-ghost { visibility: hidden !important; }

.cap-root { position: fixed; inset: 0; z-index: 1500; cursor: crosshair; touch-action: none; }

/* The dimming is the box's own shadow, so the area being captured is the
   one clear patch on the screen. */
.cap-box {
  position: fixed;
  border: 1.5px solid #fff;
  outline: 1.5px dashed #be141b; outline-offset: -1.5px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .45);
  cursor: move;
}
.cap-root.dragging .cap-box { cursor: grabbing; }
.cap-h {
  position: absolute; width: 10px; height: 10px;
  background: #fff; border: 1.5px solid #be141b; border-radius: 2px;
}
.cap-h-tl { left: -6px; top: -6px; cursor: nwse-resize; }
.cap-h-tc { left: calc(50% - 5px); top: -6px; cursor: ns-resize; }
.cap-h-tr { right: -6px; top: -6px; cursor: nesw-resize; }
.cap-h-ml { left: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.cap-h-mr { right: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.cap-h-bl { left: -6px; bottom: -6px; cursor: nesw-resize; }
.cap-h-bc { left: calc(50% - 5px); bottom: -6px; cursor: ns-resize; }
.cap-h-br { right: -6px; bottom: -6px; cursor: nwse-resize; }
.cap-size {
  position: absolute; left: 0; top: -22px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(0, 0, 0, .75); color: #fff;
  font: 500 10px/1.3 var(--font-mono); white-space: nowrap;
  pointer-events: none;
}

.cap-bar, .cap-card {
  position: fixed;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px;
  background: var(--overlay-strong); backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); border-radius: 6px;
  box-shadow: var(--overlay-shadow);
  cursor: default;
}
.cap-hint { font-size: 10px; color: var(--muted); margin: 0 4px; white-space: nowrap; }
.cap-btn {
  height: 26px; padding: 0 10px;
  background: var(--sunken); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px;
  font: 600 11px/1 var(--font-display); white-space: nowrap; cursor: pointer;
}
.cap-btn:hover { border-color: var(--accent); }
.cap-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cap-go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* After a Share capture: the picture, and the buttons to send it on. */
.cap-card {
  z-index: 1500;
  left: 50%; bottom: 24px; transform: translateX(-50%);
  align-items: stretch; gap: 10px; padding: 8px;
  max-width: calc(100vw - 32px);
}
.cap-thumb {
  width: 160px; max-height: 110px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 4px;
  background: repeating-conic-gradient(var(--sunken) 0 25%, transparent 0 50%) 0 0 / 12px 12px;
}
.cap-card-body { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; }
.cap-card-note { font-size: 11px; color: var(--text); max-width: 320px; }
.cap-dim { color: var(--muted); }
.cap-card-btns { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .cap-hint { display: none; }
  .cap-thumb { width: 96px; }
}
