/* Palette follows the Australian Warning System: red = act now, orange = prepare, blue = information. */
:root {
  color-scheme: light;
  --bg: #EDF0F3;
  --surface: #FFFFFF;
  --ink: #14212B;
  --muted: #56636F;
  --line: #D3D9DF;
  --urgent: #B3261E;
  --urgent-bg: #FBE9E7;
  --prepare: #A85400;
  --prepare-bg: #FFF0DA;
  --info: #1F5F8B;
  --info-bg: #E5EFF6;
  --clear: #2E6B3F;
  --clear-bg: #E6F2E9;
  --focus: #1F5F8B;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0F151B;
    --surface: #18212A;
    --ink: #E4EAEF;
    --muted: #9AA7B3;
    --line: #2A3640;
    --urgent: #FF7A6E;
    --urgent-bg: #3A1714;
    --prepare: #F2A23A;
    --prepare-bg: #3A2710;
    --info: #74B6E6;
    --info-bg: #12293A;
    --clear: #6BC48A;
    --clear-bg: #15301F;
    --focus: #74B6E6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
}
a { color: var(--info); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; margin: 0; line-height: 1.1; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 40px) 12px;
}
.topbar h1 { font-size: clamp(28px, 4vw, 40px); }
.sub { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }
.refresh { display: flex; align-items: center; gap: 12px; }
.refresh p { margin: 0; color: var(--muted); font-size: 14px; }
button {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer;
}
button:hover { border-color: var(--muted); }

/* ---------- Urgent banner ---------- */
.banner {
  margin: 0 clamp(16px, 4vw, 40px) 16px;
  background: var(--urgent); color: #fff;
  border-radius: 10px; padding: 14px 18px;
}
.banner h2 { font-size: 24px; color: #fff; }
.banner ul { margin: 8px 0 0; padding-left: 20px; }
.banner a { color: #fff; font-weight: 700; }
@media (prefers-color-scheme: dark) { .banner { color: #1a0605; } .banner h2, .banner a { color: #1a0605; } }

main { padding: 0 clamp(16px, 4vw, 40px) 32px; }

/* ---------- Place tiles (the hero) ---------- */
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.place {
  background: var(--surface); border-radius: 12px; padding: 18px 20px 16px;
  border-top: 8px solid var(--clear);
}
.place[data-state="urgent"] { border-top-color: var(--urgent); }
.place[data-state="prepare"] { border-top-color: var(--prepare); }
.place-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.place-name { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--muted); }
.place-status { font-family: var(--display); font-size: clamp(40px, 6vw, 60px); font-weight: 700; line-height: 1; margin: 6px 0 4px; }
.place[data-state="urgent"] .place-status { color: var(--urgent); }
.place[data-state="prepare"] .place-status { color: var(--prepare); }
.place[data-state="clear"] .place-status { color: var(--clear); }
.place-line { margin: 0 0 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0; }
.facts div { border-left: 2px solid var(--line); padding-left: 10px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.fdr {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-family: var(--display);
  font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
}
.fdr-moderate { background: #3F9142; color: #fff; }
.fdr-high { background: #F7D417; color: #111; }
.fdr-extreme { background: #EE7B11; color: #111; }
.fdr-catastrophic { background: #8E1111; color: #fff; }
.fdr-none { background: var(--line); color: var(--ink); }
.tfb { color: var(--urgent); font-weight: 700; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; margin: 24px 0 16px; overflow-x: auto; padding-bottom: 4px; }
.filters button { white-space: nowrap; border-radius: 999px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } }
.col { background: var(--surface); border-radius: 12px; padding: 16px; }
.col h2 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.col-urgent h2 { color: var(--urgent); }
.col-prepare h2 { color: var(--prepare); }
.col-info h2 { color: var(--info); }
.count {
  font-size: 16px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px;
  display: inline-grid; place-items: center; color: var(--surface);
}
.col-urgent .count { background: var(--urgent); }
.col-prepare .count { background: var(--prepare); }
.col-info .count { background: var(--info); }
.col-help { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { padding: 10px 12px; border-radius: 8px; border-left: 4px solid; }
.item.urgent { background: var(--urgent-bg); border-color: var(--urgent); }
.item.prepare { background: var(--prepare-bg); border-color: var(--prepare); }
.item.info { background: var(--info-bg); border-color: var(--info); }
.item a.title { color: var(--ink); font-weight: 700; text-decoration: none; }
.item a.title:hover { text-decoration: underline; }
.item p { margin: 4px 0 0; font-size: 14px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tag { font-weight: 700; color: var(--ink); }
.new {
  font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 4px;
  background: var(--ink); color: var(--surface); margin-left: 6px; vertical-align: 2px;
}
.also { font-size: 13px; color: var(--muted); margin-top: 4px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 2px; }
.more { margin-top: 12px; width: 100%; }

/* ---------- Lower panels ---------- */
.lower { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 24px; }
.panel { background: var(--surface); border-radius: 12px; padding: 16px; grid-column: span 4; }
.panel h2 { font-size: 24px; }
.supply { grid-column: span 6; }
.mix { grid-column: span 6; }
.links { grid-column: span 5; }
.status { grid-column: span 3; }
@media (max-width: 1000px) { .panel, .supply, .mix, .links, .status { grid-column: 1 / -1; } }
.items.compact .item { background: transparent; border-left-width: 3px; border-color: var(--line); padding: 6px 10px; }

.mixbar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin: 8px 0 10px; }
.mixbar span { display: block; height: 100%; }
.mixlegend { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.mixlegend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }

.phones dl { margin: 8px 0 0; display: grid; gap: 8px; }
.phones dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.phones dt { color: var(--muted); }
.phones dd { margin: 0; font-weight: 700; white-space: nowrap; }

.links h3 { font-size: 18px; margin: 14px 0 6px; color: var(--muted); }
.links ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }

.status ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.status li { display: flex; gap: 8px; align-items: baseline; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok { background: var(--clear); }
.dot.fail { background: var(--urgent); }
.dot.off { background: transparent; border: 1.5px solid var(--muted); }
.status small { display: block; color: var(--muted); }

footer { padding: 8px clamp(16px, 4vw, 40px) 40px; color: var(--muted); font-size: 14px; max-width: 90ch; }

@media (prefers-reduced-motion: no-preference) {
  .banner { animation: pulse 2.4s ease-in-out 2; }
  @keyframes pulse { 50% { filter: brightness(1.15); } }
}
