:root {
  color-scheme: dark;
  --bg: #071018;
  --sidebar: #09131d;
  --panel: #0d1924;
  --panel-strong: #102232;
  --border: rgba(167, 203, 228, 0.12);
  --text: #ecf7ff;
  --muted: #86a1b5;
  --cyan: #4fd9ff;
  --blue: #4285ff;
  --green: #49d49d;
  --yellow: #f3c969;
  --red: #ff6f7d;
  --surface-whisper: rgba(255, 255, 255, 0.025);
  --surface-control: rgba(255, 255, 255, 0.035);
  --surface-action: rgba(255, 255, 255, 0.03);
  --cyan-soft: rgba(79, 217, 255, 0.09);
  --cyan-selection: rgba(79, 217, 255, 0.1);
  --cyan-strong: rgba(79, 217, 255, 0.12);
  --cyan-border: rgba(79, 217, 255, 0.3);
  --green-panel: rgba(73, 212, 157, 0.07);
  --green-soft: rgba(73, 212, 157, 0.1);
  --green-strong: rgba(73, 212, 157, 0.12);
  --green-border: rgba(73, 212, 157, 0.2);
  --yellow-soft: rgba(243, 201, 105, 0.1);
  --yellow-strong: rgba(243, 201, 105, 0.11);
  --red-panel: rgba(255, 111, 125, 0.09);
  --red-soft: rgba(255, 111, 125, 0.1);
  --red-strong: rgba(255, 111, 125, 0.12);
  --red-emphasis: rgba(255, 111, 125, 0.14);
  --red-border: rgba(255, 111, 125, 0.2);
  --red-border-strong: rgba(255, 111, 125, 0.5);
  --danger-text: #ffdce0;
  --on-accent: #041019;
  --accent-hover: #85e8ff;
  --accent-focus: #85e8ff;
  --body-atmosphere: radial-gradient(circle at 75% -10%, #113552 0, transparent 36%);
  --sidebar-surface: rgba(9, 19, 29, 0.92);
  --panel-surface: linear-gradient(155deg, rgba(17,35,50,.92), rgba(11,24,35,.92));
  --primary-card-surface: radial-gradient(circle at 90% 10%, rgba(79,217,255,.18), transparent 44%), linear-gradient(155deg, #11283a, #0c1d2a);
  --input-surface: rgba(3, 11, 17, 0.58);
  --header-surface: rgba(9, 19, 29, 0.94);
  --chart-grid: rgba(167, 203, 228, 0.09);
  --error-action-surface: rgba(7, 16, 24, 0.35);
  --modal-backdrop: rgba(2, 8, 13, 0.74);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f6;
  --sidebar: #f6fafc;
  --panel: #ffffff;
  --panel-strong: #e5eff4;
  --border: rgba(31, 73, 94, 0.16);
  --text: #102a38;
  --muted: #526d7c;
  --cyan: #007e9b;
  --blue: #285fc7;
  --green: #147653;
  --yellow: #785600;
  --red: #bd3548;
  --surface-whisper: rgba(16, 42, 56, 0.035);
  --surface-control: rgba(16, 42, 56, 0.055);
  --surface-action: rgba(16, 42, 56, 0.04);
  --cyan-soft: rgba(0, 126, 155, 0.09);
  --cyan-selection: rgba(0, 126, 155, 0.11);
  --cyan-strong: rgba(0, 126, 155, 0.14);
  --cyan-border: rgba(0, 126, 155, 0.34);
  --green-panel: rgba(20, 118, 83, 0.08);
  --green-soft: rgba(20, 118, 83, 0.1);
  --green-strong: rgba(20, 118, 83, 0.14);
  --green-border: rgba(20, 118, 83, 0.24);
  --yellow-soft: rgba(120, 86, 0, 0.1);
  --yellow-strong: rgba(120, 86, 0, 0.13);
  --red-panel: rgba(189, 53, 72, 0.08);
  --red-soft: rgba(189, 53, 72, 0.1);
  --red-strong: rgba(189, 53, 72, 0.13);
  --red-emphasis: rgba(189, 53, 72, 0.15);
  --red-border: rgba(189, 53, 72, 0.23);
  --red-border-strong: rgba(189, 53, 72, 0.48);
  --danger-text: #8c2232;
  --on-accent: #ffffff;
  --accent-hover: #006780;
  --accent-focus: #007e9b;
  --body-atmosphere: radial-gradient(circle at 75% -10%, #cfe8f1 0, transparent 38%);
  --sidebar-surface: rgba(246, 250, 252, 0.94);
  --panel-surface: linear-gradient(155deg, rgba(255,255,255,.98), rgba(242,247,249,.98));
  --primary-card-surface: radial-gradient(circle at 90% 10%, rgba(0,126,155,.12), transparent 45%), linear-gradient(155deg, #ffffff, #edf5f8);
  --input-surface: rgba(255, 255, 255, 0.9);
  --header-surface: rgba(246, 250, 252, 0.96);
  --chart-grid: rgba(31, 73, 94, 0.12);
  --error-action-surface: rgba(255, 255, 255, 0.56);
  --modal-backdrop: rgba(16, 42, 56, 0.34);
  --shadow: 0 14px 36px rgba(31, 73, 94, 0.11);
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--muted) var(--sidebar); scrollbar-width: thin; }
body { margin: 0; min-width: 320px; background: var(--body-atmosphere), var(--bg); color: var(--text); }
::selection { color: var(--text); background: var(--cyan-selection); }
button, a { font: inherit; }
button { color: inherit; }
input, select { caret-color: var(--cyan); }
:where(a, button, input, select):focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; inset: 12px auto auto 12px; padding: 10px 14px; border-radius: 9px; color: var(--bg); background: var(--cyan); font-weight: 700; text-decoration: none; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; background: var(--sidebar-surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; backdrop-filter: blur(18px); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; padding: 0 8px 28px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--on-accent); background: var(--cyan); font-weight: 800; letter-spacing: -1px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18); }
.brand strong, .brand small, .sidebar-footer strong, .sidebar-footer small { display: block; }
.brand strong { letter-spacing: -0.02em; }
.brand small, .sidebar-footer small { color: var(--muted); margin-top: 2px; font-size: 11px; }
.mobile-device-picker { display: none; }
.nav-label { padding: 0 10px 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.device-list { display: grid; gap: 6px; }
.device-button { width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.device-button:hover { background: var(--surface-control); }
.device-button.active { background: var(--cyan-soft); border-color: rgba(79,217,255,.16); }
.device-button .device-name { min-width: 0; }
.device-button strong, .device-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-button strong { font-size: 13px; font-weight: 600; }
.device-button small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.device-temperature { color: var(--cyan); font-weight: 700; font-variant-numeric: tabular-nums; }
.device-dot, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,111,125,.08); }
.device-dot.online, .status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(73,212,157,.08); }
.sidebar-footer { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; font-size: 12px; }

.main { min-width: 0; padding: 34px clamp(20px, 4vw, 58px) 50px; }
.topbar { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 28px; }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1, h2 { text-wrap: balance; }
.subtitle, .analysis-description { text-wrap: pretty; }
h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
.subtitle { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.theme-toggle { white-space: nowrap; }
.refresh-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.refresh-button { min-height: 44px; border: 1px solid var(--border); background: var(--surface-control); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.refresh-button:hover { border-color: rgba(79,217,255,.38); }
.refresh-button:disabled { opacity: .55; cursor: wait; }
.logout-button { color: var(--muted); }
.logout-button:hover { color: var(--text); border-color: rgba(255,111,125,.38); }
.error-banner { margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; color: var(--danger-text); background: var(--red-strong); border: 1px solid var(--red-border); font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.error-banner button { min-height: 36px; flex: 0 0 auto; padding: 7px 11px; border: 1px solid rgba(255,111,125,.32); border-radius: 8px; color: var(--text); background: var(--error-action-surface); cursor: pointer; }
.error-banner button:hover { border-color: var(--red); }
.error-banner button:focus-visible { outline: 2px solid rgba(255,111,125,.4); outline-offset: 2px; }
.alarm-summary { margin-bottom: 14px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--green-border); border-radius: 14px; background: var(--green-panel); }
.alarm-summary > div { display: flex; align-items: center; gap: 14px; }
.alarm-summary strong, .alarm-summary small { display: block; }
.alarm-summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.alarm-count { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-strong); font-weight: 800; }
.alarm-state-label { color: var(--green); font-size: 12px; font-weight: 800; }
.alarm-summary.active { border-color: rgba(255,111,125,.28); background: var(--red-panel); }
.alarm-summary.active .alarm-count, .alarm-summary.active .alarm-state-label { color: var(--red); }
.alarm-summary.active .alarm-count { background: var(--red-emphasis); }

.status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.status-card, .panel { background: var(--panel-surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.status-card { min-height: 150px; border-radius: 16px; padding: 19px; }
.status-card.alarm-card { border-color: var(--red-border-strong); box-shadow: 0 0 0 1px var(--red-soft), var(--shadow); }
.primary-card { background: var(--primary-card-surface); }
.card-head { color: var(--muted); display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.unit { font-size: 11px; letter-spacing: .06em; }
.metric { font-size: clamp(34px, 4vw, 47px); line-height: 1; font-weight: 650; letter-spacing: -.04em; margin: 26px 0 10px; font-variant-numeric: tabular-nums; }
.state-metric { font-size: 27px; font-weight: 700; margin: 31px 0 13px; }
.state-metric.on { color: var(--green); }
.state-metric.off { color: var(--red); }
.metric-note { color: var(--muted); font-size: 11px; }
.live-mark { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 12px var(--green); }
.door-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 31px 0 17px; }
.state-chip { border-radius: 999px; padding: 7px 10px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.state-chip.open { color: var(--yellow); background: var(--yellow-strong); }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr); gap: 14px; }
.panel { border-radius: 16px; padding: 21px; min-width: 0; }
.chart-panel { grid-column: 1 / -1; min-height: 0; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.range-control { display: flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--surface-control); }
.range-control button { min-width: 44px; min-height: 44px; padding: 7px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.range-control button.active { color: var(--text); background: var(--cyan-strong); }
.legend { display: flex; gap: 16px; margin: 22px 0 4px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; gap: 7px; align-items: center; }
.legend i { display: block; width: 18px; height: 2px; border-radius: 2px; }
.legend-one { background: var(--cyan); }
.legend-two { height: 0 !important; background: transparent; border-top: 2px dashed var(--blue); }
.temperature-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
.temperature-series { min-width: 0; }
.temperature-series + .temperature-series { padding-left: 24px; border-left: 1px solid var(--border); }
.temperature-series-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.temperature-series-head h3 { margin: 0; font-size: 13px; }
.temperature-series-head span { color: var(--muted); font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.temperature-series .chart { min-height: 0; }
.chart { min-height: 290px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart svg:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; border-radius: 4px; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-line-one, .chart-line-two { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-one { stroke: var(--cyan); }
.chart-line-two { stroke: var(--blue); }
.chart-area { fill: url(#temperatureGradient); }
.temperature-limit-line { stroke-width: 1.25; stroke-dasharray: 6 5; }
.temperature-limit-line.upper { stroke: var(--red); }
.temperature-limit-line.lower { stroke: var(--yellow); }
.temperature-limit-label { font-size: 10px; font-weight: 700; }
.temperature-limit-label.upper { fill: var(--red); }
.temperature-limit-label.lower { fill: var(--yellow); }
.temperature-hover line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.temperature-hover circle { fill: var(--panel); stroke-width: 2.5; }
.temperature-hover.one circle { stroke: var(--cyan); }
.temperature-hover.two circle { stroke: var(--blue); }
.temperature-hover rect { fill: var(--panel-strong); stroke: var(--border); stroke-width: 1; }
.temperature-hover text { fill: var(--muted); font-size: 11px; pointer-events: none; }
.temperature-hover.one text tspan.value { fill: var(--cyan); font-weight: 700; }
.temperature-hover.two text tspan.value { fill: var(--blue); font-weight: 700; }
.environment-values { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 31px 0 25px; }
.environment-values div { min-width: 0; }
.environment-values span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.environment-values strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.environment-values small { color: var(--muted); margin-left: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0 0 16px; }
.detail-list { margin: 0; display: grid; gap: 13px; }
.detail-list div { display: flex; justify-content: space-between; gap: 18px; font-size: 12px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.events-panel { grid-column: 1 / -1; }
.alarms-panel { grid-column: 1 / -1; }
.analysis-panel { grid-column: 1 / -1; }
.alarm-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.alarm-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-whisper); }
.alarm-list strong, .alarm-list small { display: block; }
.alarm-list small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.alarm-list time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.alarm-severity { padding: 5px 7px; border-radius: 7px; color: var(--yellow); background: var(--yellow-soft); font-size: 11px; font-weight: 800; }
.alarm-list li.critical .alarm-severity { color: var(--red); background: var(--red-strong); }
.analysis-badge { padding: 6px 9px; border-radius: 8px; color: var(--yellow); background: var(--yellow-soft); font-size: 11px; font-weight: 800; }
.analysis-badge.ready { color: var(--green); background: var(--green-soft); }
.analysis-progress { margin-top: 22px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.analysis-progress > div { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-control); }
.analysis-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .3s ease; }
.analysis-progress strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.analysis-description { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.anomaly-chart { margin-top: 20px; }
.anomaly-chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.anomaly-chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: var(--muted); font-size: 11px; }
.anomaly-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.anomaly-chart-legend i { display: block; width: 18px; }
.score-legend-line { height: 2px; background: var(--cyan); }
.score-legend-alert { height: 2px; background: var(--red); }
.score-legend-threshold { height: 0; border-top: 1px dashed var(--yellow); }
.anomaly-chart-summary { display: flex; gap: 18px; margin: 0; }
.anomaly-chart-summary div { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.anomaly-chart-summary dt { color: var(--muted); font-size: 11px; }
.anomaly-chart-summary dd { margin: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.anomaly-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.anomaly-chart svg:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; border-radius: 4px; }
.anomaly-score-area { fill: url(#anomalyScoreArea); }
.anomaly-score-line { fill: none; stroke: var(--cyan); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.anomaly-score-alert-line { fill: none; stroke: var(--red); stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.anomaly-threshold-line { stroke: var(--yellow); stroke-width: 1.4; stroke-dasharray: 7 6; }
.anomaly-threshold-label { fill: var(--yellow); font-size: 11px; font-weight: 700; }
.anomaly-score-marker { fill: var(--panel); stroke: var(--red); stroke-width: 2.5; }
.anomaly-hover line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.anomaly-hover circle { fill: var(--panel); stroke: var(--cyan); stroke-width: 2.5; }
.anomaly-hover rect { fill: var(--panel-strong); stroke: var(--border); stroke-width: 1; }
.anomaly-hover text { fill: var(--muted); font-size: 11px; pointer-events: none; }
.anomaly-hover text tspan + tspan { fill: var(--text); font-weight: 700; }
.anomaly-hover text tspan.alert { fill: var(--red); }
.anomaly-scale-note { margin: 4px 0 0; color: var(--muted); font-size: 10px; text-align: right; }
.anomaly-chart-empty { margin-top: 18px; border-top: 1px solid var(--border); }
.anomaly-list-heading { margin: 24px 0 0; font-size: 13px; }
.anomaly-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.anomaly-list li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border-left: 1px solid var(--red); border-radius: 10px; background: rgba(255,111,125,.06); }
.anomaly-list strong, .anomaly-list small { display: block; }
.anomaly-list small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.anomaly-list time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.event-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.event-list li { min-width: 0; padding: 13px 14px; background: var(--surface-whisper); border-radius: 11px; border-left: 1px solid var(--cyan); }
.event-list strong, .event-list span { display: block; }
.event-list strong { font-size: 12px; margin-bottom: 5px; }
.event-list span { color: var(--muted); font-size: 11px; }
.empty-state { color: var(--muted); text-align: center; padding: 80px 20px; font-size: 12px; }
.empty-state.compact { padding: 30px 20px 12px; }

@media (max-width: 1050px) {
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .events-panel { grid-column: auto; }
  .alarms-panel { grid-column: auto; }
  .analysis-panel { grid-column: auto; }
  .chart-panel { grid-column: auto; }
  .temperature-chart-grid { grid-template-columns: 1fr; }
  .temperature-series + .temperature-series { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .event-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; padding: 18px max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 0 16px; }
  .mobile-device-picker { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
  .mobile-device-picker select { width: 100%; min-height: 44px; padding: 9px 38px 9px 11px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--input-surface); font: 400 16px Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }
  .mobile-device-picker select:focus { outline: 2px solid rgba(79,217,255,.3); border-color: var(--cyan); }
  .nav-label, .device-list, .sidebar-footer { display: none; }
  .main { padding: 24px max(16px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .topbar { align-items: flex-start; }
  .refresh-time { display: none; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-card { min-height: 135px; }
  .panel-head { flex-direction: column; }
  .range-control { width: 100%; }
  .range-control button { flex: 1; }
}

@media (max-width: 480px) {
  .anomaly-chart-toolbar { align-items: flex-start; flex-direction: column; }
  .anomaly-chart-summary { width: 100%; justify-content: space-between; }
  .status-strip { grid-template-columns: 1fr; }
  .topbar { display: block; }
  .top-actions { width: 100%; margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
  .top-actions .refresh-button { display: grid; place-items: center; text-align: center; }
  .event-list { grid-template-columns: 1fr; }
  .environment-values strong { font-size: 24px; }
  .alarm-list li { grid-template-columns: auto 1fr; }
  .alarm-list time { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-progress span { transition: none; }
  .skip-link { transition: none; }
}
