/* Colorado Monitor — home-page dashboard: live map with a news column beside it,
   the Live TV and Headlines panels, and the extra map layers' legend rows,
   markers and labels. Builds on the Liquid Glass tokens in coop.css / site.css.

   On large screens the dashboard stays pinned at the top of the window while the
   rest of the page scrolls beneath it; on smaller screens it stacks (map first). */

:root{--dash-h:max(460px, min(75vh, 860px));}
.dash{
  position:relative;
  z-index:900;
  padding:14px 20px;
}
.dash__grid{
  max-width:1640px;
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 380px;
  gap:14px;
}
.dash .plate{margin:0;max-width:none;}
.dash__side{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
  min-height:0;
}

@media (min-width: 1081px) and (min-height: 700px){
  .dash{
    position:sticky;
    top:0;
    /* frosted strip so the page reads as passing beneath the dashboard */
    background:linear-gradient(180deg, rgba(234,241,247,0.92), rgba(234,241,247,0.8));
    backdrop-filter:blur(18px) saturate(160%);
    -webkit-backdrop-filter:blur(18px) saturate(160%);
    border-bottom:1px solid rgba(255,255,255,0.75);
    box-shadow:0 10px 30px rgba(15,34,49,0.12);
  }
  .dash__grid{height:var(--dash-h);}
  .dash .plate{display:flex;flex-direction:column;height:100%;}
  .dash .plate .map-wrap{flex:1 1 auto;height:auto;min-height:0;}
  .dash .plate footer.map-footer{padding:7px 16px;font-size:0.66rem;line-height:1.4;}
  .dash .plate .updated{padding:7px 16px;}
  .tv{flex:0 1 auto;min-height:0;max-height:62%;}
  .tv .tv__body{overflow-y:auto;overscroll-behavior:contain;min-height:0;}
  .headlines-panel{flex:1 1 auto;min-height:160px;}
  /* in-page links land below the pinned dashboard instead of under it */
  .dash ~ section[id], .dash ~ section [id]{scroll-margin-top:calc(var(--dash-h) + 44px);}
}
@media (min-width: 1081px) and (min-height: 700px) and (max-width: 1280px){
  .dash__grid{grid-template-columns:minmax(0, 1fr) 330px;}
}
@media (max-width: 1080px), (max-height: 699px){
  .dash__grid{grid-template-columns:1fr;}
  .dash .plate .map-wrap{height:72vh;min-height:440px;}
  .dash__side{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));align-items:start;}
  .headlines-panel .panel__body{max-height:420px;}
}
@media (max-width: 720px){
  .dash__side{grid-template-columns:1fr;}
}
@media (max-width: 640px){
  .dash{padding:0 0 10px;}
  .dash .plate{margin:0;border-radius:0;border-left:none;border-right:none;}
  .dash .plate .map-wrap{height:calc(100vh - 150px);min-height:400px;}
  .dash__side{padding:0 14px;}
  .hero{padding-top:34px;}
}

/* ---- Live TV: a grid of tiles, several can play at once ---- */
.tv__body{padding:10px 12px 4px;}
.tv__body::-webkit-scrollbar{width:6px;}
.tv__body::-webkit-scrollbar-thumb{background:rgba(15,34,49,0.18);border-radius:99px;}
.tv__status{margin:2px 2px 10px;font-size:0.78rem;color:var(--slate);}
.tv__status[hidden]{display:none;}
.tv__grid{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:10px;}
.tv-tile{
  display:flex;
  flex-direction:column;
  min-width:0;
  border-radius:14px;
  overflow:hidden;
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(255,255,255,0.8);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 10px rgba(15,34,49,0.1);
}
.tv-tile.is-off{display:none;}
/* Being checked: rendered (so the player can start) but off-screen and invisible. */
.tv__grid{position:relative;}
/* 400px wide: YouTube may refuse to start players smaller than about 200px tall. */
.tv-tile.is-probing{position:absolute;left:-10000px;top:0;width:400px;opacity:0;pointer-events:none;}
.tv-tile__head{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 9px;}
.tv-tile__name{font-size:0.76rem;font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.tv-tile__live{
  flex-shrink:0;
  font-size:0.58rem;
  font-weight:800;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#fff;
  padding:1px 7px;
  border-radius:999px;
  background:#d6336c;
}
.tv-tile__media{position:relative;aspect-ratio:16 / 9;background:#0f2231;}
.tv-tile__frame{position:absolute;inset:0;width:100%;height:100%;border:0;}
.tv-tile__bar{display:flex;gap:6px;padding:6px;}
.tv-tile__play, .tv-tile__mute{
  flex:1 1 0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-width:0;
  padding:5px 6px;
  border-radius:999px;
  font:inherit;
  font-size:0.7rem;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.tv-tile__play{
  color:#fff;
  border:1px solid rgba(255,255,255,0.5);
  background:linear-gradient(180deg, #3d92c9, var(--accent-deep));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 8px rgba(28,95,143,0.3);
}
.tv-tile__mute{
  color:var(--slate);
  background:rgba(255,255,255,0.7);
  border:1px solid rgba(255,255,255,0.9);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.95);
}
.tv-tile__mute[aria-pressed="true"]{color:var(--accent-deep);background:rgba(43,127,184,0.14);}
.tv-tile__play svg, .tv-tile__mute svg{flex-shrink:0;}
.tv-tile__play:focus-visible, .tv-tile__mute:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}
.tv__credit{margin:10px 2px 8px;font-size:0.66rem;line-height:1.45;color:var(--slate-soft);}

/* ---- Headlines ---- */
.headlines-panel .panel__body{max-height:none;flex:1 1 auto;min-height:0;padding:4px 6px 6px;}
.headlines__updated{font-size:0.68rem;font-weight:500;color:var(--slate-soft);}
.headlines{list-style:none;margin:0;padding:0;}
.headline{
  padding:9px 10px;
  border-radius:12px;
  border-bottom:1px solid rgba(255,255,255,0.65);
  transition:background 0.15s ease;
}
.headline:hover{background:rgba(255,255,255,0.55);}
.headline__title{
  display:block;
  font-size:0.84rem;
  font-weight:600;
  line-height:1.35;
  color:var(--ink);
  text-decoration:none;
}
.headline__title:hover{color:var(--accent-deep);text-decoration:underline;}
.headline__meta{display:flex;gap:8px;margin-top:3px;font-size:0.7rem;color:var(--slate-soft);}
.headline__src{font-weight:700;color:var(--accent-deep);}
.headlines__empty{padding:14px 12px;font-size:0.84rem;line-height:1.5;color:var(--slate);}
.headlines__foot{
  padding:8px 14px 12px;
  font-size:0.66rem;
  line-height:1.45;
  color:var(--slate-soft);
  border-top:1px solid rgba(255,255,255,0.65);
}

/* ---- New Layers-list rows ---- */
.layer-subhead{
  margin:14px 12px 4px;
  font-size:0.66rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.09em;
  color:var(--slate-soft);
}
.swatch--military{background:#8b6f47;}
.swatch--nuclear{background:#e3b505;}
.swatch--pipelines{background:linear-gradient(90deg, #e64980 0 34%, #343a40 34% 67%, #4263eb 67%);}
.swatch--airports{background:#29a3e6;border-radius:4px;}
.swatch--superfund{background:#a61e4d;transform:rotate(45deg);width:11px;height:11px;margin:0 1px;border-radius:2px;}
.swatch--counties{background:rgba(255,255,255,0.5);box-shadow:inset 0 0 0 2px #495057, 0 1px 3px rgba(15,34,49,0.2);}
.swatch--districts{background:rgba(255,255,255,0.5);box-shadow:none;border:2px dashed #212529;}
.pipe-key{
  display:flex;
  flex-wrap:wrap;
  gap:3px 10px;
  margin:0 0 4px;
  padding:0 12px 0 46px;
  font-size:0.68rem;
  color:var(--slate-soft);
}
.pipe-key i{display:inline-block;width:14px;height:3px;border-radius:2px;margin-right:4px;vertical-align:middle;}
.pipe-key .pipe-key__dash{background:repeating-linear-gradient(90deg, #868e96 0 4px, transparent 4px 7px);}
.extra-status{display:block;margin-top:4px;font-weight:600;color:var(--accent-deep);}
.extra-status:empty{display:none;}

/* ---- New map markers & labels ---- */
.nuke-marker, .airport-marker, .map-label-marker{background:none !important;border:none !important;}
.nuke-dot{
  display:flex;
  align-items:center;
  justify-content:center;
  width:24px;height:24px;
  border-radius:50%;
  font-size:15px;
  line-height:1;
  color:#1b1b1b;
  background:#e3b505;
  border:2px solid #fff;
  box-shadow:0 1px 4px rgba(15,34,49,0.45);
}
.airport-dot{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;height:100%;
  border-radius:5px;
  font-size:11px;
  line-height:1;
  color:#fff;
  background:#29a3e6;
  border:1.5px solid #fff;
  box-shadow:0 1px 3px rgba(15,34,49,0.35);
}
.airport-dot--major{
  border-radius:8px;
  font-size:16px;
  background:linear-gradient(180deg, #4cc0f5, #0f8ad1);
  border-width:2px;
  box-shadow:0 2px 8px rgba(15,138,209,0.5);
}
/* EPA Superfund: diamonds coloured by NPL status */
.sf-marker{background:none !important;border:none !important;}
.sf-dot{
  display:block;
  width:13px;height:13px;
  margin:2px;
  transform:rotate(45deg);
  border:2px solid #fff;
  border-radius:2px;
  box-shadow:0 1px 4px rgba(15,34,49,0.45);
}
.sf-dot--final, .sf-key__dot--final{background:#a61e4d;}
.sf-dot--proposed, .sf-key__dot--proposed{background:#7048e8;}
.sf-dot--deleted, .sf-key__dot--deleted{background:#868e96;}
.sf-key .sf-key__dot{width:8px;height:8px;border-radius:1px;transform:rotate(45deg);}
.sf-key .sf-key__dot--deleted{opacity:0.6;}
.map-label{
  display:inline-block;
  transform:translate(-50%, -50%);
  white-space:nowrap;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  font-size:0.7rem;
  font-weight:600;
  color:#343a40;
  text-shadow:0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff;
  pointer-events:none;
}
.map-label--district{
  font-size:0.78rem;
  font-weight:800;
  color:#212529;
  padding:2px 9px;
  border-radius:999px;
  background:rgba(255,255,255,0.86);
  border:1px solid rgba(33,37,41,0.35);
  text-shadow:none;
  box-shadow:0 1px 4px rgba(15,34,49,0.15);
}
/* Map credits tucked behind a small "Sources ⓘ" button (every credit kept). */
#map.attr-tucked .leaflet-control-attribution{display:none;}
#map.attr-tucked.attr-open .leaflet-control-attribution{
  display:block;
  max-width:min(440px, calc(100vw - 40px));
  margin:0 10px 6px 0;
  padding:9px 12px;
  border-radius:14px;
  font-size:11px;
  line-height:1.5;
  text-align:left;
  color:var(--slate);
  background:rgba(255,255,255,0.94);
  border:1px solid rgba(255,255,255,0.9);
  box-shadow:inset 0 1px 0 rgba(255,255,255,1), 0 8px 24px rgba(15,34,49,0.22);
}
.sources-control{margin:0 10px 10px 0 !important;}
.sources-btn{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 11px;
  border-radius:999px;
  font:600 11px/1.2 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Helvetica,Arial,sans-serif;
  color:var(--slate);
  background:rgba(255,255,255,0.86);
  border:1px solid rgba(255,255,255,0.95);
  box-shadow:inset 0 1px 0 rgba(255,255,255,1), 0 2px 8px rgba(15,34,49,0.18);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  cursor:pointer;
}
.sources-btn:hover, .sources-btn[aria-expanded="true"]{color:var(--accent-deep);background:#fff;}
.sources-btn:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}
/* On phones the collapsed controls bar sits at the bottom of the map: lift the button above it. */
@media (max-width: 640px){
  .dash .leaflet-bottom.leaflet-right{bottom:60px;}
}
.popup-src{display:block;margin-top:5px;font-size:0.7rem;color:var(--slate-soft);}
.popup-note{font-size:0.72rem;color:var(--slate-soft);}
