/* The hunt (hunt_bar.js), the Hunt tab (hunt_tab.js) and the Hunts section of the Journal (hunt_log.js). On the shell
   tokens; night colors redefine them inside .hb only (the same dim red-on-black as tracking). Every element that sets
   a background token also sets a color token. */

/* top bar: one control. "Start hunt" idle; the live hunt timer while one runs (tap → back to the hunt). */
.topbar-hunt{min-height:44px;padding:0 14px;border:1.5px solid var(--accent);border-radius:999px;background:var(--accent);color:var(--accent-ink);font:700 .9rem var(--f-body);cursor:pointer;white-space:nowrap}
.topbar-hunt.is-live{display:inline-flex;align-items:center;gap:8px;background:var(--surface);color:var(--ink);border-color:var(--bad);font:700 1rem var(--f-num)}
body[data-tab="hunt"] .topbar-hunt:not(.is-live){display:none}   /* the Hunt tab has its own big Start hunt */

/* while hunting the hunt is the app: no tab bar, no top bar, the page underneath stays put */
body.hunting:not([data-tab="track"]){overflow:hidden}
body.hunting:not([data-tab="track"]) .tabs,body.hunting:not([data-tab="track"]) .topbar{display:none}
body.hunting:not([data-tab="track"]) #view{visibility:hidden}
/* away (Scout / Plan / a tab while the hunt runs): the slim "Hunt running · back" bar over the tab bar */
body.hunt-away{padding-bottom:calc(var(--tabs-h) + var(--hunt-h,0px) + env(safe-area-inset-bottom,0px))}
body.hunt-away[data-tab="scout"] #view{height:calc(100dvh - var(--topbar-h) - env(safe-area-inset-top,0px) - var(--tabs-h) - var(--hunt-h,0px) - env(safe-area-inset-bottom,0px))}
body[data-tab="track"] .hb,body.signed-out .hb{display:none}

/* the shell: a bottom sheet over the tab bar (start question, hunt saved), the whole screen while hunting */
.hb{position:fixed;left:0;right:0;bottom:calc(var(--tabs-h) + env(safe-area-inset-bottom,0px));z-index:1001;color:var(--ink)}
.hb[data-night="1"]{
  --bg:#000; --surface:#120404; --soft:#1f0806; --ink:#e8493b; --muted:#b9473a; --line:#4a140e;
  --accent:#ff4a36; --accent-ink:#000; --olive:#e8493b; --good:#e8493b; --warn:#e8493b; --bad:#ff4a36; color-scheme:dark}
.hb-main:empty{display:none}
body.hunting .hb{top:0;bottom:0;display:flex;flex-direction:column;background:var(--bg);color:var(--ink)}
body.hunting .hb-main{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--bg);color:var(--ink)}
body:not(.hunting) .hb-main{display:none}

/* the map, with the timer + GPS top left, Hold to end top right, the chip / strip at its foot */
.hb-map{position:relative;flex:1;min-height:0;overflow:hidden;background:var(--soft);color:var(--ink)}
.hb-leaf{position:absolute;inset:0;z-index:0;background:var(--soft);color:var(--ink)}
.hb[data-night="1"] .hb-leaf .leaflet-tile-pane{filter:grayscale(1) brightness(.22) sepia(1) hue-rotate(-40deg) saturate(2)}
.hb-top{position:absolute;z-index:2;top:calc(10px + env(safe-area-inset-top,0px));left:10px;right:10px;display:flex;justify-content:space-between;align-items:flex-start;gap:10px;pointer-events:none}
.hb-top > *{pointer-events:auto}
.hb-clock{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:start;column-gap:8px;padding:8px 12px;border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:0 2px 10px rgba(0,0,0,.25)}
.hb-time{font:700 1.45rem/1.1 var(--f-num);color:var(--ink)}
.hb-read{grid-column:1/-1;font:600 .8rem var(--f-num);color:var(--ink);white-space:nowrap}
.hb-dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--bad);animation:hb-pulse 2s infinite}
@keyframes hb-pulse{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.hb-dot{animation:none}}
.hb-hold{display:flex;align-items:center;gap:8px;min-height:56px;padding:0 18px 0 10px;border-radius:999px;border:2px solid var(--line);background:var(--surface);color:var(--ink);
  font:700 1rem var(--f-body);cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.25);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.hb-ring{width:34px;height:34px;transform:rotate(-90deg)}
.hb-ring circle{fill:none;stroke-width:3.2}
.hb-ring-bg{stroke:var(--line)}
.hb-ring-fill{stroke:var(--bad);stroke-dasharray:100;stroke-dashoffset:100;stroke-linecap:round;transition:stroke-dashoffset .15s}
.hb-hold.holding{border-color:var(--bad)}
.hb-hold.holding .hb-ring-fill{stroke-dashoffset:0;transition:stroke-dashoffset 1.2s linear}
@media (prefers-reduced-motion:reduce){.hb-hold.holding .hb-ring-fill{transition:stroke-dashoffset 1.2s steps(4)}}
.hb-low{position:absolute;z-index:2;left:10px;right:10px;bottom:10px;display:grid;gap:8px;pointer-events:none}
.hb-low > *,.hb-lowrow > *{pointer-events:auto}
.hb-lowrow{display:flex;align-items:center;gap:8px;pointer-events:none}
.hb-msg{margin:0;padding:8px 12px;border-radius:10px;background:var(--surface);color:var(--ink);font-size:.9rem;font-weight:600;box-shadow:0 2px 10px rgba(0,0,0,.2)}
.hb-msg.hb-pick{border-left:4px solid var(--accent)}
.hb-chip{min-height:48px;max-width:70%;padding:0 16px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:700 .95rem var(--f-body);cursor:pointer;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 2px 10px rgba(0,0,0,.25)}
.hb-sp{flex:1;pointer-events:none}
.hb-fab{flex:none;display:grid;place-items:center;width:52px;height:52px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.25)}
.hb-fab svg{width:24px;height:24px}
/* map marks (inside Leaflet; fixed colors read on aerial imagery) */
.hb-pin{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--accent);color:var(--accent-ink);border:2px solid #fff;font:800 .95rem var(--f-body);box-shadow:0 1px 4px rgba(0,0,0,.5)}
.hb-pin-app{box-shadow:0 0 0 3px #f2b705,0 1px 4px rgba(0,0,0,.5)}
.hb-path{stroke:#ff7a3d;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;fill:none}
.hb[data-night="1"] .hb-me{fill:#e8493b;stroke:#000}   /* the only CSS over the marks' own colors */

/* the 2×3 grid under the thumb */
.hb-btns{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px));background:var(--surface);color:var(--ink);border-top:2px solid var(--accent)}
.hb-b{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:76px;padding:6px 4px;border:1.5px solid var(--line);border-radius:14px;
  background:var(--soft);color:var(--ink);font:700 .95rem/1.1 var(--f-body);text-align:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.hb-b svg{width:28px;height:28px}
.hb-b:active{transform:scale(.97)}
.hb-b:disabled{opacity:.45;cursor:default}
.hb-saw{background:var(--olive);color:var(--bg);border-color:var(--olive)}
.hb-shot{border:2px solid var(--bad);color:var(--bad);background:var(--surface)}
.hb-b.on,.hb-b[aria-expanded="true"],.hb-night[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}

/* away: the slim bar back to the hunt */
.hb-back{display:none}
body.hunt-away .hb-back{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:0 16px;border:0;border-top:2px solid var(--accent);background:var(--surface);color:var(--ink);font:600 1rem var(--f-body);cursor:pointer}
.hb-back-txt{font-family:var(--f-num)}
.hb-back strong{margin-left:auto;color:var(--accent)}
body.hunt-away .hb-panel{display:none}

/* panels: inline, right above the grid (hunting) or the tab bar (start, hunt saved) */
.hb-panel{position:absolute;left:0;right:0;bottom:100%;z-index:3;max-height:min(70vh,calc(100dvh - var(--topbar-h) - var(--tabs-h) - 120px));overflow:auto;
  display:grid;gap:10px;padding:14px 12px;background:var(--surface);color:var(--ink);border-top:1px solid var(--line);border-radius:18px 18px 0 0;box-shadow:0 -8px 24px rgba(0,0,0,.25)}
body.hunting .hb-panel{bottom:var(--hunt-h,0px);max-height:calc(100dvh - var(--hunt-h,0px) - 84px - env(safe-area-inset-top,0px))}
.hb-panel > *{margin:0}
.hb-after .hb-panel{border-top:2px solid var(--accent)}
.hb-q{font-size:1.25rem;margin:0}
.hb-hint{margin:0;color:var(--ink);font-size:.95rem}
.hb-ok{color:var(--good);font-weight:700}
.hb-label{margin:0;font-weight:700;color:var(--muted);font-size:.85rem;text-transform:uppercase;letter-spacing:.05em}
.hb-row{display:flex;gap:10px;align-items:center}
.hb-row > .hb-big{flex:1}
.hb-col{display:grid;gap:8px}
.hb-two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.hb-big{display:flex;align-items:center;justify-content:center;gap:8px;min-height:56px;padding:6px 12px;border:1.5px solid var(--line);border-radius:12px;
  background:var(--soft);color:var(--ink);font:700 1.02rem/1.15 var(--f-body);text-align:center;text-decoration:none;cursor:pointer}
.hb-big small{font:500 .8rem var(--f-num);color:var(--muted)}
.hb-primary,.hb-awake[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.hb-quiet{background:var(--surface);color:var(--ink)}
.hb-count > span{flex:1;font-weight:700}
.hb-step{width:56px;height:56px;border:1.5px solid var(--line);border-radius:12px;background:var(--soft);color:var(--ink);font:800 1.5rem/1 var(--f-body);cursor:pointer}
.hb-step:disabled{opacity:.4}
.hb-n{min-width:2.2em;text-align:center;font:800 1.6rem var(--f-num);color:var(--ink)}
.hb-segs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.hb-seg,.hb-dir{min-height:52px;border:1.5px solid var(--line);border-radius:12px;background:var(--soft);color:var(--ink);font:700 1rem var(--f-body);cursor:pointer}
.hb-seg[aria-pressed="true"],.hb-dir[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.hb-dirs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.hb-dir{min-height:48px;font-size:.95rem}
.hb-note{display:flex;gap:8px;align-items:stretch}
.hb-text{flex:1;min-height:84px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--ink);font:1rem var(--f-body);resize:vertical}
.hb-mic{flex:none;width:56px;border:1.5px solid var(--accent);border-radius:12px;background:var(--surface);color:var(--accent);cursor:pointer}
.hb-mic[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink)}
.hb-offer{display:grid;gap:8px;padding:10px 12px;border-radius:12px;background:var(--soft);color:var(--ink);border-left:4px solid var(--accent)}
.hb-offer p{margin:0}
.hb-cmp{z-index:1700}
@media (min-width:700px){.hb-panel{max-width:560px;margin:0 auto}.hb-btns{max-width:560px;width:100%;margin:0 auto;border-radius:16px 16px 0 0}}

/* ---- Hunt tab (hunt_tab.js) ---- */
.ht{max-width:620px;margin:0 auto;display:grid;gap:12px}
.ht h1{margin:0}
.ht-card{text-decoration:none;display:grid;gap:2px;padding:12px 16px;border-radius:var(--radius);background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.ht-k{font:700 .75rem var(--f-body);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.ht-v{font:800 1.2rem/1.25 var(--f-display);color:var(--ink)}
.ht-stars{color:var(--accent);letter-spacing:1px}
.ht-off{color:var(--muted);opacity:.55}
.ht-why{margin:0;color:var(--muted);font-size:.92rem}
.ht-best{margin:4px 0 0;font-size:.88rem;color:var(--ink)}
.ht-go,.ht-shot,.ht-live{display:grid;gap:2px;width:100%;min-height:92px;padding:14px 18px;text-align:left;border-radius:var(--radius);font:800 1.6rem/1.15 var(--f-display);text-decoration:none;cursor:pointer}
.ht-go{border:0;background:var(--accent);color:var(--accent-ink)}
.ht-go small,.ht-live small{font:500 .92rem var(--f-body)}
.ht-live{border:0;background:var(--olive);color:var(--bg)}
.ht-two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ht-two button{min-height:56px;padding:0 8px;border:1px solid var(--line);border-radius:12px;background:var(--soft);color:var(--ink);font:700 1rem var(--f-body);cursor:pointer}
.ht-shot{border:2px solid var(--bad);background:var(--surface);color:var(--bad)}
.ht-shot small{font:500 .92rem var(--f-body);color:var(--bad)}
.ht-go:focus-visible,.ht-shot:focus-visible,.ht-live:focus-visible{outline:3px solid var(--ink);outline-offset:2px}
.ht-rows{display:grid;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface);color:var(--ink)}
.ht-row{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;padding:8px 14px;border:0;border-top:1px solid var(--line);background:var(--surface);color:var(--ink);
  font:600 1rem var(--f-body);text-align:left;text-decoration:none;cursor:pointer}
.ht-row:first-child{border-top:0}
.ht-row > span{flex:1;min-width:0}
.ht-row small{display:block;color:var(--muted);font-weight:500;font-size:.85rem}
.ht-row::after{content:"›";color:var(--muted);font-size:1.3rem;line-height:1}
.ht-n{flex:none;display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font:700 .8rem var(--f-num)}
.ht-last{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--radius);background:var(--surface);color:var(--ink);border:1px solid var(--line);text-decoration:none}
.ht-last > span{flex:1;min-width:0}
.ht-last strong{display:block;font-family:var(--f-display)}
.ht-last small{display:block;color:var(--muted);font-size:.88rem}
.ht-last em{flex:none;font-style:normal;color:var(--muted);font-size:.92rem}
.ht-backrow{display:inline-flex;align-items:center;min-height:44px;padding:0 4px;color:var(--accent);font-weight:700;text-decoration:none}
.ht-startbox{display:grid;gap:8px}
.ht-blood-top{padding:8px 12px 0;max-width:620px;margin:0 auto}

/* ---- Journal: Hunts (hunt_log.js) ---- */
.hl-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.hl-head h2{margin:0}
.hl-start{margin-left:auto;min-height:48px;padding:0 18px;border:0;border-radius:12px;background:var(--accent);color:var(--accent-ink);font:700 1rem var(--f-body);cursor:pointer}
.hl-board{margin:0 0 10px;padding:10px 12px;border-radius:12px;background:var(--soft);color:var(--ink);font-size:.95rem}
.hl-item > summary{list-style:none}
.hl-item > summary::-webkit-details-marker{display:none}
.hl-item[open] > summary{border-bottom-left-radius:0;border-bottom-right-radius:0}
.hl-body{display:grid;gap:12px;padding:12px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-top:0;border-radius:0 0 12px 12px}
.hl-body > *{margin:0}
.hl-tl{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.hl-tl li{display:grid;grid-template-columns:4.2em 1fr;gap:8px;font-size:.95rem;color:var(--ink)}
.hl-t{font:600 .85rem var(--f-num);color:var(--muted);padding-top:2px}
.hl-k-scent{padding:6px 8px;margin:0 -8px;border-radius:8px;background:var(--soft);color:var(--ink);border-left:4px solid var(--warn);font-weight:700}
.hl-k-scent .hl-t{color:var(--ink)}
.hl-k-shot,.hl-k-found{font-weight:700}
.hl-cols{display:grid;gap:10px}
@media (min-width:560px){.hl-cols{grid-template-columns:1fr 1fr}}
.hl-card{padding:10px 12px;border-radius:12px;background:var(--soft);color:var(--ink)}
.hl-card h3{font-size:1rem;margin:0 0 6px}
.hl-card p{margin:6px 0 0;font-size:.92rem}
.hl-facts{margin:0;padding:0;list-style:none;display:grid;gap:4px;font-size:.92rem}
.hl-muted{color:var(--muted)}
.hl-small{color:var(--muted);font-size:.85rem}
.hl-stars{color:var(--ink);letter-spacing:1px}
.hl-off{color:var(--line)}
.hl-map{height:260px;border-radius:12px;overflow:hidden;background:var(--soft);color:var(--ink)}
.hl-path{stroke:#ff7a3d;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;fill:none}
.hl-path-pins{stroke-dasharray:8 8}
.hl-trackline{stroke:#d0201a;stroke-width:3;stroke-dasharray:2 6;fill:none}
.hl-bed{stroke:#8a5a2b;stroke-width:1.5;fill:#8a5a2b;fill-opacity:.5}
.hl-flag{stroke:#f2b705;stroke-width:3;fill:#f2b705;fill-opacity:.25}
.hl-app{stroke:#ffd27a;stroke-width:3;stroke-dasharray:4 4;fill:none}
.hl-del{justify-self:start;min-height:44px;padding:0 14px;border:1px solid var(--bad);border-radius:10px;background:none;color:var(--bad);font:600 .95rem var(--f-body);cursor:pointer}

/* Lens from the last scout: the hero near the scouted ground, a row elsewhere */
.ht-lens{display:flex;align-items:center;gap:14px;width:100%;min-height:92px;padding:14px 18px;text-align:left;border:0;border-radius:var(--radius);background:var(--ink);color:var(--bg);font:800 1.5rem/1.15 var(--f-display);cursor:pointer}
.ht-lens span{display:grid;gap:2px}
.ht-lens small{font:500 .92rem var(--f-body);opacity:.85}
.ht-lens svg{flex:none}
.ht-lens:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
#ht-lens:empty{display:none}
#ht-lens .ht-row{border-radius:var(--radius)}
