/* Ontario Hunting web app - layout and look. Palette (0.6 "clean modern", same as the phone app): ink, green, white, slate;
 * red / orange / green stay for legal warnings. Phone (< 900 px): floating search, bottom tab bar, drag-able sheets.
 * PC: top bar, side panel with tabs, card on the right. Light / dark (auto + Me ▸ Settings). */
:root {
  /* 0.6 clean modern (as the Backcountry app): ink #0F172A, green #16A34A, white surfaces, slate text, 16 px corners.
     The --g* names are kept from the forest palette so older rules still work: ink, ink, green, green tint, white */
  --g900: #0F172A; --g700: #0F172A; --g600: #16A34A; --g400: #DCFCE7; --g100: #FFFFFF;
  --bg: #F8FAFC; --surface: #ffffff; --surface2: #F1F5F9; --line: #E2E8F0; --text: #0F172A; --muted: #56606F;   /* (roadmap 104: 5.8:1 on surface2, was 4.3) */
  --bar: #0F172A; --bar-text: #fff; --primary: #0F172A; --primary-text: #fff; --accent: #16A34A; --hl: #DCFCE7;
  --link: #15803D; --danger: #DC2626; --warn: #EA580C; --ok: #16A34A; --green: #16A34A; --green-ink: #166534;
  --shadow: 0 6px 24px rgba(15, 23, 42, .14); --r: 16px; --tap: 48px; --tabh: 64px; --fs: 14.5px;
  color-scheme: light;
}
:root.is-dark {
  --g900: #0B0F14; --g700: #F1F5F9; --g600: #4ADE80; --g400: #14532D; --g100: #F1F5F9;
  --bg: #0B0F14; --surface: #10161C; --surface2: #1A222C; --line: #2A3441; --text: #F1F5F9; --muted: #94A3B8;
  --bar: #0B0F14; --primary: #F1F5F9; --primary-text: #0B0F14; --accent: #4ADE80; --hl: #14532D; --link: #4ADE80;
  --green: #4ADE80; --green-ink: #BBF7D0; --shadow: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root[data-text="large"] { --fs: 16.5px; }
@media (max-width: 899px) { :root { --fs: 15.5px; } :root[data-text="large"] { --fs: 17.5px; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; font: var(--fs)/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
             color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 20px; height: 20px; }
a { color: var(--link); }
.hint { font-size: .85em; color: var(--muted); }
.error { color: var(--danger); font-size: .9em; }
[hidden] { display: none !important; }
button.primary, .primary { background: var(--primary); color: var(--primary-text); border: 0; border-radius: 10px; font-weight: 600; }
button.wide { width: 100%; min-height: var(--tap); margin-top: 8px; }

/* ---------------------------------------------------------------- top bar (PC) */
body { display: flex; flex-direction: column; }
#bar { display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 12px; background: var(--bar); color: var(--bar-text); flex: none; z-index: 15; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.1em; white-space: nowrap; margin-right: 6px; }
.brand .logo { font-size: 1.4em; }
@media (max-width: 1500px) { .brand b { display: none; } }
#views { min-width: 0; flex: 0 1 auto; }
#views { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#views button, #species, .top-btn, #date { height: 38px; border: 0; border-radius: 999px; padding: 0 12px; background: rgba(255,255,255,.12);
  color: #fff; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
#views button:hover, .top-btn:hover, #date:hover { background: rgba(255,255,255,.2); }
#views button.on { background: var(--g100); color: var(--g900); font-weight: 700; }
:root.is-dark #views button.on { background: var(--g400); color: var(--g900); }
#species { appearance: none; padding-right: 14px; max-width: 150px; }
#species option { color: #000; }
.top-btn.primary { background: var(--g400); color: var(--g900); font-weight: 700; }
#search-box { position: relative; margin-left: auto; flex: 0 1 360px; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; font-size: .9em; opacity: .7; pointer-events: none; }
#search { width: 100%; height: 40px; border: 0; border-radius: 999px; padding: 0 14px 0 36px; background: var(--surface); color: var(--text); outline: none; }
#search:focus { box-shadow: 0 0 0 3px var(--g400); }
#results { position: absolute; right: 0; top: 46px; z-index: 40; width: 420px; max-width: 92vw; max-height: 65vh; overflow: auto; margin: 0; padding: 6px 0;
  list-style: none; background: var(--surface); color: var(--text); border-radius: var(--r); box-shadow: var(--shadow); }
#results li { padding: 10px 14px; cursor: pointer; }
#results li.head { font-size: .78em; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; cursor: default; padding: 10px 14px 4px; }
#results li:not(.head):hover, #results li.sel { background: var(--surface2); }
#date { position: relative; cursor: pointer; }
#date.set { background: var(--g400); color: var(--g900); font-weight: 700; }
#hunt-date { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
#date-today { display: none; }

/* ---------------------------------------------------------------- main + side panel (PC) */
main { position: relative; flex: 1; min-height: 0; display: flex; }
#side { width: 344px; flex: none; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
        transition: margin-left .2s ease; z-index: 12; min-height: 0; }
body.side-closed:not(.phone) #side { margin-left: -344px; }
#side .sheet-handle { display: none; }
.side-tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.side-tabs button { flex: 1; min-height: var(--tap); border: 0; background: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.side-tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }
.side-tabs .side-collapse { flex: 0 0 44px; font-size: 1.2em; }
.pane { flex: 1; overflow-y: auto; padding: 12px 14px 24px; min-height: 0; }
.pane h2 { font-size: 1.05em; margin: 4px 0 10px; }
.pane h3 { font-size: .8em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
#side-open { position: absolute; left: 12px; top: 12px; z-index: 11; width: var(--tap); height: var(--tap); border-radius: 12px; border: 0;
             background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: 1.2em; display: none; }
body.side-closed:not(.phone) #side-open { display: block; }
body.side-closed:not(.phone) .maplibregl-ctrl-top-left { margin-top: 60px; }
#map { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9em; margin-bottom: 8px; }
.field select, .dialog input, .dialog select, .dialog textarea, .setting select, #spot-filter {
  min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--surface); color: var(--text); width: 100%; }

/* layers list + legend */
#layers details { border-bottom: 1px solid var(--line); }
#layers summary { padding: 12px 4px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
#layers summary::after { content: '▾'; color: var(--muted); transition: transform .15s; }
#layers details:not([open]) summary::after { transform: rotate(-90deg); }
#layers label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px 8px 6px; cursor: pointer; border-radius: 8px; min-height: 40px; }
#layers label:hover { background: var(--surface2); }
#layers label.out { color: var(--muted); }
#layers label .t { flex: 1; min-width: 0; }
.sw { display: inline-block; flex: none; width: 18px; height: 13px; margin: 3px 0 0; background: var(--c); border: 1px solid rgba(0,0,0,.35); border-radius: 3px; }
.sw-line { height: 0; border: 0; border-top: 3px solid var(--c); margin-top: 9px; border-radius: 0; }
.sw-point { width: 12px; height: 12px; border-radius: 50%; }
.sw-pat { background: repeating-linear-gradient(45deg, var(--c) 0 2px, transparent 2px 5px); }
ul.legend { list-style: none; margin: -4px 0 8px 36px; padding: 0; font-size: .85em; color: var(--muted); }
ul.legend li { display: flex; align-items: flex-start; gap: 6px; margin: 3px 0; }
ul.legend li.note { font-style: italic; }

/* lists, chips, tools grid, settings */
.big-list { display: flex; flex-direction: column; gap: 8px; }
.big-list button { min-height: 52px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 12px; text-align: left;
                   padding: 10px 14px; font-weight: 600; display: flex; flex-direction: column; justify-content: center; }
.big-list button small { font-weight: 400; color: var(--muted); font-size: .85em; }
.big-list button.on { background: var(--hl); border-color: var(--accent); color: var(--text); }
:root:not(.is-dark) .big-list button.on { color: var(--g900); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); }
.chip.on { background: var(--accent); color: var(--g900); border-color: var(--accent); font-weight: 700; }
.lidar-box { margin: 4px 0 12px; }
.lidar-box .chip { min-height: 36px; padding: 0 12px; font-weight: 600; }
.lidar-op { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--muted); }
.lidar-op input { flex: 1; accent-color: var(--accent); }
.lidar-op[hidden] { display: none; }
.lidar-legend { font-weight: 400; font-size: .85em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.lidar-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
.lidar-legend .ramp { width: 100%; height: 10px; border-radius: 5px; border: 1px solid var(--line); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool-grid button { min-height: 84px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 14px; padding: 8px 6px;
                    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .82em; font-weight: 600; text-align: center; line-height: 1.15; }
.tool-grid button span { font-size: 1.7em; }
.tool-grid button:hover, .big-list button:hover { border-color: var(--accent); }
.setting { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-weight: 600; font-size: .92em; }
.seg { display: flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
:root.is-dark .seg button.on { background: var(--g600); color: #fff; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--tap); padding: 4px 2px; border-bottom: 1px solid var(--line); }
#pane-me details { border-top: 1px solid var(--line); padding: 4px 0; }
#pane-me summary { padding: 12px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
#pane-me summary::after { content: '▾'; color: var(--muted); }
#pane-me details:not([open]) summary::after { transform: rotate(-90deg); }
.me-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; }
.me-head > div:nth-child(2) { flex: 1; }
.me-head button { min-height: 40px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 10px; padding: 0 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--g900); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2em; flex: none; }
#spot-filter { margin-bottom: 8px; }
.spot { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.spot:hover { background: var(--surface2); }
.spot .ic { font-size: 1.3em; width: 28px; text-align: center; }
.spot .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.spot .tx small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot .go { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); }
.popover { position: fixed; z-index: 60; width: 320px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; }

/* ---------------------------------------------------------------- the card */
#card { position: absolute; right: 12px; top: 12px; bottom: 12px; width: 430px; max-width: calc(100% - 24px); display: flex; flex-direction: column;
        background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); z-index: 14; overflow: hidden; }
#card-head { position: relative; flex: none; padding: 12px 56px 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); touch-action: none; }
#card-head .sheet-handle { display: none; }
#card-close { position: absolute; top: 6px; right: 6px; width: var(--tap); height: var(--tap); border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 1.7em; line-height: 1; }
#card-close:hover { background: var(--surface2); }
#card-peek:empty::before { content: "What's here"; font-weight: 700; }
.pk-title { font-size: 1.12em; font-weight: 750; display: flex; align-items: center; gap: 8px; line-height: 1.25; }
.tone { width: 14px; height: 14px; border-radius: 50%; flex: none; background: #868e96; box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.tone-green { background: var(--ok); } .tone-red { background: var(--danger); } .tone-orange { background: var(--warn); } .tone-purple { background: #7b2cbf; }
.pk-row { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; color: var(--muted); font-size: .9em; }
.pk-warn { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pk-warn span { background: rgba(193, 18, 31, .12); color: var(--danger); border-radius: 999px; padding: 3px 10px; font-size: .85em; font-weight: 700; }
:root.is-dark .pk-warn span { background: rgba(255, 90, 90, .16); color: #ff8f8f; }
#card-body { flex: 1; overflow-y: auto; padding: 6px 16px 28px; overscroll-behavior: contain; }
#card .loading { color: var(--muted); }
#card details { margin: 2px 0; border-bottom: 1px solid var(--line); }
#card details > summary { cursor: pointer; padding: 11px 2px; min-height: 44px; }
#card details details { margin: 2px 0 2px 4px; border: 0; }
#card details details > summary { padding: 8px 2px; min-height: 40px; }
.hit-head { display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; padding: 8px 10px; background: var(--surface2); border-radius: 10px; font-size: .92em; }
.hit-head.here { margin-top: 6px; font-weight: 700; display: none; }
.hit-head.lake { display: flex; background: rgba(76, 201, 240, .15); }
.badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--g900); color: #fff;
         font-size: .78em; font-weight: 700; border: 2px solid #ffbe0b; }
details.land-fold { margin-top: 12px; border-top: 2px solid var(--line); padding-top: 4px; }
details.land-fold > summary { cursor: pointer; padding: 12px 0; }
.point-tools { background: var(--surface2); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; }
.point-tools button { min-height: 40px; margin: 3px 6px 3px 0; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.point-tools img { display: block; max-width: 100%; max-height: 240px; margin-top: 8px; border-radius: 10px; cursor: zoom-in; }
/* the server's card HTML has inline light-theme colours: tone them down in the dark */
:root.is-dark #card-body [style*="background:#f1f3f5"] { background: var(--surface2) !important; }
:root.is-dark #card-body font[color="#6c757d"], :root.is-dark #card-body font[color="#868e96"], :root.is-dark #card-body [style*="color:#495057"],
:root.is-dark #card-body [style*="color:#555"], :root.is-dark #card-body [style*="color:#666"], :root.is-dark #card-body span[style*="color:#666"] { color: var(--muted) !important; }
:root.is-dark #card-body font[color="#343a40"], :root.is-dark #card-body font[color="#1d3557"], :root.is-dark #card-body font[color="#111"] { color: var(--text) !important; }
:root.is-dark #card-body div[style*="background:#fff"] { background: transparent !important; color: var(--text) !important; }
:root.is-dark #card-body table[border], :root.is-dark #card-body table[border] td, :root.is-dark #card-body table[border] th { border-color: var(--line) !important; }

/* field guide inside cards */
a.hunting-id { display: inline-flex; align-items: center; min-height: 36px; margin: 6px 0 2px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
               background: var(--surface2); color: var(--text); text-decoration: none; font-size: .9em; font-weight: 600; }
a.hunting-id.open { background: var(--g700); color: #fff; border-color: var(--g700); }
.guide { margin: 8px 0 10px; padding: 10px; background: var(--surface2); border-radius: 12px; font-size: .92em; }
.g-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.g-photos figure { margin: 0; flex: 0 0 min(260px, 85%); scroll-snap-align: start; }
.g-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; background: var(--line); cursor: zoom-in; }
.g-photos figcaption { font-size: .78em; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.g-photos figcaption b { font-size: 1.05em; color: var(--text); }
.g-photos figcaption a { color: var(--muted); }
.g-photos figure.g-drawing img { object-fit: contain; background: #fff; border: 1px solid var(--line); }
.g-sec { margin-top: 10px; }
.g-h { font-weight: 700; }
.g-sec ul { margin: 3px 0 0; padding-left: 20px; }
.g-sec li { margin: 3px 0; }
.g-legal { border-left: 3px solid var(--ok); padding-left: 8px; }
.g-warn { border-left: 3px solid var(--danger); padding-left: 8px; }
.g-more { margin-top: 10px; color: var(--muted); }

/* ---------------------------------------------------------------- map buttons, controls */
#fabs { position: absolute; right: 12px; bottom: 36px; z-index: 11; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--surface); color: var(--g700); box-shadow: var(--shadow); font-size: 1.6em;
       display: flex; align-items: center; justify-content: center; }
:root.is-dark .fab { color: var(--g400); }
#fab-compass span { display: inline-block; color: var(--danger); transition: transform .15s; }
body.card-open:not(.phone) #fabs { right: 456px; }
.maplibregl-ctrl-geolocate { display: none !important; }
.maplibregl-ctrl-group { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
:root.is-dark .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-scale { background: rgba(255,255,255,.8); border-color: var(--g900); color: var(--g900); }
:root.dim-map .maplibregl-canvas { filter: brightness(.72) saturate(.9); }
:root.dim-map.topo-on .maplibregl-canvas { filter: none; }
#tools-btn, #tools-menu { display: none !important; }

/* ---------------------------------------------------------------- dialogs, mode bar, toast, tool panel */
.dialog { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); z-index: 50; width: 420px; max-width: calc(100% - 20px); max-height: calc(100% - 60px);
          overflow: auto; background: var(--surface); color: var(--text); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.dialog h2 { font-size: 1.15em; margin: 0 0 10px; }
.dialog label { display: block; margin: 10px 0; font-weight: 600; font-size: .9em; }
.dialog label input, .dialog label select, .dialog label textarea { display: block; margin-top: 4px; }
.dialog label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.dialog label.check input { width: 20px; min-height: 0; }
.dialog .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dialog .buttons button { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); }
.dialog .buttons button.primary { background: var(--primary); color: var(--primary-text); border: 0; }
#print-estimate { font-size: .85em; color: var(--muted); min-height: 2.6em; }
#print-estimate.warn { color: var(--warn); }
#point-winds { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 8px 0; }
#point-winds legend { font-size: .9em; font-weight: 600; }
#point-winds label { display: inline-flex; align-items: center; gap: 4px; margin: 4px 10px 4px 0; font-weight: 600; }
#point-winds label input { display: inline-block; width: 20px; min-height: 0; margin: 0; }
#mode-bar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 30; background: var(--g900); color: #fff; border-radius: var(--r);
            padding: 10px 12px; box-shadow: var(--shadow); width: max-content; max-width: calc(100% - 24px); }
.mode-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#mode-bar button { min-height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; }
#mode-bar button.primary { background: var(--g400); color: var(--g900); border: 0; }
#toast { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 70; background: var(--g900); color: #fff; border-radius: 12px; padding: 12px 16px;
         max-width: min(90%, 520px); box-shadow: var(--shadow); }
#tool-panel { position: absolute; z-index: 20; top: 12px; left: 50%; transform: translateX(-50%); width: min(400px, calc(100% - 24px)); max-height: 60vh; overflow-y: auto;
              background: var(--surface); color: var(--text); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 14px; font-size: .95em; }
.tp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 1.05em; }
#tp-close { width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 1.6em; line-height: 1; border-radius: 10px; }
.tp-read { margin: 6px 0; }
.tp-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#tool-panel button:not(#tp-close) { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); }
#tool-panel label { display: block; margin: 6px 0; font-weight: 600; font-size: .9em; }
#tool-panel input:not([type=range]):not([type=checkbox]), #tool-panel select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px;
  background: var(--surface); color: var(--text); max-width: 100%; }
#tool-panel input[type=range] { width: 100%; accent-color: var(--primary); }
.tp-coords { border-collapse: collapse; width: 100%; }
.tp-coords th { text-align: left; font-weight: 600; padding: 4px 6px 4px 0; white-space: nowrap; }
.tp-coords td { padding: 4px; font-family: ui-monospace, monospace; font-size: .85em; }
.tp-coords button { min-height: 34px !important; }
.tp-chart { width: 100%; height: auto; background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; }
:root.is-dark .tp-chart text { fill: var(--text); }
.tp-arrow-wrap { text-align: center; }
.tp-arrow { display: inline-block; font-size: 72px; line-height: 1; color: var(--g600); transition: transform .2s; }
#swipe-map { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#swipe-bar { position: absolute; top: 0; bottom: 0; z-index: 6; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.5); cursor: ew-resize; touch-action: none; }
#swipe-bar span { position: absolute; top: 50%; left: -20px; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: #fff; color: var(--g900);
                  box-shadow: 0 1px 4px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; font-size: 20px; }
#tabbar { display: none; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 899px) {
  :root { --tabh: calc(64px + env(safe-area-inset-bottom, 0px)); }
  #bar { position: fixed; top: 0; left: 0; right: 0; height: auto; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; background: none; gap: 8px; pointer-events: none; }
  #bar > * { pointer-events: auto; }
  .brand, #views, #species, #add-btn, #account-btn { display: none !important; }
  #search-box { flex: 1; margin: 0; }
  #search { height: 50px; box-shadow: var(--shadow); font-size: 16px; }
  #date { height: 50px; padding: 0 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
  #date.set { background: var(--g400); color: var(--g900); }
  #date-label { font-weight: 700; }
  #results { position: fixed; left: 10px; right: 10px; top: calc(66px + env(safe-area-inset-top, 0px)); width: auto; max-height: 60vh; }
  main { position: fixed; left: 0; right: 0; top: 0; bottom: var(--tabh); }
  #side, #card { position: fixed; left: 0; right: 0; top: auto; bottom: var(--tabh); width: auto; max-width: none; margin: 0 !important; border: 0;
                 border-radius: 28px 28px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.22); z-index: 18; height: 52vh;
                 transition: height .34s cubic-bezier(.2, .9, .25, 1);   /* one curve for every move: fast out, soft landing */
                 display: flex; flex-direction: column; background: var(--surface); }
  #side.dragging, #card.dragging { transition: none; }
  #card { z-index: 19; }
  #side .sheet-handle, #card-head .sheet-handle { display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .4; margin: 10px auto 8px; flex: none; }
  #side .sheet-handle { touch-action: none; }
  #card-head { padding: 0 56px 10px 16px; cursor: grab; }
  #card-close { top: 10px; }
  .side-tabs { display: none; }
  .hit-head.here { display: none; }
  #fabs { position: fixed; right: 12px; bottom: calc(var(--tabh) + 18px); }
  body.sheet-open #fabs { display: none; }
  .maplibregl-ctrl-top-left .maplibregl-ctrl-zoom-in, .maplibregl-ctrl-top-left .maplibregl-ctrl-zoom-out { display: none; }
  .maplibregl-ctrl-top-left { display: none; }
  .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: 0; }
  #tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabh); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 25;
            background: var(--surface); border-top: 1px solid var(--line); }
  #tabbar button { flex: 1; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center;
                   gap: 2px; font-size: .75em; font-weight: 600; position: relative; }
  #tabbar button span { font-size: 1.55em; line-height: 1; filter: grayscale(.4); }
  #tabbar button.on { color: var(--text); }
  #tabbar button.on span { filter: none; }
  #tabbar button.on::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  #pane-views:not([hidden]) { display: block; }
  .dialog { top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; transform: none; width: auto; max-width: none; max-height: calc(100% - 20px); }
  #mode-bar { top: calc(70px + env(safe-area-inset-top, 0px)); left: 10px; right: 10px; transform: none; width: auto; }
  #toast { bottom: calc(var(--tabh) + 84px); position: fixed; }
  #tool-panel { position: fixed; top: auto; bottom: calc(var(--tabh) + 8px); left: 8px; right: 8px; width: auto; transform: none; max-height: 48vh; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .popover { left: 10px; right: 10px; width: auto; }
}

/* ---------------------------------------------------------------- photo viewer (lightbox.js) */
#lightbox { position: fixed; inset: 0; z-index: 1000; background: #0b120b; display: none; flex-direction: column; }
#lightbox.open { display: flex; }
#lightbox .lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; user-select: none; -webkit-user-drag: none; }
#lightbox .lb-cap { position: relative; z-index: 1; background: #0b120b; color: #e9ecef; font-size: 13px; padding: 8px 16px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; max-height: 25vh; overflow: auto; }
#lightbox .lb-cap a { color: #ced4da; }
#lightbox button { position: absolute; z-index: 2; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.5); color: #fff; border-radius: 50%;
                   width: 48px; height: 48px; font-size: 30px; line-height: 1; cursor: pointer; }
#lightbox .lb-close { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; }
#lightbox .lb-prev { left: 10px; top: 50%; margin-top: -24px; }
#lightbox .lb-next { right: 10px; top: 50%; margin-top: -24px; }

/* hiking: difficulty tones, the trail card's elevation profile + buttons */
.tone-blue { background: #1e88e5; } .tone-black { background: #111; } .tone-grey { background: #868e96; }
.hike-profile { margin: 4px 0 8px; }
.hike-profile .prof { width: 100%; height: auto; max-width: 480px; display: block; }
.prof-line { fill: none; stroke: var(--accent, #4f772d); stroke-width: 2; }
.prof-fill { fill: var(--accent, #4f772d); opacity: .15; }
.hike-profile text { font-size: 10px; fill: var(--muted, #6c757d); }
.hike-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.hike-actions .btn { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line, #ccc); text-decoration: none; color: inherit; font-weight: 600; }

.hike-row { display: block; width: 100%; text-align: left; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line, #ddd); background: none; color: inherit; cursor: pointer; }
.hike-row .tone { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
#tp-body .chip.on { background: var(--hl); color: var(--green-ink); }

.g-banner { font-weight: 700; padding: 8px; margin: 6px 0; }
h2.g-group { margin-top: 28px; border-bottom: 2px solid currentColor; }

.hit-head.extra { display: flex; margin-top: 6px; background: rgba(29, 127, 196, .12); }
.hit-head.extra small { color: var(--muted); font-weight: 400; }

/* the card: what you tapped that has no card of its own (land, parks, WMU, closures) - named above What's here */
.tapped-quiet { margin: 4px 0 8px; padding: 6px 8px; border-radius: 6px; background: var(--surface2);
    font-size: 13px; line-height: 1.6; }
.tapped-quiet span { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font-weight: 600; }
.tapped-quiet small { color: var(--muted); font-weight: normal; }

/* first-open "not legal advice" note: centred over everything, the map dimmed behind it */
#terms-dialog { position: fixed; top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); z-index: 1000;
    width: min(420px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 32px); margin: 0;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), var(--shadow); }
#terms-dialog ul { padding-left: 20px; }

/* under every card: share / report */
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-actions button { flex: 1 1 140px; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font-weight: 600; }
#report-dialog { position: fixed; top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); z-index: 1000;
    width: min(440px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 32px);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), var(--shadow); }
#report-dialog textarea, #report-dialog input, #report-dialog select { width: 100%; box-sizing: border-box; }
#me-reports .report { padding: 8px 0; border-bottom: 1px solid var(--line); }
#me-reports .report button { margin: 6px 6px 0 0; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); }

/* find a layer */
#layer-filter { width: 100%; box-sizing: border-box; margin: 6px 0 8px; min-height: 40px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1em; }

/* ================================================================ 0.6 clean modern: Inter, line icons, the app's controls */
@font-face { font-family: Inter; src: url(fonts/ui/Inter-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/ui/Inter-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/ui/Inter-SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/ui/Inter-Bold.woff2) format('woff2'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: 'Material Symbols Outlined'; src: url(fonts/ui/material-symbols.woff2) format('woff2'); font-weight: 400; font-display: block; }
html, body { -webkit-font-smoothing: antialiased; }
.ms { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 1.25em; line-height: 1; letter-spacing: normal;
      text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; vertical-align: -0.22em; font-feature-settings: 'liga';
      -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 0, 'wght' 400, 'opsz' 24; }
.has-ms { gap: 8px; }
b, strong { font-weight: 600; }

/* top bar (PC): ink, white pills */
#bar { height: 60px; padding: 0 16px; }
.brand { gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand .logo { display: inline-flex; font-size: 1em; }
#views button, #species, .top-btn, #date { height: 36px; background: rgba(255,255,255,.08); font-weight: 500; padding: 0 14px; }
#views button.on, :root.is-dark #views button.on { background: #fff; color: #0F172A; font-weight: 600; }
#date.set { background: #DCFCE7; color: #166534; font-weight: 600; }
.top-btn.primary { background: var(--green); color: #fff; font-weight: 600; }
:root.is-dark .top-btn.primary { color: #0B0F14; }
#search { border-radius: 12px; height: 40px; }
#search:focus { box-shadow: 0 0 0 3px rgba(22,163,74,.35); }
.search-icon .ms { font-size: 20px; color: var(--muted); }
.search-icon { opacity: 1; display: inline-flex; }

/* side panel */
.side-tabs button { font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.side-tabs button[aria-selected=true] { color: var(--text); font-weight: 600; border-bottom-color: var(--green); }
.pane h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.field select, .dialog input, .dialog select, .dialog textarea, .setting select, #spot-filter, #layer-filter {
  border-radius: 12px; border-color: var(--line); background: var(--surface2); }
#layer-filter { min-height: 44px; border: 0; }

/* buttons */
button.primary, .primary { border-radius: 12px; }
.big-list button { border-radius: 14px; background: var(--surface); flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap;
                   gap: 0 12px; font-weight: 600; }
.big-list button > .ms { width: 40px; height: 40px; border-radius: 12px; background: var(--surface2); display: inline-flex; align-items: center;
                         justify-content: center; font-size: 22px; flex: none; }
.big-list button small { flex-basis: 100%; padding-left: 52px; margin-top: -4px; }
.big-list button.on { background: var(--hl); border-color: var(--green); }
.big-list button:hover, .tool-grid button:hover { border-color: var(--line2, #CBD5E1); background: var(--surface2); }
.chip { min-height: 36px; border-radius: 999px; border-color: var(--line); background: var(--surface); font-weight: 500; }
.chip.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
.lidar-box .chip.on, #tp-body .chip.on { background: var(--hl); color: var(--green-ink); border-color: transparent; }
.tool-grid button { background: var(--surface); border-radius: 16px; font-weight: 500; }
.tool-grid button span, .tool-grid button .ms { font-size: 26px; color: var(--text); }
.seg { border: 0; padding: 4px; gap: 4px; border-radius: 12px; }
.seg button { min-height: 36px; font-weight: 500; }
.seg button.on, :root.is-dark .seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.14); }
:root.is-dark .seg button.on { background: var(--line); }
input[type=checkbox], input[type=radio] { accent-color: var(--green); }
.avatar { background: var(--hl); color: var(--green-ink); }

/* layers: switch-style toggles */
#layers summary { font-weight: 600; }
#layers label { align-items: center; }
#layers input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; order: 9; width: 40px; height: 24px; margin: 0 0 0 auto; border-radius: 12px;
  background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
#layers input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.3); transition: left .15s; }
#layers input[type=checkbox]:checked { background: var(--green); }
#layers input[type=checkbox]:checked::after { left: 19px; }
.sw { border-radius: 3px; border-color: rgba(15,23,42,.18); }
ul.legend { margin-left: 30px; }

/* the card */
#card-head { padding: 14px 56px 12px 18px; }
.pk-title { font-size: 1.15em; font-weight: 700; letter-spacing: -.01em; }
.tone { width: 10px; height: 10px; box-shadow: none; }
.pk-row { gap: 6px; margin-top: 8px; color: var(--text); font-size: .88em; }
.pk-row span { background: var(--surface2); border-radius: 8px; padding: 4px 10px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.pk-row span .ms { font-size: 16px; color: var(--muted); }
.pk-warn span, :root.is-dark .pk-warn span { border-radius: 8px; font-weight: 600; }
:root:not(.is-dark) .pk-warn span { background: #FEE2E2; color: #991B1B; }
#card-close { border-radius: 50%; width: 36px; height: 36px; top: 12px; right: 12px; background: var(--surface2); font-size: 1.3em; }
#card-body { background: var(--bg); padding: 8px 14px 28px; }
#card-body > details, #card-body .land-fold { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; margin: 8px 0; }
#card-body > details > summary { font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
#card-body > details > summary::-webkit-details-marker { display: none; }
#card-body > details > summary::after { content: 'expand_more'; font-family: 'Material Symbols Outlined'; margin-left: auto; color: var(--muted); font-size: 22px;
  transition: transform .15s; font-weight: normal; }
#card-body > details[open] > summary::after { transform: rotate(180deg); }
#card-body > details > summary .ms { color: var(--green); }
#card details details { border-top: 1px solid var(--line); margin: 0; }
.hit-head { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.hit-head.lake { background: rgba(14, 165, 233, .08); }
.badge { background: #0F172A; }
.card-actions { border-top: 0; }
.card-actions button { border-radius: 12px; min-height: 46px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.card-actions button:first-child { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
a.hunting-id { border-radius: 12px; background: var(--surface); }
a.hunting-id.open { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* map buttons: white rounded squares, one style */
#fabs { gap: 12px; }
.fab, :root.is-dark .fab { width: 48px; height: 48px; border-radius: 14px; color: var(--text); font-size: 22px; box-shadow: 0 4px 16px rgba(15,23,42,.16); }
.fab .ms { font-size: 24px; }
.maplibregl-ctrl-group { border-radius: 14px; }
.maplibregl-ctrl-scale { border-color: #0F172A; color: #0F172A; border-radius: 0 0 3px 3px; }

/* dialogs, bars, toast */
.dialog { border-radius: 20px; padding: 20px 22px; }
.dialog h2 { font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.dialog .buttons button { border-radius: 12px; font-weight: 600; }
#mode-bar, #toast { background: #0F172A; color: #fff; }
:root.is-dark #mode-bar, :root.is-dark #toast { background: #1A222C; }
#mode-bar button.primary { background: var(--green); color: #fff; }
#tool-panel { border-radius: 18px; }
#tool-panel button:not(#tp-close), .point-tools button { border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; }
.tp-arrow { color: var(--green); }

@media (max-width: 899px) {
  #bar { padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; }
  #search { height: 48px; border-radius: 14px; }
  #date { height: 48px; border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 500; }
  #date.set { background: #DCFCE7; color: #166534; }
  :root.is-dark #date.set { background: #14532D; color: #BBF7D0; }
  #side, #card { border-radius: 22px 22px 0 0; box-shadow: 0 -4px 24px rgba(15,23,42,.14); }
  #side .sheet-handle, #card-head .sheet-handle { width: 36px; height: 4px; background: #CBD5E1; }
  :root.is-dark #side .sheet-handle, :root.is-dark #card-head .sheet-handle { background: #334155; }
  #fabs { right: 16px; }
  #tabbar button { font-weight: 500; font-size: 11px; gap: 3px; }
  #tabbar button span, #tabbar button .ms { font-size: 24px; filter: none; }
  #tabbar button.on { color: var(--green); font-weight: 600; }
  #tabbar button.on::before { display: none; }
}

/* cell tower card (build_cell.py) */
.cell-badge { display: inline-block; padding: 1px 9px; margin: 2px 2px 2px 0; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 13px; }
.cell-ll { font-variant-numeric: tabular-nums; }
.cell-copy { margin-left: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: inherit; font: inherit; font-size: 13px; cursor: pointer; }

/* 3D button (map controls, top left) */
.maplibregl-ctrl-group .btn-3d { width: 48px; height: 48px; font: 700 15px/1 inherit; color: var(--text); }
.maplibregl-ctrl-group .btn-3d.on, .maplibregl-ctrl-group .btn-3d.on:hover { background: var(--text) !important; color: var(--bg) !important; }

/* Plan a trip (plan.js, redesign phase 3) */
#pane-plan h3 { margin: 18px 0 6px; }
.plan-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.plan-row .field { flex: 1; min-width: 130px; }
.plan-btn { min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; margin: 4px 0; }
.plan-btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.plan-btn.danger { color: var(--danger); }
.plan-back { border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; padding: 8px 0; }
.plan-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.plan-trip { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 48px; }
.plan-trip small { display: block; color: var(--muted); margin-top: 2px; }
.plan-trip.past { opacity: .6; }
.plan-table-wrap { overflow-x: auto; margin: 0 -4px; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plan-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.plan-table th.on { color: var(--text); }
.plan-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plan-table tr[data-fly] { cursor: pointer; }
.plan-table tr[data-fly]:hover td { background: var(--surface2); }
.plan-score { letter-spacing: 1px; color: var(--text); white-space: nowrap; }
.plan-star { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); min-width: 32px; min-height: 32px; }
.plan-star.on { color: #d97706; }
.plan-st { display: inline-block; width: 18px; text-align: center; font-weight: 700; }
.plan-st-ok { color: #0369A1; } .plan-st-check { color: #B45309; } .plan-st-no { color: #9F1239; }
#pane-plan textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.plan-save { margin-top: 12px; }

/* (2026-11-18) your own version of a mode + fil's "save as default"; the quick swap chip in the view bar */
#mode-tools:empty { display: none; }
#mode-tools { margin: 0 0 10px; display: grid; gap: 6px; }
#mode-tools .hint { margin: 0; }
#mode-tools .linkish { background: none; border: 0; padding: 0; color: var(--g600, #16A34A); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
#mode-tools .btn-secondary { border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; text-align: left; }
#views button.swap { font-weight: 700; }
#views button.swap[hidden] { display: none; }

/* basemap chip (2026-11-18): bottom left over the map, a small drop-down */
#bm-chip { position: relative; margin: 8px 0 0 10px; clear: both; }
#bm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; box-shadow: 0 4px 16px rgba(15,23,42,.16); cursor: pointer; }
#bm-btn .ic svg, #bm-menu .ic svg { width: 16px; height: 16px; display: block; }
#bm-btn .caret, #bm-btn .t { display: none; }
#bm-btn .ic svg { width: 20px; height: 20px; }
#bm-menu { position: absolute; left: 0; top: 40px; min-width: 150px; background: var(--surface); color: var(--text); border-radius: 12px; padding: 4px;
  box-shadow: 0 8px 28px rgba(15,23,42,.22); display: grid; }
#bm-menu[hidden] { display: none; }
#bm-menu button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; background: none; color: inherit; font: inherit; border-radius: 8px; cursor: pointer; text-align: left; }
#bm-menu button:hover { background: rgba(127,127,127,.12); }
#bm-menu .ok { margin-left: auto; font-weight: 700; }

/* ---- the tap card's six parts (tier.js, 2026-11-19) */
.tier { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 8px; }
.tier-kind { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tier-sw { width: 12px; height: 12px; border-radius: 3px; background: #6c757d; }
.tier-sw.tone-green { background: #16A34A; } .tier-sw.tone-blue { background: #2563EB; } .tier-sw.tone-red { background: #DC2626; }
.tier-sw.tone-orange { background: #EA580C; } .tier-sw.tone-purple { background: #7B2CBF; }
.tier-title { margin: -4px 0 0; font-size: 21px; line-height: 1.2; font-weight: 700; }
.tier-sub { font-size: 13px; color: var(--muted); margin-top: -6px; }
.tier-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-chips span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface2); font-weight: 500; }
.tier-verdict, .tier-alert { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 14px; font-weight: 600; line-height: 1.3; }
.tier-verdict { font-size: 15.5px; }
.tier-alert { font-size: 14px; padding: 9px 12px; border-radius: 12px; }
.tier-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
             color: #fff; font-size: 13px; font-weight: 700; background: #64748B; }
.st-ok { background: #DCFCE7; color: #166534; } .st-ok .tier-mark { background: #16A34A; }
.st-check { background: #FFEDD5; color: #9A3412; } .st-check .tier-mark { background: #EA580C; }
.st-no { background: #FEE2E2; color: #991B1B; } .st-no .tier-mark { background: #DC2626; }
.st-neutral { background: var(--surface2); color: var(--text); }
.st-ink-ok { color: #166534; font-weight: 600; } .st-ink-check { color: #9A3412; font-weight: 600; } .st-ink-no { color: #991B1B; font-weight: 600; }
.tier-here { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier-fact { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 12px; background: var(--surface2); min-width: 0; }
.tf-l, .tier-cap { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tf-v { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.tf-n { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.tier-next { display: flex; flex-direction: column; gap: 4px; }
.tier-next .tn { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.tier-next .tn b { min-width: 84px; font-size: 13px; color: var(--green-ink); }
.tier-quiet { font-size: 13px; color: var(--green-ink); }
details.tier-all { border-top: 1px solid var(--line); margin-top: 6px; }
details.tier-all > summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: 15px; cursor: pointer; }
:root.is-dark .st-ok { background: #14532D; color: #BBF7D0; } :root.is-dark .st-check { background: #431407; color: #FED7AA; }
:root.is-dark .st-no { background: #450A0A; color: #FECACA; }
:root.is-dark .st-ink-ok { color: #86EFAC; } :root.is-dark .st-ink-check { color: #FDBA74; } :root.is-dark .st-ink-no { color: #FCA5A5; }
#card:not([data-state="full"]) #card-body .tier > .in-strip { display: none; }   /* full card: the big header scrolls with the body */
.tier-strip { gap: 6px; margin: 0; padding-right: 8px; }
.tier-strip .tier-verdict { margin-top: 4px; }
/* the chips: every layer under the finger (2026-11-19) */
.tier-mapchips { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.mc-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mc-row::-webkit-scrollbar { display: none; }
.mchip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 999px;
         border: 0; background: var(--surface2); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
         -webkit-touch-callout: none; user-select: none; touch-action: pan-x; }
.mchip.on { background: var(--text); color: var(--surface); }
.mchip.off span { text-decoration: line-through; opacity: .6; }
.mchip.off .sw { opacity: .3; }
.mc-row { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }

/* (2026-11-19) the sheet's parts: actions in reach on the short card, the layer a swipe picked, a compact bar when full */
.tier-actions { display: flex; gap: 8px; margin-top: 2px; }
.tier-actions > * { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
                    color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.tier-actions .ta-main { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.tier-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface2); }
.tier-pick[hidden] { display: none; }
#card[data-state="full"] .tier-strip > :not(.tier-title) { display: none; }
#card[data-state="full"] .tier-strip .tier-title { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#card[data-state="full"] #card-head { box-shadow: 0 1px 0 var(--line); }
.tier-sw.tone-yellow { background: #E9C23B; }
/* (roadmap 28/30/34) layer groups: counts, turn all off, zoom-in notes, the colours page */
#layers summary .gcount { color: var(--muted); font-weight: 400; font-size: .9em; }
#layers summary .goff { float: right; border: 0; background: none; color: var(--link); font: inherit; font-size: .85em; cursor: pointer; padding: 0 4px; }
#layers label.needs-zoom::after { content: "Zoom in to see it"; display: block; margin-left: 28px; font-size: .82em; color: var(--link); }
.linkish { border: 0; background: none; color: var(--link); font: inherit; padding: 6px 0; cursor: pointer; text-align: left; }
#colours-dialog { border: 0; border-radius: 20px; padding: 20px 22px; max-width: 440px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
#colours-dialog::backdrop { background: rgba(0,0,0,.4); }
#colours-dialog ul { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; }
#colours-dialog li { display: grid; grid-template-columns: 20px 1fr; column-gap: 10px; font-size: 14px; }
#colours-dialog li i { width: 16px; height: 16px; border-radius: 4px; background: var(--c); grid-row: span 2; margin-top: 2px; }
#colours-dialog li b { display: block; }
#colours-dialog form button { margin-top: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; }

/* ---- 2026-11-19: for hunters who aren't map people (simple.js) */
#big-here { position: absolute; left: 356px; bottom: 36px; z-index: 11; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
body.side-closed:not(.phone) #big-here { left: 12px; }
.big-ask { min-height: 58px; padding: 0 24px; border: 0; border-radius: 999px; background: #2b8a3e; color: #fff;
           font-size: 1.2em; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.big-ask:disabled { opacity: .75; }
.big-ask, .big-chip { display: inline-flex; align-items: center; gap: 8px; }
.big-ic { width: 24px; height: 24px; flex: none; }
.big-chip { min-height: 50px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text, inherit);
            font-size: 1.05em; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.big-primary { width: 100%; min-height: 54px; border: 0; border-radius: 14px; background: #2b8a3e; color: #fff; font-size: 1.1em; font-weight: 700; cursor: pointer; }
.big-outline { min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; font-size: 1.05em; font-weight: 600; cursor: pointer; }
#reset-map { width: 100%; margin: 4px 0 10px; }
.detail-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.detail-row span { flex: 1; display: flex; flex-direction: column; }
.detail-row small { color: var(--muted); font-weight: 400; }
.detail-row input { width: 22px; height: 22px; }
.tier-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
#answer-dialog, #help-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 22px; overflow: hidden; background: var(--surface); color: inherit; }
#answer-dialog::backdrop, #help-dialog::backdrop { background: rgba(0,0,0,.5); }
.ans-top { padding: 20px; color: #fff; background: #495057; }
#answer-dialog.ans-ok .ans-top { background: #2b8a3e; }
#answer-dialog.ans-no .ans-top { background: #c0262d; }
#answer-dialog.ans-private .ans-top { background: #5b5b5b; }
#answer-dialog.ans-check .ans-top { background: #f2a900; color: #212529; }
.ans-where { font-size: 15px; }
#ans-head { margin: 4px 0; font-size: 28px; line-height: 1.15; }
#ans-verdict { margin: 0; font-size: 20px; }
.ans-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
#ans-place { margin: 0; font-size: 18px; font-weight: 600; }
#ans-alerts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 17px; }
#ans-alerts .st-no { color: #c0262d; } #ans-alerts .st-check { color: #c45200; }
.ans-note { margin: 0; font-size: 14px; color: var(--muted); }
.ans-row { display: flex; gap: 8px; } .ans-row > * { flex: 1; }
#help-dialog { padding: 20px; } #help-dialog h2 { margin: 0 0 8px; font-size: 24px; } #help-dialog p { font-size: 17px; }
#help-text { width: 100%; box-sizing: border-box; font-size: 18px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; }
.help-shot { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 10px 0; }
.help-shot input { width: 22px; height: 22px; }
@media (max-width: 899px) {
  #big-here { position: fixed; left: 12px; bottom: calc(var(--tabh) + 62px); }
  body.card-open #big-here { display: none; }
}
