:root {
  --bg: #070a0f; --panel: #0d1219; --panel2: #121924; --line: #1c2733; --text: #d7e0ea; --dim: #7c8a9a;
  --accent: #3ad6c5; --warn: #f2a01d; --hot: #e0263c;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.45 -apple-system, "Segoe UI", Inter, Roboto, sans-serif; display: flex; flex-direction: column; }
.mono { font-family: var(--mono); }
button, input { font: inherit; color: inherit; }

#top { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 15px var(--mono); letter-spacing: .14em; color: var(--accent); }
.brand b { color: var(--text); font-weight: 700; }
a.brand { text-decoration: none; }
.brand-h { margin: 0; font: inherit; }   /* the page heading, for search engines; looks like the plain link */
a.brand:hover b { color: var(--accent); }
.brand img { border-radius: 7px; border: 1px solid var(--line); flex: none; }
.brand { font-size: 13px; white-space: nowrap; }
.top-right a { color: var(--dim); text-decoration: none; white-space: nowrap; }
.top-right a:hover { color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 11px var(--mono); letter-spacing: .06em; padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); color: var(--dim); white-space: nowrap; }
.chip.new { color: var(--warn); border-color: var(--warn); cursor: pointer; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 6px var(--accent); }
.dot.live { animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* Small basis: the search box gives up width before the header wraps to two rows. */
.search { position: relative; flex: 1 1 120px; max-width: 360px; }
.search input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; outline: none; }
.search input:focus { border-color: var(--accent); }
#search-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px #000a; }
#search-results li { padding: 6px 8px; border-radius: 3px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
#search-results li:hover, #search-results li.on { background: #1b2635; }
#search-results small { color: var(--dim); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 4px 10px; cursor: pointer; color: var(--dim); }
.seg button.on { background: var(--accent); color: #04110f; font-weight: 600; }

#grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr) 372px; }
aside { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
#left { border-right: 1px solid var(--line); }
#right { border-left: 1px solid var(--line); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.panel h2 { margin: 0 0 8px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; }
.panel.note { color: var(--dim); font-size: 12px; }
.list button { display: block; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 4px; padding: 6px 8px; cursor: pointer; color: var(--text); }
.list button:hover { background: var(--panel2); }
.list button.on { background: #10262b; border-color: #1f5a57; color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pills button { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.pills button:hover { border-color: var(--accent); color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 2px; cursor: pointer; }
.check input { accent-color: var(--accent); }
#legal { flex: none; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 18px; color: var(--dim); font-size: 11px; padding: 5px 14px; border-top: 1px solid var(--line); background: var(--panel); position: relative; }
/* Links to the other Cross Step Labs pages, set off from the legal text by a rule. */
#legal .apps { display: flex; gap: 14px; padding-right: 18px; border-right: 1px solid var(--line); }
#legal .apps a { color: var(--text); text-decoration: none; white-space: nowrap; }
#legal .apps a:hover { color: var(--accent); }
#sources summary { cursor: pointer; list-style: none; text-decoration: underline dotted; text-underline-offset: 3px; }
#sources summary::-webkit-details-marker { display: none; }
#sources summary:hover, #sources[open] summary { color: var(--accent); }
.sources-pop { position: absolute; z-index: 40; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; box-shadow: 0 8px 24px #000a; text-align: left; font-size: 12px; line-height: 1.5; color: var(--text); }
.sources-pop p { margin: 0 0 6px; }
.sources-pop p:last-child { margin: 0; color: var(--dim); }
.sources-pop b { color: var(--dim); font-weight: 600; }

#mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #05080c; }
.maplibregl-ctrl-attrib { background: #0d1219cc !important; color: var(--dim); }
.maplibregl-ctrl-attrib a { color: var(--dim); }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1) brightness(.8); }
#readout { position: absolute; top: 10px; left: 10px; background: #0d1219e6; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; font-size: 12px; pointer-events: none; max-width: 70%; }
#readout b { color: var(--accent); font-weight: 600; }
#legend { position: absolute; right: 10px; bottom: 96px; background: #0d1219e6; border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px 5px; width: 282px; }
#legend-title { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
#legend-bar { width: 100%; height: 10px; border-radius: 2px; display: block; }
#legend-ticks { position: relative; height: 15px; font-size: 10px; color: var(--dim); }
#legend-ticks span { position: absolute; top: 2px; transform: translateX(-50%); }
#loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #0d1219e6; border: 1px solid var(--line); border-radius: 4px; padding: 10px 16px; color: var(--dim); }
#timeline { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 10px; align-items: center; background: #0d1219f0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
#play { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--accent); background: #10262b; color: var(--accent); font-size: 14px; cursor: pointer; }
#play:hover { background: var(--accent); color: #04110f; }
.tl-main { flex: 1; min-width: 0; }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; }
#tl-valid { font-weight: 600; font-size: 14px; }
#tl-lead { color: var(--dim); font-size: 11px; }
#slider { width: 100%; margin: 4px 0 0; accent-color: var(--accent); height: 16px; }
#tl-days { position: relative; height: 14px; font-size: 10px; color: var(--dim); overflow: hidden; }
#tl-days span { position: absolute; top: 0; padding-left: 4px; border-left: 1px solid #2c3a4a; white-space: nowrap; }

#detail .d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
#detail h3 { margin: 0; font-size: 16px; }
#detail .sub { color: var(--dim); font-size: 11px; font-family: var(--mono); }
#detail .x { background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); cursor: pointer; padding: 1px 7px; }
#detail .x:hover { color: var(--text); border-color: var(--dim); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 7px; min-width: 0; }
.tile label { display: block; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile strong { font: 600 17px var(--mono); }
.tile small { color: var(--dim); font-size: 10px; margin-left: 2px; }
.ctitle { display: flex; justify-content: space-between; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-top: 10px; }
.ctitle i { font-style: normal; }
.ctitle i::before { content: ""; display: inline-block; width: 9px; height: 3px; margin: 0 4px 2px 8px; background: currentColor; vertical-align: middle; }
svg.chart { width: 100%; height: auto; display: block; cursor: crosshair; }
svg.chart text { font: 9px var(--mono); fill: var(--dim); }
table.days { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
table.days th { font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-align: left; padding: 3px 4px; border-bottom: 1px solid var(--line); }
table.days td { padding: 4px; border-bottom: 1px solid #141c27; font-family: var(--mono); white-space: nowrap; }
.arr { display: inline-block; color: var(--accent); }
.bar { display: inline-block; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.rows .row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 6px; border-radius: 4px; cursor: pointer; border-bottom: 1px solid #141c27; }
.rows .row:hover { background: var(--panel2); }
.rows .row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .row .v { font: 600 13px var(--mono); text-align: right; }
.rows .row small { color: var(--dim); font-size: 11px; }
.rows .row small.r { text-align: right; font-family: var(--mono); }
.muted { color: var(--dim); font-size: 12px; }
a { color: var(--accent); }
.sel-marker { width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #000a, 0 0 14px var(--accent); animation: pulse 1.6s infinite; }

@media (max-width: 980px) {
  body { height: auto; }
  #grid { display: flex; flex-direction: column; }
  #mapwrap { height: 68vh; order: -1; }
  #left, #right { border: 0; overflow: visible; }
  #left { order: 1; }
  .brand { white-space: normal; font-size: 12px; letter-spacing: .1em; }
  #top { gap: 8px 10px; padding: 8px 10px; }
  .top-right { margin-left: 0; width: 100%; justify-content: flex-end; }
  .search { max-width: none; flex-basis: 100%; }
  #legend { width: 200px; bottom: 100px; }
  .top-right #clock { display: none; }
  #legal .apps { width: 100%; justify-content: center; padding: 0 0 4px; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Seattle Monitor additions ---------- */
#grid { grid-template-columns: 300px minmax(0, 1fr) 372px; }
.check .key { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.check .key.tri { width: 0; height: 0; border-radius: 0; background: none; border: 5px solid transparent; border-top: 0; border-bottom: 9px solid currentColor; }
#legend { width: auto; bottom: 96px; left: 10px; right: auto; }
#legend[hidden], #loading[hidden] { display: none; }
.maplibregl-ctrl-bottom-right { bottom: 84px; }
.ctitle { gap: 8px; white-space: nowrap; }
#legend .keys { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10px; color: var(--dim); padding-bottom: 2px; }
#legend .keys i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
#tl-days span { border-left: 0; padding: 0; transform: translateX(-50%); }
#tl-days span:first-child { transform: none; }
#tl-days span.end { right: 0; transform: none; }
#timeline[hidden] { display: none; }
.panel h2 .seg { margin-left: auto; text-transform: none; letter-spacing: 0; }
.panel h2 .seg button { padding: 1px 7px; font-size: 10px; }
.tiles.t3 { grid-template-columns: repeat(3, 1fr); }
.tile strong.s { font-size: 13px; }
.banner { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 4px; background: var(--panel2); padding: 6px 9px; margin: 8px 0; font-size: 12px; }
.banner.hot { border-left-color: var(--hot); }
.banner.calm { border-left-color: var(--accent); }
.banner b { display: block; }
.banner small { color: var(--dim); }
.rows .row.one { grid-template-columns: 1fr; cursor: default; }
.rows .row a { color: var(--text); text-decoration: none; font-weight: 600; }
.rows .row a:hover { color: var(--accent); }
.rows .row b.wrap, .rows .row a.wrap { white-space: normal; overflow: visible; }
.badge { display: inline-block; font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--dim); margin-right: 4px; vertical-align: 1px; }
.badge.hot { color: var(--hot); border-color: var(--hot); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.ok { color: var(--accent); border-color: #1f5a57; }
.pills button.on { background: #10262b; border-color: #1f5a57; color: var(--accent); }
#news-filter { margin-bottom: 6px; }
.more { display: block; width: 100%; margin-top: 6px; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 4px; color: var(--dim); cursor: pointer; font-size: 12px; }
.more:hover { color: var(--accent); border-color: var(--accent); }
.cam { width: 100%; display: block; border: 1px solid var(--line); border-radius: 4px; margin-top: 10px; background: #05080c; min-height: 120px; }
#detail p { margin: 8px 0 0; }
.wx-marker { font: 600 11px var(--mono); color: var(--text); background: #0d1219e6; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; cursor: pointer; white-space: nowrap; }
.wx-marker:hover { border-color: var(--accent); color: var(--accent); }
.wx-marker small { color: #7fb2ff; font-weight: 400; }
table.days td.txt { font-family: inherit; white-space: normal; color: var(--dim); font-size: 11px; line-height: 1.3; }
table.days tr { cursor: help; }
.maplibregl-popup-content { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }

@media (max-width: 980px) {
  #legend { bottom: 100px; width: auto; max-width: 70%; }
}
