@font-face {
  font-family: Montserrat;
  src: url("assets/montserrat.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f3f7f8;
  --paper: #fff;
  --ink: #172b35;
  --muted: #667a83;
  --line: #dfe8ea;
  --teal: #087d75;
  --teal-soft: #e2f4f0;
  --navy: #122b34;
  --amber: #a96313;
  --amber-soft: #fff4e5;
  --red: #b34253;
  --red-soft: #fff0f2;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #49b8a9; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
svg { display: block; }
[hidden] { display: none !important; }

.app-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; height: 100dvh; flex-direction: column; padding: 27px 16px 22px; color: #e6f1f2; background: #112b34; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 9px; }
.brand-icon { display: grid; width: 37px; height: 37px; flex: none; place-items: center; border-radius: 11px; background: #bdf4dd; color: #0d6e68; }
.brand-icon svg { width: 23px; height: 23px; }
.brand strong, .brand small { display: block; }
.brand strong { font: 800 14px/1.1 Montserrat, sans-serif; letter-spacing: -.03em; }
.brand small { margin-top: 5px; color: #8fb2b6; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.sidebar-section { margin: 61px 18px 14px; color: #72939b; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.side-nav { display: grid; gap: 5px; }
.nav-link { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 0 15px; border: 1px solid transparent; border-radius: 12px; color: #a9c1c5; font-weight: 650; transition: background .15s ease, color .15s ease; }
.nav-link svg { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-link.is-current { border-color: rgb(130 228 205 / 15%); color: #dcfff2; background: #1d4950; }
.sidebar-bottom { margin-top: auto; padding: 15px 9px 0; border-top: 1px solid rgb(255 255 255 / 12%); }
.station-tile { display: flex; align-items: center; gap: 10px; }
.station-tile-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgb(147 225 210 / 25%); border-radius: 10px; color: #acf0d5; font-size: 11px; font-weight: 800; }
.station-tile strong, .station-tile small { display: block; }
.station-tile strong { font-size: 12px; }
.station-tile small { margin-top: 2px; color: #91afb5; font-size: 10px; }
.sidebar-bottom p { margin-top: 17px; color: #8daeb4; font-size: 10px; line-height: 1.65; }

.main-shell { min-width: 0; }
.topbar { display: flex; min-height: 69px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 38px; border-bottom: 1px solid var(--line); background: #fafcfc; }
.breadcrumb, .eyebrow, .panel-kicker, .summary-label, .readout-label { font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.breadcrumb { color: #527079; }
.breadcrumb span { padding: 0 9px; color: #a0afb3; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.environment-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #bdded6; border-radius: 999px; background: #eaf7f2; color: #246f62; font-size: 9px; font-weight: 800; letter-spacing: .11em; white-space: nowrap; }
.environment-pill > span:first-child { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #1aa87e; }
.environment-pill[data-tone="warning"] { border-color: #efd6aa; background: #fff7e9; color: #8b581a; }
.environment-pill[data-tone="warning"] > span:first-child { background: #d79843; }
.header-clock { color: #667a83; font-size: 11px; font-weight: 650; white-space: nowrap; }
.dashboard-main { width: min(100%, 1720px); padding: 31px 38px 30px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow, .panel-kicker { color: var(--teal); }
h1, h2, h3 { font-family: Montserrat, "Segoe UI", sans-serif; }
h1 { margin-top: 5px; font-size: clamp(30px, 3.1vw, 46px); font-weight: 800; line-height: 1.14; letter-spacing: -.055em; }
.heading-dot { color: #17a58b; }
.page-description { margin-top: 7px; color: var(--muted); font-size: 13px; }
.overall-status, .state-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #b9e1d1; background: #eaf8f1; color: #216b50; font-size: 11px; font-weight: 750; }
.overall-status { min-height: 35px; padding: 0 12px; border-radius: 999px; white-space: nowrap; }
.overall-status-mark { width: 7px; height: 7px; border-radius: 50%; background: #21a77c; }
.overall-status[data-tone="warning"], .state-pill[data-tone="warning"] { border-color: #f2d39c; background: var(--amber-soft); color: #8c5614; }
.overall-status[data-tone="warning"] .overall-status-mark { background: #d08a2c; }
.overall-status[data-tone="critical"], .state-pill[data-tone="critical"] { border-color: #efb9c1; background: var(--red-soft); color: #a53449; }
.overall-status[data-tone="critical"] .overall-status-mark { background: #c6495e; }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 8px 25px rgb(25 56 64 / 3%); }
.summary-item { display: flex; min-width: 0; min-height: 103px; flex-direction: column; justify-content: center; padding: 16px 23px; }
.summary-item + .summary-item { border-left: 1px solid var(--line); }
.summary-label { color: #778c92; font-size: 9px; }
.summary-item strong { margin-top: 6px; font: 800 28px/1.15 Montserrat, sans-serif; letter-spacing: -.055em; }
.summary-item strong small { color: var(--muted); font: 650 12px "Segoe UI", sans-serif; letter-spacing: 0; }
.summary-item .summary-word { font-size: 19px; letter-spacing: -.04em; }
.summary-item > span:last-child { overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.monitor-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(295px, .86fr); gap: 16px; }
.right-rail { display: grid; min-width: 0; grid-template-rows: 1.13fr .87fr; gap: 16px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 24px rgb(30 62 69 / 4%); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; padding: 22px 24px 0; }
.panel-kicker { font-size: 9px; }
h2 { margin-top: 5px; font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.state-pill { min-height: 28px; padding: 0 10px; border-radius: 999px; white-space: nowrap; }

.infusion-body { display: grid; grid-template-columns: minmax(170px, 240px) minmax(0, 1fr); align-items: center; gap: 17px; padding: 12px 28px 23px; }
.bag-zone { position: relative; display: grid; min-height: 316px; place-items: center; overflow: hidden; border: 1px solid #e6f0ee; border-radius: 15px; background: radial-gradient(circle at 45% 36%, #fafffd, #eaf5f2 78%); }
.bag-model { width: min(100%, 222px); height: 298px; filter: drop-shadow(0 12px 13px rgb(46 104 99 / 12%)); transform: perspective(750px) rotateY(-4deg); }
.bag-visual-caption { position: absolute; right: 0; bottom: 8px; left: 0; color: #61837f; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-align: center; }
.bag-drop { opacity: .35; transition: opacity .2s ease; }
.bag-zone[data-flow="active"] .bag-drop { opacity: 1; }
.infusion-readout { min-width: 0; }
.readout-label { color: #66838a; font-size: 9px; }
.volume-number { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; white-space: nowrap; }
.volume-number output { font: 800 clamp(52px, 5vw, 76px)/1 Montserrat, sans-serif; letter-spacing: -.07em; }
.volume-number span { color: #627780; font-size: 17px; font-weight: 700; }
.readout-subtitle { margin-top: 7px; color: var(--teal); font-size: 12px; font-weight: 700; }
.readout-subtitle[data-tone="warning"] { color: var(--amber); }
.meter-caption { display: flex; justify-content: space-between; gap: 10px; margin-top: 25px; color: var(--muted); font-size: 11px; }
.meter-caption strong { color: var(--ink); }
.meter-track { height: 9px; margin: 8px 0 17px; overflow: hidden; border-radius: 20px; background: #e7eeee; }
.meter-track span { display: block; width: 68%; height: 100%; border-radius: inherit; background: #26a996; transition: width .6s ease; }
.meter-track[data-tone="warning"] span { background: #dca14c; }
.reference-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.reference-row strong { color: var(--ink); font-weight: 750; white-space: nowrap; }
.signal-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.signal-card { display: flex; min-width: 0; gap: 13px; padding: 20px 24px 23px; }
.signal-card + .signal-card { border-left: 1px solid var(--line); }
.signal-icon { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 10px; }
.signal-icon svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-teal { background: #e4f5f1; color: #158b7e; }
.icon-rose { background: #fff0f1; color: #b94d5b; }
.signal-card > div { min-width: 0; }
.signal-card > div > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.signal-card strong { display: block; margin-top: 3px; font: 800 26px/1.2 Montserrat, sans-serif; letter-spacing: -.045em; }
.signal-card strong small { color: var(--muted); font: 600 12px "Segoe UI", sans-serif; letter-spacing: 0; }
.signal-card p { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.attention-panel { display: flex; flex-direction: column; }
.count-pill { display: grid; min-width: 29px; height: 29px; place-items: center; border-radius: 9px; background: #e7f2ef; color: var(--teal); font-size: 12px; font-weight: 800; }
.attention-empty { display: flex; min-height: 170px; flex: 1; flex-direction: column; align-items: flex-start; justify-content: center; padding: 16px 25px; }
.attention-empty-icon { display: grid; width: 39px; height: 39px; margin-bottom: 13px; place-items: center; border-radius: 50%; background: #e5f6ef; color: #178265; font-size: 18px; font-weight: 700; }
.attention-empty strong { font: 750 13px Montserrat, sans-serif; }
.attention-empty p { max-width: 300px; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.attention-list { display: grid; gap: 8px; margin: 15px 23px; padding: 0; list-style: none; }
.attention-list li { padding: 11px 13px; border: 1px solid #f0d5af; border-radius: 11px; background: #fff8ec; }
.attention-list li[data-tone="critical"] { border-color: #edb9c2; background: #fff2f3; }
.attention-list strong, .attention-list span { display: block; }
.attention-list strong { color: #784a15; font-size: 11px; }
.attention-list li[data-tone="critical"] strong { color: #ab3448; }
.attention-list span { margin-top: 3px; color: #687b80; font-size: 10px; line-height: 1.45; }
.panel-footnote { margin-top: auto; padding: 12px 23px 15px; border-top: 1px solid var(--line); color: #788990; font-size: 10px; line-height: 1.5; }
.source-panel { display: flex; flex-direction: column; }
.source-list { padding: 14px 24px 6px; }
.source-list div, .threshold-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.source-list dt, .threshold-list dt { color: var(--muted); }
.source-list dd, .threshold-list dd { font-weight: 750; text-align: right; }
.text-link { display: inline-flex; width: fit-content; align-items: center; gap: 8px; margin: auto 24px 18px; color: #08776e; font-size: 11px; font-weight: 800; }
.text-link:hover, .subtle-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(295px, .86fr); gap: 16px; margin-top: 16px; }
.subtle-link { color: #197e75; font-size: 11px; font-weight: 800; white-space: nowrap; }
.chart-wrap { display: flex; gap: 12px; padding: 22px 25px 8px; }
.chart-scale { display: flex; flex: none; flex-direction: column; justify-content: space-between; padding: 5px 0 16px; color: #82939a; font-size: 10px; font-weight: 700; }
.drop-chart { width: 100%; height: 160px; overflow: visible; }
.chart-grid { fill: none; stroke: #e7eeee; stroke-width: 1; }
.target-line { stroke: #dca767; stroke-width: 1.4; stroke-dasharray: 5 5; }
.drop-line { fill: none; stroke: #158f82; stroke-width: 3.3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 24px 22px 47px; color: #7b8c92; font-size: 10px; }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: #526c72; white-space: nowrap; }
.chart-legend i { width: 12px; height: 3px; border-radius: 3px; background: #158f82; }
.chart-legend i.target-key { height: 2px; background: #dca767; }
.chart-legend b { margin-left: 3px; color: #1e333a; }
.threshold-list { padding: 15px 24px 9px; }
.thresholds-panel { display: flex; flex-direction: column; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; padding: 23px 0 0; color: #8a9a9f; font-size: 9px; font-weight: 750; letter-spacing: .09em; }
.recent-panel { margin-top: 16px; }
.recent-empty { padding: 22px 24px 25px; color: var(--muted); font-size: 12px; }
.recent-events { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 0; padding: 17px 24px 24px; list-style: none; }
.recent-events li { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfb; }
.recent-events li[data-tone="warning"] { border-color: #efd6aa; background: #fff9ef; }
.recent-events li[data-tone="critical"] { border-color: #efc8cf; background: #fff5f6; }
.recent-events strong, .recent-events small { display: block; }
.recent-events strong { font-size: 11px; }
.recent-events small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.toast-stack { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; width: min(360px, calc(100vw - 30px)); gap: 8px; pointer-events: none; }
.toast { padding: 14px 16px; border: 1px solid #eac77d; border-left: 4px solid #bd8235; border-radius: 11px; background: #fffdfa; box-shadow: 0 15px 42px rgb(18 43 52 / 17%); pointer-events: auto; }
.toast[data-tone="critical"] { border-color: #e5aeb7; border-left-color: #b34253; background: #fff9fa; }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 12px; }
.toast span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* Trends and Settings reuse the same station shell. */
.subpage-intro { margin-bottom: 22px; }
.subpage-intro h1 { margin-top: 5px; }
.subpage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.subpage-grid .panel { min-width: 0; }
.panel-description { padding: 8px 24px 0; color: var(--muted); font-size: 12px; }
.trend-card { min-height: 300px; }
.trend-current { display: flex; align-items: baseline; gap: 6px; margin: 20px 24px 0; font: 800 31px/1 Montserrat, sans-serif; letter-spacing: -.045em; }
.trend-current small { color: var(--muted); font: 650 12px "Segoe UI", sans-serif; }
.trend-chart { display: block; width: calc(100% - 48px); height: auto; min-height: 165px; margin: 15px 24px 5px; border-radius: 10px; background: #f8fbfa; }
.trend-grid { stroke: #e3ebed; stroke-dasharray: 4 7; }
.trend-line { fill: none; stroke: #148f80; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-line.secondary { stroke: #cc8c41; }
.trend-axis { fill: #778a90; font: 11px "Segoe UI", sans-serif; }
.trend-caption { display: flex; justify-content: space-between; gap: 10px; padding: 0 24px 21px; color: var(--muted); font-size: 10px; }
.demo-notice { display: flex; gap: 13px; align-items: flex-start; margin-top: 16px; padding: 17px 20px; border: 1px solid #bcded8; border-radius: 15px; background: #eaf7f3; color: #1b635e; }
.demo-notice strong { display: block; margin-bottom: 3px; font-size: 12px; }
.demo-notice p { color: #55747a; font-size: 11px; line-height: 1.55; }
.notice-icon { display: grid; width: 27px; height: 27px; flex: none; place-items: center; border: 1px solid #80beb1; border-radius: 50%; font-weight: 800; }
.setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.browser-alert-panel { margin-bottom: 16px; }
.browser-alert-content { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px 0; }
.browser-alert-content p { max-width: 680px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.browser-alert-content button { flex: none; }
.notification-status { padding: 12px 24px 19px; color: var(--teal); font-size: 10px; font-weight: 700; }
.log-panel { min-height: 300px; }
.log-filter-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.log-filter-label select { min-height: 35px; padding: 0 9px; border: 1px solid #c8d9dc; border-radius: 8px; background: #f8fbfb; color: var(--ink); font: inherit; }
.log-empty { padding: 60px 24px; text-align: center; }
.log-empty strong { display: block; font-size: 13px; }
.log-empty p { margin-top: 6px; color: var(--muted); font-size: 11px; }
.log-list { margin: 14px 24px 25px; padding: 0; list-style: none; }
.log-list li { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border-bottom: 0; }
.log-mark { width: 9px; height: 9px; flex: none; margin-top: 5px; border-radius: 50%; background: #78aaa0; }
.log-list li[data-tone="warning"] .log-mark { background: #d69a40; }
.log-list li[data-tone="critical"] .log-mark { background: #bd5364; }
.log-list strong { display: block; font-size: 12px; }
.log-list p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.log-list small { display: block; margin-top: 6px; color: #829499; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.scenario-panel { margin-bottom: 16px; padding-bottom: 20px; }
.scenario-control { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 15px 24px 0; }
.scenario-control label { display: block; font-size: 12px; font-weight: 800; }
.scenario-control p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.scenario-control select { width: min(100%, 275px); min-height: 39px; flex: none; padding: 0 12px; border: 1px solid #c9dadd; border-radius: 9px; background: #f8fbfb; color: var(--ink); cursor: pointer; font: 700 11px "Segoe UI", sans-serif; }
.setting-card { padding: 22px 24px; }
.setting-card label { display: block; font: 750 15px Montserrat, sans-serif; }
.setting-card small { display: block; min-height: 30px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.setting-control { display: flex; align-items: center; gap: 17px; margin-top: 19px; }
.settings-range { width: 100%; accent-color: #168c7c; cursor: pointer; }
.setting-value { display: inline-flex; min-width: 77px; justify-content: flex-end; color: #114b49; font-size: 14px; font-weight: 800; white-space: nowrap; }
.settings-status { margin-top: 15px; color: #256f62; font-size: 11px; font-weight: 700; }
.setting-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.setting-button-group { display: flex; flex-wrap: wrap; gap: 9px; }
.button-outline { min-height: 38px; padding: 0 15px; border: 1px solid #c4d9d7; border-radius: 9px; background: #fff; color: #165f59; font-size: 11px; font-weight: 800; cursor: pointer; }
.button-outline:hover { background: #eaf7f3; }
.button-outline:disabled, .button-primary:disabled, .scenario-control select:disabled, .settings-range:disabled { opacity: .52; cursor: not-allowed; }
.button-primary { min-height: 38px; padding: 0 16px; border: 1px solid #147f72; border-radius: 9px; background: #0d8275; color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.button-primary:hover { background: #086c63; }

@media (max-width: 1230px) {
  .app-layout { grid-template-columns: 205px minmax(0, 1fr); }
  .dashboard-main { padding-inline: 27px; }
  .topbar { padding-inline: 27px; }
  .monitor-grid, .lower-grid { grid-template-columns: minmax(0, 1.3fr) minmax(270px, .9fr); }
  .infusion-body { grid-template-columns: 155px minmax(0, 1fr); gap: 18px; }
  .bag-zone { min-height: 285px; }
  .bag-model { height: 265px; }
}
@media (max-width: 990px) {
  .app-layout { display: block; }
  .sidebar { position: relative; height: auto; min-height: 0; padding: 16px 22px; }
  .brand { padding: 0; }
  .sidebar-section, .sidebar-bottom { display: none; }
  .side-nav { display: flex; gap: 7px; margin-top: 15px; overflow-x: auto; }
  .nav-link { min-height: 37px; flex: none; padding-inline: 12px; font-size: 12px; }
  .nav-link svg { width: 16px; height: 16px; }
  .monitor-grid, .lower-grid { grid-template-columns: 1fr; }
  .right-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr; }
  .infusion-body { grid-template-columns: 200px 1fr; }
}
@media (max-width: 650px) {
  .sidebar { padding: 14px 15px; }
  .side-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .nav-link { min-height: 47px; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 5px 2px; font-size: 9px; line-height: 1.1; text-align: center; white-space: normal; }
  .nav-link svg { width: 14px; height: 14px; }
  /* Breadcrumb on its own row, controls below it, instead of squeezing all three. */
  .topbar { min-height: 49px; flex-wrap: wrap; row-gap: 10px; padding: 12px 17px; }
  .breadcrumb { font-size: 9px; white-space: nowrap; }
  .topbar-right { gap: 12px; }
  .header-clock { display: none; }
  .environment-pill { font-size: 8px; }
  .dashboard-main { padding: 24px 15px 25px; }
  .page-intro { display: block; }
  .page-intro h1 { font-size: 34px; }
  .overall-status { width: fit-content; margin-top: 15px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item { min-height: 91px; padding: 13px 15px; }
  .summary-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .summary-item:nth-child(4) { border-top: 1px solid var(--line); }
  .summary-item strong { font-size: 23px; }
  .summary-item .summary-word { font-size: 16px; }
  .panel-heading { padding: 18px 18px 0; }
  .infusion-body { grid-template-columns: 118px minmax(0, 1fr); gap: 13px; padding: 12px 18px 18px; }
  .bag-zone { min-height: 219px; }
  .bag-model { width: 120px; height: 205px; }
  .bag-visual-caption { font-size: 6px; letter-spacing: .05em; }
  .volume-number output { font-size: 42px; }
  .volume-number span { font-size: 13px; }
  .readout-subtitle { font-size: 10px; }
  .meter-caption { margin-top: 13px; }
  .reference-row { font-size: 10px; }
  .signal-card { gap: 8px; padding: 14px 16px; }
  .signal-icon { width: 28px; height: 28px; }
  .signal-icon svg { width: 17px; height: 17px; }
  .signal-card strong { font-size: 21px; }
  .signal-card p { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.35; }
  .right-rail, .subpage-grid, .setting-grid { grid-template-columns: 1fr; }
  .recent-events { grid-template-columns: 1fr; }
  .browser-alert-content { display: grid; padding-inline: 18px; }
  .browser-alert-content button { width: fit-content; }
  .notification-status { padding-inline: 18px; }
  .log-filter-label { align-items: flex-start; flex-direction: column; }
  .scenario-control { display: grid; gap: 12px; padding-inline: 18px; }
  .scenario-control select { width: 100%; }
  .chart-wrap { padding-inline: 16px; }
  .chart-caption { padding-inline: 35px 16px; flex-wrap: wrap; }
  .chart-legend { order: 3; width: 100%; justify-content: center; }
  .app-footer { display: grid; gap: 5px; }
}
@media (max-width: 390px) {
  .summary-item > span:last-child { font-size: 10px; }
  .infusion-body { grid-template-columns: 1fr; }
  .bag-zone { width: 100%; min-height: 220px; }
  .infusion-readout { padding-top: 7px; }
  .signal-cards { grid-template-columns: 1fr; }
  .signal-card + .signal-card { border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Telemetry path: shows exactly where the displayed numbers come from. */
.source-pipeline { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; }
.source-pipeline li { position: relative; display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7fbfb; font-size: 10px; line-height: 1.25; }
.source-pipeline li:not(:last-child)::after { content: ""; position: absolute; right: -6px; top: 50%; width: 6px; height: 1px; background: #9fbdb9; }
.source-pipeline strong { font-size: 12px; color: #173b45; }
.source-pipeline small { color: var(--muted); font-size: 10.5px; }
@media (max-width: 560px) { .source-pipeline { grid-template-columns: 1fr; } .source-pipeline li:not(:last-child)::after { display: none; } }
.pipe-dot { width: 8px; height: 8px; border-radius: 50%; background: #2a9d8f; }
.source-pipeline[data-mode="demo"] [data-step="origin"] .pipe-dot { background: transparent; border: 1.5px dashed #6f8f8b; }
.source-pipeline[data-mode="stale"] [data-step="origin"],
.source-pipeline[data-mode="fallback"] [data-step="origin"] { border-color: #e6c28e; background: #fff8ec; }
.source-pipeline[data-mode="stale"] [data-step="origin"] .pipe-dot,
.source-pipeline[data-mode="fallback"] [data-step="origin"] .pipe-dot { background: #c78232; }
.telemetry-path { padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.telemetry-path-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--muted); }
.telemetry-path .source-pipeline { margin: 10px 0 0; }
.sample-age { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.sample-age output { font-variant-numeric: tabular-nums; font-weight: 750; color: var(--ink, #173b45); }
.sample-age output[data-tone="warning"] { color: #9a5b12; }
.bag-watermark { font: 700 11px/1 "Segoe UI", sans-serif; letter-spacing: .32em; fill: #0f4f4a; opacity: .22; }

/* Station display: dark, high-contrast, large readouts for a monitoring screen. */
.station-toggle { min-height: 34px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: 700 11px/1 "Segoe UI", sans-serif; letter-spacing: .04em; white-space: nowrap; flex-shrink: 0; cursor: pointer; }
.station-toggle:hover { border-color: #9cc8c1; }
.station-toggle:focus-visible { outline: 3px solid #2a9d8f; outline-offset: 2px; }
body[data-station="on"] {
  --canvas: #071418; --paper: #0d1f25; --ink: #e8f4f3; --muted: #93aeb0; --line: #1d3a41;
  --teal-soft: #0f3833; --amber-soft: #3a2a12; --red-soft: #3b1a20;
  background: var(--canvas); color: var(--ink);
}
body[data-station="on"] .sidebar,
body[data-station="on"] .recent-panel,
body[data-station="on"] .page-description,
body[data-station="on"] .app-footer,
body[data-station="on"] .thresholds-panel,
body[data-station="on"] .telemetry-path { display: none; }
body[data-station="on"] .app-layout { grid-template-columns: 1fr; }
body[data-station="on"] .topbar,
body[data-station="on"] .summary-strip,
body[data-station="on"] .station-toggle { background: var(--paper); border-color: var(--line); color: var(--ink); }
body[data-station="on"] .panel { background: var(--paper); border-color: var(--line); box-shadow: none; }
body[data-station="on"] .lower-grid { grid-template-columns: 1fr; }
body[data-station="on"] .bag-zone { background: radial-gradient(circle at 50% 40%, #12343a, #0a1a1f); }
body[data-station="on"] .volume-number output { font-size: clamp(88px, 9vw, 150px); }
body[data-station="on"] .volume-number span { color: var(--muted); font-size: 26px; }
body[data-station="on"] .signal-card strong { font-size: clamp(36px, 3.2vw, 54px); }
body[data-station="on"] .summary-item strong { font-size: 30px; }
body[data-station="on"] .environment-pill { padding: 10px 16px; font-size: 13px; background: #3a2a12; border-color: #a96313; color: #ffd597; }
body[data-station="on"] h1 { font-size: 30px; }
body[data-station="on"] .bag-watermark { fill: #bfe9e2; opacity: .3; }
@media (prefers-reduced-motion: reduce) { .station-toggle { transition: none; } }

/* 3D bag: a WebGL canvas layered over the SVG, which stays as the fallback. */
.bag-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.bag-zone.has-3d .bag-model { visibility: hidden; }
.bag-zone.has-3d .bag-visual-caption { z-index: 1; }
