*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1A1410;
  --bg2: #221C16;
  --bg3: #2A231B;
  --gold: #C8A45A;
  --gold-light: #DDB96E;
  --gold-dim: rgba(200,164,90,0.12);
  --gold-border: rgba(200,164,90,0.28);
  --white: #F7F2EA;
  --muted: rgba(247,242,234,0.52);
  --muted2: rgba(247,242,234,0.28);
  --border: rgba(247,242,234,0.09);
  --border2: rgba(247,242,234,0.15);
  --red: #E05252;
  --orange: #E07B30;
  --yellow: #D4B84A;
  --purple: #9B72CF;
  --green: #4CAF7D;
  --radius: 10px;
  --rsm: 6px;
  --panel-width: 340px;
  --topbar-display: flex;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--white); font-family: 'Lato', sans-serif; font-size: 16px; line-height: 1.6; }
.page-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.gold { color: var(--gold); }
.hidden { display: none !important; }

/* TOP BAR */
.tracker-topbar {
  display: var(--topbar-display);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1160px; margin: 0 auto; }
.window-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: 40px; padding: 5px 14px; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--gold); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.25} }
.header-phone { color: var(--white); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.header-phone:hover { color: var(--gold); }

/* SEARCH BAR */
.search-bar-wrap { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 18px 0; }
.search-row { display: flex; gap: 10px; max-width: 700px; }
.search-input { flex: 1; background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius); padding: 13px 18px; font-family: 'Lato', sans-serif; font-size: 15px; color: var(--white); outline: none; transition: border-color 0.2s; min-width: 0; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--gold-border); }
.search-btn { background: var(--gold); color: #1A1410; border: none; border-radius: var(--radius); padding: 13px 24px; font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.18s; flex-shrink: 0; }
.search-btn:hover { background: var(--gold-light); }
.search-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.search-hint { font-size: 12px; color: var(--muted2); margin-top: 8px; }

/* TRACKER LAYOUT — desktop side by side */
.tracker-layout { display: flex; height: 560px; border-bottom: 1px solid var(--border); }

/* MAP */
.map-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.map-toolbar { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-group { display: flex; gap: 6px; }
.filter-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: 40px; padding: 5px 13px; font-size: 12px; color: var(--muted); cursor: pointer; font-family: 'Lato', sans-serif; transition: all 0.15s; }
.filter-btn:hover { border-color: var(--gold-border); color: var(--white); }
.filter-btn.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }
.map-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; }
.ldot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
#map { flex: 1; width: 100%; min-height: 200px; }
.mobile-map-hint { display: none; text-align: center; font-size: 11px; color: var(--muted2); padding: 8px; background: var(--bg2); border-top: 1px solid var(--border); }

/* SIDE PANEL */
.side-panel { width: var(--panel-width); background: var(--bg2); border-left: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; }
.panel-state { padding: 24px 20px; flex: 1; display: flex; flex-direction: column; }
.panel-state.hidden { display: none; }

#panel-default { align-items: center; text-align: center; justify-content: center; }
.panel-icon { font-size: 36px; margin-bottom: 14px; opacity: 0.6; }
#panel-default h3 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; margin-bottom: 10px; }
#panel-default p { font-size: 13px; color: var(--muted); margin-bottom: 8px; line-height: 1.65; }
.quick-stats { width: 100%; margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.qs-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--bg3); border-radius: var(--rsm); font-size: 13px; }
.qs-label { color: var(--muted); }
.qs-val { font-family: 'DM Mono', monospace; color: var(--gold); font-size: 14px; }

.panel-back { font-size: 12px; color: var(--gold); cursor: pointer; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 4px; }
.panel-back:hover { color: var(--gold-light); }

.event-type-tag { display: inline-block; border-radius: 4px; padding: 3px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 8px; }
.hail-tag { background: rgba(224,82,82,0.15); color: var(--red); }
.wind-tag { background: rgba(200,164,90,0.15); color: var(--gold); }
.event-header h3 { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.event-meta { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

.event-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.estat-box { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--rsm); padding: 10px 8px; text-align: center; }
.estat-num { display: block; font-family: 'DM Mono', monospace; font-size: 18px; color: var(--gold); font-weight: 500; line-height: 1.2; }
.estat-label { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; letter-spacing: 0.04em; }

.panel-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.ptab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 13px; color: var(--muted); cursor: pointer; font-family: 'Lato', sans-serif; transition: all 0.15s; margin-bottom: -1px; }
.ptab.active { color: var(--gold); border-bottom-color: var(--gold); }
.ptab-content { flex: 1; }

.canvass-block { margin-bottom: 14px; }
.canvass-label { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.12em; color: var(--gold); text-transform: uppercase; margin-bottom: 5px; }
.canvass-action { font-size: 13px; color: var(--white); line-height: 1.5; }
.canvass-script { background: var(--bg3); border-left: 3px solid var(--gold-border); border-radius: 0 var(--rsm) var(--rsm) 0; padding: 10px 12px; font-size: 12px; color: var(--white); line-height: 1.6; font-style: italic; }
.canvass-lookfor { font-size: 12px; color: var(--muted); line-height: 1.6; }

.ins-verdict { border-radius: var(--rsm); padding: 12px 14px; font-size: 13px; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.ins-detail { font-size: 13px; color: var(--muted); line-height: 1.65; }
.wind-info-block { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--rsm); padding: 14px; font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 20px; flex: 1; }

.addr-verdict-wrap { margin-bottom: 16px; }
.addr-verdict { display: inline-flex; align-items: center; gap: 6px; border-radius: 40px; padding: 5px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 6px; }
.verdict-yes { background: rgba(76,175,125,0.15); color: #4CAF7D; border: 1px solid rgba(76,175,125,0.3); }
.verdict-no { background: rgba(247,242,234,0.07); color: var(--muted); border: 1px solid var(--border); }
.verdict-severe { background: rgba(224,82,82,0.15); color: #E05252; border: 1px solid rgba(224,82,82,0.35); animation: severepulse 2s ease-in-out infinite; }
.verdict-monitor { background: rgba(212,184,74,0.12); color: var(--yellow); border: 1px solid rgba(212,184,74,0.3); }
@keyframes severepulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.addr-label { font-size: 12px; color: var(--muted); }

.events-feed { flex: 1; margin-bottom: 16px; overflow-y: auto; max-height: 180px; }
.feed-section-label { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.12em; color: var(--gold); text-transform: uppercase; padding: 8px 0 4px; }
.feed-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.feed-date { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 11px; }
.feed-detail { color: var(--white); flex: 1; padding: 0 8px; }
.size-pill { font-family: 'DM Mono', monospace; font-size: 10px; border-radius: 3px; padding: 2px 6px; flex-shrink: 0; }
.sp-green  { background: rgba(125,184,122,0.15); color: #7DB87A; }
.sp-yellow { background: rgba(212,184,74,0.15); color: var(--yellow); }
.sp-orange { background: rgba(224,123,48,0.15); color: var(--orange); }
.sp-red    { background: rgba(224,82,82,0.15); color: var(--red); }
.sp-purple { background: rgba(155,114,207,0.15); color: var(--purple); }
.sp-wind   { background: rgba(200,164,90,0.12); color: var(--gold); }

.panel-cta-btn { width: 100%; background: var(--gold); color: #1A1410; border: none; border-radius: var(--radius); padding: 13px; font-family: 'Lato', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.18s; margin-top: auto; }
.panel-cta-btn:hover { background: var(--gold-light); }
.panel-cta-sub { font-size: 11px; color: var(--muted2); text-align: center; margin-top: 7px; }

/* NOAA OFFICIAL REPORT BUTTON — visual anchor alongside hail size */
.noaa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; background: var(--gold-dim); border: 1.5px solid var(--gold); border-radius: var(--radius); padding: 11px 14px; font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 700; color: var(--gold); text-decoration: none; text-align: center; cursor: pointer; transition: all 0.18s; margin: 12px 0 4px; }
.noaa-btn:hover { background: rgba(200,164,90,0.22); color: var(--gold-light); }
.noaa-btn .noaa-shield { font-size: 16px; line-height: 1; }
.noaa-btn-sub { font-size: 11px; color: var(--muted2); text-align: center; margin-bottom: 10px; line-height: 1.4; }

/* REP TAB HERO — exact hail size + category leads */
.rep-hero { display: flex; align-items: baseline; gap: 10px; padding: 4px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.rep-hero-size { font-family: 'DM Mono', monospace; font-size: 34px; font-weight: 500; color: var(--gold); line-height: 1; }
.rep-hero-cat { font-size: 13px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.05em; }

/* HOMEOWNER TAB — simple, phone-first */
.ho-block { margin-bottom: 12px; font-size: 13px; color: var(--white); line-height: 1.6; }
.ho-block strong { color: var(--gold); }
.ho-lead { font-size: 15px; font-weight: 700; color: var(--white); line-height: 1.5; margin-bottom: 10px; }
.ho-lead .ho-size { font-family: 'DM Mono', monospace; font-size: 22px; color: var(--gold); }

/* Per-event NOAA link inside address results feed */
.feed-noaa { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--gold); text-decoration: none; margin-left: 8px; flex-shrink: 0; border: 1px solid var(--gold-border); border-radius: 3px; padding: 2px 6px; }
.feed-noaa:hover { background: var(--gold-dim); }

/* MODAL — properly hidden until opened */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #221C16; border: 1px solid rgba(200,164,90,0.25); border-radius: 14px; padding: 32px 28px; width: 100%; max-width: 460px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: rgba(247,242,234,0.4); font-size: 18px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--white); }
.modal-eyebrow { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.16em; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 600; color: var(--white); margin-bottom: 8px; }
.modal-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-family: 'DM Mono', monospace; letter-spacing: 0.06em; }
.form-input { width: 100%; background: #2A231B; border: 1px solid rgba(247,242,234,0.12); border-radius: 8px; padding: 12px 14px; font-family: 'Lato', sans-serif; font-size: 15px; color: var(--white); outline: none; transition: border-color 0.2s; }
.form-input::placeholder { color: rgba(247,242,234,0.25); }
.form-input:focus { border-color: var(--gold-border); }
.form-submit { width: 100%; background: var(--gold); color: #1A1410; border: none; border-radius: var(--radius); padding: 15px; font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.18s; margin-top: 8px; }
.form-submit:hover { background: var(--gold-light); }
.form-success { text-align: center; padding: 20px 0; }
.success-icon { width: 52px; height: 52px; border-radius: 50%; background: rgba(76,175,125,0.15); border: 1px solid rgba(76,175,125,0.3); color: #4CAF7D; font-size: 22px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.form-success h3 { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--white); margin-bottom: 8px; }
.form-success p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.modal-disclaimer { font-size: 11px; color: var(--muted2); text-align: center; margin-top: 16px; }

/* BELOW MAP */
.below-map { padding: 60px 0; border-bottom: 1px solid var(--border); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 56px; }
.info-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; }
.info-icon { font-size: 24px; margin-bottom: 12px; }
.info-card h4 { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.info-card p { font-size: 13px; color: var(--muted); line-height: 1.65; }

.faq-section { max-width: 720px; }
.section-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 600; margin-bottom: 24px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 18px 0; font-family: 'Lato', sans-serif; font-size: 15px; color: var(--white); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chev { font-size: 18px; color: var(--gold); transition: transform 0.2s; flex-shrink: 0; }
.faq-q.open .chev { transform: rotate(180deg); }
.faq-a { display: none; padding-bottom: 18px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.faq-a.open { display: block; }

.disclaimer { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--gold-border); border-radius: 0 var(--rsm) var(--rsm) 0; padding: 16px 20px; font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 40px; }
.disclaimer strong { color: var(--gold); font-weight: 400; }

/* BOTTOM CTA */
.bottom-cta { padding: 72px 0; background: var(--bg2); border-top: 1px solid var(--border); }
.bottom-cta h2 { font-family: 'Playfair Display', serif; font-size: clamp(24px, 3.5vw, 38px); font-weight: 600; margin-bottom: 12px; }
.bottom-cta p { font-size: 15px; color: var(--muted); max-width: 500px; margin: 0 auto 28px; }
.cta-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-gold { background: var(--gold); color: #1A1410; border: none; border-radius: var(--radius); padding: 15px 32px; font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.18s; text-decoration: none; display: inline-block; }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; color: var(--white); border: 1px solid var(--border2); border-radius: var(--radius); padding: 15px 32px; font-family: 'Lato', sans-serif; font-size: 15px; cursor: pointer; transition: border-color 0.18s; text-decoration: none; display: inline-block; }
.btn-outline:hover { border-color: var(--gold-border); color: var(--gold); }

/* LEAFLET */
.leaflet-popup-content-wrapper { background: #221C16; border: 1px solid rgba(200,164,90,0.3); border-radius: 8px; color: #F7F2EA; box-shadow: none; }
.leaflet-popup-tip { background: #221C16; }
.leaflet-popup-content { margin: 12px 16px; font-family: 'Lato', sans-serif; font-size: 13px; }
.leaflet-control-attribution { display: none; }
.leaflet-control-zoom a { background: #221C16 !important; color: #C8A45A !important; border-color: rgba(247,242,234,0.12) !important; }
.leaflet-control-zoom a:hover { background: #2A231B !important; }

/* MOBILE */
@media (max-width: 768px) {
  .tracker-layout {
    flex-direction: column;
    height: auto;
  }
  .map-col {
    height: 280px;
    flex-shrink: 0;
    width: 100%;
  }
  #map {
    height: 100%;
    width: 100%;
  }
  .mobile-map-hint { display: block; }
  .side-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    min-height: 260px;
    max-height: none;
  }
  .search-row { flex-direction: column; }
  .search-btn { width: 100%; }
  .map-legend { display: none; }
  .header-phone { display: none; }
  .below-map { padding: 40px 0; }
  .info-grid { grid-template-columns: 1fr; gap: 14px; }
  .modal-box { padding: 24px 18px; }
}
@media (max-width: 420px) {
  .page-wrap { padding: 0 14px; }
  .tracker-topbar { padding: 8px 14px; }
  .map-col { height: 240px; }
}
