/* PathogenWatch analyst workspace. Full-height, map first, Maplore type.
   The level scale is the same four steps as the district view; blue for
   "more than usual", never amber (amber is Tiddi's locusts). */
:root {
  --paper: #f7f7f7; --ink: #1a1c1f; --ink-2: #4b4a46; --muted: #85837c; --rule: #e2e0da;
  --lv-top: #0d366b; --lv-high: #3987e5; --lv-usual: #d3d1ca; --lv-low: #cde2fb; --lv-none: #ecebe7;
  --sans: "Space Grotesk", system-ui, sans-serif; --mono: "Space Mono", ui-monospace, monospace; --serif: "DM Serif Display", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.ws { display: grid; grid-template-rows: auto 1fr; height: 100dvh; }
.ws-top { display: flex; align-items: center; gap: 18px; padding: 10px 20px; border-bottom: 1px solid var(--rule); background: #fff; }
.ws-top .mk { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; }
.ws-top .mk img { height: 20px; }
.ws-top .nm { font-family: var(--serif); font-style: italic; font-size: 21px; }
.ws-top .ds { display: inline-flex; border: 1px solid var(--rule); }
.ws-top .ds a { padding: 6px 12px; font-size: 13px; text-decoration: none; color: var(--muted); }
.ws-top .ds a[aria-current] { background: var(--ink); color: #fff; }
.ws-top .sp { flex: 1; }
.ws-top .lk { font-size: 13px; color: var(--ink-2); }
.ws-top button { font: inherit; font-size: 13px; background: none; border: 1px solid var(--rule); padding: 6px 12px; cursor: pointer; }
.ws-top button:hover { border-color: var(--ink); }

.ws-body { display: grid; grid-template-columns: 440px 1fr; min-height: 0; }
.side { display: grid; grid-template-rows: auto auto auto 1fr; min-height: 0; border-right: 1px solid var(--rule); background: #fff; }
.side > section { padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; }

#weeks { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
#weeks button { font: inherit; border: 1px solid var(--rule); background: #fff; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#weeks button b { font-weight: 600; font-size: 12px; white-space: nowrap; }
#weeks button span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
#weeks button.k-forecast { border-style: dashed; }
#weeks button.k-outlook { border-style: dotted; }
#weeks button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
#weeks button[aria-selected="true"] span { color: #cfcfcf; }

#summary .big { font-family: var(--serif); font-size: 26px; line-height: 1.1; margin: 0 0 6px; }
#summary p:not(.big) { margin: 0; color: var(--ink-2); line-height: 1.45; font-size: 14px; }

.filter { display: flex; align-items: center; gap: 10px; }
.filter select { font: inherit; flex: 1; padding: 7px 8px; border: 1px solid var(--rule); background: #fff; }
.filter .ct { font-size: 12px; color: var(--muted); white-space: nowrap; }

.listwrap { overflow: auto; min-height: 0; }
#list { list-style: none; margin: 0; padding: 0; }
#list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 104px 80px; gap: 8px; align-items: center; padding: 9px 18px; border-bottom: 1px solid #f0efeb; cursor: pointer; }
#list li:hover { background: #fafaf8; }
#list li.on { background: #eef4fd; box-shadow: inset 3px 0 0 var(--lv-high); }
#list .r { font-family: var(--mono); font-size: 12px; color: var(--muted); }
#list .nm b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#list .nm small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#list .lv { font-size: 13px; }
#list .lv i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: 0; }
#list .lv small { display: block; color: var(--muted); font-family: var(--mono); font-size: 11px; margin-left: 16px; }

/* The drawer sits beside the map, not over it: the unit being read stays in view. */
.stage { position: relative; min-height: 0; display: flex; }
.mapwrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
.legend { position: absolute; left: 14px; bottom: 26px; background: rgba(255,255,255,.94); border: 1px solid var(--rule); padding: 8px 10px; font-size: 12px; display: grid; gap: 4px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -2px; }
.nomap { padding: 40px; color: var(--muted); }

#drawer { flex: 0 0 min(520px, 45%); background: #fff; border-left: 1px solid var(--rule); overflow: auto; padding: 18px 22px 30px; }
#drawer[hidden] { display: none; }
.d-head { display: flex; align-items: start; gap: 10px; }
.d-head h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; line-height: 1.05; }
.d-head .sp { flex: 1; }
.d-head button { font: inherit; background: none; border: 1px solid var(--rule); cursor: pointer; padding: 5px 10px; font-size: 13px; }
#d-sub { color: var(--muted); margin: 4px 0 14px; font-size: 13px; }
#d-level { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
#d-level i { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -1px; }
#d-say { color: var(--ink-2); line-height: 1.45; margin: 0 0 12px; }
#d-charts h4 { margin: 18px 0 4px; font-size: 13px; font-weight: 600; }
#d-charts h4 span { font-weight: 400; color: var(--muted); }
svg.ch { width: 100%; display: block; overflow: visible; }
svg.ch text { font: 10.5px var(--sans); fill: var(--muted); }
svg.ch .g { stroke: #efeee9; }
svg.ch .x { stroke: var(--muted); }
svg.ch .band { fill: #dfeafb; }
svg.ch .clim { fill: none; stroke: #a9a79f; stroke-width: 1.4; stroke-dasharray: 1 3; stroke-linecap: round; }
svg.ch .obs { fill: none; stroke: var(--lv-high); stroke-width: 1.6; }
svg.ch .fc { fill: none; stroke: var(--lv-high); stroke-width: 1.6; stroke-dasharray: 4 3; }
svg.ch .out { fill: none; stroke: var(--lv-high); stroke-width: 1.6; stroke-dasharray: 1.5 3; stroke-linecap: round; }
svg.ch .past { fill: none; stroke: #c9c7bf; stroke-width: 1; }
svg.ch .rain { fill: #9ec5f4; }
svg.ch .temp { fill: none; stroke: #b0662e; stroke-width: 1.2; }
svg.ch .term { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
.terms { margin-top: 16px; font-size: 13px; }
.terms summary { cursor: pointer; color: var(--ink-2); }
.terms p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.d-actions { margin-top: 18px; display: flex; gap: 10px; }
.d-actions button { font: inherit; font-size: 13px; background: #fff; border: 1px solid var(--ink); padding: 7px 12px; cursor: pointer; }

#tt { position: fixed; pointer-events: none; z-index: 50; background: #fff; border: 1px solid var(--rule); padding: 7px 9px; font-size: 12px; line-height: 1.45; opacity: 0; max-width: 260px; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
#tt span { color: var(--muted); }

#method { max-width: min(780px, calc(100vw - 32px)); width: 100%; border: 1px solid var(--rule); padding: 0; }
#method::backdrop { background: rgba(26,28,31,.35); }
.m-head { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: #fff; }
.m-head h2 { font-family: var(--serif); font-weight: 400; margin: 0; font-size: 26px; flex: 1; }
.m-head button { font: inherit; background: none; border: 1px solid var(--rule); padding: 5px 10px; cursor: pointer; }
#method-body { padding: 6px 22px 24px; }
#method-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; font-weight: 500; }
#method-body p { line-height: 1.55; margin: 0 0 8px; color: var(--ink-2); }
#method-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
#method-body th, #method-body td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #efeee9; }
#method-body th { color: var(--muted); font-weight: 500; }
.news { list-style: none; padding: 0; margin: 0; }
.news li { padding: 7px 0; border-bottom: 1px solid #efeee9; font-size: 13px; }
.news li span { display: block; color: var(--muted); font-size: 11.5px; }

@media (max-width: 900px) {
  .ws { height: auto; }
  .stage { flex-direction: column; }
  .mapwrap { height: 60vh; flex: none; }
  #drawer { flex: none; border-left: 0; border-top: 1px solid var(--rule); }
  .ws-body { grid-template-columns: 1fr; }
  .stage { height: 60vh; }
  .side { border-right: 0; }
  .listwrap { max-height: 60vh; }
  .ws-top { flex-wrap: wrap; }
}
