/* ============================================================================
   fire-panels.css — Shared slide-over panel system for ACTIVE-FIRE pages.
   ----------------------------------------------------------------------------
   A trimmed, SCOPED copy of the weather-station stylesheet: only the button
   strip, slide-over panel and panel-content styles — none of the weather
   page's body/header/map layout rules, so it can't disturb the fire page.

   Variables are declared on .sbw-scope (NOT :root) because the fire pages
   define their own --ink/--line/--shadow. Put class="sbw-scope" on the
   #sbw-strip nav and the #sbw-panel aside.
   ========================================================================== */

.sbw-scope {
  --rust:        #8C3B2E;
  --rust-dark:   #6E2C22;
  --rust-tint:   #B4583F;
  --cream:       #F7F2E7;
  --cream-2:     #FBF8F0;
  --cream-panel: #FCFAF3;
  --ink:         #211D18;
  --ink-soft:    #4A4239;
  --slate:       #5E6B78;
  --slate-2:     #8A97A3;
  --line:        #E4DCC9;
  --line-2:      #D6CCB4;

  --low:      #3C7A4B;
  --low-bg:   #E7F0E4;
  --mod:      #B67B12;
  --mod-bg:   #FBF0D8;
  --high:     #C24A16;
  --high-bg:  #FBE3D3;
  --extreme:  #A32020;
  --extreme-bg:#F7D9D6;

  --sans: "Source Sans 3", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --shadow: 0 10px 30px rgba(33,29,24,0.18);
  --num: "tnum" 1, "lnum" 1;

  font-family: var(--sans);
  color: var(--ink);
}
.sbw-scope .num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: var(--num); }

/* ---- Button strip --------------------------------------------------- */
.sbw-strip {
  display: flex; gap: 8px;
  padding: 10px 2px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
}
.sbw-btn {
  position: relative;
  flex: 0 0 auto;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 15px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.sbw-btn:hover { border-color: var(--rust-tint); box-shadow: 0 2px 6px rgba(140,59,46,0.12); }
.sbw-btn:active { transform: translateY(1px); }
.sbw-btn-badge {
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: var(--slate-2); color: #fff; letter-spacing: .2px;
}
.sbw-btn-badge.dot-only { padding: 0; width: 9px; height: 9px; border-radius: 50%; }
.sbw-btn.tone-ok    .sbw-btn-badge { background: var(--low); }
.sbw-btn.tone-warn  { border-color: var(--mod); background: var(--mod-bg); }
.sbw-btn.tone-warn  .sbw-btn-badge { background: var(--mod); }
.sbw-btn.tone-alert { border-color: var(--extreme); background: var(--extreme-bg); }
.sbw-btn.tone-alert .sbw-btn-badge { background: var(--extreme); }
.sbw-strip-fallback { font: 500 13px/1.4 var(--sans, system-ui); color: #8C3B2E; padding: 6px 2px; }

/* ---- Slide-over panel ---------------------------------------------- */
.sbw-backdrop {
  position: fixed; inset: 0; background: rgba(33,29,24,0.42);
  z-index: 1000; backdrop-filter: blur(1px);
}
.sbw-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 92vw;
  background: var(--cream-panel); z-index: 1001; box-shadow: -12px 0 34px rgba(33,29,24,0.28);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
}
.sbw-panel.open { transform: translateX(0); }
.sbw-panel-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--rust); color: var(--cream);
  border-bottom: 3px solid var(--rust-dark);
}
.sbw-panel-title { font-family: var(--serif); font-weight: 700; font-size: 19px; margin: 0; }
.sbw-panel-close {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.4); color: #fff;
  width: 32px; height: 32px; border-radius: 8px; font-size: 22px; line-height: 1; cursor: pointer;
}
.sbw-panel-close:hover { background: rgba(255,255,255,0.28); }
.sbw-panel-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px 40px; }

/* ---- Panel content primitives -------------------------------------- */
.sbw-scope .sbw-note { color: var(--slate); font-style: italic; background: var(--cream); border: 1px dashed var(--line-2); border-radius: 8px; padding: 12px; }
.sbw-scope .sbw-empty { color: var(--slate); background: var(--low-bg); border-radius: 8px; padding: 16px; text-align: center; }
.sbw-scope .sbw-muted { color: var(--slate-2); font-size: 11.5px; margin-top: 12px; }
.sbw-scope .sbw-context { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 14px; }
.sbw-scope .sbw-subhead { font-family: var(--serif); font-size: 15px; margin: 20px 0 8px; }

.sbw-scope .sbw-readout { border-radius: 10px; padding: 13px 15px; font-size: 14px; line-height: 1.45; margin-bottom: 16px; border-left: 5px solid var(--slate); background: var(--cream); }
.sbw-scope .sbw-readout.cat-low { border-left-color: var(--low); background: var(--low-bg); }
.sbw-scope .sbw-readout.cat-mod { border-left-color: var(--mod); background: var(--mod-bg); }
.sbw-scope .sbw-readout.cat-high { border-left-color: var(--high); background: var(--high-bg); }
.sbw-scope .sbw-readout.cat-extreme { border-left-color: var(--extreme); background: var(--extreme-bg); }

/* tables */
.sbw-scope .sbw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sbw-scope .sbw-table th { text-align: left; font-weight: 700; color: var(--slate); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; border-bottom: 2px solid var(--line-2); }
.sbw-scope .sbw-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.sbw-scope .sbw-table td.num, .sbw-scope .sbw-table th.num { text-align: right; }
.sbw-scope .sbw-table tbody tr.cat-low { background: var(--low-bg); }
.sbw-scope .sbw-table tbody tr.cat-mod { background: var(--mod-bg); }
.sbw-scope .sbw-table tbody tr.cat-high { background: var(--high-bg); }
.sbw-scope .sbw-table tbody tr.cat-extreme { background: var(--extreme-bg); }
.sbw-scope .sbw-table-hover tbody tr { cursor: pointer; }
.sbw-scope .sbw-table-hover tbody tr:hover { background: var(--cream); box-shadow: inset 3px 0 0 var(--rust); }
.sbw-scope .sbw-stn { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sbw-scope .sbw-row-flash { animation: sbwrowflash 1.6s ease; }
@keyframes sbwrowflash { 0%,100% { background: transparent; } 20% { background: #FBF0D8; } }

.sbw-scope .pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.sbw-scope .pill.cat-low { background: var(--low); color: #fff; }
.sbw-scope .pill.cat-mod { background: var(--mod); color: #fff; }
.sbw-scope .pill.cat-high { background: var(--high); color: #fff; }
.sbw-scope .pill.cat-extreme { background: var(--extreme); color: #fff; }
.sbw-scope .flag { color: var(--high); }
.sbw-scope .dot { width: 10px; height: 10px; display: inline-block; flex: 0 0 auto; }
.sbw-scope .dot.asos { border-radius: 50%; background: var(--slate); }
.sbw-scope .dot.raws { width: 0; height: 0; background: none;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid var(--rust); }

/* card grid + metric grid */
.sbw-scope .sbw-cardgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sbw-scope .sbw-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.sbw-scope .sbw-card-name { font-size: 12.5px; color: var(--slate); font-weight: 600; }
.sbw-scope .sbw-card-main { font-size: 24px; font-weight: 700; color: var(--rust-dark); line-height: 1.1; margin-top: 3px; }
.sbw-scope .sbw-unit { font-size: 12px; color: var(--slate); font-weight: 600; }
.sbw-scope .sbw-card-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.sbw-scope .sbw-metricgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sbw-scope .sbw-metric { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.sbw-scope .sbw-metric-val { font-size: 26px; font-weight: 700; color: var(--rust-dark); }
.sbw-scope .sbw-metric-lbl { font-size: 12px; color: var(--slate); margin-top: 4px; font-weight: 600; }

/* gust bar chart */
.sbw-scope .sbw-bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 8px 4px 0; background: var(--cream); border-radius: 10px; }
.sbw-scope .sbw-bar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.sbw-scope .sbw-bar-fill { width: 60%; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--slate); }
.sbw-scope .sbw-bar-fill.cat-low { background: var(--low); }
.sbw-scope .sbw-bar-fill.cat-mod { background: var(--mod); }
.sbw-scope .sbw-bar-fill.cat-high { background: var(--high); }
.sbw-scope .sbw-bar-val { font-size: 11px; font-weight: 700; margin-top: 3px; }
.sbw-scope .sbw-bar-lbl { font-size: 9.5px; color: var(--slate); margin-top: 1px; }

/* NWS alerts */
.sbw-scope .sbw-alert { border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.sbw-scope .sbw-alert.sev-extreme, .sbw-scope .sbw-alert.sev-severe { border-color: var(--extreme); }
.sbw-scope .sbw-alert-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--cream); border: none; padding: 11px 13px; cursor: pointer; font-family: var(--sans); text-align: left; }
.sbw-scope .sbw-alert.sev-extreme .sbw-alert-head, .sbw-scope .sbw-alert.sev-severe .sbw-alert-head { background: var(--extreme-bg); }
.sbw-scope .sbw-alert-event { font-weight: 700; font-size: 14px; }
.sbw-scope .sbw-alert-sev { font-size: 11px; font-weight: 700; color: var(--extreme); text-transform: uppercase; }
.sbw-scope .sbw-alert-body { padding: 0 13px 13px; font-size: 13px; }
.sbw-scope .sbw-alert-when { font-weight: 600; color: var(--ink-soft); margin: 8px 0; }
.sbw-scope .sbw-alert-area { color: var(--slate); font-size: 12px; margin-bottom: 8px; }
.sbw-scope .sbw-alert-desc { line-height: 1.5; color: var(--ink-soft); }

/* NWS text forecast */
.sbw-scope .sbw-fcst { border-bottom: 1px solid var(--line); padding: 12px 0; }
.sbw-scope .sbw-fcst-name { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.sbw-scope .sbw-fcst-temp { color: var(--rust-dark); }
.sbw-scope .sbw-fcst-text { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin-top: 4px; }

/* skeleton loader */
.sbw-scope .sbw-skeleton .sk-line, .sbw-scope .sbw-skeleton .sk-block { background: linear-gradient(90deg, var(--line) 25%, var(--cream) 50%, var(--line) 75%); background-size: 200% 100%; animation: sbwshimmer 1.3s infinite; border-radius: 6px; }
.sbw-scope .sk-line { height: 14px; margin-bottom: 10px; }
.sbw-scope .sk-line.short { width: 60%; }
.sbw-scope .sk-block { height: 160px; margin-top: 16px; }
@keyframes sbwshimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* wind panel extras */
.sbw-scope .sbw-dir-arrow {
  display: inline-block; font-size: 12px; line-height: 1;
  transform-origin: 50% 50%; color: var(--rust, #b3512f);
}
.sbw-scope .sbw-windflow { margin: 10px 0 4px; }
.sbw-scope .sbw-windy { width: 100%; height: 320px; border: 0; border-radius: 10px; display: block; background: #e8e4da; }
.sbw-scope .sbw-xscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
.sbw-scope .sbw-xscroll .sbw-table { min-width: 560px; }
.sbw-scope .sbw-table tr.cat-mod  td { background: rgba(217, 119, 6, 0.10); }
.sbw-scope .sbw-table tr.cat-high td { background: rgba(179, 45, 30, 0.12); }

/* progression + evac + shelter list items */
.sbw-scope .sbw-zone { border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; margin-bottom: 8px; background: #fff; }
.sbw-scope .sbw-zone.zone-order { border-left: 5px solid var(--extreme); background: var(--extreme-bg); }
.sbw-scope .sbw-zone.zone-warning { border-left: 5px solid var(--mod); background: var(--mod-bg); }
.sbw-scope .sbw-zone-name { font-weight: 700; font-size: 14px; }
.sbw-scope .sbw-zone-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }

/* ---- Mobile --------------------------------------------------------- */
@media (max-width: 640px) {
  .sbw-panel { width: 100vw; max-width: 100vw; }
  .sbw-strip { padding: 8px 2px; }
  .sbw-scope .sbw-cardgrid, .sbw-scope .sbw-metricgrid { grid-template-columns: 1fr 1fr; }
}
