/* Monitoring overview: stable readings and clear state changes. */
.ops-overview {
  --overview-surface: #0d2332;
  --overview-border: #274859;
  --overview-muted: #afc5d3;
  --overview-ink: #edf7fc;
  --overview-blue: #77d0fa;
  --overview-green: #82deca;
  --overview-amber: #f5d18b;
  --overview-red: #ffc0ab;
}

.overview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  margin: 2px 0 14px;
}

.overview-heading h1 {
  margin: 0;
  color: var(--overview-ink);
  font-size: clamp(23px, 2.1vw, 34px);
  line-height: 1.2;
  letter-spacing: .02em;
}

.overview-heading p {
  margin: 5px 0 0;
  color: var(--overview-muted);
  font-size: 12px;
  line-height: 1.5;
}

.overview-heading p > span { padding-inline: 3px; }
.overview-heading time { color: var(--overview-ink); font-variant-numeric: tabular-nums; }
.overview-alerts { display: flex; flex-wrap: wrap; gap: 8px; }

.overview-alert-chip {
  --chip-color: var(--overview-red);
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 11px;
  border: 1px solid #795048;
  border-radius: 6px;
  background: #35252a;
  color: var(--chip-color);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.overview-alert-chip.review {
  --chip-color: var(--overview-amber);
  border-color: #685b3c;
  background: #2d2821;
}

.overview-alert-chip:hover { border-color: var(--chip-color); background: #453434; }
.overview-alert-chip.review:hover { background: #3c3426; }
.overview-alert-chip > svg { width: 16px; height: 16px; flex: none; }
.overview-alert-chip > .overview-chip-arrow { width: 12px; opacity: .8; }
.overview-alert-chip strong { font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1; }

.ops-overview .wide-summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding-block: 12px;
  height: auto;
  min-height: 74px;
  background: var(--overview-surface);
  border-color: var(--overview-border);
  border-radius: 6px;
}

.ops-overview .wide-summary .metric { min-width: 0; }
.ops-overview .wide-summary .summary-icon { flex: none; }
.ops-overview .wide-summary .metric-label { color: var(--overview-muted); font-size: 12px; white-space: normal; }
.ops-overview .wide-summary .metric-value { color: var(--overview-blue); font-variant-numeric: tabular-nums; }
.ops-overview .wide-summary .metric-value.teal { color: var(--overview-green); }
.ops-overview .wide-summary .metric-value.amber { color: var(--overview-amber); }
.ops-overview .wide-summary .metric-value small { color: var(--overview-muted); }
.ops-overview .ops-health-strip { background: #0b202d; border-color: var(--overview-border); }
.overview-health-title { color: var(--overview-ink); font-size: 12px; font-weight: 650; margin-right: 5px; }
.ops-overview .ops-health-strip > button:not(.button),
.ops-overview .ops-health-strip > .button { min-height: 28px; font-size: 11px; }
.ops-overview .ops-health-strip > button:not(.button):hover { background: #203c4e; border-radius: 4px; }
.ops-overview .ops-health-scope { color: var(--overview-muted); font-size: 11px; }
.ops-overview .panel { border-color: var(--overview-border); }
.ops-overview .panel:not(.screen-map) > .panel-head { background: #102b3a; }
.ops-overview .panel-title { color: var(--overview-ink); }
.ops-overview .panel-subtitle { color: var(--overview-muted); }
.ops-overview .text-button { color: var(--overview-blue); font-size: 12px; white-space: nowrap; }
.ops-overview .interactive-chart-toolbar .segmented button,
.ops-overview .playback-button,
.ops-overview .chart-interaction-hint { font-size: 11px; }

.ops-overview .screen-right .water-panel .readings { padding: 9px 10px 10px; }
.ops-overview .water-readings { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ops-overview .screen-right .water-reading.ops-water {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  min-height: 108px;
  padding: 8px;
  border: 1px solid #34576a;
  border-radius: 5px;
  background: #112b3c;
}

.ops-overview .screen-right .water-reading.ops-water:hover { background: #19384c; border-color: var(--overview-blue); }
.ops-overview .screen-right .water-reading.water-invalid { background: #24262e; border-color: #644b48; }
.ops-overview .screen-right .water-reading.water-stale { background: #142632; border-color: #455b69; }
.ops-overview .water-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px; }
.ops-overview .water-card-head .water-label { color: var(--overview-ink); font-size: 12px; font-weight: 650; }
.ops-overview .water-card-head .ops-quality { font-size: 10px; padding: 1px 4px; }
.ops-overview .water-reading .water-value { color: var(--overview-blue); font-size: clamp(18px, 1.5vw, 26px) !important; margin: 0 !important; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-overview .water-value small { color: var(--overview-muted); font-size: 11px; }
.ops-overview .water-stale .water-value { color: #9cb0bf; }
.ops-overview .water-invalid .water-value { color: var(--overview-red); }
.ops-overview .screen-right .water-reading > .water-observed,
.ops-overview .screen-right .water-reading > .water-last { display: block; color: var(--overview-muted); font-size: 11px; line-height: 1.3; }
.ops-overview .water-last { border-top: 1px solid #614b4a; padding-top: 4px; }
.ops-overview .water-last b { color: var(--overview-ink); margin-left: 2px; white-space: nowrap; }
.ops-overview .water-last time { display: block; }
.ops-overview .water-basis { margin-top: 5px; color: var(--overview-muted); font-size: 10px; line-height: 1.3; }

.overview-event-list { display: grid; list-style: none; margin: 0; padding: 0 12px 4px; }
.overview-event {
  display: grid;
  grid-template-columns: 73px minmax(0, 1fr) minmax(0, 145px) auto;
  align-items: center;
  column-gap: 10px;
  padding: 5px 0;
  min-height: 42px;
}

.overview-event + .overview-event { border-top: 1px solid #294657; }
.overview-event-status { width: fit-content; border-radius: 4px; padding: 3px 5px; font-size: 11px; font-weight: 650; }
.overview-event-status.exceeded { color: var(--overview-red); background: #513334; }
.overview-event-status.offline { color: var(--overview-amber); background: #413521; }
.overview-event-status.recovered { color: var(--overview-green); background: #173f3a; }
.overview-event-name { display: grid; gap: 1px; min-width: 0; }
.overview-event-name strong { color: var(--overview-ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-event-name small { color: var(--overview-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.overview-event-name small span { padding-inline: 2px; }
.overview-event > .tag { justify-self: start; white-space: normal; }
.overview-event-empty { padding: 15px 0; color: var(--overview-muted); }
.overview-event-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 3px 7px;
  border: 1px solid #335b71;
  border-radius: 4px;
  color: var(--overview-blue);
  background: #143344;
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
}
.overview-event-button svg { width: 11px; height: 11px; }
.overview-event-button:hover { background: #204a60; border-color: var(--overview-blue); }
.ops-overview button:focus-visible,
.ops-overview select:focus-visible { outline: 2px solid #bceaff; outline-offset: 2px; }

.ops-event-trend h3 { margin-bottom: 3px; }
.drawer .ops-event-trend .ops-chart { height: 236px; }
.ops-linked-event { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; color: #b0c9da; font-size: 12px; }
.ops-linked-event strong { color: #85d9fc; margin-left: 5px; }
.ops-linked-event .button { color: #bceaff; font-size: 11px; min-height: 29px; }
body[data-view="overview"]:has(.drawer:not([hidden]) .ops-linked-event) .drawer-backdrop {
  backdrop-filter: none;
  background: #07182444;
}

body[data-view="overview"].home-motion-on .topbar::after { opacity: .3; }
.home-motion-on #main .ops-overview .panel:not(.screen-map) > .panel-head::after { opacity: .22; box-shadow: none; }
.home-motion-on .ops-overview .scene-ambient-motion { opacity: .35; }
.home-motion-on .ops-overview .device-ring::after,
.home-motion-on .ops-overview .device-ring::before { opacity: .45; }
.home-motion-on #main .ops-overview .panel:hover,
.home-motion-on #main .ops-overview .panel:focus-within { box-shadow: none; border-color: #467188; }

.ops-overview .model-marker[data-priority] { z-index: 2; }
.ops-overview .model-marker.selected { outline: 2px solid #bceaff; outline-offset: 2px; z-index: 3; }
.ops-overview .model-marker.compact:not(:hover):not(:focus-visible):not(.selected) { padding: 3px; border-radius: 50%; }
.ops-overview .model-marker.compact:not(:hover):not(:focus-visible):not(.selected) > :not(.beacon-dot) {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 1101px) {
  .ops-overview .screen-grid {
    height: calc(100dvh - 310px);
    min-height: 660px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr) minmax(0, 1fr);
    grid-template-rows: minmax(476px, 1fr) 176px;
  }
  .ops-overview .screen-right { grid-template-rows: minmax(195px, 1.2fr) minmax(135px, 1fr) minmax(121px, .9fr); }
  .drawer.device-wide:has(.ops-linked-event) { width: clamp(385px, 33vw, 520px); }
}

@media (max-width: 1100px) {
  .ops-overview .wide-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .ops-overview .screen-right {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: minmax(195px, auto) minmax(170px, auto);
  }
  .ops-overview .screen-videos { grid-column: 1 / -1; }
  .ops-overview .screen-videos .video-image { max-height: 106px; }
  .ops-overview .water-readings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .overview-heading { align-items: flex-start; flex-direction: column; margin-bottom: 11px; }
  .overview-alert-chip { min-height: 40px; }
  .ops-overview .wide-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ops-overview .wide-summary .metric { grid-column: span 3; }
  .ops-overview .wide-summary .metric:nth-child(n + 5) { grid-column: span 2; padding-inline: 8px; gap: 6px; }
  .ops-overview .wide-summary .metric:last-child { border-left: 1px solid #17435e; }
  .ops-overview .wide-summary .metric:nth-child(n + 5) .summary-icon { width: 19px; }
  .overview-health-title { flex-basis: 100%; }
  .ops-overview .ops-health-strip > button:not(.button) { padding-inline: 4px; }
  .ops-overview .screen-events { order: -1; min-height: 0; }
  .overview-event {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    column-gap: 7px;
    row-gap: 5px;
    padding: 8px 0;
  }
  .overview-event > .tag { grid-column: 2; grid-row: 2; }
  .overview-event-button { grid-column: 3; grid-row: 1 / 3; }
  .overview-event-status { font-size: 10px; }
}
