/* Public dashboard layout. Shared basics live in styles.css. Mobile-first.
   Desktop: list on the left, map on the right (both fill the screen), trackers below.
   Phone: List / Map switch in the toolbar. */
body.dash { -webkit-text-size-adjust: 100%; }
.dash header.top .wrap { padding-top: 10px; padding-bottom: 10px; }
.dash .brand { flex: 1 1 260px; color: var(--text); text-decoration: none; }
.dash .brand:hover { color: var(--text); }
.dash .brand h1 { font-size: 17px; }
.dash .search { flex: 1 1 260px; display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.dash .search input { width: 100%; max-width: 340px; }
.dash main.wrap { gap: 14px; padding-top: 14px; }
.updated { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(143, 227, 176, .6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(143, 227, 176, .55); } 70% { box-shadow: 0 0 0 7px rgba(143, 227, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(143, 227, 176, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Summary strip: four compact tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.stat:hover, .stat:focus-visible { border-color: var(--field); background: #152036; }
.stat .n { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 500; line-height: 1.1; }
.stat .l { font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; line-height: 1.25; }
.stat .s { display: none; font-size: 12px; color: var(--muted); }

/* Toolbar (sticky) */
.toolbar { position: sticky; top: 0; z-index: 900; background: var(--bg); padding: 8px 0; margin: -8px 0; display: flex; flex-direction: column; gap: 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--field); background: transparent; color: var(--text2); font: 500 14px 'IBM Plex Sans', sans-serif; cursor: pointer; white-space: nowrap; }
.tab:hover { border-color: #3A5175; }
.tab[aria-selected="true"] { background: #16304F; border-color: var(--funding); color: var(--text); }
.tab .c { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); margin-left: 5px; }
.filters2 { display: flex; gap: 8px; align-items: center; }
.filters2 select { height: 36px; font-size: 13px; padding: 0 8px; min-width: 0; }
.viewtoggle { display: inline-flex; border: 1px solid var(--field); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.viewtoggle button { height: 34px; padding: 0 16px; background: transparent; border: none; color: var(--text2); font: 600 13px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.viewtoggle button[aria-pressed="true"] { background: #16304F; color: var(--text); }

/* Workspace: list + map */
.workspace { display: block; }
.listpane, .mappane { min-width: 0; }
.mappane { position: relative; overflow: hidden; display: none; }
body[data-view="map"] .listpane { display: none; }
body[data-view="map"] .mappane { display: block; }
#map { height: calc(100svh - 200px); min-height: 380px; border-radius: 8px; background: #0E1828; }
.maplegend { position: absolute; left: 56px; top: 10px; z-index: 500; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: calc(100% - 112px);
  background: rgba(11, 18, 32, .86); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--text2); pointer-events: none; }
.maplegend span { display: inline-flex; align-items: center; gap: 5px; }
.maplegend .shape.tri { border-left-width: 5px; border-right-width: 5px; border-bottom-width: 9px; }
.mapbtn { position: absolute; left: 10px; top: 84px; z-index: 500; height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--field);
  background: rgba(11, 18, 32, .9); color: var(--text); font: 600 12px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.mapbtn:hover { background: #16213A; }

/* Feed */
.feed { outline: none; }
.dayhead { position: sticky; top: 0; z-index: 2; background: var(--panel); font-size: 11.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 10px 16px 6px; border-top: 1px solid var(--line2); }
.dayhead:first-child { border-top: none; }
.story { position: relative; padding: 12px 16px 12px 19px; border-top: 1px solid var(--line2); cursor: pointer; transition: background .12s; }
.dayhead + .story { border-top: none; }
.story::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, transparent); opacity: 0; transition: opacity .12s; }
.story:hover { background: #151F35; }
.story:hover::before { opacity: .5; }
.story.sel { background: #172741; }
.story.sel::before { opacity: 1; }
.story:focus-visible { outline: 2px solid var(--funding); outline-offset: -2px; }
.story .top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 5px; }
.pill { font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; padding: 1px 7px; border-radius: 10px; border: 1px solid currentColor; line-height: 1.55; }
.official { font-size: 10.5px; font-weight: 600; letter-spacing: .3px; color: var(--ok); display: inline-flex; align-items: center; gap: 3px; }
.official svg { width: 11px; height: 11px; }
.story h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); }
.story p { margin: 4px 0 0; font-size: 14px; color: var(--text2); line-height: 1.45; }
.story .meta { margin-top: 6px; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.story .loc { display: inline-flex; align-items: center; gap: 3px; color: var(--text2); }
.story .loc svg { width: 11px; height: 11px; }
.story .note { margin-top: 8px; padding: 8px 10px; background: #10233D; border-radius: 6px; font-size: 13px; color: var(--text2); }
.story .note b { color: var(--text); }
.actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: transparent;
  color: var(--text2); font: 500 12.5px 'IBM Plex Sans', sans-serif; text-decoration: none; cursor: pointer; }
.act:hover { border-color: var(--field); background: #1A2740; color: var(--text); }
.act svg { width: 13px; height: 13px; }
.act.primary { color: #A9D2FF; border-color: #24476F; }
.shared-banner { margin: 10px 12px 0; padding: 8px 12px; border-radius: 6px; background: #10233D; border: 1px solid #24476F; font-size: 12.5px; color: var(--text2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shared-banner button { background: none; border: none; color: #7DBBFF; font: 600 12.5px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.more { display: block; width: 100%; height: 44px; border: none; border-top: 1px solid var(--line2); background: transparent; color: #7DBBFF; font: 600 14px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.more:hover { background: #15203A; }

/* Map markers and popups */
.leaflet-control-attribution { font-size: 10px; line-height: 1.4; background: rgba(11, 18, 32, .75) !important; color: var(--dim) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); background: var(--c); box-shadow: 0 0 0 2px rgba(11, 18, 32, .7); transition: transform .15s; }
.pin.hollow { background: rgba(11, 18, 32, .6); }
.pin.area { width: 12px; height: 12px; border-style: dashed; background: rgba(11, 18, 32, .5); }
.pin.sel { transform: scale(1.55); box-shadow: 0 0 0 3px rgba(11, 18, 32, .8), 0 0 14px var(--c); }
.pop .k { font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.pop .t { margin: 4px 0; font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.pop .m { color: var(--muted); font-size: 12px; }
.pop .a { margin-top: 8px; display: flex; gap: 12px; }
.pop .a a, .pop .a button { background: none; border: none; padding: 0; color: #7DBBFF; font: 600 12.5px 'IBM Plex Sans', sans-serif; cursor: pointer; text-decoration: none; }
.leaflet-control-layers { background: rgba(11, 18, 32, .92) !important; color: var(--text2); border: 1px solid var(--field) !important; }
.leaflet-control-layers-toggle { filter: invert(1) hue-rotate(180deg); }
.leaflet-bar a { background: rgba(11, 18, 32, .92); color: var(--text); border-color: var(--field); }
.leaflet-bar a:hover { background: #16213A; color: var(--text); }

/* Trackers below the workspace */
.panels { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.side-list .row { display: block; padding: 10px 16px; border-top: 1px solid var(--line2); color: var(--text); text-decoration: none; }
.side-list .row:first-child { border-top: none; }
.side-list .row:hover { background: #15203A; }
.side-list .t { font-size: 14px; font-weight: 500; line-height: 1.4; }
.side-list .m { font-size: 12px; color: var(--muted); margin-top: 3px; }
.case { display: block; padding: 12px 16px; border-top: 1px solid var(--line2); color: var(--text); text-decoration: none; cursor: pointer; }
.case:first-child { border-top: none; }
.case:hover { background: #15203A; }
.case .t { font-size: 14px; font-weight: 500; line-height: 1.4; }
.case .meta { margin: 3px 0 8px; font-family: 'IBM Plex Sans', sans-serif; }
.due { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--incident); }
.panel .head { padding: 12px 16px; }
.panel .head h2 { font-size: 15px; }
.panel .head .linkbtn { background: none; border: none; color: #7DBBFF; font: 500 13px 'IBM Plex Sans', sans-serif; cursor: pointer; padding: 4px 0; }
.atis-grid { grid-template-columns: 1fr; }
.atis-item { border-right: none; padding: 12px 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 2000; background: #E6EDF5; color: #0B1220; font: 600 13px 'IBM Plex Sans', sans-serif;
  padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Tablet and up */
@media (min-width: 720px) {
  .stat { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 16px; text-align: left; }
  .stat .n { font-size: 28px; min-width: 2ch; }
  .stat .txt { display: flex; flex-direction: column; min-width: 0; }
  .stat .l { font-size: 12px; }
  .stat .s { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Desktop: list and map side by side, filling the screen */
@media (min-width: 1024px) {
  .viewtoggle { display: none; }
  .workspace { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 14px; height: clamp(560px, calc(100vh - 215px), 920px); }
  .listpane { display: flex !important; flex-direction: column; overflow: hidden; }
  .listpane .feed { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
  .mappane { display: block !important; }
  #map { height: 100%; min-height: 0; }
  .mapbtn { top: 84px; }
}
@media (min-width: 1280px) {
  .panels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dash .wrap { padding-left: 12px; padding-right: 12px; }
  .dash .brand p { display: none; }
  .dash .search { flex-basis: 100%; }
  .dash .search input { max-width: none; }
  .dash .top .updated { display: none; }
  .filters2 select { flex: 1 1 0; }
  .story h3 { font-size: 15.5px; }
  .act { height: 34px; }
  .cta { padding: 18px; }
  .cta .btn { width: 100%; }
}
