:root {
  color-scheme: light;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  background: #edf2f7;
  color: #142239;
  --navy: #111f36;
  --muted: #50617a;
  --border: #dce5ee;
  --green: #4ee0a3;
  --cyan: #6adaf5;
  --amber: #ffbc70;
  --violet: #c5a8ff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid #3383e7; outline-offset: 3px; }
.masthead { color: #f7faff; background: var(--navy); border-bottom: 1px solid #243955; }
.masthead-inner { max-width: 1320px; margin: auto; padding: 22px 26px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-size: 17px; font-weight: 820; letter-spacing: .035em; margin: 0 0 5px; color: #c6e0ff; }
.brand span { font-size: 10px; font-weight: 700; color: #9cb0cb; letter-spacing: .12em; margin-left: 5px; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -.045em; margin: 0; }
.demo-tag { border: 1px solid #3c5271; border-radius: 6px; color: #deeaff; padding: 7px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
main { max-width: 1320px; margin: auto; padding: 20px 26px max(24px, env(safe-area-inset-bottom)); }
.access, .control-panel { border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 14px; }
.access { max-width: 430px; margin: 14px auto; padding: 20px; }
.access label { display: block; font-weight: 750; margin-bottom: 8px; }
.access div { display: flex; gap: 8px; }
.access input { width: 100%; min-width: 0; border: 1px solid #9aabc0; border-radius: 7px; padding: 8px 10px; }
.access button { color: #fff; background: #184785; border: 0; padding: 10px 14px; border-radius: 7px; white-space: nowrap; }
.access p { margin: 8px 0 0; font-size: 14px; color: #a12532; }
.access p:empty { display: none; }
.connection-row { display: flex; align-items: center; min-height: 38px; gap: 8px; }
.status { display: inline-flex; gap: 7px; align-items: center; font-size: 15px; font-weight: 800; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #b78016; flex: 0 0 auto; }
.status[data-state="live"]::before { background: #138665; box-shadow: 0 0 0 3px #def5ea; }
.status[data-state="down"]::before { background: #c54450; }
.transport { background: #e9f1fc; border-radius: 5px; color: #1e4f8c; font-size: 12px; font-weight: 760; padding: 4px 7px; white-space: nowrap; }
.reconnect { margin-left: auto; min-height: 38px; border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 6px 10px; color: #29446a; font-weight: 700; font-size: 13px; }
.connection-note { margin: 4px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.settings { display: flex; gap: 8px; margin: 11px 0 12px; }
.settings label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.settings select { background: #f6f9fc; border: 1px solid var(--border); border-radius: 7px; color: #223856; min-width: 0; min-height: 40px; padding: 5px 7px; font-weight: 700; }
.beds { display: grid; grid-template-columns: repeat(9, minmax(32px, 58px)); gap: 5px; }
.beds button { color: #355171; background: #f6f9fc; border: 1px solid var(--border); border-radius: 7px; min-height: 42px; font-size: 14px; font-weight: 760; padding: 0; }
.beds button[aria-pressed="true"] { background: #1a4c87; color: #fff; border-color: #1a4c87; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.metrics > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; background: #f9fbfd; }
.metrics span { color: var(--muted); font-size: 12px; font-weight: 670; }
.metrics strong { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.monitors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.monitors[data-single="true"] { grid-template-columns: minmax(0, 1fr); }
.monitor { min-width: 0; background: #111f35; color: #f4f8ff; border: 1px solid #203550; border-radius: 14px; padding: 14px 15px 10px; box-shadow: 0 8px 24px #26385319; }
.monitor-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.monitor-title h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.bed-status { font-size: 12px; font-weight: 700; color: #acc1dd; }
.bed-status[data-live="true"] { color: #9fe7cc; }
.vitals { margin: 0 0 9px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.28fr; gap: 6px; }
.vitals div { border: 1px solid #29405d; border-radius: 7px; background: #172941; padding: 6px 7px 7px; }
.vitals dt { color: #c2d2e5; font-size: 12px; font-weight: 720; white-space: nowrap; }
.vitals small { color: #9fb3cd; font-weight: 550; font-size: 10px; }
.vitals dd { font-variant-numeric: tabular-nums; margin: 1px 0 0; font-size: clamp(19px, 5.5vw, 28px); font-weight: 750; letter-spacing: -.055em; white-space: nowrap; }
.hr { color: var(--green); }
.spo2 { color: var(--cyan); }
.art { color: var(--amber); }
.resp { color: var(--violet); }
.wave-list { background: #0d1a2d; border: 1px solid #223753; border-radius: 8px; overflow: hidden; }
.wave { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px; align-items: center; min-height: 66px; }
.wave + .wave { border-top: 1px solid #21334a; }
.wave-label { padding: 0 0 0 8px; font-size: 12px; font-weight: 800; }
.wave-label small { display: block; margin-top: 3px; font-size: 10px; font-weight: 560; color: #a0b5d0; white-space: nowrap; }
.wave canvas { width: 100%; height: 66px; display: block; aspect-ratio: auto; }
.monitor-footer { margin-top: 8px; display: flex; justify-content: space-between; color: #a8bed9; font-size: 11px; }
@media (max-width: 760px) {
  .masthead-inner { padding: 15px 14px 17px; }
  main { padding: 12px 12px max(16px, env(safe-area-inset-bottom)); }
  .control-panel { padding: 9px 9px 10px; }
  .settings { display: grid; grid-template-columns: 1fr 1.1fr; margin: 7px 0 9px; }
  .settings label { grid-template-columns: 1fr; gap: 3px; }
  .settings select { font-size: 16px; }
  .beds { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .beds button { font-size: 12px; }
  .metrics { margin: 8px 0; }
  .metrics > div { padding: 6px 8px; display: grid; gap: 2px; }
  .monitors { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .monitor { padding: 11px 9px 8px; }
  .wave { grid-template-columns: 47px minmax(0, 1fr); min-height: 67px; }
  .wave-label { padding-left: 6px; }
}
@media (max-width: 350px) {
  .vitals dt small { display: none; }
  .beds { gap: 3px; }
}
