:root {
  color-scheme: dark;
  --ground: #080b0c; --surface: #0e1315; --raised: #151d20; --ink: #edf3f2; --muted: #a5b2b5;
  --line: #293436; --line-strong: #536366; --mint: #72f0c6; --mint-soft: #162d28;
  --coral: #ff9586; --amber: #efc675; --blue: #95bfff; --red: #ff938b;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  --z-header: 10; --z-dialog: 30; --z-toast: 40;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--ground); }
body { margin: 0; font: 15px/1.55 var(--sans); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { min-height: 48px; padding: 9px 15px; border: 1px solid transparent; border-radius: 7px; color: var(--ink); background: none; cursor: pointer; touch-action: manipulation; transition: background-color .18s ease, border-color .18s ease; }
button:hover { background: var(--raised); }
button:active { background: var(--line); }
button:disabled { opacity: .52; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
input, select { min-width: 0; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 12px; background: var(--ground); color: var(--ink); }
input::placeholder { color: var(--muted); opacity: 1; }
input:disabled, select:disabled { opacity: .55; }
input[type="checkbox"] { width: 20px; min-height: 20px; flex: 0 0 20px; accent-color: var(--mint); }
input[type="date"] { min-width: 158px; }
label { color: var(--ink); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -.015em; font-weight: 620; line-height: 1.3; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { max-width: 72ch; text-wrap: pretty; }
a { color: var(--mint); }
.muted, .help { color: var(--muted); }
.help { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: 10px; z-index: var(--z-toast); padding: 12px; background: var(--mint); color: var(--ground); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.primary { background: var(--mint); color: #08231a; font-weight: 650; }
.primary:hover { background: #a0f6d9; }
.secondary { border-color: var(--line-strong); }
.quiet { color: var(--muted); }
.quiet:hover { color: var(--ink); }
.danger { color: #240c0a; background: var(--red); font-weight: 650; }
.danger:hover { background: #ffb0aa; }
.danger-quiet { color: var(--red); padding-left: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 30px; min-height: 88px; border-bottom: 1px solid var(--line); }
.brand, .top-actions, .inline-cluster, .section-heading, .detail-heading, .view-actions, .dialog-heading, .dialog-footer { display: flex; align-items: center; gap: 12px; }
.brand-symbol { color: var(--mint); font-size: 36px; line-height: 1; }
.brand strong { font-size: 19px; font-weight: 650; }
.brand div > span { display: block; color: var(--muted); font-size: 13px; }
.top-actions { font-size: 13px; }
.workspace { max-width: 1600px; padding: 28px 30px 0; margin: auto; outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 5px; }
.page-heading p { color: var(--muted); margin: 0; }
.readonly-note { color: var(--muted); font-size: 13px; white-space: nowrap; }
.workspace-grid { display: grid; grid-template-columns: 355px minmax(0, 1fr); gap: 28px; align-items: start; }
.device-pane { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.section-heading { justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 17px; }
.device-pane > .section-heading { padding: 10px 16px; }
.device-pane > input { width: calc(100% - 32px); margin: 0 16px 12px; }
.count { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 5px; }
.device-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 16px 12px; font-size: 14px; }
.device-filter select { flex: 0 1 170px; }
.device-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.device-table th { padding: 10px 15px; font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; background: var(--ground); }
.device-table th:first-child { width: 44%; }
.device-table td { padding: 14px 15px; vertical-align: top; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.device-table tr.selected td { background: var(--mint-soft); }
.device-table tr:hover td { background: #1b2527; }
.device-code { display: block; text-align: left; padding: 0; min-height: 48px; width: 100%; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.device-name { font-weight: 550; margin-bottom: 3px; }
.device-key { display: block; font: 11px/1.5 var(--mono); color: var(--muted); }
.device-state { margin-top: 5px; color: var(--muted); font-size: 12px; }
.device-state.failed { color: var(--red); }
.row-source { display: inline-block; color: var(--amber); font-size: 12px; }
.pane-note { color: var(--muted); font-size: 13px; padding: 14px 16px; margin: 0; border-top: 1px solid var(--line); }
.device-pane > .error-text { margin: 12px 16px; }
.detail-pane { min-width: 0; }
.detail-heading { align-items: start; justify-content: space-between; margin: 1px 0 18px; }
.device-identity { min-width: 0; }
.device-identity h2 { margin: 0; font-size: 23px; overflow-wrap: anywhere; }
.device-identity p { margin: 6px 0 0; }
.badge { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 5px; white-space: nowrap; }
.badge.simulated { color: var(--amber); border-color: #806333; }
.badge.real { color: var(--mint); border-color: #355b4e; }
.connection-strip { display: grid; grid-template-columns: 1fr 1fr 1.5fr; border-block: 1px solid var(--line); padding: 14px 0; gap: 16px; }
.connection-strip span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.connection-strip strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.view-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 22px 0 12px; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.tab { color: var(--muted); padding-inline: 16px; min-height: 48px; }
.tab.active { color: #08231a; background: var(--mint); font-weight: 650; }
.view-actions { gap: 4px; }
.range-toolbar { display: flex; gap: 12px 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; font-size: 13px; }
.range-toolbar label { display: flex; align-items: center; gap: 9px; }
#update-caption { margin-left: auto; }
.custom-range-wrap { margin-top: -10px; margin-bottom: 18px; }.custom-range-wrap > label { width: fit-content; min-height: 48px; align-items: center; }.custom-range-fields { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }.custom-range-fields label { display: grid; gap: 6px; font-size: 13px; }.custom-range-fields input { max-width: 100%; }.custom-range-fields > * { min-width: 0; }
.notice { padding: 12px 15px; border: 1px solid #365653; background: #112320; border-radius: 7px; margin: 0 0 16px; font-size: 14px; }
.notice.warning { border-color: #66532f; background: #242017; color: #f3dca6; }
.notice.error { border-color: #774a47; background: #271a19; color: #ffc6c0; }
.error-text { color: #ffc0b9; font-size: 14px; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; min-height: 370px; padding: 36px 26px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.empty-state h2 { margin-bottom: 9px; }
.empty-state p { max-width: 45ch; color: var(--muted); margin: 0; }
.empty-symbol { font-size: 40px; color: var(--muted); margin-bottom: 20px; }
.compact-empty { text-align: left; padding: 26px 18px; }
.compact-empty p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.status-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.status-summary h3 { margin: 0; font-size: 19px; }
.status-summary p { color: var(--muted); font-size: 13px; margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0 0 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.metric { min-width: 0; }
.metric dt { color: var(--muted); font-size: 13px; margin-bottom: 9px; }
.metric dd { margin: 0; font-size: 26px; line-height: 1.3; font-variant-numeric: tabular-nums; font-weight: 560; }
.metric small { color: var(--muted); font-size: 12px; margin-left: 4px; font-weight: 400; }
.metric p { color: var(--muted); font-size: 12px; margin: 7px 0 0; }
.metric.heart dd { color: var(--coral); }.metric.breath dd { color: var(--mint); }
.metrics.stale .metric dd { color: var(--muted); }
.chart-panel { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 18px; margin-bottom: 18px; }
.chart-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-heading h3 { margin: 0; }.chart-heading span { color: var(--muted); font-size: 12px; }
.chart { display: block; width: 100%; height: 150px; overflow: visible; }
.chart text { fill: var(--muted); font: 12px var(--sans); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart-empty { color: var(--muted); margin: 16px 0; font-size: 14px; }
.chart-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 9px; }
.stage-track { display: flex; width: 100%; min-height: 30px; border-radius: 3px; overflow: hidden; background: #1c2427; }
.stage-segment { min-width: 0; height: 32px; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.legend-item { display: flex; gap: 6px; align-items: center; }.legend-dot { width: 9px; height: 9px; border-radius: 2px; }
.info-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 8px; }
.info-section { min-width: 0; }.info-section h3 { margin-bottom: 12px; }
.facts { margin: 0; }.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }.fact dt { color: var(--muted); }.fact dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.observation-list { margin: 0; padding-left: 20px; }.observation-list li { margin-bottom: 9px; font-size: 14px; color: var(--muted); }
.report-disclaimer { color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.trend-table-wrap { overflow-x: auto; margin: 18px 0; }.trend-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }.trend-table th { color: var(--muted); font-weight: 500; text-align: left; }.trend-table th, .trend-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }.trend-table th:first-child, .trend-table td:first-child { padding-left: 0; }.date-link { color: var(--mint); padding: 0; text-align: left; }
.system-panel { border: 1px solid var(--line); border-radius: 9px; margin-top: 28px; background: var(--surface); }
.system-panel summary { display: flex; gap: 16px; align-items: center; min-height: 62px; padding: 16px 20px; cursor: pointer; }
.system-panel summary::before { content: "+"; color: var(--mint); font-size: 20px; }.system-panel[open] summary::before { content: "−"; }.system-panel summary .muted { font-size: 13px; margin-left: auto; }.system-body { padding: 0 20px 20px; }.system-body > .section-heading p { color: var(--muted); font-size: 13px; margin: 0; }.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; }.system-details { margin-top: 14px; }.system-details summary { min-height: 48px; padding: 8px 0; }.system-details pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; color: var(--muted); margin: 0; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 22px 0 28px; font-size: 12px; color: var(--muted); }
.login-wrap { padding: 68px 24px; }.login-panel { max-width: 440px; margin: auto; }.login-panel h1 { font-size: 28px; }.login-panel > p { color: var(--muted); }.login-panel form { margin-top: 30px; }.login-panel label { display: block; margin-bottom: 9px; }.login-panel input { width: 100%; }.login-panel .primary { width: 100%; margin-top: 18px; }
dialog { z-index: var(--z-dialog); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 24px; width: min(510px, calc(100% - 32px)); max-height: calc(100dvh - 36px); overflow-y: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .75); }dialog h2 { margin-bottom: 16px; }.dialog-heading { justify-content: space-between; }.dialog-heading h2 { margin: 0; }dialog form > label:not(.checkbox-label) { display: block; margin: 18px 0 7px; }dialog form > input { width: 100%; }dialog .help { margin: 12px 0; }.checkbox-label { display: flex; align-items: start; gap: 10px; padding: 10px 0; font-size: 14px; }.dialog-footer { justify-content: space-between; margin-top: 20px; }.dialog-footer > button { flex-shrink: 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); max-width: calc(100% - 32px); background: var(--mint); color: #08231a; border-radius: 7px; padding: 12px 18px; font-size: 14px; }
.loading-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.skeleton { height: 95px; border-radius: 7px; background: var(--raised); animation: pulse 1.2s ease-in-out infinite alternate; }.skeleton.wide { grid-column: 1 / -1; height: 230px; }@keyframes pulse { to { opacity: .5; } }
@media (max-width: 1150px) { .workspace-grid { grid-template-columns: 310px minmax(0, 1fr); gap: 22px; }.workspace { padding-inline: 22px; }.metrics { gap: 12px; }.metric dd { font-size: 23px; }.connection-strip { grid-template-columns: 1fr 1fr; }.connection-strip > div:last-child { grid-column: 1 / -1; }.view-toolbar { align-items: start; }.tab { padding-inline: 13px; } }
@media (max-width: 850px) { .workspace-grid { grid-template-columns: 1fr; }.device-table-wrap { max-height: 245px; overflow-y: auto; }.device-table th:first-child { width: 42%; }.device-pane .device-key { font-size: 12px; }.pane-note { display: none; }.device-pane > .section-heading { padding-block: 7px; }.device-table td { padding-block: 9px; }.device-identity h2 { font-size: 22px; }.connection-strip { grid-template-columns: 1fr 1fr 1.3fr; }.connection-strip > div:last-child { grid-column: auto; }.readonly-note { display: none; }.empty-state { min-height: 280px; } }
@media (max-width: 550px) { .topbar { padding: 12px 16px; gap: 8px; }.brand { gap: 9px; }.brand strong { font-size: 17px; }.brand-symbol { font-size: 29px; }.top-actions { gap: 0; }.top-actions > span { display: none; }.workspace { padding: 20px 16px 0; }.page-heading { margin-bottom: 18px; }.page-heading h1 { font-size: 23px; }.page-heading p { font-size: 14px; }.workspace-grid { gap: 24px; }.detail-heading { gap: 9px; }.detail-heading > button { font-size: 13px; padding-inline: 11px; flex-shrink: 0; }.inline-cluster { gap: 7px; flex-wrap: wrap; }.device-identity h2 { font-size: 20px; }.connection-strip { grid-template-columns: 1fr 1fr; gap: 12px; }.connection-strip > div:last-child { grid-column: 1 / -1; }.tabs { width: 100%; }.tabs button { flex: 1; padding-inline: 8px; }.view-toolbar { gap: 8px; margin-top: 18px; }.view-actions { margin-left: auto; }.range-toolbar { gap: 8px 12px; }.range-toolbar > .muted { font-size: 12px; }#update-caption { margin-left: 0; }.metrics { grid-template-columns: 1fr 1fr; gap: 22px; }.metric dd { font-size: 26px; }.info-columns, .system-grid { grid-template-columns: 1fr; gap: 22px; }.chart-panel { padding: 14px; }.system-panel summary { padding-inline: 14px; }.system-panel summary .muted { font-size: 12px; }.system-body { padding: 0 14px 16px; }.system-body .section-heading { gap: 8px; }.system-body .section-heading button { flex-shrink: 0; }.notice { font-size: 13px; padding: 11px 12px; }dialog { padding: 18px; }.dialog-heading h2 { font-size: 18px; }.dialog-footer { gap: 8px; }.dialog-footer button { font-size: 14px; padding-inline: 11px; }.login-wrap { padding-top: 44px; }.login-panel h1 { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
