/* Eight fixed slots. Pagination replaces the center panel's nested scroll areas. */
.screen-monitor-panel { overflow: visible; height: auto; flex: 1; padding: 12px 14px 8px; }
.screen-selected-panel { overflow: visible; }
.screen-device-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 40px; flex-shrink: 0; border-bottom: 1px solid var(--screen-line); padding-bottom: 8px; }
.screen-device-bar h2 { min-width: 50px; flex: 1; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-device-bar .screen-device-states { padding: 0; gap: 10px; flex-wrap: nowrap; min-width: 0; flex-shrink: 1; }
.screen-device-bar .screen-device-state { padding: 0; border: 0; gap: 4px; min-width: 0; font-size: 14px; white-space: nowrap; }
.screen-device-bar .screen-device-state strong, .screen-device-bar .screen-device-state small { font-size: 14px; }
.screen-device-info { position: relative; flex-shrink: 0; font-size: 14px; }
.screen-device-info summary { cursor: pointer; color: var(--screen-teal); list-style: none; padding: 5px 0 5px 4px; }
.screen-device-info summary::-webkit-details-marker { display: none; }
.screen-device-info summary:focus-visible { outline: 2px solid var(--screen-teal); outline-offset: 3px; }
.screen-info-popover { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 52px); background: var(--screen-surface); border: 1px solid var(--screen-line-strong); border-radius: 10px; padding: 16px; box-shadow: 0 12px 35px #213c5b24; display: grid; gap: 10px; }
.screen-info-popover > span { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; color: var(--screen-muted); }
.screen-info-popover strong { color: var(--screen-text); overflow-wrap: anywhere; font-weight: 500; }
.screen-info-popover .screen-position-link { padding: 0; font-size: 14px; }
.screen-device-overview.screen-gauge-overview { flex: 1; min-height: 0; padding-top: 10px; }
.screen-primary-metrics.screen-gauge-grid { flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; padding: 0; max-height: none; overflow: visible; scrollbar-gutter: auto; }
.screen-primary-card.screen-gauge-card { gap: 2px; padding: 6px 5px; justify-content: center; }
.screen-gauge-card .screen-metric-label.screen-gauge-label { min-height: 24px; line-height: 24px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-gauge-face { width: min(100%, 124px); }
.screen-gauge-card .screen-metric-state.screen-gauge-status { min-height: 23px; padding: 0 9px; line-height: 21px; }
.screen-gauge-range { min-height: 21px; line-height: 21px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-gauge-card .screen-metric-unit { white-space: normal; overflow: visible; text-overflow: clip; font-size: 16px; min-height: 23px; line-height: 1.4; }
.screen-gauge-placeholder { border-style: dashed !important; background: #f9fbfd !important; color: var(--screen-muted); min-height: 180px !important; font-size: 15px; }
.screen-gauge-placeholder > span:first-child { color: #cbd7e3; font-size: 32px; }
.screen-gauge-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding-top: 7px; flex-shrink: 0; }
.screen-gauge-footer .screen-received { justify-content: flex-start; padding: 0; font-size: 14px; }
.screen-gauge-pager { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--screen-muted); }
.screen-gauge-pager button { background: #edf4f7; border: 1px solid var(--screen-line); border-radius: 6px; color: var(--screen-text); min-width: 28px; height: 28px; padding: 0 6px; }
.screen-gauge-pager button:hover:not(:disabled) { background: #deeeeb; color: var(--screen-teal); }
#screenGaugePage { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
@media (min-width: 1101px) {
  .screen-app { min-height: 900px; gap: 10px; padding: 0 16px; }
  .screen-header { height: 64px; min-height: 64px; }
  .screen-summary { padding: 4px 12px; }
  .screen-view-tabs button { padding: 8px; }
  .screen-topbar { grid-template-columns: 230px 1fr; }
  .screen-workspace { min-height: 722px; grid-template-columns: 230px minmax(0, 1fr) 280px; gap: 12px; }
  .screen-left-column, .screen-center-column { gap: 10px; }
  .screen-selected-panel { min-height: 550px; flex: 1; }
  .screen-trend-panel { min-height: 160px; flex: .4; }
  .screen-trend-heading { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
  .screen-trend-chart { min-height: 90px; }
  .screen-trend-hint { min-height: 24px; padding: 0 16px 2px; }
  .screen-footer { min-height: 24px; height: 24px; padding: 0 0 5px; }
}
@media (min-width: 1700px) {
  .screen-workspace { grid-template-columns: 270px minmax(0, 1fr) 320px; }
  .screen-gauge-face { width: min(100%, 154px); }
  .screen-primary-card.screen-gauge-card { gap: 3px; }
  .screen-selected-panel { min-height: 610px; }
}
@media (min-width: 1101px) and (max-width: 1250px) {
  .screen-workspace { grid-template-columns: 200px minmax(0, 1fr) 240px; }
  .screen-device-bar { gap: 6px; }
  .screen-device-bar .screen-device-states { gap: 6px; }
  .screen-device-bar .screen-device-state { flex-direction: column; gap: 0; line-height: 18px; }
}
@media (max-width: 1100px) {
  .screen-selected-panel { min-height: 0; }
  .screen-primary-metrics.screen-gauge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .screen-gauge-face { width: min(100%, 130px); }
  .screen-monitor-panel { min-height: 0; flex: initial; }
  .screen-device-bar .screen-device-states { gap: 7px; }
  .screen-device-bar .screen-device-state { flex-direction: column; gap: 0; line-height: 18px; }
}
@media (max-width: 600px) {
  .screen-monitor-panel { padding: 10px; }
  .screen-device-bar { gap: 6px; }
  .screen-device-bar h2 { font-size: 16px; }
  .screen-device-bar .screen-status { padding: 3px 5px; font-size: 13px; }
  .screen-device-bar .screen-device-state > span { display: none; }
  .screen-device-bar .screen-device-state strong { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  .screen-primary-metrics.screen-gauge-grid { gap: 10px 8px; }
  .screen-gauge-card .screen-metric-value { font-size: 25px; }
  .screen-gauge-footer { justify-content: center; gap: 8px; }
}
