:root {
  --mw-blue: #337ab7;
  --mw-border: #d9e2ea;
  --mw-muted: #657786;
  --mw-panel: #ffffff;
  --mw-bg: #f5f5f5;
  --ops-header: #337ab7; --ops-shell: #eef3f7; --ops-subtext: #e3f0fa; --ops-accent: #8fc7ee;
  --ops-control-bg: rgba(255,255,255,.94); --ops-control-color: #263b4f;
}
/* Logged-in receiver status page */
.cw-status-page { max-width: 920px; margin: 24px auto 50px; }
.cw-status-heading { margin-bottom: 20px; }
.cw-status-heading p { color: #6b7c8d; }
.cw-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cw-status-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid #d9e2ea; border-left: 5px solid #8595a5; border-radius: 5px; box-shadow: 0 2px 7px rgba(23,42,61,.08); }
.cw-status-card.cw-health-online { border-left-color: #2f9d62; }
.cw-status-card.cw-health-stale { border-left-color: #e09a26; }
.cw-status-card.cw-health-offline { border-left-color: #c34b55; }
.cw-status-card .cw-health-dot { width: 13px; height: 13px; }
.cw-status-card h3 { margin: 0 0 4px; font-size: 18px; }
.cw-status-card p, .cw-status-card span { margin: 0; color: #708090; }
.cw-status-value { text-align: right; }
.cw-status-value strong, .cw-status-value span { display: block; }
.cw-status-meta { margin-top: 18px; padding: 14px 18px; background: #eef3f7; border-radius: 5px; color: #526577; }
body.cw-dark .cw-status-card { background: #1b2c3e; border-color: #31465b; }
body.cw-dark .cw-status-card.cw-health-online { border-left-color: #45ba7c; }
body.cw-dark .cw-status-card.cw-health-stale { border-left-color: #f0ad3d; }
body.cw-dark .cw-status-card.cw-health-offline { border-left-color: #e16670; }
body.cw-dark .cw-status-card h3 { color: #edf4fa; }
body.cw-dark .cw-status-meta { background: #172637; color: #b9c8d5; }
@media (max-width: 767px) {
  .cw-status-page { margin: 12px 0 30px; }
  .cw-status-grid { grid-template-columns: 1fr; }
  .cw-status-card { grid-template-columns: auto 1fr; }
  .cw-status-value { grid-column: 2; text-align: left; }
}

/* Central West Alerts dashboard */
.cw-dashboard { margin: 12px 1.5% 18px; }
.cw-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 9px; }
.cw-toolbar .pull-right { margin-left: auto; }
.cw-health { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: #fff; border: 1px solid var(--mw-border); border-left: 4px solid #8593a0; border-radius: 6px; color: var(--mw-muted); }
.cw-health strong { color: #263b4f; }
.cw-health-dot { width: 10px; height: 10px; border-radius: 50%; background: #8593a0; box-shadow: 0 0 0 3px rgba(133,147,160,.16); }
.cw-health-online { border-left-color: #24945e; }
.cw-health-online .cw-health-dot { background: #24945e; box-shadow: 0 0 0 3px rgba(36,148,94,.18); }
.cw-health-quiet { border-left-color: #e49b21; }
.cw-health-quiet .cw-health-dot { background: #e49b21; }
.cw-health-stale, .cw-health-offline { border-left-color: #bd3e4b; }
.cw-health-stale .cw-health-dot, .cw-health-offline .cw-health-dot { background: #bd3e4b; }
.cw-health-note { margin-left: auto; font-size: 11px; }
.cw-health-beacons { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 10px; align-items: stretch; border-left-color: var(--mw-blue); }
.cw-receiver-beacon { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--mw-border); border-left: 4px solid #bd3e4b; border-radius: 5px; background: rgba(255,255,255,.55); }
.cw-receiver-beacon > div { display: flex; flex-direction: column; min-width: 0; }
.cw-receiver-beacon > div span { font-size: 11px; color: var(--mw-muted); }
.cw-receiver-state { text-align: right; }
.cw-receiver-beacon.cw-health-online { border-left-color: #24945e; }
.cw-receiver-beacon.cw-health-stale { border-left-color: #e49b21; }
.cw-receiver-beacon.cw-health-offline { border-left-color: #bd3e4b; }
.cw-server-health { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--mw-muted); padding: 0 3px; }
.cw-panel { margin-top: 12px; padding: 14px; background: #fff; border: 1px solid var(--mw-border); border-radius: 7px; }
.cw-empty { padding: 22px; color: var(--mw-muted); text-align: center; }
.cw-incident, .cw-discovery { margin-bottom: 10px; padding: 12px 14px; background: #f9fbfd; border: 1px solid #dfe7ee; border-left: 5px solid #8794a0; border-radius: 5px; }
.cw-incident-heading { font-size: 15px; }
.cw-incident-meta { margin: 3px 0 7px; color: var(--mw-muted); font-size: 12px; }
.cw-incident-message { line-height: 1.45; }
.cw-timeline { padding: 5px 0; border-top: 1px solid #e4e9ee; }
.cw-discovery .badge { margin-left: 8px; }
.cw-discovery .btn { margin-top: 8px; }
.cw-agency-suggestion { margin-top: 8px; padding: 6px 8px; border-radius: 4px; background: rgba(35,116,171,.08); color: #365b78; font-size: 12px; }
.cw-correlation { margin: 7px 0; padding: 6px 9px; border-left: 3px solid var(--mw-blue); background: rgba(35,116,171,.07); font-size: 12px; }
.cw-warning-active { border-color: #dc6b28 !important; }
.cw-warning-header { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--mw-border); }
.cw-warning-clear { display: flex; gap: 10px; align-items: center; padding: 18px; border-left: 4px solid #24945e; background: rgba(36,148,94,.08); border-radius: 5px; }
.cw-warning-clear i { color: #24945e; font-size: 22px; }
.cw-warning-clear span { color: var(--mw-muted); }
.cw-warning-item { margin-bottom: 12px; padding: 14px; border: 1px solid #edc6a8; border-left: 5px solid #dc6b28; background: #fff9f3; border-radius: 5px; }
.cw-warning-item h4 { margin: 0 0 8px; color: #9a4518; }
.cw-bom-attribution { margin: 14px 0 0; color: var(--mw-muted); font-size: 11px; }
.cw-radio-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--mw-border); }
.cw-radio-header strong { display: block; font-size: 16px; color: #263b4f; }
.cw-radio-header span { display: block; margin-top: 2px; color: var(--mw-muted); font-size: 12px; }
.cw-radio-call { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, 420px); gap: 16px; align-items: center; margin-bottom: 9px; padding: 11px 13px; background: #f9fbfd; border: 1px solid #dfe7ee; border-left: 4px solid var(--mw-blue); border-radius: 5px; }
.cw-radio-call-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cw-radio-call-title strong { color: #263b4f; }
.cw-radio-call-title span { white-space: nowrap; color: var(--mw-muted); font-size: 12px; }
.cw-radio-call-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--mw-muted); font-size: 12px; }
.cw-radio-agency { padding: 2px 7px; border-radius: 10px; background: #6f7f8d; color: #fff; font-weight: 700; }
.cw-radio-agency-rfs { background: #f2c84b; color: #3b310b; }
.cw-radio-agency-ses { background: #ef8b2c; color: #fff; }
.cw-radio-agency-vra, .cw-radio-agency-npws { background: #328454; color: #fff; }
.cw-radio-agency-frnsw { background: #c64141; color: #fff; }
.cw-radio-agency-ambulance { background: #2878b5; color: #fff; }
.cw-radio-player { width: 100%; height: 36px; }
.cw-radio-note { margin: 13px 0 0; color: var(--mw-muted); font-size: 11px; }
.cw-priority-label { display: inline-block; margin-right: 7px; padding: 2px 7px; border-radius: 10px; background: #8794a0; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .35px; text-transform: uppercase; }
tr.cw-priority-medium > td:first-child, .cw-incident.cw-priority-medium { border-left: 5px solid #e49b21; }
tr.cw-priority-high > td:first-child, .cw-incident.cw-priority-high { border-left: 5px solid #dc6b28; }
tr.cw-priority-critical > td:first-child, .cw-incident.cw-priority-critical { border-left: 5px solid #bd3e4b; }
.cw-priority-medium .cw-priority-label { background: #e49b21; }
.cw-priority-high .cw-priority-label { background: #dc6b28; }
.cw-priority-critical .cw-priority-label { background: #bd3e4b; }
#cw-incident-map { width: 100%; height: 520px; border-radius: 5px; }
.cw-map-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; color: var(--mw-muted); font-size: 12px; }
.cw-map-note { margin: 8px 0 0; color: var(--mw-muted); font-size: 11px; }
.cw-map-legend { display: flex; gap: 20px; margin-top: 10px; color: var(--mw-muted); font-size: 12px; }
.cw-map-dot { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border-radius: 50%; vertical-align: -1px; }
.cw-map-dot-pager { background: #2374ab; }
.cw-map-dot-rfs { background: #e49b21; border: 1px solid #fff; box-shadow: 0 0 0 1px #d18c18; }
.cw-map-incident-legend { margin-right: 5px; padding: 3px 4px; border-radius: 3px; background: #f4c542; color: #202b33; }
.cw-incident-marker { background: transparent; border: 0; }
.cw-incident-marker span { display: flex; width: 34px; height: 31px; padding-top: 5px; align-items: center; justify-content: center; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: #f4c542; color: #202b33; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); font-size: 14px; }
.cw-incident-marker.watch span { background: #ef9f2f; color: #fff; }
.cw-incident-marker.emergency span { background: #cf3f4d; color: #fff; animation: cw-incident-pulse 1.15s infinite; }
@keyframes cw-incident-pulse { 50% { filter: drop-shadow(0 0 7px rgba(207,63,77,.9)); } }
.cw-correlation-combined { padding: 9px 11px; border-left: 4px solid #e49b21; border-radius: 4px; background: rgba(228,155,33,.1); }
.cw-map-aircraft-icon { margin-right: 5px; color: #2374ab; }
.cw-map-dam-icon { display: inline-flex; width: 22px; height: 22px; margin-right: 5px; align-items: center; justify-content: center; border-radius: 5px; background: #1683a6; vertical-align: middle; }
.cw-map-dam-icon svg { width: 18px; height: 18px; }
.cw-map-dam-icon .cw-dam-water { fill: #80d7ef; }
.cw-map-dam-icon .cw-dam-wall { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cw-map-gauge-marker { display: inline-block; width: 13px; height: 13px; margin-right: 5px; border: 2px solid #fff; border-radius: 50%; background: #7249a8; box-shadow: 0 0 0 1px #7249a8; vertical-align: -2px; }
.cw-map-algae-markers { display: inline-flex; margin-right: 5px; vertical-align: -2px; }
.cw-map-algae-markers b { width: 10px; height: 10px; margin-right: -2px; border: 1px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(80,90,100,.25); }
.cw-map-algae-markers b:nth-child(1) { background: #2c9b59; }
.cw-map-algae-markers b:nth-child(2) { background: #e49b21; }
.cw-map-algae-markers b:nth-child(3) { background: #bd3e4b; }
.cw-algae-summary { display: flex; gap: 8px; margin: 0 0 10px; }
.cw-algae-summary-top { align-items: center; margin: 10px 0 14px; }
.cw-algae-summary-top > strong { margin-right: 3px; }
.cw-algae-chip { padding: 4px 10px; border-radius: 12px; color: #fff; font-size: 11px; font-weight: 700; }
.cw-algae-green { background: #2c9b59; }
.cw-algae-amber { background: #e49b21; }
.cw-algae-red { background: #bd3e4b; }
.cw-algae-alert { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0; padding: 10px 12px; border-left: 5px solid #e49b21; border-radius: 5px; background: #fff8e9; }
.cw-algae-alert-red { border-left-color: #bd3e4b; background: #fff5f6; }
.cw-algae-alert span { color: var(--mw-muted); font-size: 11px; }
.cw-gauge-marker span { display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 2px solid #fff; border-radius: 50%; background: #7249a8; color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.45); }
.cw-dam-marker span { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 2px solid #fff; border-radius: 8px; background: var(--dam-colour); box-shadow: 0 2px 7px rgba(0,0,0,.45); }
.cw-dam-marker svg { width: 26px; height: 26px; }
.cw-dam-marker .cw-dam-water { fill: #80d7ef; }
.cw-dam-marker .cw-dam-wall { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cw-dam-marker.cw-dam-spill span { animation: cw-dam-pulse 1.5s infinite; }
@keyframes cw-dam-pulse { 50% { box-shadow: 0 0 0 6px rgba(189,62,75,.28), 0 2px 7px rgba(0,0,0,.45); } }
.cw-dam-spill span { animation: cw-dam-pulse 1.15s infinite; }
@keyframes cw-dam-pulse { 50% { box-shadow: 0 0 0 8px rgba(189,62,75,.2), 0 2px 5px rgba(0,0,0,.45); } }
.cw-water-alert-active { border-color: #bd3e4b !important; }
.cw-dam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.cw-dam-card { position: relative; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; min-height: 105px; padding: 14px 58px 14px 14px; border: 1px solid #d8e5ec; border-left: 5px solid #1683a6; border-radius: 6px; background: #f8fbfd; }
.cw-dam-trend { position: absolute; top: 10px; right: 12px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 7px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.cw-dam-trend-up { color: #19733a; background: #daf2e2; }
.cw-dam-trend-down { color: #a52f3b; background: #f8dfe2; }
.cw-dam-trend-steady { color: #65727c; background: #e7ecef; }
.cw-dam-card h4 { margin: 0 0 7px; }
.cw-dam-level { display: flex; min-width: 86px; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 6px; background: rgba(22,131,166,.1); color: #126d89; }
.cw-dam-level strong { font-size: 25px; }
.cw-dam-level span { font-size: 10px; }
.cw-dam-near-capacity { border-left-color: #e49b21; }
.cw-dam-full { border-left-color: #dc6b28; }
.cw-dam-level-unavailable { border-left-color: #778894; }
.cw-dam-possible-spill { border-left-color: #bd3e4b; background: #fff7f7; }
.cw-dam-card.cw-dam-algae-green { border-left-color: #2c9b59; }
.cw-dam-card.cw-dam-algae-amber { border-left-color: #e49b21; }
.cw-dam-card.cw-dam-algae-red { border-left-color: #bd3e4b; }
.cw-dam-algae-detail { display: grid; gap: 4px; margin: 8px 0; padding: 8px; border-radius: 5px; background: rgba(44,155,89,.08); }
.cw-dam-algae-detail .cw-algae-chip { width: max-content; }
.cw-dam-algae-detail small { color: var(--mw-muted); }
.cw-dam-flow-estimate { display: grid; min-width: 215px; flex: 1 1 100%; gap: 3px; padding: 9px 11px; border-left: 4px solid #4e91c5; border-radius: 5px; background: rgba(78,145,197,.09); }
.cw-dam-flow-estimate .cw-flow-label { color: var(--mw-muted); font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.cw-dam-flow-estimate small { max-width: 260px; color: var(--mw-muted); font-size: 10px; }
.cw-dam-flow-estimate.cw-flow-elevated { border-left-color: #e49b21; background: rgba(228,155,33,.1); }
.cw-dam-flow-estimate.cw-flow-passing { border-left-color: #2c9b59; background: rgba(44,155,89,.08); }
.cw-dam-flow-estimate.cw-flow-low { border-left-color: #8794a0; }
.cw-dam-flow-estimate.cw-flow-retaining { border-left-color: #7249a8; background: rgba(114,73,168,.08); }
.cw-dam-alert { margin-bottom: 12px; padding: 14px; border: 1px solid #e7b4ba; border-left: 5px solid #bd3e4b; border-radius: 6px; background: #fff5f6; }
.cw-dam-alert h4 { margin-top: 0; color: #9d2f3c; }
.cw-dam-change-up { color: #237f54; }
.cw-dam-change-down { color: #356f9f; }
.cw-dam-history { margin: 6px 0; color: var(--mw-muted); font-size: 11px; }
.cw-gauge-heading { margin: 20px 0 10px; }
.cw-gauge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px; }
.cw-gauge-card { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid #d8e5ec; border-left: 5px solid #7249a8; border-radius: 6px; background: #f8fbfd; }
.cw-gauge-card div small, .cw-gauge-card > small { display: block; color: var(--mw-muted); }
.cw-aircraft-marker { display: flex; align-items: center; justify-content: center; color: #2374ab; background: transparent; border: 0; }
.cw-aircraft-svg { width: 30px; height: 30px; overflow: visible; fill: currentColor; transform-origin: center; filter: drop-shadow(0 1px 0 #fff) drop-shadow(0 2px 3px rgba(0,0,0,.55)); }
.cw-aircraft-helicopter { color: #7b3fb2; }
.cw-aircraft-heavy { color: #174e86; }
.cw-aircraft-jet { color: #176c98; }
.cw-aircraft-glider { color: #198a71; }
.cw-aircraft-drone { color: #6d7882; }
.cw-aircraft-marker.cw-plane-emergency { color: #bd3e4b; animation: cw-plane-pulse 1.2s infinite; }
@keyframes cw-plane-pulse { 50% { filter: drop-shadow(0 0 7px rgba(189,62,75,.9)); } }
.cw-operations-header { display: none; }
body.cw-operations { overflow: hidden; }
body.cw-operations .navbar, body.cw-operations footer { display: none !important; }
body.cw-operations .cw-panel:has(#cw-incident-map) { position: fixed; inset: 0; z-index: 10000; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--ops-shell); }
body.cw-operations .cw-operations-header { display: flex; height: 64px; padding: 10px 18px; align-items: center; justify-content: space-between; background: var(--ops-header); color: #fff; border-bottom: 4px solid var(--ops-accent); }
body.cw-operations .cw-operations-header strong { display: block; font-size: 20px; }
body.cw-operations .cw-operations-header span { color: var(--ops-subtext); font-size: 12px; }
body.cw-operations .cw-operations-status { display: flex; gap: 8px; align-items: center; }
body.cw-operations #cw-incident-map { height: calc(100vh - 116px); border-radius: 0; }
body.cw-operations .cw-map-controls { position: absolute; z-index: 11000; top: 72px; right: 12px; padding: 6px; border-radius: 5px; color: var(--ops-control-color); background: var(--ops-control-bg); }
body.cw-operations .cw-map-legend, body.cw-operations .cw-map-note { margin: 0; padding: 7px 16px; color: var(--ops-control-color); background: var(--ops-control-bg); }
body.cw-dark .cw-agency-suggestion, body.cw-dark .cw-correlation { color: #b8cddd; }

/* Remembered dark mode */
body.cw-dark { --mw-border: #31465b; --mw-muted: #9cacbb; background: #0e1925 !important; color: #dce6ef; }
body.cw-dark #content, body.cw-dark .container-fluid { background: #0e1925; }
body.cw-dark .table, body.cw-dark .cw-panel, body.cw-dark .cw-health { background: #172637; color: #dce6ef; }
body.cw-dark .cw-receiver-beacon { background: rgba(8,20,32,.42); }
body.cw-dark .table > thead > tr > th { background: #1d3044; color: #b8c8d7; border-color: #31465b; }
body.cw-dark .table > tbody > tr > td { background: #172637; border-color: #2b3e51; }
body.cw-dark .table > tbody > tr:nth-child(even) > td { background: #1a2a3c; }
body.cw-dark .table > tbody > tr:hover > td { background: #22394f; }
body.cw-dark .pagerMessage, body.cw-dark .cw-health strong { color: #edf4fa; }
body.cw-dark .cw-incident, body.cw-dark .cw-discovery { background: #1b2c3e; border-color: #31465b; }
body.cw-dark .cw-warning-item { background: #35291f; border-color: #694a31; }
body.cw-dark .cw-warning-item h4 { color: #ffb276; }
body.cw-dark .cw-dam-card { background: #1b2c3e; border-color: #31465b; }
body.cw-dark .cw-dam-level { background: rgba(45,160,195,.15); color: #78cce5; }
body.cw-dark .cw-dam-algae-detail { background: rgba(44,155,89,.12); }
body.cw-dark .cw-dam-flow-estimate { background: rgba(78,145,197,.12); }
body.cw-dark .cw-dam-alert { background: #3a2329; border-color: #7d3f48; }
body.cw-dark .cw-dam-alert h4 { color: #ff9eaa; }
body.cw-dark .cw-gauge-card { background: #1b2c3e; border-color: #31465b; border-left-color: #a77bdc; }
body.cw-dark .cw-algae-alert { background: #35291f; }
body.cw-dark .cw-algae-alert-red { background: #3a2329; }
body.cw-dark .cw-radio-call { background: #1b2c3e; border-color: #31465b; border-left-color: #4e91c5; }
body.cw-dark .cw-radio-header strong, body.cw-dark .cw-radio-call-title strong { color: #edf4fa; }
body.cw-dark .form-control, body.cw-dark .dropdown-menu { background: #172637; border-color: #3a5167; color: #edf4fa; }
body.cw-dark footer { background: #101d2a; border-color: #31465b; }

@media (max-width: 767px) {
  .cw-dashboard { margin: 8px 0 12px; }
  .cw-toolbar .btn { flex: 1 1 auto; }
  .cw-toolbar .pull-right { margin-left: 0; }
  .cw-health { gap: 8px 14px; }
  .cw-health-note { width: 100%; margin-left: 0; }
  #cw-incident-map { height: 400px; }
  .cw-radio-call { grid-template-columns: 1fr; gap: 9px; }
  .cw-radio-call-title { align-items: flex-start; flex-direction: column; gap: 2px; }
}
