/* Grid Ref styles. Colours are tokens on :root; dark mode redefines them.
   Palette from the South Cumbria reserves: spruce (actions and anything selected; the
   --green name is kept so the rest of the CSS needn't change), bog-cotton white (panels),
   limestone grey (lines), peat (text), Walney sand (the map's background while tiles
   load). The team's reserves on the map are burnt orange: nothing on the topo map uses it.
   The original palette is in git tag v49-before-style. */
:root {
  --green: #2e6560;        /* spruce */
  --green-soft: #e2eeeb;
  --ink: #26261f;          /* peat */
  --muted: #6b695c;
  --panel: #fbf9f3;        /* bog cotton */
  --card: #f1ede1;
  --line: #e3dfd1;         /* limestone */
  --sand: #ece4d0;         /* Walney sand */
  --danger: #a33a2a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nudge: 10px;           /* clear of the iPhone's blurred top edge */
  --on-ink-link: #9fd4ab; /* a link on the dark toast/nudge card */
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #8cc2b8;      /* spruce, lifted for dark: calm, not neon */
    --green-soft: #1f2f2c;
    --ink: #f1efe6;
    --muted: #b0ad9d;
    --panel: #1b1a15;        /* peat */
    --card: #25241e;
    --line: #35332b;
    --sand: #2c2a22;
    --danger: #ff8a75;
    --on-ink-link: #2f5d3a;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body, button, a, input, .sheet, .drawer, .top, .fabs, .layers, .results { touch-action: manipulation; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--panel); color: var(--ink); font-family: var(--sans); }
#map { position: fixed; inset: 0; background: var(--sand); }

/* search */
.top { position: fixed; z-index: 1000; left: 12px; right: 12px; top: calc(var(--safe-t) + var(--nudge) + 10px); display: flex; gap: 8px; }
/* The search bar is the way in, so it's the boldest thing at the top: a spruce outline,
   a magnifier, bigger type and a filled Go */
.search { flex: 1; display: flex; align-items: center; background: var(--panel); border: 2px solid var(--green); border-radius: 16px; box-shadow: 0 3px 14px rgba(0,0,0,.28); padding-left: 12px; }
.search > svg { width: 21px; height: 21px; flex: none; color: var(--green); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 17px var(--sans); padding: 13px 10px; outline: none; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search button { border: 0; background: var(--green); color: var(--panel); font: 700 15px var(--sans); padding: 9px 14px; margin: 4px; border-radius: 11px; }
.results { max-height: 55vh; overflow-y: auto; position: fixed; z-index: 1001; left: 12px; right: 12px; top: calc(var(--safe-t) + var(--nudge) + 70px); background: var(--panel); border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); overflow: hidden; display: none; }
.results button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 15px var(--sans); padding: 13px 14px; }
.results button small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.results button .tag { float: right; font: 600 11px var(--sans); color: var(--green); background: var(--green-soft); border-radius: 6px; padding: 2px 6px; margin-left: 8px; }
.results button.clearrow { color: var(--muted); text-align: center; font-size: 14px; }
.results .msg { padding: 13px 14px; color: var(--muted); font-size: 14px; }

/* crosshair */
.cross { position: fixed; z-index: 900; left: 50%; top: var(--cross-y, 40%); width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: #c0392b; box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }
.cross::before { left: 21px; top: 0; width: 2px; height: 44px; }
.cross::after { top: 21px; left: 0; height: 2px; width: 44px; }

/* floating buttons */
.fabs { position: fixed; z-index: 1000; right: 12px; display: flex; flex-direction: column; gap: 10px; bottom: calc(var(--sheet-h, 230px) + 12px); }
.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--panel); color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.22); display: grid; place-items: center; }
.fab svg { width: 24px; height: 24px; }
.fab.on { background: var(--green); color: var(--panel); }
.fab { position: relative; }
.fabs.left { right: auto; left: 12px; }
body.measuring .fabs.left, body.navigating .fabs.left, body.moving .fabs.left { display: none; }
/* GPS accuracy, always in view once GPS is on: green good, amber so-so, red poor */
.acc { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font: 700 11px var(--sans); color: #fff; background: #1f8a4c; padding: 1px 6px; border-radius: 9px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.acc.mid { background: #c98a00; }
.acc.poor { background: #c0392b; animation: accflash 1s ease-in-out infinite; }
@keyframes accflash { 50% { background: #ff6b5a; transform: translateX(-50%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .acc.poor { animation: none; } }
body.large .acc { font-size: 13px; }

/* bottom sheet */
.sheet { position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: 0 -2px 16px rgba(0,0,0,.18); padding: 12px 16px max(8px, calc(var(--safe-b) - 20px)); display: flex; flex-direction: column; max-height: 62vh; }
.grab { display: block; width: 100%; border: 0; background: none; padding: 0 0 8px; margin-top: -6px; touch-action: none; }
.grab span { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
.sheet.compact .more { display: none; }
.more { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.meta { flex-wrap: wrap; column-gap: 10px; row-gap: 0; }
.meta:has(.from-me:empty) { display: none; }
.big { display: flex; align-items: center; width: 100%; gap: 10px; border: 0; background: none; color: var(--ink); padding: 4px 8px 2px; text-align: left; }
.ref { flex: 1; font: 700 clamp(26px, 8.6vw, 36px)/1.15 var(--mono); letter-spacing: .01em; white-space: nowrap; }
.ref.off { font-size: 20px; color: var(--muted); font-family: var(--sans); font-weight: 500; }
.c { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font: 600 13px var(--sans); flex: none; border-radius: 10px; transition: background .15s; }
.c svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.refline { display: flex; align-items: center; gap: 10px; }
.refline .big { flex: 1; min-width: 0; }
.refline .prec { flex-direction: column; flex: none; }
.refline .prec button { padding: 6px 10px; }
.row .c { padding: 4px 0; }
.rows { margin-top: 6px; border-top: 1px solid var(--line); flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); padding: 9px 8px; text-align: left; }
.row .k { width: 80px; flex: none; font: 600 12px var(--sans); color: var(--muted); }
.row .v { flex: 1; min-width: 0; font: 14.5px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v.dim { font-family: var(--sans); color: var(--muted); font-size: 14px; white-space: normal; line-height: 1.25; } /* instructions may wrap; numbers never do */
/* Copied: the whole thing goes green with a tick, plus a toast, so nobody wonders */
label.big, label.row { cursor: pointer; -webkit-user-select: none; user-select: none; }
.big, .row { position: relative; border-radius: 10px; transition: background .15s, color .15s; }
.copied { background: var(--green) !important; color: var(--panel) !important; }
.copied .k, .copied .v { color: var(--panel) !important; }
.big.copied .ref { color: var(--panel); }
a.row { text-decoration: none; }
.row:active, .big:active { opacity: .6; }
.from-me { font: 600 14px var(--sans); color: var(--green); min-width: 0; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line, always: a wrap resized the panel */
.prec { display: inline-flex; background: var(--green-soft); border-radius: 9px; padding: 2px; }
.prec button { border: 0; background: none; color: var(--muted); font: 600 13px var(--sans); padding: 5px 10px; border-radius: 7px; }
.prec button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
/* Share and Navigate sit under the grid ref: they act on that place */
.actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 8px 0 0; }
/* After a search: Add joins Share and Navigate for a few seconds */
.actions:has(#keepBtn:not([hidden])) { grid-template-columns: 1fr 1fr 1fr auto; }
#keepBtn[hidden] { display: none; }
#keepBtn { background: var(--green); color: var(--panel); }
.actions button { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 22px; padding: 10px 8px; font: 600 15px var(--sans); background: var(--green-soft); color: var(--green); }
.actions svg { width: 20px; height: 20px; }
/* Aa: the panel's own text size, so it lives in the panel's corner (same place in both sizes) */
.aa { border: 0; border-radius: 22px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; width: 52px; }
.aa svg { width: 24px; height: 24px; }
.aa.on { color: var(--panel); background: var(--green); }
body.adding #listBtn { display: none; } /* the + menu needs the room; the notebook's back when it closes */

/* saved points drawer */
.drawer { position: fixed; z-index: 1100; inset: 0; background: var(--panel); display: none; flex-direction: column; padding-top: var(--safe-t); }
.drawer.open { display: flex; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer h2 { margin: 0; font-size: 19px; }
.drawer header button, .link { border: 0; background: none; color: var(--green); font: 600 16px var(--sans); padding: 6px 0; }
.list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* notebook header and filters */
.drawer header { gap: 10px; }
.drawer h2.dtitle { flex: 1; min-width: 0; font-size: clamp(21px, 7vw, 26px); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtitle small { color: var(--muted); font: 400 clamp(11.5px, 3.5vw, 13px) var(--sans); letter-spacing: 0; }
.drawer header .back { padding: 6px 8px 6px 0; } /* "‹ Back", as everywhere a step goes back */
.chiprow { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; flex: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chiprow:last-of-type, .chiprow + .chiprow { padding-bottom: 8px; }
.chiprow[hidden] { display: none; }
.chiprow button { flex: none; border: 0; border-radius: 16px; padding: 7px 13px; font: 600 13.5px var(--sans); white-space: nowrap; background: var(--green-soft); color: var(--muted); }
.chiprow button small { font-weight: 500; opacity: .75; margin-left: 2px; }
.chiprow button.on { background: var(--green); color: var(--panel); }
.drawer .list { border-top: 1px solid var(--line); padding-bottom: 8px; }
.folderacts { display: flex; gap: 8px; padding: 8px 12px 0; }
.folderacts[hidden] { display: none; }
.folderacts button { flex: 1; border: 0; border-radius: 10px; padding: 8px; font: 600 14px var(--sans); background: var(--green-soft); color: var(--green); }
.folderacts .danger { color: var(--danger); }
/* day headings and folders in the list */
.day { position: sticky; top: 0; z-index: 1; background: var(--panel); padding: 14px 16px 8px; font: 700 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.folderrow { cursor: pointer; }
.folderrow .mk { color: var(--green); width: 34px; }
.folderrow .chev { font-size: 24px; color: var(--muted); padding: 0 8px; }
.rtag { display: inline-block; font: 600 11px var(--sans); color: #a83c0c; background: rgba(217, 72, 15, .1); border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
@media (prefers-color-scheme: dark) { .rtag { color: #f2a679; background: rgba(217, 72, 15, .2); } }
.modal.sheetmenu { align-items: flex-end; padding-bottom: max(10px, calc(var(--safe-b) - 14px)); }
.sheetmenu .card { gap: 6px; }
.im-title { display: flex; flex-direction: column; padding: 2px 4px 6px; }
.im-title b { font-size: 17px; }
.im-title span { font: 14px var(--mono); color: var(--muted); }
.sheetmenu button { border: 0; border-radius: 12px; padding: 13px; font: 600 16px var(--sans); background: var(--green-soft); color: var(--green); }
.sheetmenu .danger { color: var(--danger); }
.sheetmenu .cancel { background: none; color: var(--muted); }
.card .btns.three { grid-template-columns: 1fr 1fr 1.2fr; }
.item .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--green-soft); display: block; }
.photopin { width: 28px; height: 28px; box-sizing: border-box; border-radius: 50%; background: #2b2b2b; border: 3px solid #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.photopin svg { width: 14px; height: 14px; }
.shopts { display: grid; gap: 4px; }
.selbar { display: none; gap: 8px; padding: 12px 16px max(10px, calc(var(--safe-b) - 20px)); border-top: 1px solid var(--line); }
.drawer.selecting #selBar { display: flex; }
.drawer.selecting footer, .drawer.selecting .item .go, .drawer.selecting #backup { display: none; }
.selbar button { flex: 1; border: 0; border-radius: 12px; padding: 13px; font: 600 15px var(--sans); background: var(--green-soft); color: var(--green); }
.selbar .primary { background: var(--green); color: var(--panel); }
.item .chk { display: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; place-items: center; color: var(--panel); font: 700 15px var(--sans); }
.drawer.selecting .item .chk { display: grid; }
.item.picked .chk { background: var(--green); border-color: var(--green); }
.item.picked { background: var(--green-soft); }
.card .shopts label { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 8px 6px; font: 400 16px var(--sans); color: var(--ink); border-bottom: 1px solid var(--line); }
.shopts input { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.group { padding: 10px 14px 4px; font: 700 12px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--panel); position: sticky; top: 0; }
.item { margin: 0 10px 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); display: flex; gap: 12px; align-items: center; cursor: pointer; }
.item .main { flex: 1; min-width: 0; }
.item .mk { flex: none; display: grid; place-items: center; }
.item .line1 { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.item .name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .gr { font: 13px var(--mono); flex: none; white-space: nowrap; }
.item .note { font-size: 13px; color: var(--ink); margin-top: 2px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.im-notes { margin: 0 4px 4px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; max-height: 35vh; overflow-y: auto; }
.im-notes:empty { display: none; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .ic { border: 0; background: none; padding: 8px; flex: none; display: grid; place-items: center; }
.item .ic svg { width: 21px; height: 21px; }
.item .go { color: var(--green); }

.empty { padding: 40px 24px; color: var(--muted); text-align: center; line-height: 1.5; }
.drawer footer { display: flex; gap: 8px; padding: 12px 16px max(10px, calc(var(--safe-b) - 20px)); border-top: 1px solid var(--line); }
.backup { margin: 0; padding: 4px 16px 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.backup:empty { display: none; }
.drawer footer button { flex: 1; border: 0; border-radius: 12px; padding: 13px; font: 600 15px var(--sans); background: var(--green-soft); color: var(--green); }

/* Aa: a big, simple readout. Just the location, centred; everything else hidden. */
body.large .actions button { padding: 14px 8px; font-size: 18px; }
body.large .actions svg { width: 24px; height: 24px; }
body.large .aa { width: 62px; }
body.large .meta { display: none !important; }
body.large .refline { flex-direction: column; gap: 8px; margin-top: 6px; }
body.large .refline .big { justify-content: center; width: 100%; }
body.large .ref { text-align: center; flex: none; }
body.large .refline .prec { flex-direction: row; }
body.large .rows { border-top: 0; }
body.large .row { flex-direction: column; align-items: center; gap: 0; padding: 6px 8px; border-bottom: 0; }
body.large .row .k { width: auto; text-align: center; font-size: 13px; }
body.large .row .v { flex: none; text-align: center; font-size: clamp(22px, 7vw, 30px) !important; }
/* Large text: for small phones and tired eyes in the field */
/* the grid ref itself is the copy button here, so the digits get the full width */
body.large .c svg { width: 22px; height: 22px; }
body.large .row .v.dim { font-size: 18px; }
body.large .prec button { font-size: 16px; padding: 8px 11px; }
body.large .from-me { font-size: 17px; }
body.large .search input { font-size: 18px; }
body.large .results button { font-size: 18px; padding: 15px 14px; }
body.large .results button small { font-size: 14px; }
body.large .fab { width: 56px; height: 56px; }
body.large .fab svg { width: 28px; height: 28px; }
body.large .item .name { font-size: 18px; }
body.large .item .gr { font-size: 16px; }
body.large .layers button { font-size: 18px; padding: 12px 16px; }

/* navigate: the map shows you, the flag and the line; the panel is the compass */
.nav { display: none; }
body.navigating .sheet > :not(.nav) { display: none; }
.measure { display: none; }
body.measuring .sheet > :not(.measure) { display: none; }
.movepanel { display: none; }
body.moving .sheet > :not(.movepanel) { display: none; }
body.moving .movepanel { display: block; }
body.shape-mode .cross { display: none; }
.mvhint { margin: 2px 4px 10px; color: var(--muted); font-size: 14px; }
.movepanel .btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.movepanel .btns button { border: 0; border-radius: 12px; padding: 13px; font: 600 16px var(--sans); background: var(--green-soft); color: var(--green); }
.movepanel .btns .primary { background: var(--green); color: var(--panel); }
.handle { width: 34px; height: 34px; border-radius: 50%; background: rgba(192,57,43,.25); border: 3px solid #c0392b; box-shadow: 0 0 0 2px #fff inset; }
body.measuring .measure { display: block; }
.m-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-nums small { display: block; font: 600 12px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.m-nums b { font: 700 clamp(24px, 8vw, 32px)/1.15 var(--mono); }
.m-nums { margin-bottom: 8px; }
body.measuring:not(.area-mode) .m-area { display: none; }
body.measuring:not(.area-mode) .m-nums { grid-template-columns: 1fr; }
body.area-mode .m-len { display: none; }
.m-btns { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; }
.m-btns button { border: 0; border-radius: 12px; padding: 10px 4px; font: 600 14px var(--sans); background: var(--green-soft); color: var(--green); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.m-btns button svg { width: 22px; height: 22px; }
.m-btns .primary { background: var(--green); color: var(--panel); }
body.large .m-btns button { font-size: 16px; }
body.navigating .nav { display: block; }
body.navigating .cross { display: none; }
.nav-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav-head small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.nav-head b { font: 700 22px var(--mono); }
.nav-head button { border: 0; border-radius: 12px; padding: 10px 18px; font: 600 16px var(--sans); background: var(--green-soft); color: var(--green); }
.nav-body { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.dial { width: min(30vw, 120px); height: min(30vw, 120px); flex: none; }
.dial .ring { fill: var(--green-soft); stroke: var(--line); stroke-width: 2; }
.dial .tick { stroke: var(--muted); stroke-width: 3; }
.dial text { fill: var(--muted); font: 700 18px var(--sans); text-anchor: middle; }
.dial text.n { fill: #c0392b; font-size: 22px; }
.dial .arrow { fill: var(--green); stroke: var(--panel); stroke-width: 3; stroke-linejoin: round; }
.dial.here .arrow { fill: #c0392b; }
/* not to be trusted yet: orange and pulsing, so nobody walks off on a guess */
.dial.unsure .arrow { fill: #f08c00; animation: unsure 1.1s ease-in-out infinite; }
.dial.unsure .ring { stroke: #f08c00; stroke-width: 4; }
@keyframes unsure { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dial.unsure .arrow { animation: none; } }
/* Same shape in every state (a bold line, then two lines' room), so the panel never resizes */
.nav-hint b { display: block; font: 800 15px var(--sans); color: var(--ink); }
.nav-hint span { display: block; min-height: 2.6em; line-height: 1.3; }
.nav-hint.warn, .nav-hint.warn b { color: #c25e00; }
@media (prefers-color-scheme: dark) { .nav-hint.warn, .nav-hint.warn b { color: #ffa94d; } }
.nav-hint.ok b { color: #2f9e44; }
.dial.ready .ring { fill: #2f9e44; stroke: #2f9e44; }
.dial.ready .arrow { fill: #fff; stroke: #2f9e44; }
.dial.ready .tick { stroke: #fff; }
.dial.ready text { fill: #fff; }
.dial.ready { animation: readypop .45s ease-out; }
@keyframes readypop { 40% { transform: scale(1.08); } }
#rose, #arrow { will-change: transform; }
.nav-nums { flex: 1; min-width: 0; font-size: 16px; line-height: 1.5; }
.nav-nums .dist { font: 700 clamp(30px, 10vw, 44px)/1.1 var(--mono); }
.nav-nums .dim { color: var(--muted); font-size: 13px; }
.nav-nums .head { font: 700 clamp(20px, 6.4vw, 26px)/1.2 var(--sans); color: var(--green); }
.nav-nums .deg { font: 600 16px var(--mono); }
.nav-hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
body.large .nav-head b { font-size: 26px; }
body.large .dial { width: min(34vw, 140px); height: min(34vw, 140px); }
body.large .nav-nums { font-size: 19px; }
body.large .nav-nums .dist { font-size: clamp(36px, 12vw, 54px); }
.flag { font-size: 30px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* search results: every answer shown as a grid ref */
.results button .gr { display: block; font: 700 19px var(--mono); }
body.large .results button .gr { font-size: 23px; }

/* no visible scrollbars anywhere: lists still scroll with a finger */
.rows, .results, .list, .layers { scrollbar-width: none; }
.rows::-webkit-scrollbar, .results::-webkit-scrollbar, .list::-webkit-scrollbar, .layers::-webkit-scrollbar { display: none; }

/* save popup */
.modal { position: fixed; inset: 0; z-index: 1300; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding: calc(var(--safe-t) + 14px) 12px 12px; }
.modal[hidden] { display: none; }
.card { width: 100%; max-width: 420px; background: var(--panel); border-radius: 16px; padding: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; }
.card label { display: flex; flex-direction: column; gap: 4px; font: 600 14px var(--sans); color: var(--muted); }
.card input, .card textarea { font: 16px var(--sans); color: var(--ink); background: var(--green-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; resize: none; }
.edmove { display: flex; gap: 8px; }
.edmove[hidden], .edmove button[hidden] { display: none; }
.edmove button { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 600 15px var(--sans); background: var(--panel); color: var(--green); }
.kind { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kind[hidden] { display: none; }
.kind button { border: 2px solid var(--line); border-radius: 10px; padding: 9px; font: 600 15px var(--sans); background: var(--panel); color: var(--ink); }
.kind button.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.pick[hidden] { display: none; }
.pick { display: flex; gap: 6px; }
.pick button { flex: 1 1 0; min-width: 0; max-width: 44px; aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); display: grid; place-items: center; padding: 0; }
.pick button.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel) inset; }
.pick svg { width: 24px; height: 24px; }
/* Buttons, the same everywhere:
   - anything that makes something (a popup, measuring a line or area, moving a point,
     making a map): grey Cancel (leave, nothing saved) and one green verb at the end for
     what happens (Save, Send, Export, Add, Place here, Make map). Delete is red and asks
   - a popup that's only for looking: one Close
   - a screen where nothing gets made (the notebook, navigating): Done, back to the map
   - one step back inside a flow: "‹ Back", top left */
.card .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card .btns button { border: 0; border-radius: 12px; padding: 13px; font: 600 16px var(--sans); background: var(--green-soft); color: var(--green); }
.card .btns .primary { background: var(--green); color: var(--panel); }
.w3wcard { height: calc(100% - 10px); padding: 8px; }
.w3wcard iframe { flex: 1; width: 100%; border: 0; border-radius: 10px; background: #fff; }
.w3wnote { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.card .btns.one { grid-template-columns: 1fr; }
.btnlink { display: grid; place-items: center; border-radius: 12px; padding: 13px; font: 600 16px var(--sans); text-decoration: none; background: var(--green); color: var(--panel); }
.pin { filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }

/* install nudge, iPhone only, until it's installed */
.install { position: fixed; z-index: 1150; left: 12px; right: 12px; top: calc(var(--safe-t) + var(--nudge) + 112px); background: var(--ink); color: var(--panel); border-radius: 14px; padding: 12px 40px 12px 14px; font: 14px/1.4 var(--sans); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.install[hidden] { display: none; }
.install b { display: block; font-size: 15px; margin-bottom: 2px; }
.instlink { color: var(--on-ink-link); font-weight: 700; white-space: nowrap; }
.install button { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--panel); font-size: 18px; padding: 6px 10px; }
.undo { position: fixed; z-index: 1250; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + var(--nudge) + 112px); display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--panel); padding: 8px 8px 8px 16px; border-radius: 22px; font: 600 15px var(--sans); max-width: calc(100vw - 32px); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.undo[hidden] { display: none; }
.undo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo button { border: 0; border-radius: 16px; padding: 8px 14px; font: 700 15px var(--sans); background: var(--green); color: var(--panel); flex: none; }
.toast { position: fixed; z-index: 1200; left: 50%; top: calc(var(--safe-t) + var(--nudge) + 124px); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 12px 18px; border-radius: 22px; font: 600 16px var(--sans); opacity: 0; transition: opacity .2s; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.3; }
.toast.show { opacity: 1; }

.leaflet-control-attribution { font-size: 9px; }
.leaflet-bottom.leaflet-left .leaflet-control-attribution { margin: 0 0 4px 74px; border-radius: 10px; padding: 3px 8px; cursor: pointer;
  background: color-mix(in srgb, var(--panel) 70%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--muted); }
.leaflet-control-attribution:not(.open) { font-size: 0; padding: 2px 7px; }
.leaflet-control-attribution:not(.open)::before { content: "©"; font: 600 12px var(--sans); }
.leaflet-control-attribution.open { max-width: calc(100vw - 100px); }
.leaflet-control-attribution a { color: inherit; }
.leaflet-bottom { bottom: var(--sheet-h, 230px); }
.grid-label { color: #1d4f8f; font: 600 11px var(--mono); text-shadow: 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.layers { position: fixed; z-index: 1001; right: 76px; max-width: calc(100vw - 84px); box-sizing: border-box; max-height: calc(100% - 80px); overflow-y: auto; background: var(--panel); border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.22); display: none; }
.layers button { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 15px var(--sans); padding: 10px 14px; text-align: left; white-space: nowrap; }
.lidarrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 14px 4px 0; }
.layers .lidarrow button.tick { width: auto; border: 0; flex: none; }
/* the slider on its own line under "LiDAR 65%"; width 0 so it never sets the menu's width (it fills the line it gets). The whole bar is the touch target */
.lidarrow input { order: 3; flex: 0 0 calc(100% - 14px); width: 0; min-width: 0; margin: 0 0 0 14px; accent-color: var(--green); height: 40px; touch-action: none; }
.lidarrow .tick + input + span { margin-left: auto; }
.lidarrow span { font: 600 13px var(--sans); color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
body.large .lidarrow span { font-size: 16px; }
/* LiDAR ground detail: grey tiles blended onto whatever map is below (mid-grey = no change,
   darker = a dip, lighter = a rise). Hard light, because soft light barely touches a pale map.
   The blend sits on the pane, so it reaches the map tiles. */
.leaflet-shade-pane { mix-blend-mode: hard-light; } /* strength (opacity) comes from the slider */
.lidar { filter: brightness(.72) contrast(1.35); } /* the EA's shading is pale: bring flat ground to mid-grey (no change) */
.layers button.on { color: var(--green); font-weight: 700; }
/* width 0 + min-width 100%: wraps to the menu's width instead of setting it */
.layers .byline { width: 0; min-width: 100%; box-sizing: border-box; padding: 5px 10px 7px; font: 10px/1.4 var(--sans); color: var(--muted); text-align: center; }
#map.county .leaflet-interactive, #map.county .leaflet-overlay-pane canvas { pointer-events: none !important; }

/* reserve chips: one tap to each of the team's reserves */
.chips { position: fixed; z-index: 999; left: 12px; right: 12px; top: calc(var(--safe-t) + var(--nudge) + 68px); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 0; border-radius: 16px; padding: 6px 12px; font: 600 13.5px var(--sans); background: var(--panel); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.18); }
/* the chosen reserve stands out on any map: dark, with a white edge */
.chips button.on { background: var(--ink); color: var(--panel); box-shadow: 0 0 0 2px var(--panel), 0 2px 8px rgba(0,0,0,.35); }
body.measuring .chips, body.navigating .chips, body.moving .chips { display: none; }

/* the team's reserves named on the map when zoomed out */
/* map tiles stay light in dark mode, so labels on the map keep dark text and a white halo */
/* reserve names: bold orange halo text just off the reserve, never on top of it */
.reslabel { display: block; width: max-content; font: 800 12.5px/1 var(--sans); letter-spacing: .02em; color: #a63a0a; white-space: nowrap; pointer-events: none; transform: translate(-50%, calc(-100% - 4px));
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff, 0 0 6px #fff; }
.reslabel.below { transform: translate(-50%, 4px); }
/* names beside your own points, lines and areas when zoomed right in: a notebook, not a pin map */
.pinlabel { font: 600 12px var(--sans); color: #26261f; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; display: none; }
.leaflet-container.close .pinlabel { display: block; }

/* the osprey */
.osprey { display: block; margin: 6px auto 0; width: 92px; opacity: .55; }
@media (prefers-color-scheme: dark) { .osprey { filter: invert(1); } } /* the drawings are black lines */

/* short phones (SE, mini): four left buttons + the reserve chips need the room */
@media (max-height: 620px) {
  .fabs { gap: 8px; }
  .fab, body.large .fab { width: 44px; height: 44px; }
  .fab svg, body.large .fab svg { width: 22px; height: 22px; }
}

/* your marks shrink when zoomed out (the icon stays centred on its spot) */
.pin > svg, .photopin { transition: transform .15s; }
.leaflet-container.mid .pin > svg, .leaflet-container.mid .photopin { transform: scale(.75); }
.leaflet-container.far .pin > svg, .leaflet-container.far .photopin { transform: scale(.5); }
/* photo: take one or choose one, beside the camera button */
.photomenu { right: auto; }
/* measure numbers go green when copied, like everything else */
.m-nums > div { border-radius: 10px; padding: 2px 6px; transition: background .15s; }
.m-nums .copied small, .m-nums .copied b { color: var(--panel) !important; }
.m-nums b { display: block; white-space: nowrap; overflow: hidden; }

/* empty saved tabs: faint contour lines behind the words, fading out at the edges.
   The lines are a mask filled with the ink colour, so they follow light and dark mode. */
.empty { position: relative; min-height: 52vh; display: flex; flex-direction: column; justify-content: center; }
.empty .tex { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent); mask-image: radial-gradient(closest-side, #000 35%, transparent); }
.empty .tex::before { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: .09;
  -webkit-mask: url(art/contours.svg) center / 420px auto repeat; mask: url(art/contours.svg) center / 420px auto repeat; }
.empty > :not(.tex) { position: relative; }
/* Arrived: the whole panel turns green with a big tick, so nobody has to read anything */
.arrive { display: none; width: min(30vw, 120px); height: min(30vw, 120px); flex: none; fill: none; stroke: var(--panel); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.sheet.arrived { background: var(--green); transition: background .3s; }
.sheet.arrived .dial { display: none; }
.sheet.arrived .arrive { display: block; }
.sheet.arrived, .sheet.arrived .nav-head small, .sheet.arrived .nav-nums .head, .sheet.arrived .nav-nums .dim { color: var(--panel); }
.sheet.arrived .nav-head button { background: var(--panel); color: var(--green); }
.sheet.arrived .grab span { background: var(--panel); opacity: .5; }
.sheet.arrived .dist { font-size: clamp(22px, 7vw, 28px); white-space: nowrap; }
.sheet.arrived .head { font-size: 15px; }
.m-nums > div { min-width: 0; } /* let the number shrink to the box, not the box grow to the number */
.empty p { margin: 0; }
/* slid down: Share and Navigate stay, a little slimmer */
.sheet.compact .actions { margin: 2px 0 0; }
.sheet.compact .actions button { padding: 7px 8px; font-size: 14px; }
.sheet.compact .actions svg { width: 18px; height: 18px; }
#keepBar span { font-weight: 500; }
/* left: 50% halves the room a shrink-to-fit bar gets; size these to their content instead */
.undo { width: max-content; }
.undo span { min-width: 0; }

/* photo stamp: what goes on it */
.stampopts { flex-wrap: wrap; padding: 10px 0 2px; }

/* the + button and what it opens: Photo, Area, Line, Point stacked above it */
.addbtn { background: var(--green); color: var(--panel); }
.addbtn svg { transition: transform .18s; }
body.adding .addbtn svg { transform: rotate(45deg); }
.addmenu { display: none; flex-direction: column; align-items: flex-start; gap: 10px; }
body.adding .addmenu { display: flex; animation: addin .14s ease-out; }
@keyframes addin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.adding .chips { visibility: hidden; } /* the menu may need their room on a small phone */

/* Two families, two see-through pills: the notebook on the left (open it, add to it), the map
   on the right (where am I, which map). Frosted so the map shows through. */
.pill { display: flex; flex-direction: column; border-radius: 26px; padding: 2px; }
.pill .fab { background: transparent; box-shadow: none; }
.pill .fab + .fab::before { content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: 1px; background: color-mix(in srgb, var(--ink) 15%, transparent); }
.pill .fab.on, .pill .addbtn { background: var(--green); color: var(--panel); }
.pill .addbtn::before, .pill .fab.on::before { display: none; }
.stampline { display: block; width: 100%; box-sizing: border-box; margin: 8px 0 2px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: 16px var(--sans); background: var(--panel); color: var(--ink); }
.stampline[hidden] { display: none; }


/* the panel opens for the other formats: say so when it's down */
.more-hint { display: none; font: 500 11.5px var(--sans); color: var(--muted); margin-top: 4px; }
.sheet.compact .more-hint { display: block; }
body.large .more-hint { display: none !important; }
/* share: options as chips, and room to read the whole message */
.shchips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0 2px; }
/* photo preview leaves room for the stamp options */
#photoOut { max-height: 46vh; object-fit: contain; background: #000; }
#photoModal .card { max-height: calc(100vh - var(--safe-t) - 28px); overflow-y: auto; }
.stampopts button { padding: 6px 11px; font-size: 13px; }
body.large .row .v.dim { font-size: 17px !important; }
.shchips button { padding: 8px 4px; font-size: 13.5px; border-radius: 12px; background: var(--green-soft); color: var(--muted); white-space: nowrap; }
.shchips button.on { background: var(--green); color: var(--panel); }

/* Big text (John mode): also high contrast and a big "Copied" */
body.large { --ink: #000; --muted: #2b2b28; --panel: #fff; --line: #bdb8a8; }
@media (prefers-color-scheme: dark) { body.large { --ink: #fff; --muted: #e4e2da; --panel: #000; --line: #55534a; } }
body.large .row .k { font-weight: 700; }
body.large .toast { font-size: 22px; padding: 16px 22px; border-radius: 18px; }
/* the grid ref sits centred in the panel */
.refline .big { justify-content: center; }
.ref { flex: none; text-align: center; }
.more-hint { text-align: center; }
/* a photo's own picture at the top of its Name/Notes screen (tap to see it full size) */
.ptthumb { display: block; width: 100%; max-height: 22vh; object-fit: cover; border-radius: 10px; margin-bottom: 8px; background: #000; }
.ptthumb[hidden] { display: none; }
/* the photo's name, on the photo screen (bold: it's the notebook entry, not the stamp) */
.photoname { font-weight: 700; }
.photoname[hidden] { display: none; }
/* hold + : it fills in when a held tap will drop a pin */
.addbtn { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; } /* a hold mustn't turn into a scroll or the iOS press menu */
.addbtn.held { background: var(--ink); color: var(--panel); }
.pill .addbtn svg.holdring { position: absolute; left: -26px; top: -26px; width: 100px; height: 100px; pointer-events: none; overflow: visible; transition: none; transform: none !important; }
.holdring circle { fill: none; stroke: var(--green); stroke-width: 5; stroke-linecap: round; opacity: 0; transition: opacity .12s; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.45)); }
.addbtn.h1 .h1, .addbtn.h2 .h2, .addbtn.h3 .h3 { opacity: 1; }
.addbtn.held .holdring circle { stroke: var(--ink); }

/* photos belong to points, lines and areas: a strip in the Save popup, the notebook and the viewer */
.phrow { display: flex; flex-direction: column; gap: 8px; }
.pthumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.pthumbs:empty, .pthumbs[hidden] { display: none; }
.pth { position: relative; }
.pth img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; background: var(--green-soft); }
.pth .x { position: absolute; top: -7px; right: -7px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); background: var(--ink); color: var(--panel); font: 700 15px/1 var(--sans); padding: 0; }
.phbtns { display: flex; gap: 8px; }
.phbtns[hidden] { display: none; }
.phbtns button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 600 15px var(--sans); background: var(--panel); color: var(--green); }
.phbtns svg { width: 18px; height: 18px; }
.item .pthumbs { gap: 6px; margin: 5px 0 2px; }
.item .pthumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--green-soft); }
.viewstrip { padding-top: 8px; }
.viewstrip img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; opacity: .55; background: #000; }
.viewstrip img.on { opacity: 1; outline: 2.5px solid var(--green); outline-offset: 1px; }
/* map: a dark camera badge on pins with photos; a camera where each photo of a line/area was taken */
.pcam { position: absolute; right: -6px; top: -6px; width: 15px; height: 15px; box-sizing: border-box; border-radius: 50%; background: #2b2b2b; border: 1.5px solid #fff; display: grid; place-items: center; transition: transform .15s; }
.pcam svg { width: 9px; height: 9px; }
.leaflet-container.mid .pcam { transform: translate(-3px, 3px) scale(.85); }
.leaflet-container.far .pcam { display: none; }
.photodot { width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; background: #2b2b2b; border: 2px solid #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.photodot svg { width: 11px; height: 11px; }
.leaflet-container.mid .photodot { transform: scale(.8); }

/* Map labels: OS cartography is drawn light; a touch more contrast makes names readable */
.leaflet-tile-pane > .leaflet-layer:not(.leaflet-shade-pane) { filter: contrast(var(--map-contrast, 1.18)) saturate(1.05); }
#photoModal .btns.three { grid-template-columns: .8fr .8fr 1.5fr; }
#photoModal .btns.three button { padding-left: 6px; padding-right: 6px; white-space: nowrap; }
/* small phones: the stamp step scrolls rather than pushing its buttons off the bottom */
#photoModal .card { max-height: calc(100dvh - var(--safe-t) - 26px); overflow-y: auto; }
/* Take photo / Add from phone: side by side, or stacked on the narrowest phones (never wrapped mid-label) */
.phbtns { flex-wrap: wrap; }
.phbtns button { flex: 1 1 auto; white-space: nowrap; padding: 10px 8px; }

/* Launch glide: reserve outlines, labels and pins wait for the map to settle, then fade in */
#map .leaflet-overlay-pane, #map .leaflet-marker-pane, #map .leaflet-shadow-pane { transition: opacity .5s; }
#map.gliding .leaflet-overlay-pane, #map.gliding .leaflet-marker-pane, #map.gliding .leaflet-shadow-pane { opacity: 0; }
/* Spotlight round the reserves when zoomed in (app.js closeUp): fades with the zoom */
#map .leaflet-mask-pane { opacity: 0; transition: opacity .6s; pointer-events: none; }
#map .leaflet-mask-pane.on { opacity: 1; }
#map.gliding .leaflet-mask-pane { opacity: 0; }

/* tides, from typing "tide" in search */
.results button.tiderow .t { display: block; font-weight: 700; }
.results button.tiderow .tl, .results button.tiderow .tdays { margin-top: 5px; font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.results button.tiderow .tdays div { display: grid; grid-template-columns: 5.4em 1fr; }
.results button.tiderow .tdays div + div { margin-top: 3px; }
.results button.tiderow .tdays span:first-child { font-weight: 700; }
.results button.tiderow [hidden] { display: none; }
/* easter eggs: animals pinned to the map; a sign on a stick above one of them */
.eggpin { pointer-events: none; }
.eggpin > div { position: relative; line-height: 0; }
.eggsign { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); transform-origin: 50% 100%; background: #fffdf5; color: #3b2a12; border: 2px solid #7a5a2e; border-radius: 4px; padding: 3px 7px; font: 700 13px/1.2 var(--sans); white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.eggsign::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 12px; margin-left: -1px; background: #7a5a2e; }
/* Mike's wolf: a blink of black with our huge, slightly torn wolf, like reality skipping */
.wolfglitch { position: fixed; inset: 0; z-index: 3000; background: #000; display: none; place-items: center; overflow: hidden; pointer-events: none; }
.wolfglitch.on { display: grid; }
.wolfglitch svg { width: 92vmin; height: 92vmin; transform: translateX(var(--dx, 0)) skewX(-4deg);
  filter: drop-shadow(8px 0 0 rgba(255,0,60,.7)) drop-shadow(-8px 0 0 rgba(0,240,255,.6));
  clip-path: polygon(0 0, 100% 0, 100% 38%, 92% 38%, 92% 44%, 100% 44%, 100% 100%, 0 100%, 0 71%, 7% 71%, 7% 66%, 0 66%); }
.wolfglitch::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 2px, transparent 2px 5px); }

/* Glass: everything floating over the map is frosted at one of two levels, so they read as one
   family. Buttons (and the search bar) are the most see-through, the map showing through
   their own blur; menus and popups hold text to read, so they're a little more solid. Chosen
   states (a chip that's on, the green buttons) stay solid so they still stand out. */
:root {
  --glass-btn: color-mix(in srgb, var(--panel) 58%, transparent);
  --glass-menu: color-mix(in srgb, var(--panel) 80%, transparent);
  --glass-edge: 0 1px 8px rgba(0,0,0,.16), inset 0 0 0 .5px rgba(255,255,255,.35);
}
.pill, .addmenu .fab, .chips button:not(.on), .leaflet-bottom.leaflet-left .leaflet-control-attribution {
  background: var(--glass-btn); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: var(--glass-edge); }
.layers, .results {
  background: var(--glass-menu); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 4px 16px rgba(0,0,0,.18), inset 0 0 0 .5px rgba(255,255,255,.35); }
.toast { background: color-mix(in srgb, var(--ink) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
/* Large text is for reading at a glance: the same glass, just more solid behind the words */
body.large {
  --glass-btn: color-mix(in srgb, var(--panel) 82%, transparent);
  --glass-menu: color-mix(in srgb, var(--panel) 94%, transparent);
}
/* The © is the least important thing on screen: closed, it's barely there (a faint frosted dot);
   opened to read the credits, it takes the menu glass */
#map .leaflet-bottom.leaflet-left .leaflet-control-attribution:not(.open) { background: color-mix(in srgb, var(--panel) 22%, transparent); box-shadow: none; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#map .leaflet-bottom.leaflet-left .leaflet-control-attribution.open { background: var(--glass-menu); }
#map .leaflet-control-attribution:not(.open)::before { color: var(--ink); opacity: .8; text-shadow: 0 0 3px var(--panel), 0 0 2px var(--panel); }
/* The location itself (grid ref, lat/long, E/N, what3words) in pure black, or pure white in
   dark mode: the highest contrast there is, for reading out over a radio or phone */
:root { --data: #000; }
@media (prefers-color-scheme: dark) { :root { --data: #fff; } }
.ref:not(.off), .row .v:not(.dim) { color: var(--data); }

/* Make a map: the usual controls step aside; a frame (what the picture will hold, everything
   outside it dimmed) and the maker's own glass bar take over */
body.mapmaker .top, body.mapmaker .chips, body.mapmaker .fabs, body.mapmaker .sheet, body.mapmaker .cross, body.mapmaker .leaflet-control-attribution { display: none !important; }
.maker[hidden] { display: none; }
.mkframe { position: fixed; z-index: 990; border: 2px solid #fff; border-radius: 4px; box-shadow: 0 0 0 100vmax rgba(15, 20, 16, .42), 0 0 0 3px rgba(0,0,0,.35); pointer-events: none; }
.mkdraw { position: fixed; inset: 0; z-index: 995; display: none; touch-action: none; }
.maker.drawing .mkdraw { display: block; }
.mktop { position: fixed; z-index: 1001; left: 12px; right: 12px; top: calc(var(--safe-t) + var(--nudge) + 10px); display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--glass-btn); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: var(--glass-edge); border-radius: 16px; padding: 6px; }
.mktop b { font: 700 16px var(--sans); color: var(--ink); }
.mktop button { border: 0; border-radius: 11px; padding: 9px 12px; font: 600 14px var(--sans); background: var(--green-soft); color: var(--green); }
.mkbar { position: fixed; z-index: 1001; left: 8px; right: 8px; bottom: max(8px, calc(var(--safe-b) - 14px)); border-radius: 18px; padding: 8px;
  background: var(--glass-menu); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 4px 16px rgba(0,0,0,.18), inset 0 0 0 .5px rgba(255,255,255,.35); display: flex; flex-direction: column; gap: 8px; }
.mktools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.mktools button { border: 0; border-radius: 12px; padding: 8px 2px; font: 600 12.5px var(--sans); background: var(--green-soft); color: var(--green); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mktools button svg { width: 22px; height: 22px; }
.mktools button.on { background: var(--green); color: var(--panel); }
.mkrow { display: flex; gap: 6px; align-items: stretch; }
.mkrow > button { flex: 1; border: 0; border-radius: 12px; padding: 11px 6px; font: 600 14.5px var(--sans); background: var(--green-soft); color: var(--green); white-space: nowrap; }
.mkrow > button.on { background: #1a73e8; color: #fff; }
.mkrow > .primary { background: var(--green); color: var(--panel); }
.mkcols { display: flex; gap: 5px; align-items: center; padding: 0 2px; }
.mkcols button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.mkcols button.on { box-shadow: 0 0 0 2.5px var(--ink); }
.mkhint { margin: 0; text-align: center; font: 12.5px var(--sans); color: var(--muted); }
/* the set's pictures in a row: swipe between them, each snaps to the middle */
.mkpreviews { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mkpreviews::-webkit-scrollbar { display: none; }
.mkpreviews[hidden] { display: none; }
.mkpreviews img { flex: 0 0 100%; width: 100%; max-height: 46vh; object-fit: contain; scroll-snap-align: center; border-radius: 8px; border: 1px solid var(--line); background: var(--green-soft); box-sizing: border-box; }
/* labels: black with a solid white edge, centred on their spot, a line per line */
.mklabel { font: 800 15px/1.2 var(--sans); color: #1b1a15; white-space: nowrap; text-align: center; transform: translate(-50%, -50%); display: inline-block;
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 0 -2px 0 #fff, 0 2px 0 #fff, -2px 0 0 #fff, 2px 0 0 #fff; }
.mklabelpin { cursor: grab; }
.pin.mkoff { opacity: .28; }
/* a line or area left off the map: dashed as well as faint, so on and off can't be confused */
.leaflet-overlay-pane .mkoff { opacity: .5; stroke-dasharray: 2 9; }
.mksyms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; max-height: 148px; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 2px; } /* 27 symbols: two and a half rows show, the rest scroll */
.mksyms[hidden] { display: none; }
/* A laptop: the tools sit in a column on the left, so the frame keeps the screen's full height */
@media (min-width: 900px) {
  .mkbar { right: auto; width: 360px; }
  .mksyms { max-height: 320px; }
}
.mksyms button { border: 2px solid transparent; border-radius: 10px; padding: 5px 1px 4px; background: var(--green-soft); display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 10.5px var(--sans); color: var(--ink); }
.mksyms button.on { border-color: var(--green); background: var(--panel); }
.mksyms button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mksym { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.card .btns[hidden] { display: none; }
.card .btns.three { grid-template-columns: 1.15fr .85fr 1fr; }
.card .btns.one { grid-template-columns: 1fr; }
.maplist { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
.mapacts button { border: 0; border-radius: 9px; padding: 7px 4px; font: 600 13.5px var(--sans); background: var(--green-soft); color: var(--green); }
.mapacts button.danger { color: var(--danger); }

body.mapmaker .layers { z-index: 1100; } /* the map menu opens over the maker's bar */
.card .btns button:disabled { opacity: .75; }
.toast { z-index: 1400; } /* over the cards too, so messages from a card are seen */
.card .btns#mkBtnsDone:not(.three) { grid-template-columns: 1fr 1fr; }
.mktop .mkready { background: var(--green); color: var(--panel); }
.mktop [hidden], .card > label[hidden] { display: none; }
/* Gloves: the small controls get bigger touch areas (about 40 px; phones advise 44) */
.chips button { padding: 10px 14px; min-height: 38px; }
.chips { padding-bottom: 8px; }
.mkcols button { width: 36px; height: 36px; }
.mapacts button { padding: 11px 4px; }
/* Notebook | Maps: two tabs, equal footing. Each tab has its own list and its own buttons */
.dtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 16px 2px; padding: 3px; border-radius: 12px; background: var(--green-soft); flex: none; }
.dtabs[hidden] { display: none; }
.dtabs button { border: 0; border-radius: 9px; padding: 9px; font: 600 15px var(--sans); background: none; color: var(--muted); }
.dtabs button.on { background: var(--panel); color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.drawer.maps-tab #list, .drawer.maps-tab #backup, .drawer.maps-tab footer .nb { display: none; }
.drawer:not(.maps-tab) #mapList, .drawer:not(.maps-tab) footer .mp { display: none; }
.drawer footer button.primary { background: var(--green); color: var(--panel); }
/* A reserve's own places (Barn, Car park…): a short list straight down from that reserve's
   button for a few seconds after you open it, then they fade */
.subchips { position: fixed; z-index: 999; left: 12px; width: max-content; max-width: calc(100vw - 24px); top: calc(var(--safe-t) + var(--nudge) + 116px); display: flex; flex-direction: column; align-items: stretch; gap: 6px; opacity: 0; transition: opacity .25s; pointer-events: none; } /* a short list down from its reserve's button */
.subchips::-webkit-scrollbar { display: none; }
.subchips.show { opacity: 1; pointer-events: auto; }
.subchips[hidden] { display: none; }
.subchips button { flex: none; border: 0; border-radius: 14px; padding: 8px 14px; min-height: 36px; text-align: left; font: 600 13px var(--sans); color: var(--ink);
  background: var(--glass-btn); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: var(--glass-edge); }
body.measuring .subchips, body.navigating .subchips, body.moving .subchips, body.mapmaker .subchips, body.adding .subchips { display: none; }
/* the zoom level, small, beside the closed © (for telling Nick which view you mean) */
#map .leaflet-control-attribution:not(.open)::before { content: "© " attr(data-z); }
/* After a place jump (Barn, Car park…): the cross is the view's middle, not the place, so
   the grid ref's spot shows the place's name instead, quietly, until the map's moved */
.refline { position: relative; }
.placenote { display: none; }
.sheet.placeview .ref, .sheet.placeview .rows .v { visibility: hidden; }
.sheet.placeview .placenote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: absolute; inset: 0; text-align: center; pointer-events: none; }
.placenote b { font: 700 26px var(--sans); color: var(--ink); }
.placenote small { font: 13px var(--sans); color: var(--muted); }

.picframe[hidden] { display: none; }

/* Maps tab: a card per map, the picture half the width (tap for full screen), its details and
   buttons beside it. Reserve chips wrap above; a reserve has a New map card first */
.maplist { padding: 0 0 12px; gap: 0; }
.mapnew { display: flex; align-items: center; gap: 12px; margin: 8px 10px; padding: 14px; border: 2px dashed var(--line); border-radius: 12px; background: none; color: var(--green); font: 600 16px var(--sans); text-align: left; }
.mapnew b { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: var(--panel); display: grid; place-items: center; font: 600 24px var(--sans); flex: none; }
.mapitem { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 10px 10px; padding: 10px; border-radius: 12px; background: var(--card); align-items: start; }
.mapthumb { position: relative; }
.mapthumb img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--green-soft); }
.mapthumb .chk { display: none; position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); place-items: center; color: #fff; font: 700 16px var(--sans); }
.drawer.mselecting .mapthumb .chk { display: grid; }
.mapitem.picked .mapthumb .chk { background: var(--green); }
.mapitem.picked { box-shadow: inset 0 0 0 2px var(--green); }
.mapside { min-width: 0; display: flex; flex-direction: column; gap: 3px; height: 100%; }
.mapside b { font: 700 16px var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.mapside small { font: 13px var(--sans); color: var(--muted); }
.mapnote { margin: 2px 0 0; font: 13.5px var(--sans); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mapacts { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 8px; }
.drawer.mselecting .mapacts { display: none; }
.drawer.mselecting #mapSelBar { display: flex; }
.drawer.mselecting footer, .drawer.mselecting .mapnew { display: none; }
#mapSelBar .danger { color: var(--danger); }
.selbar button:disabled { opacity: .5; }
.mapview { position: fixed; inset: 0; z-index: 1500; background: rgba(10, 12, 10, .92); display: grid; place-items: center; padding: calc(var(--safe-t) + 12px) 12px 12px; }
.mapview[hidden] { display: none; }
.mapview img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.mspics img { width: 46%; flex: none; scroll-snap-align: start; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--green-soft); }
.mstext { display: flex; flex-direction: column; gap: 6px; font: 600 13px var(--sans); color: var(--muted); }
.mstext textarea { font: 15px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; }

/* The notebook's banner: a spruce band with the contour texture, the place you're looking at
   in big type and a one-line count under it. The tabs sit on its bottom edge */
.drawer header { position: relative; overflow: hidden; align-items: flex-start; min-height: 118px; padding: 12px 16px 30px; background: var(--green); border-bottom: 0; }
.drawer header::before { content: ""; position: absolute; inset: 0; background: var(--panel); opacity: .13; pointer-events: none;
  -webkit-mask: url(art/contours.svg) center / 420px auto repeat; mask: url(art/contours.svg) center / 420px auto repeat; }
.drawer header > :not(.bannerart) { position: relative; z-index: 1; } /* above the banner art */
.drawer header button, .drawer header .back { color: var(--panel); }
.drawer h2.dtitle { align-self: flex-end; color: var(--panel); font-size: clamp(28px, 9vw, 34px); line-height: 1.05; white-space: normal; }
.dtitle small { display: block; margin-top: 5px; color: var(--panel); opacity: .82; font: 500 14px var(--sans); }
.dtabs { position: relative; z-index: 2; margin: -20px 16px 4px; background: var(--card); box-shadow: 0 3px 12px rgba(0,0,0,.14), inset 0 0 0 1px var(--line); }
/* the picked tab: solid spruce, so it's clear which one you're on in light and dark */
.dtabs button.on { background: var(--green); color: var(--panel); box-shadow: none; }
.drawer .list { border-top: 0; }
body.mappick .top, body.mappick .fabs, body.mappick .sheet, body.mappick .cross, body.mappick .subchips { display: none !important; }
.mktop button:disabled { opacity: .5; }
/* LiDAR: ground or trees and hedges, two halves under the slider */
.lidarkind { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 10px 10px; padding: 3px; border-radius: 10px; background: var(--green-soft); }
.layers .lidarkind button { border: 0; border-radius: 8px; padding: 7px 6px; font: 600 13.5px var(--sans); background: none; color: var(--muted); text-align: center; width: auto; }
.layers .lidarkind button.on { background: var(--panel); color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* The reserve pill under the notebook's title, and its list */
.drawer header .respick { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; border: 0; border-radius: 14px; padding: 5px 8px 5px 12px; font: 600 14px var(--sans); background: color-mix(in srgb, var(--panel) 22%, transparent); color: var(--panel); }
.respick svg { width: 16px; height: 16px; }
.dtitle small:empty { display: none; }
.reslist { display: flex; flex-direction: column; }
.reslist button { border: 0; border-top: 1px solid var(--line); background: none; padding: 14px 6px; text-align: left; font: 500 17px var(--sans); color: var(--ink); }
.reslist button:first-child { border-top: 0; }
.reslist button.on { color: var(--green); font-weight: 700; }
.reslist button.on::after { content: "  ✓"; }
.drawer header { min-height: 104px; }
.msedit { align-self: flex-start; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 16px; padding: 8px 14px; font: 600 14px var(--sans); background: var(--green-soft); color: var(--green); }
.msedit[hidden] { display: none; }
.msedit svg { width: 16px; height: 16px; }
/* The banner's drawing (art/banner): the reserve's own ground and boundary, or the whole patch
   for all of them. A plain picture, white lines (dark in dark mode), on the right clear of the
   title and faded in from the left so the drawing's edge doesn't show as a box */
.drawer header .bannerart { position: absolute; z-index: 0; top: 2px; right: 4px; width: 74%; height: calc(100% + 14px); /* (runs on under the tabs) */ object-fit: contain; object-position: right center; opacity: .42; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 20%, #000 55%); mask-image: linear-gradient(to right, transparent 20%, #000 55%); }
@media (prefers-color-scheme: dark) { .drawer header .bannerart { filter: invert(1); } }
.drawer header::before { opacity: .06; } /* the general texture, now just a wash under the drawing */
.msedit b { font-weight: 700; font-size: 17px; }
/* Share: the first row fits grid ref, lat/long, E/N and the two map links (logos) on one line */
.shchips.row1 { grid-template-columns: 1.2fr 1.15fr .8fr 42px 42px; }
.shchips.row1 button { font-size: 12.5px; padding: 8px 2px; }
.shchips button.logo { display: grid; place-items: center; padding: 6px 0; }
.shchips button.logo svg { width: 20px; height: 20px; }
.shchips button.logo:not(.on) svg { opacity: .45; filter: grayscale(1); }
.shchips:empty { display: none; }
/* The map maker's bar keeps one height whatever the tool: the symbols, the hint and the label
   box take turns in one fixed slot, so the frame never jumps. Symbols are one row that scrolls */
.mkslot { height: 64px; display: flex; flex-direction: column; justify-content: center; }
.mkslot .mksyms { display: flex; grid-template-columns: none; gap: 5px; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0; }
.mkslot .mksyms[hidden], .mkslot .mkhint[hidden], .mklabelbox[hidden] { display: none; }
.mkslot .mksyms::-webkit-scrollbar { display: none; }
.mkslot .mksyms button { flex: 0 0 60px; }
.mklabelbox { display: flex; gap: 6px; align-items: stretch; height: 100%; }
.mklabelbox textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: 600 16px/1.25 var(--sans); color: var(--ink); background: var(--card); }
.mklbtns { display: grid; grid-template-columns: auto auto; gap: 4px; }
.mklbtns button { border: 0; border-radius: 9px; padding: 0 10px; font: 600 13px var(--sans); background: var(--green-soft); color: var(--green); }
.mklbtns .primary { grid-row: span 2; grid-column: 2; background: var(--green); color: var(--panel); }
.mklbtns .danger { color: var(--danger); }
.mklbtns button[hidden] { display: none; }
@media (min-width: 900px) { .mkslot { height: auto; min-height: 64px; } .mkslot .mksyms { flex-wrap: wrap; } }
/* Share: a page like the notebook. Spruce header with what's being shared; sections below */
.sharepage { position: fixed; inset: 0; z-index: 1150; background: var(--panel); display: flex; flex-direction: column; padding-top: var(--safe-t); }
.sharepage[hidden] { display: none; }
.shhead { display: flex; align-items: center; gap: 12px; padding: 12px 16px 14px; background: var(--green); color: var(--panel); }
.shhead button { border: 0; background: none; color: var(--panel); font: 600 16px var(--sans); padding: 6px 0; }
.shhead > div { flex: 1; min-width: 0; text-align: right; }
.shhead .shref { display: block; font: 700 clamp(20px, 6.5vw, 26px) var(--mono); }
.shhead small { display: block; font: 500 13px var(--sans); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shbody { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 16px; }
.shbody section { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.shbody section:last-child { border-bottom: 0; }
.shbody h3 { margin: 0; font: 700 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.shhint { margin: -4px 0 0; font: 13px var(--sans); color: var(--muted); }
.shnone { margin: 0; font: 14px var(--sans); color: var(--muted); }
.shbody .msedit { align-self: flex-start; }
.shmaps { display: flex; flex-direction: column; gap: 10px; }
.shmap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px; border-radius: 12px; background: var(--card); }
.shmap img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 8px; background: var(--green-soft); }
.shmapside { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shmapside b { font: 700 15px var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.shmapside small { font: 13px var(--sans); color: var(--muted); }
.shmapside button { margin-top: auto; border: 0; border-radius: 10px; padding: 10px 6px; font: 600 14px var(--sans); background: var(--green-soft); color: var(--green); }
.shmapside button + button { margin-top: 0; }
.shmapside .danger { color: var(--danger); }
.shphotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shphotos:has(.shnone) { display: block; }
.shph img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--green-soft); }
.bubble { align-self: stretch; padding: 10px 12px 8px; border-radius: 18px 18px 4px 18px; background: #dcf2e4; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .bubble { background: #20412f; } }
.bubble textarea { min-height: 4.2em; display: block; width: 100%; border: 0; background: none; resize: none; padding: 0; font: 15px/1.4 var(--sans); color: var(--ink); overflow: hidden; outline: none; }
.bubble small { display: block; margin-top: 6px; font: 600 12px var(--sans); color: var(--muted); text-align: right; }
.shfoot { padding: 10px 16px max(12px, calc(var(--safe-b) - 16px)); border-top: 1px solid var(--line); }
.shfoot button { width: 100%; border: 0; border-radius: 14px; padding: 15px; font: 700 17px var(--sans); background: var(--green); color: var(--panel); }
/* One way out, everywhere: Close / Cancel / ‹ Back on the left of a bar at the bottom, the
   main action on the right; top bars only say where you are */
.drawer footer button#folderBack[hidden], .drawer footer button#closeDrawer[hidden] { display: none; }
.drawer footer #closeDrawer, .drawer footer #folderBack { flex: 0 0 auto; padding: 13px 16px; background: none; border: 1px solid var(--line); color: var(--ink); }
.drawer.maps-tab footer .nb { display: none; }
.shfoot { display: flex; gap: 8px; }
.shfoot button { flex: 1; width: auto; }
.shfoot #shCancel { flex: 0 0 auto; padding: 15px 18px; background: none; border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.botbar { position: fixed; z-index: 1001; left: 8px; right: 8px; bottom: max(8px, calc(var(--safe-b) - 14px)); display: flex; gap: 8px; padding: 8px; border-radius: 18px;
  background: var(--glass-menu); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.botbar button { flex: 1; border: 0; border-radius: 12px; padding: 13px; font: 600 15px var(--sans); background: var(--green-soft); color: var(--green); }
.botbar #mpCancel { flex: 0 0 auto; padding: 13px 18px; }
.botbar .primary { background: var(--green); color: var(--panel); }
.botbar button:disabled { opacity: .5; }
.picframe .mktop { justify-content: center; }
.mktop { justify-content: center; }
.mktop .mkready { position: absolute; right: 8px; }
.mkslot .mkcols { display: flex; gap: 10px; justify-content: center; align-items: center; height: 100%; }
.mkslot .mkcols[hidden] { display: none; }
.mkrow #mkCancel { flex: 0 0 auto; padding: 11px 14px; }
.mkanother { align-self: center; }
.mkanother[hidden] { display: none; }
.shph { position: relative; padding: 0; border: 0; background: none; border-radius: 10px; }
.shph img { opacity: .45; }
.shph.on img { opacity: 1; box-shadow: 0 0 0 3px var(--green); }
.shph span { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--sans); color: #fff; background: rgba(0,0,0,.35); border: 2px solid #fff; }
.shph.on span { background: var(--green); }
/* Draw's row: line / arrow choice, a divider, then the colours */
.mkcols .mkkind { width: 44px; height: 36px; border-radius: 10px; border: 0; box-shadow: none; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.mkcols .mkkind svg { width: 22px; height: 22px; }
.mkcols .mkkind.on { background: var(--green); color: var(--panel); box-shadow: none; }
.mkcols .mksep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line); }
