/* Hail Knock chrome. Owner rules: dark/light CHROME only via tokens; the
   basemap is always CARTO voyager — theme NEVER touches map tiles. */
:root {
  --bg: #12151c; --panel: #1b2029; --ink: #eef2f7; --ink-dim: #9fb0c3;
  --accent: #14C2B2; --warn: #FFCC2C; --danger: #c62828; --line: #2a3140;
  --chip: #232a37; --chip-on: #14C2B2;
}
html[data-theme="light"] {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #16202c; --ink-dim: #5a6a7d;
  --chip: #e8edf3; --line: #d7dee8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* our display:flex panels would
   otherwise override the hidden attr and swallow clicks */
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, Roboto, sans-serif; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.msym { font-family: "Material Symbols Outlined"; font-weight: normal;
  font-style: normal; line-height: 1; letter-spacing: normal;
  -webkit-font-smoothing: antialiased; font-size: 24px; }

/* login */
#login { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; }
.lcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: min(88vw, 340px); display: flex; flex-direction: column; gap: 10px; }
.brand { font-size: 26px; font-weight: 800; }
.brand span { color: var(--accent); }
.lcard input { padding: 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); }
.err { color: #ff6b6b; min-height: 1em; font-size: 12px; }

/* top bar (dark chrome, orange rule like theirs but tokenized) */
#top { position: fixed; top: 0; left: 0; right: 0; height: calc(54px + env(safe-area-inset-top, 0px)); z-index: 900;
  display: flex; align-items: center; gap: 4px; padding: env(safe-area-inset-top, 0px) 6px 0;
  background: var(--panel); border-bottom: 3px solid var(--warn); }
.spacer { flex: 1; }
#map { position: fixed; inset: calc(57px + env(safe-area-inset-top, 0px)) 0 0 0; z-index: 1; }

/* alert strip (A1.2 parity: translucent bold white centered) */
#alertStrip { position: fixed; top: calc(57px + env(safe-area-inset-top, 0px)); left: 0; right: 0; z-index: 850;
  background: rgba(255, 140, 0, .78); color: #fff; font-weight: 700;
  text-align: center; padding: 6px; }

/* chips */
.chip { background: var(--chip); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 5px 11px; font-size: 13px; }
.chip.on { background: var(--chip-on); color: #04231f; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.mini { font-size: 12px; padding: 3px 8px; }
button.primary { background: var(--accent); color: #04231f; font-weight: 700;
  border-radius: 10px; padding: 9px 14px; }

/* FAB */
#fab { position: fixed; right: 16px; bottom: 20px; z-index: 900; width: 56px;
  height: 56px; border-radius: 50%; background: var(--warn); color: #402;
  font-size: 28px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#fabMenu { position: fixed; right: 16px; bottom: 86px; z-index: 900;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; min-width: 190px; padding: 6px; }
#fabMenu button { display: flex; gap: 10px; align-items: center; padding: 9px;
  border-radius: 8px; text-align: left; }
#fabMenu button:hover, #fabMenu button:active { background: var(--chip); }

/* drawer */
.sheet-left { position: fixed; top: calc(57px + env(safe-area-inset-top, 0px)); bottom: 0; left: 0; z-index: 950; width: 280px;
  background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto;
  padding-bottom: 20px; }
.dsec { color: var(--warn); font-weight: 800; font-size: 11px; letter-spacing: .8px;
  padding: 14px 14px 4px; }
.sheet-left button { display: block; width: 100%; text-align: left; padding: 11px 16px; }
.pop { position: fixed; top: calc(57px + env(safe-area-inset-top, 0px)); right: 0; z-index: 950; width: 260px;
  background: var(--panel); border-left: 1px solid var(--line); padding: 8px; }
.pop button { display: block; width: 100%; text-align: left; padding: 10px; }
.who { font-weight: 800; padding: 8px; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.about { padding: 8px; color: var(--ink-dim); font-size: 12px; }

/* date strip */
#dateStrip { position: fixed; left: 0; right: 0; top: calc(57px + env(safe-area-inset-top, 0px)); z-index: 880;
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px;
  display: flex; gap: 6px; align-items: center; overflow-x: auto; }
#stormRow { display: flex; gap: 6px; }

/* marker sheet (B: single scroll card + sticky footer) */
#sheet, #noteForm, #spotterForm, #options, #leader, #contactForm,
#datesPanel, #reportPanel, #filterPanel, #searchPanel, #addrPanel,
#alertPanel, #nearbyPanel, #photoPanel, #dbgPanel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 960; max-height: 72vh;
  background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column; }
#noteForm, #spotterForm, #options, #leader, #contactForm,
#datesPanel, #reportPanel, #filterPanel, #searchPanel, #addrPanel,
#alertPanel, #nearbyPanel, #photoPanel, #dbgPanel { padding: 14px; gap: 8px; overflow-y: auto; }
.shead { padding: 10px 12px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.sbody { overflow-y: auto; padding: 10px 12px; flex: 1; }
.sfoot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 12px;
  background: var(--panel); border-top: 1px solid var(--line); }
.row { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tabs { display: flex; gap: 6px; margin: 8px 0 4px; }
.tabs button { padding: 6px 10px; border-radius: 8px; background: var(--chip); }
.tabs button.on { background: var(--chip-on); color: #04231f; font-weight: 700; }
.note { padding: 6px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; margin: 3px; }
textarea, input[type=text], #spNotes, #nfText { background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
tr[data-uid] { cursor: pointer; }

/* cluster bubble counts + toast */
.clCount { background: none !important; border: none !important; box-shadow: none !important;
  color: #fff; font-weight: 800; font-size: 13px; }
#toast { position: fixed; top: calc(70px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 1200; background: #0d1117ee; color: #fff; padding: 10px 16px;
  border-radius: 10px; max-width: 86vw; }

/* canvass mode bars */
#canvassBar { position: fixed; left: 8px; bottom: 88px; z-index: 900;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
#canvassStrip { max-width: 86vw; }
#hintPill { background: rgba(0,0,0,.65); color: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; max-width: 86vw; }
#routeBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 905;
  background: var(--panel); border-top: 1px solid var(--line); padding: 10px;
  display: flex; gap: 8px; align-items: center; }
#routeSave { position: fixed; left: 8px; right: 8px; bottom: 90px; z-index: 970;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px; }
#canvassPill.on { background: var(--chip-on); color: #04231f; font-weight: 700; }
.greenCell { color: #2e7d32; font-weight: 700; }
html[data-theme="dark"] .greenCell { color: #66bb6a; }

/* swath legend (A2.1 amber->red ramp) */
#legend { position: fixed; right: 8px; bottom: 200px; z-index: 890;
  background: rgba(20,20,20,.78); color: #fff; border-radius: 10px;
  padding: 8px 10px; font-size: 11px; line-height: 1.5; }
#legend i { display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; margin-right: 6px; vertical-align: -2px; }

/* hail finder + hail replay sheets (same idiom as #options/#leader) */
#finder, #replay { position: fixed; left: 0; right: 0; bottom: 0; z-index: 960;
  max-height: 72vh; background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 14px; display: flex;
  flex-direction: column; gap: 8px; overflow-y: auto; }
#replay { max-height: 46vh; }
#finder h4, #replay h4 { margin: 0; display: flex; justify-content:
  space-between; align-items: center; }
.miniR { margin-left: auto; }
#fResults .fRow { padding: 10px 6px; border-bottom: 1px solid var(--line);
  cursor: pointer; }
#fResults .fRow.on { background: var(--chip-on); color: #04231f; }
/* the range chip row must never be flex-shrunk under the rows (with 40
   storm days #fResults used to squeeze #fRanges to 0px and swallow the
   chip clicks); only the results list scrolls */
#fRanges { flex: 0 0 auto; }
#fResults { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#fResults .fRow b { font-size: 14px; }
#fResults .hint { color: #999; padding: 8px 0; }
.chipOn { background: var(--chip-on); color: #04231f; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; }
#rCtl { display: flex; gap: 8px; align-items: center; }
#rCtl button { font-size: 18px; min-width: 46px; }
#rTimeline { display: flex; align-items: flex-end; gap: 1px; height: 48px;
  overflow-x: auto; background: rgba(0,0,0,.15); border-radius: 8px;
  padding: 2px; }
#rTimeline .tBar { min-width: 6px; height: 100%; }
#rTimeline .tBar.sel { outline: 2px solid var(--chip-on); }

/* team + follow-ups + notifications sheets (same idiom as #options/#leader) */
#teamPanel, #fuPanel, #notifPanel { position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 960; max-height: 72vh; background: var(--panel);
  border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; }
#teamPanel h4, #fuPanel h4, #notifPanel h4 { margin: 0; display: flex;
  justify-content: space-between; align-items: center; }
#tpTable { width: 100%; }
#tpTable td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
#tpTable button { color: var(--danger); font-size: 12px; }
#teamPanel input, #teamPanel select { padding: 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
#fuList .fuRow { padding: 10px 6px; border-bottom: 1px solid var(--line); }
#fuList .fuRow.due { border-left: 3px solid var(--warn); padding-left: 8px; }
#fuList .fuRow button { color: var(--accent); font-weight: 700; }
#notifPanel .npSec { font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--muted, #889); margin-top: 6px; }
#notifPanel .npRow { padding: 6px 0; border-bottom: 1px solid var(--line); }
#notifPanel .npRow button.link { color: var(--danger); font-size: 12px; }
#notifPanel .npHint { font-size: 12px; color: var(--muted, #889); }
#notifPanel select, #notifPanel button { padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

.leaflet-container { background: #aab; }

/* territory labels + date-strip impact dots (A2.5 parity) */
.terrLbl { color: #0f766e; font-weight: 700; font-size: 10px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff; background: none; border: none; }
#stormRow .chip i.dot { font-style: normal; letter-spacing: 1px;
  color: #e08f00; margin-left: 4px; }
#stormRow .chip.on { outline: 2px solid #14C2B2; }

/* spotter report pins (marker pane, above swaths): drop-shadow pops the
   teardrop off red swath fills; no divIcon default chrome */
.spotPin { background: none; border: none; }
.spotPin svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
  display: block; }

/* legend collapsed chip (owner: 10-row card covered too much screen):
   tap the gradient chip to pin the full ramp open/closed */
#legend .legHead { background: none; border: none; color: inherit;
  font: inherit; cursor: pointer; padding: 0; display: flex;
  align-items: center; gap: 6px; width: 100%; }
#legend .legGrad { width: 26px; height: 12px; border-radius: 3px;
  margin: 0; display: inline-block;
  background: linear-gradient(90deg, #FFCC00, #CC6600, #FF0000); }

/* the draggable blue dot */
.meDot { background: none; border: none; cursor: grab; }
.meDot:active { cursor: grabbing; }
.meDot svg { display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

/* wave-1 parity chrome: marker number, inline fields, tags, contacts,
   dates rows, reports list, base-map segment */
.mnum { font-size: 11px; color: var(--ink-dim); font-weight: 700; }
.inlineIn { width: 100%; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--ink); }
.tag { background: var(--chip); border-radius: 999px; padding: 2px 8px;
  font-size: 12px; display: inline-block; }
.tag b { color: var(--danger); cursor: pointer; margin-left: 3px; }
.crow { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.csub { font-size: 12px; color: var(--ink-dim); }
.star { color: var(--warn); font-size: 11px; }
.dhead { font-size: 11px; color: var(--ink-dim); padding-bottom: 4px; }
.drow { padding: 6px 0; border-bottom: 1px solid var(--line); }
.drow.sel { outline: 2px solid var(--accent); }
#oBase button { background: var(--chip); border-radius: 8px; padding: 5px 10px; }
#oBase button.on { background: var(--chip-on); color: #04231f; font-weight: 700; }
#notifPanel input[type=time] { background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
#photoPanel .phBig { width: 100%; max-height: 42vh; object-fit: contain;
  border-radius: 10px; background: #000; }

/* wave-2 screens: search results, alert list, filter chips */
#msFilter, #msResults, #faResults, #alList { font-size: 13px; }
.sRow { padding: 8px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; }
.sRow:hover { background: var(--chip); }
.sRowTop { font-size: 11px; color: var(--ink-dim); }
.alDay { font-size: 11px; font-weight: 700; color: var(--ink-dim);
  padding: 8px 0 2px; letter-spacing: .5px; }
.alRow { padding: 7px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; }
.alRow:hover { background: var(--chip); }
.alType { font-size: 10px; font-weight: 700; color: #e08f00;
  letter-spacing: .4px; }
#fpTeam .chip, #fpStatus .chip, #fpTags .chip { cursor: pointer; }
#fpMap.on { background: var(--chip-on); color: #04231f; font-weight: 700; }
