:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --navy: #082642;
  --brand-navy: #163447;
  --ink: #192c3a;
  --muted: #536776;
  --canvas: #f3f6f8;
  --paper: #fff;
  --line: #cedae2;
  --soft-line: #e2eaf0;
  --blue: #32668a;
  --red: #b7332b;
  --green: #267254;
  --amber: #a46411;
  --neutral: #6d8190;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--navy); color: var(--paper); }
::selection { color: var(--paper); background: var(--brand-navy); }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { color: inherit; font: inherit; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }

#tv {
  display: grid;
  grid-template-rows: 112px 54px 61px minmax(0, 1fr) 39px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  transform: translate(-50%, -50%) scale(var(--tv-scale, 1));
}

.masthead {
  display: grid;
  grid-template-columns: auto max-content minmax(max-content, 1fr) auto;
  align-items: center;
  gap: 40px;
  padding: 0 34px;
  background: var(--navy);
  color: var(--paper);
}

.department, .header-right, .myfd-brand { display: flex; align-items: center; }
.department { gap: 16px; }
.department img { object-fit: contain; }
.department-wordmark { display: grid; gap: 3px; }
.department-wordmark strong { font-size: 37px; line-height: 0.98; letter-spacing: 0.035em; }
.department-wordmark span { font-size: 15px; font-weight: 700; letter-spacing: 0.18em; color: #d8e7f2; }

.clock { display: flex; align-items: center; gap: 88px; padding-inline-start: 64px; }
#clock-date { color: #d9e8f3; font-size: 26px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
#clock-time { display: flex; align-items: baseline; gap: 9px; line-height: 1; white-space: nowrap; }
#clock-digits { font-size: 58px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.035em; }
#clock-period { font-size: 23px; font-weight: 700; color: #d7e7f2; }
#clock-zone { color: #d7e7f2; font-size: 14px; font-weight: 700; }

.header-right { justify-self: end; gap: 28px; }
.shift {
  justify-self: center;
  color: #ff847a;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.leadership { display: flex; align-items: baseline; gap: 28px; font-size: 16px; white-space: nowrap; }
.leadership div { display: flex; gap: 8px; align-items: baseline; }
.leadership dt { color: #cfdfeb; }
.leadership dd { color: var(--paper); font-size: 18px; font-weight: 700; }
.myfd-brand { gap: 10px; border-left: 1px solid #466074; padding-left: 20px; }
.myfd-brand img { display: block; object-fit: contain; border-radius: 7px; }
.myfd-brand > span { display: grid; gap: 2px; }
.myfd-brand strong { font-size: 22px; letter-spacing: -0.02em; }
.myfd-brand small { color: #d8e7f2; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }

.alert-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 34px;
  border-bottom: 1px solid #ccdce6;
  background: #e8f0f6;
  color: var(--brand-navy);
}
.alert-icon { display: grid; place-items: center; width: 30px; height: 30px; color: #315b75; }
.alert-icon .icon { width: 25px; height: 25px; }
.alert-label { padding-right: 14px; border-right: 1px solid #bccfdb; font-size: 15px; letter-spacing: 0.065em; text-transform: uppercase; white-space: nowrap; }
.alert-message { font-size: 20px; font-weight: 700; }
.alert-state { display: flex; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; font-size: 15px; font-weight: 700; }
.alert-banner[data-severity="advisory"] { color: #65410c; background: #fff1cf; border-color: #e4c681; }
.alert-banner[data-severity="critical"] { color: #fff; background: #9b2e2a; border-color: #862520; }
.alert-banner[data-severity="emergency"] { color: #fff; background: #792320; border-color: #67201c; }
.alert-banner[data-severity="advisory"] .alert-icon,
.alert-banner[data-severity="critical"] .alert-icon,
.alert-banner[data-severity="emergency"] .alert-icon { color: inherit; }
.alert-banner[data-severity="critical"] .alert-state .status-dot,
.alert-banner[data-severity="emergency"] .alert-state .status-dot { background: #fff; }
.alert-ack { flex: none; margin-left: auto; padding-inline: 10px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.alert-ack + .alert-state { margin-left: 3px; }
.alert-ack-link { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.alert-ack-link:hover strong { text-decoration: underline; }
.alert-ack-link:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.alert-ack-link img { display: block; width: 128px; height: 128px; border-radius: 4px; }
.alert-ack-copy { display: grid; gap: 4px; }
.alert-ack-copy strong { font-size: 20px; }
.alert-ack-detail { font-size: 15px; font-weight: 400; }

.station-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 34px; }
.station-heading, .preview-label { display: flex; align-items: center; }
.station-heading { gap: 15px; }
.station-heading h1 { color: var(--navy); font-size: 30px; letter-spacing: -0.028em; }
.station-heading > span { padding-left: 15px; border-left: 1px solid var(--line); color: var(--muted); font-size: 17px; }
.preview-label { gap: 9px; color: var(--muted); font-size: 15px; }
.preview-label strong { color: var(--brand-navy); }
.preview-label .icon { width: 17px; height: 17px; color: var(--blue); }
.preview-label > span { margin-left: 2px; padding-left: 11px; border-left: 1px solid var(--line); }

.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 170px 155px 245px minmax(0, 1fr);
  gap: 15px;
  min-height: 0;
  padding: 0 34px;
}

#operations { grid-area: 1 / 1 / 3 / 8; }
#weather { grid-area: 1 / 8 / 2 / 13; }
#forecast { grid-area: 2 / 8 / 3 / 13; }
#checks { grid-area: 3 / 1 / 4 / 4; }
#staffing { grid-area: 3 / 4 / 4 / 7; }
#wind { grid-area: 3 / 7 / 4 / 10; }
#radar { grid-area: 3 / 10 / 4 / 13; }
#announcements { grid-area: 4 / 1 / 5 / 7; }
#unit-status { grid-area: 4 / 7 / 5 / 13; }
.board.board-partial { grid-template-rows: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; }
.board.board-partial > .panel { grid-area: auto / span 3; }
.board.board-partial > :is(#operations, #weather, #forecast, #announcements, #unit-status) { grid-column: span 6; }
.board.board-partial > #operations { grid-row: span 2; }

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 30px; margin-bottom: 10px; }
.panel-header h2 { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 22px; line-height: 1.15; letter-spacing: -0.023em; white-space: nowrap; }
.panel-header h2 .icon { width: 23px; height: 23px; color: var(--blue); }
.panel-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.panel-body { flex: 1; min-height: 0; min-width: 0; }
.simulation-tag, .location-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.simulation-tag { padding: 5px 9px; border: 1px solid var(--soft-line); border-radius: 6px; background: var(--canvas); color: var(--muted); font-size: 13px; }
.location-label .icon { width: 16px; height: 16px; }
.steps { display: flex; align-items: center; gap: 5px; }
.steps i { width: 6px; height: 6px; border-radius: 6px; background: #bbcbd5; }
.steps .current { width: 15px; background: var(--blue); }
.status-dot { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--tone, var(--neutral)); }
.tone-blue { --tone: var(--blue); }
.tone-green { --tone: var(--green); }
.tone-amber { --tone: var(--amber); }
.tone-red { --tone: var(--red); }

.operations-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 15px; height: 100%; }
.operations-map, .radar-map { position: relative; overflow: hidden; isolation: isolate; border: 1px solid var(--line); border-radius: 9px; background: #e6edf0; }
.operations-map > img, .radar-map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.operations-map figcaption, .map-legend { position: absolute; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--paper); color: var(--brand-navy); font-size: 13px; font-weight: 700; }
.operations-map figcaption { top: 10px; left: 10px; }
.operations-map figcaption .icon { width: 16px; height: 16px; }
.map-legend { bottom: 10px; right: 10px; }
.map-legend .status-dot { width: 7px; height: 7px; }
.map-legend > .status-dot { margin-left: 6px; }
.incident-colors { display: flex; gap: 3px; }
.map-marker { position: absolute; left: var(--x); top: var(--y); display: flex; align-items: center; gap: 5px; transform: translate(-50%, -50%); }
.map-pin, .incident-icon { display: grid; place-items: center; flex: none; }
.map-pin { width: 29px; height: 29px; border: 2px solid var(--paper); border-radius: 50%; background: var(--marker); color: var(--paper); }
.map-pin .icon, .incident-icon .icon { width: 17px; height: 17px; }
.map-marker strong { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--marker); font-size: 13px; white-space: nowrap; }
.marker-red { --marker: #a93630; --marker-bg: #faecea; }
.marker-amber { --marker: #8a520c; --marker-bg: #fbf0da; }
.marker-blue { --marker: #315d7c; --marker-bg: #e8f1f6; }
.marker-green { --marker: #267254; --marker-bg: #e9f5ed; }
.incident-feed { display: flex; flex-direction: column; min-width: 0; }
.incident-summary { display: flex; justify-content: space-between; align-items: center; padding: 3px 0 9px; color: var(--muted); font-size: 15px; font-weight: 700; }
.incident-summary strong { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; color: var(--brand-navy); background: #eaf1f6; font-size: 15px; }
.incident-list { flex: 1; border-top: 1px solid var(--soft-line); }
.incident-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 63px; border-bottom: 1px solid var(--soft-line); }
.incident-icon { width: 33px; height: 33px; border-radius: 7px; color: var(--marker); background: var(--marker-bg); }
.incident-detail { display: grid; gap: 4px; white-space: nowrap; }
.incident-detail strong { font-size: 19px; }
.incident-detail > span { color: var(--muted); font-size: 16px; font-weight: 600; }
.dispatch-time { align-self: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.incident-key { display: flex; align-items: center; gap: 6px; padding-top: 7px; color: var(--muted); font-size: 13px; }
.incident-key .icon { width: 15px; height: 15px; }

.weather-layout { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 18px; height: 100%; }
.temperature { display: flex; align-items: center; gap: 7px; color: var(--navy); }
.temperature strong { font-size: 63px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.temperature strong span { font-size: 0.72em; vertical-align: top; }
.weather-symbol { width: 64px; height: 64px; color: #4d7891; stroke-width: 1.35; }
.sun-ray { stroke: #ac711b; }
.weather-condition { display: grid; align-content: center; gap: 6px; padding-right: 14px; }
.weather-condition strong { max-width: 205px; overflow: hidden; color: var(--navy); font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.weather-source { color: var(--muted); font-size: 13px; font-weight: 700; }
.weather-source[data-state="stale"] { color: #81540d; }
.weather-placeholder { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 16px; }
.weather-condition > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 16px; white-space: nowrap; }
.weather-condition i { width: 4px; height: 4px; border-radius: 50%; background: var(--neutral); }
.weather-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 9px; padding-left: 17px; border-left: 1px solid var(--soft-line); }
.weather-details div { display: grid; gap: 3px; }
.weather-details dt { color: var(--muted); font-size: 14px; white-space: nowrap; }
.weather-details dd { color: var(--ink); font-size: 18px; font-weight: 700; white-space: nowrap; }

.forecast-periods { display: grid; grid-template-columns: repeat(var(--periods), minmax(0, 1fr)); height: 100%; }
.forecast-period { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; border-left: 1px solid var(--soft-line); }
.forecast-period:first-child { border: 0; }
.period-label { font-size: 16px; white-space: nowrap; }
.period-conditions { display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.period-conditions, .period-conditions > span { max-width: 100%; }
.period-conditions > span { overflow: hidden; text-overflow: ellipsis; }
.period-conditions .icon { width: 23px; height: 23px; color: var(--blue); }
.period-values { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 16px; white-space: nowrap; }
.period-low, .period-rain { color: var(--muted); font-size: 13px; }
.period-rain { display: flex; align-items: center; gap: 2px; margin-left: 2px; }
.period-rain .icon { width: 11px; height: 11px; color: var(--blue); }

.checks-list { display: grid; gap: 6px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 39px; padding: 0 10px; border: 1px solid var(--soft-line); border-radius: 7px; font-size: 19px; }
.check-row strong { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.check-row[data-tone="green"] strong { color: #245f47; }
.check-row[data-tone="amber"] { border-color: #e4bf69; background: #fff8e7; box-shadow: 0 0 8px #dba83f45; }
.check-row[data-tone="amber"] strong { color: #78500d; }
.check-row[data-tone="red"] { border-color: #da8d87; background: #fdf0ee; box-shadow: 0 0 8px #b7332b45; }
.check-row[data-tone="red"] strong { color: #a42f29; }
.check-row[data-tone="neutral"] strong { color: var(--muted); }
.checks-note { display: flex; align-items: center; gap: 6px; margin-top: 11px; color: var(--muted); font-size: 15px; }
.checks-note .icon { width: 17px; height: 17px; }
#checks[data-state="overdue"] .checks-note { color: #a42f29; font-weight: 700; }

#staffing .panel-body { overflow: hidden; }
.staffing-track, .staffing-page { height: 100%; }
.staffing-assignment { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 7px; background: #edf3f7; }
.staffing-assignment h3 { color: var(--navy); font-size: 21px; letter-spacing: -0.02em; }
.staffing-assignment > span { color: var(--muted); font-size: 14px; font-weight: 700; }
.crew-list { margin-top: 3px; }
.crew-list li { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 10px; border-bottom: 1px solid var(--soft-line); font-size: 19px; }
.crew-list li:last-child { border-bottom: 0; }
.crew-list .status-dot { width: 6px; height: 6px; }
.staffing-pending { margin: 15px 10px; color: var(--muted); font-size: 17px; }
.empty-state { color: var(--muted); font-size: 17px; }

.wind-overview { display: grid; grid-template-columns: 1fr 108px; align-items: center; gap: 8px; margin: 0 5px 9px 1px; }
.wind-reading { display: grid; gap: 3px; align-content: center; }
.wind-reading > span { color: var(--muted); font-size: 17px; }
.wind-reading > span:first-child { color: var(--brand-navy); font-weight: 700; }
.wind-reading > strong { color: var(--navy); font-size: 46px; line-height: 1; letter-spacing: -0.035em; }
.wind-reading small { font-size: 19px; letter-spacing: 0; }
.wind-reading b { color: var(--ink); }
.compass { width: 108px; height: 108px; fill: none; stroke: #9eb2c0; stroke-width: 1.25; }
.compass-ring { stroke-dasharray: 2 3; }
.compass text { stroke: none; fill: var(--muted); font: 700 13px Arial, sans-serif; text-anchor: middle; }
.compass .compass-arrow { fill: var(--blue); stroke: none; }
.wind-sides { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--soft-line); border-radius: 7px; background: #f4f7f9; }
.wind-sides div { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; padding: 8px 9px; }
.wind-sides div + div { border-left: 1px solid var(--soft-line); }
.wind-sides dt { color: var(--muted); font-size: 14px; }
.wind-sides dd { color: var(--navy); font-size: 17px; font-weight: 700; }

.radar-map { height: calc(100% - 27px); min-height: 0; }
.radar-map img { object-position: 50% 56%; }
.radar-map:not(.radar-live-map) .radar-echo { transform: translate(var(--echo-x), var(--echo-y)); }
.radar-live-map img { object-position: center; }
.radar-city { position: absolute; top: 56%; left: 50%; display: inline-flex; align-items: center; gap: 5px; color: var(--navy); font-size: 15px; font-weight: 700; text-shadow: 0 1px 2px var(--paper), 0 -1px 2px var(--paper), 1px 0 2px var(--paper); }
.radar-city .status-dot { width: 10px; height: 10px; outline: 2px solid var(--paper); }
.radar-live-map .radar-city { top: 50%; transform: translate(-5px, -50%); }
.radar-message { position: absolute; top: 8px; left: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--navy); font-size: 14px; }
.radar-caption { display: flex; align-items: center; justify-content: space-between; height: 27px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.radar-caption :is(b, time) { font-weight: 700; }
.radar-legend { display: inline-flex; gap: 3px; }
.radar-legend i { width: 13px; height: 6px; border-radius: 2px; background: #8dcad1; }
.radar-legend i:nth-child(2) { background: #65a67f; }
.radar-legend i:nth-child(3) { background: #c4ab54; }

.announcement-list { display: grid; height: 100%; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.announcement-list li { display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--soft-line); }
.announcement-list li:last-child { border-bottom: 0; }
.announcement-date { display: flex; align-items: baseline; justify-content: center; gap: 4px; width: 67px; padding: 5px 6px; border-radius: 6px; background: #edf3f7; color: var(--blue); }
.announcement-date strong { color: var(--navy); font-size: 18px; }
.announcement-date > span { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.announcement-date .icon { width: 19px; height: 19px; }
.announcement-list li > div { display: flex; align-items: baseline; gap: 11px; }
.announcement-list li > div strong { font-size: 18px; }
.announcement-list li > div span { color: var(--muted); font-size: 15px; }

.unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); height: 100%; gap: 6px 9px; }
.unit-grid li { display: grid; grid-template-columns: 9px 44px minmax(0, 1fr); align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--soft-line); border-radius: 7px; background: #f8fafb; }
.unit-grid li > strong { color: var(--navy); font-size: 19px; }
.unit-grid li > span:last-child { color: var(--muted); font-size: 17px; white-space: nowrap; }

.footer { display: flex; justify-content: space-between; align-items: center; padding: 0 34px; color: var(--muted); font-size: 13px; }
.footer > div, #connection-status { display: flex; align-items: center; gap: 9px; }
.footer strong { color: var(--brand-navy); }
.footer-divider { display: inline-block; width: 1px; height: 12px; background: var(--line); }
.footer .status-dot { width: 7px; height: 7px; }
.footer button { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; padding: 2px 5px; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.footer button .icon { width: 16px; height: 16px; }
.footer button:hover:not(:disabled) { background: #e2ecf3; color: var(--navy); }
.footer button:disabled { cursor: default; }

#tv:has(#alert-ack[data-state="pending"]) {
  grid-template-rows: 112px 146px 52px minmax(0, 1fr) 33px;
}
#tv:has(#alert-ack[data-state="pending"]) .board:not(.board-partial) {
  grid-template-rows: 144px 142px 225px minmax(0, 1fr);
  gap: 12px;
}
#tv:has(#alert-ack[data-state="pending"]) .panel { padding-block: 10px; }
#tv:has(#alert-ack[data-state="pending"]) .panel-header { margin-bottom: 7px; }
#tv:has(#alert-ack[data-state="pending"]) .incident-list li { min-height: 54px; }
#tv:has(#alert-ack[data-state="pending"]) .forecast-period { gap: 4px; }
