:root { --primary:#2c3e50; --accent:#3498db; --bg:#f4f7f6; }

#app-wrapper{
  font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
  background:var(--bg);
  padding:20px;
  border-radius:12px;
  max-width:1200px;
  margin:auto;
}

.main-header{
  text-align:center;
  margin-bottom:15px;
  border-bottom:2px solid var(--primary);
  padding-bottom:10px;
}
.main-header h1{
  margin:0;
  color:var(--primary);
  font-size:30px;
  text-transform:uppercase;
}

.middle-section{
  display:flex;
  height:600px;
  margin-bottom:20px;
  gap:15px;
}
.content-stack{ flex:3; display:flex; flex-direction:column; gap:10px; }

#nws-top-bar{
  height:20%;
  background:#fff;
  border:1px solid #ddd;
  border-radius:8px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.nws-header{
  padding:6px 15px;
  background:#cc7000;
  color:white;
  font-weight:bold;
  font-size:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid #ddd;
}
.nws-content{
  flex:1;
  overflow-y:auto;
  padding:10px 15px;
  font-size:13px;
  border-top:2px solid var(--accent);
}

#map{ height:80%; border-radius:8px; border:1px solid #ccc; cursor:crosshair; }

#sidebar{
  flex:1;
  padding:20px;
  background:#fff;
  border-radius:8px;
  border:1px solid #ddd;
  overflow-y:auto;
}
#sidebar select{
  width:100%;
  padding:4px;
  margin-top:3px;
  font-size:11px;
}
#sidebar label{
  font-size:10px;
  font-weight:bold;
  margin-top:12px;
  display:block;
  text-transform:uppercase;
  color:#555;
}
.filter-option{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  font-size:10px !important;
  font-weight:bold;
  cursor:pointer;
  text-transform:none;
}

.station-box{
  margin-top:8px;
  padding:6px 10px;
  background:#f8f9fa;
  border:1px solid #e9ecef;
  border-radius:6px;
  font-size:11px;
  line-height:1.2;
}
.station-box strong{
  color:var(--primary);
  display:block;
  border-bottom:1px solid #dee2e6;
  margin-bottom:3px;
  font-size:9px;
}

.bottom-row{
  width:100%;
  height:450px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:8px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.col-header{
  padding:6px 15px;
  background:var(--primary);
  color:white;
  font-weight:bold;
  font-size:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.scroll-body{
  flex:1;
  overflow-y:auto;
  padding:15px;
  font-size:13px;
}

.event-card{
  border-bottom:1px solid #eee;
  padding:15px 0;
  display:flex;
  gap:15px;
  align-items:center;
}
.tag-year{
  background:#2f3542;
  color:#fff;
  padding:4px 10px;
  border-radius:4px;
  font-size:13px;
  font-weight:bold;
  white-space:nowrap;
}
.impact-high{
  color:#e74c3c;
  font-weight:800;
  font-size:18px;
  display:block;
  margin-bottom:2px;
}
.event-detail{ font-size:14px; line-height:1.4; }
.weather-icon{ font-size:36px; min-width:50px; text-align:center; }

.btn-refresh{
  background:#e74c3c;
  color:white;
  border:none;
  padding:4px 8px;
  border-radius:4px;
  cursor:pointer;
  font-size:10px;
  text-transform:uppercase;
}
.btn-download{
  background:#27ae60;
  color:white;
  border:none;
  padding:2px 8px;
  border-radius:4px;
  cursor:pointer;
  font-size:10px;
  text-transform:uppercase;
  margin-left:10px;
}

/* keep checkbox rows tight (label controls the spacing, not the input) */
label.filter-option{
  margin-top: 2px !important;  /* reduces gap above each checkbox row */
}

/* make the SECOND checkbox row even tighter relative to the first */
label.filter-option + label.filter-option{
  margin-top: 1px !important;
}

.nominal-blue {
  color: #1e6bd6 !important;
}

/* FEMA inline (merged into the same line) */
.fema-inline{
  font-weight:800;
  color:#b23a00; /* dark red-orange */
}

.fema-row{
  display:block;
  padding-top:2px; /* reduced top padding */
}

/* GRAPH CONTROLS */
.graph-controls{ display:flex; gap:5px; margin:20px 0 10px 0; }
.btn-metric{
  flex:1;
  padding:8px;
  font-size:11px;
  font-weight:bold;
  text-transform:uppercase;
  cursor:pointer;
  border:1px solid #ccc;
  background:#fff;
  border-radius:1px;
  transition:0.2s;
}
.btn-metric.active{
  background:var(--accent);
  color:white;
  border-color:var(--accent);
}

.graph-container{
  background:#fff;
  border:1px solid #ccc;
  border-radius:8px;
  padding:30px 40px 40px 50px;
  height:240px;
  display:flex;
  align-items:flex-end;
  gap:2px;
  position:relative;
  overflow-x:auto;

  border-left:0 !important;   /* remove old full-height axis */
  border-bottom:0 !important; /* we'll draw the x-axis inside the plot area */
}

/* plot-area-only Y axis (skinny + gray) */
.graph-container::before{
  content:"";
  position:absolute;
  top:35px;            /* must match updateGraph plot-area top */
  bottom:35px;         /* must match updateGraph plot-area bottom */
  left:69px;           /* slight nudge to avoid bars stacking on axis */
  width:1px;
  background:#bdbdbd;
  pointer-events:none;
}

/* plot-area-only X axis (skinny + gray, Jan → Dec) */
.graph-container::after{
  content:"";
  position:absolute;
  left:69px;           /* start at y-axis */
  right:60px;          /* must match updateGraph plot-area right */
  bottom:35px;         /* must match updateGraph plot-area bottom */
  height:1px;
  background:#bdbdbd;
  pointer-events:none;
}

.bar{
  background:var(--accent);
  width:12px;
  flex-shrink:0;
  position:relative;
  cursor:pointer;
  min-height:2px;
}
.bar:hover{ background:var(--primary); }
.bar:hover::after{
  content:attr(data-label);
  position:absolute;
  top:-30px;
  left:50%;
  transform:translateX(-50%);
  background:#333;
  color:#fff;
  padding:4px 8px;
  border-radius:4px;
  font-size:10px;
  white-space:nowrap;
  z-index:100;
}

.y-label{
  position:absolute;
  top:10px;
  left:20px;
  font-size:9px;
  font-weight:bold;
  color:#666;
  text-transform:uppercase;
}
.y-max{ position:absolute; top:30px; left:15px; font-size:10px; color:#999; }
.y-min{ position:absolute; bottom:8px; left:15px; font-size:10px; color:#999; }

.x-axis-title{
  position:absolute;
  bottom:5px;
  left:50%;
  transform:translateX(-50%);
  font-size:9px;
  font-weight:bold;
  color:#666;
  text-transform:uppercase;
}
