/* H.C.R display. Drawn on a 1600x900 stage (16:9) that app.js scales to the screen.
   Colors are taken from docs/hcr-design-ref/mock-aams-cloud-list.png and, for the
   graph, biosilver-realtime-graph-slide.png. */
:root {
  --blue: #1a56e8;
  --navy: #1b2a8c;
  --text: #2a3350;
  --muted: #7b8496;
  --bg: #e8ecf3;
  --line: #e3e7ef;
  --chip-bg: #eaf0fd;
  --chip-text: #3d58d8;
  --leave: #fc770b;
  --awake: #fedb01;
  --deep: #0c58ac;
  --light: #00b9f5;
  --rise: #888b91;
  --comm: #5f6b78;
  --waiting: #b8c0cc;
  --band-red: #fd0718;
  --band-yellow: #fed200;
  --confirm: #1a56e8;
  --heart-block: #e39cbc;
  --breath-block: #7daddb;
  --wave-heart: #d97fa8;
  --wave-breath: #5e93cf;
  --wave-bg: #efeff1;
  --motion: #f0a43c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; color: var(--text); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { fill: currentColor; }
img { display: block; }
.mask { display: inline-block; width: 100%; height: 100%; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
[data-icon] { display: inline-block; }
[data-icon] img { width: 100%; height: 100%; object-fit: contain; }

#stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: center; background: var(--bg); overflow: hidden; }

/* left menu */
.sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: 170px; background: linear-gradient(#fdfefe, #f3f6fb); padding: 14px 8px; }
.logo { padding: 2px 12px 22px; }
.logo-name { font-size: 23px; font-weight: 700; color: var(--blue); letter-spacing: -0.5px; }
.logo-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.menu a { display: flex; align-items: center; gap: 10px; height: 50px; margin-bottom: 18px; padding: 0 12px; border-radius: 10px; font-size: 16px; white-space: nowrap; font-weight: 700; color: var(--navy); }
.menu a.active { background: #0065fe; color: #fff; box-shadow: 0 4px 10px rgba(0, 101, 254, .3); }
.menu svg, .menu [data-icon] { width: 26px; height: 26px; flex: none; color: #6b7690; }
.menu a.active svg { color: #fff; }
.badge { margin-left: -4px; width: 22px; height: 22px; border-radius: 50%; background: #e8202a; color: #fff; font-size: 14px; display: grid; place-items: center; }

/* top bar */
.topbar { position: absolute; left: 170px; right: 0; top: 0; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 24px 0 26px; background: #fbfcfe; }
.facility { display: flex; align-items: center; gap: 8px; font-size: 27px; font-weight: 800; color: var(--navy); margin-right: auto; }
.facility svg { width: 22px; height: 22px; color: var(--blue); }
.updated-at { font-size: 18px; color: var(--navy); margin-right: 10px; }
.outline-btn { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1.5px solid var(--blue); border-radius: 8px; color: var(--blue); font-size: 15px; font-weight: 700; }
.outline-btn [data-icon] { width: 16px; height: 16px; }
.divider { width: 1px; height: 36px; background: var(--line); margin: 0 8px; }
.building { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--navy); margin-right: 120px; }
.building svg { width: 26px; height: 26px; }
.hamburger { width: 28px; height: 22px; }

/* list screen */
#list { position: absolute; left: 183px; top: 88px; width: 1102px; bottom: 0; display: flex; flex-direction: column; gap: 18px; }
.summary { display: flex; align-items: center; height: 90px; padding: 0 16px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(20, 40, 90, .08); flex: none; }
.summary-title { font-size: 20px; font-weight: 800; color: var(--navy); padding-right: 14px; white-space: nowrap; }
.summary-item { display: flex; align-items: center; gap: 6px; padding: 0 11px; white-space: nowrap; border-left: 1px solid var(--line); color: var(--navy); font-size: 14px; }
.summary-item svg, .summary-item [data-icon] { width: 30px; height: 30px; flex: none; }
.summary-item [data-icon].wide { width: 40px; }
.summary-item [data-icon].tall { width: 22px; height: 36px; }
.summary-item small { display: block; font-size: 13px; color: var(--muted); }
.summary-item b { font-size: 22px; font-weight: 600; color: var(--blue); margin-right: 4px; }
.summary-item.risk small { color: var(--navy); font-weight: 800; margin-bottom: 6px; }
.dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; margin: 0 4px 0 10px; vertical-align: -1px; }
.dot.red { background: #e8121c; } .dot.yellow { background: #fbd300; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; overflow-y: auto; padding-bottom: 20px; scrollbar-width: none; }
.grid::-webkit-scrollbar { display: none; }

/* resident card */
.card { position: relative; height: 286px; padding: 14px 14px 10px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(20, 40, 90, .1); display: flex; flex-direction: column; }
.card.band-red, .card.band-yellow { border-top: 7px solid; padding-top: 8px; }
.card.band-red { border-top-color: var(--band-red); }
.card.band-yellow { border-top-color: var(--band-yellow); }
.card-head { display: flex; align-items: flex-start; gap: 8px; }
.who { margin-right: auto; }
.room { font-size: 17px; color: var(--navy); }
.name { font-size: 28px; font-weight: 700; color: #1d2fd6; letter-spacing: -0.5px; }
.smile { width: 26px; height: 26px; margin-top: 20px; }
.bell { width: 48px; height: 48px; border: 1.5px solid #5b8df0; border-radius: 8px; display: grid; place-items: center; }
.bell img { width: 22px; height: 24px; }
.card-body { display: flex; gap: 10px; margin-top: 8px; flex: 1; min-height: 0; }
.panel-slot { flex: 1; min-width: 0; }
.side { display: flex; flex-direction: column; justify-content: space-around; align-items: center; width: 30px; }
.side img { width: 26px; height: 24px; }
.card-foot { position: relative; height: 34px; margin-top: 10px; }
.chips { display: flex; gap: 5px; height: 100%; }
.chip { display: grid; place-items: center; flex: 1; height: 32px; padding: 0 4px; border-radius: 6px; background: var(--chip-bg); color: var(--chip-text); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.none { background: #eef1f6; color: var(--text); font-weight: 500; }
.confirm { width: 100%; height: 34px; border-radius: 17px; background: var(--confirm); color: #fff; font-size: 16px; font-weight: 700; }

/* state panels */
.panel { height: 100%; border-radius: 6px; color: #fff; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }
.panel.leave { background: var(--leave); }
.panel.awake { background: var(--awake); color: #111; }
.panel.deep { background: var(--deep); }
.panel.light { background: var(--light); }
.panel.rise { background: var(--rise); }
.panel.alert { background: var(--leave); }
.panel.comm { background: var(--comm); }
.panel.waiting { background: var(--waiting); }
.panel.row { flex-direction: row; align-items: center; justify-content: center; gap: 8px; padding: 10px; }
.panel.row .panel-label { font-size: 22px; }
.panel-label { font-size: 24px; font-weight: 500; white-space: nowrap; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 60%; border-bottom: 2px solid currentColor; padding-bottom: 6px; }
.panel-icon { width: 76px; height: 48px; object-fit: contain; }
.panel.row .panel-icon { width: 56px; }
.panel-vitals { display: flex; align-items: center; justify-content: space-around; height: 40%; padding-top: 6px; font-size: 25px; }
.panel-vitals span { margin-right: 10px; }
.v-icon { width: 22px; height: 22px; object-fit: contain; }
.leave-icon { width: 54px; height: 90px; object-fit: contain; }
.leave-text { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.panel-time { font-size: 28px; }

/* right panel */
.detail { position: absolute; left: 1300px; top: 82px; width: 288px; height: 806px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(20, 40, 90, .08); padding: 14px 16px; display: flex; flex-direction: column; }
.detail-head { display: flex; justify-content: space-between; }
.detail-head .room { font-size: 15px; color: var(--muted); }
.detail-head .name { font-size: 25px; }
.detail-head small { font-size: 14px; color: var(--muted); font-weight: 400; }
.close { width: 20px; height: 20px; color: var(--muted); }
.now-row { display: flex; justify-content: space-between; margin: 12px 0 8px; font-size: 14px; font-weight: 700; color: var(--navy); }
.now-row span:last-child { font-weight: 400; color: var(--muted); }
.now-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2ec4b6; margin-right: 6px; }
.big-panel { display: flex; align-items: center; gap: 12px; height: 88px; padding: 0 16px; border-radius: 8px; color: #fff; }
.big-panel.leave, .big-panel.alert { background: var(--leave); }
.big-panel.awake { background: var(--awake); color: #111; }
.big-panel.deep { background: var(--deep); } .big-panel.light { background: var(--light); }
.big-panel.rise { background: var(--rise); } .big-panel.comm { background: var(--comm); }
.big-panel.waiting { background: var(--waiting); }
.big-icon { width: 64px; height: 56px; object-fit: contain; flex: none; }
.big-label { font-size: 27px; }
.big-time { margin-left: 10px; font-size: 22px; }
.big-desc { font-size: 13px; margin-top: 4px; white-space: nowrap; }
.vitals { display: flex; align-items: baseline; gap: 5px; margin: 12px 0; font-size: 23px; text-align: left; white-space: nowrap; }
.vitals [data-icon] { width: 24px; height: 22px; align-self: center; }
.vitals .heart { color: #f7000f; } .vitals .lungs { color: var(--blue); margin-left: 14px; }
.vitals b { font-weight: 500; color: #f7000f; } .vitals b.br { color: var(--blue); }
.vitals .unit { color: var(--muted); font-size: 17px; } .vitals .unit.br { color: var(--blue); }
.changes { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: #f1f4fa; border-radius: 8px; }
.changes div { width: 100%; font-size: 14px; font-weight: 700; color: var(--navy); }
.changes .chip { flex: none; font-size: 13px; height: 28px; background: #e2e9fa; }
.tabs { display: flex; justify-content: space-between; margin: 14px 0 10px; font-size: 15px; color: var(--muted); border-bottom: 1px solid var(--line); }
.tabs > * { padding: 6px 2px; }
.tabs .active { color: var(--blue); border-bottom: 2px solid var(--blue); }
.live-video { position: relative; height: 128px; border-radius: 8px; background: #edf0f5; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 14px; gap: 8px; font-size: 14px; color: #556; }
.live-badge { position: absolute; left: 10px; top: 10px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; background: #fe1526; color: #fff; font-size: 13px; }
.live-badge i { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.expand { position: absolute; right: 10px; top: 10px; width: 20px; height: 20px; color: #4a5a78; }
.live-video .cam { width: 44px; height: 30px; color: #5a6a86; }
.recent-title { margin: 12px 0 6px; font-size: 15px; font-weight: 800; color: var(--navy); }
.recent { list-style: none; margin: 0; padding: 0; flex: 1; }
.recent li { display: flex; align-items: center; gap: 8px; height: 34px; font-size: 14px; border-bottom: 1px solid #f0f2f6; }
.recent time { width: 40px; color: var(--muted); }
.recent-icon { width: 30px; height: 22px; border-radius: 4px; padding: 2px; flex: none; }
.recent-icon img { width: 100%; height: 100%; object-fit: contain; }
.recent-icon.leave { background: var(--leave); } .recent-icon.awake { background: var(--awake); }
.recent-icon.deep { background: var(--deep); } .recent-icon.light { background: var(--light); }
.recent b { color: var(--navy); font-weight: 700; white-space: nowrap; }
.recent-desc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { display: grid; place-items: center; height: 50px; border: 1.5px solid #5b8df0; border-radius: 8px; color: var(--blue); font-size: 16px; }

/* graph screen (shapes of the biosilver slide) */
.graph { position: absolute; left: 183px; top: 88px; right: 16px; bottom: 16px; padding: 18px 24px; background: #fff; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.graph-head { display: flex; align-items: center; gap: 24px; height: 52px; margin-bottom: 8px; }
.back { height: 44px; padding: 0 22px; border: 1.5px solid var(--blue); border-radius: 8px; color: var(--blue); font-size: 18px; font-weight: 700; }
.graph-who { font-size: 20px; color: var(--muted); }
.graph-who b { font-size: 28px; color: #1d2fd6; }
.graph-note { margin-left: auto; font-size: 18px; color: #e8202a; font-weight: 700; }
.wave-row { display: flex; flex: 1; min-height: 0; }
.wave-label { width: 210px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #fff; }
.wave-label div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 22px; }
.wave-label [data-icon] { width: 36px; height: 32px; }
.wave-label b { font-size: 84px; font-weight: 600; }
.heart .wave-label { background: var(--heart-block); }
.breath .wave-label { background: var(--breath-block); }
.wave-row canvas { flex: 1; min-width: 0; height: 100%; background: var(--wave-bg); display: block; }
.mid-row { display: flex; align-items: center; gap: 10px; height: 84px; flex: none; }
#graph-stage { width: 92px; height: 76px; }
.stage-box { width: 100%; height: 100%; border-radius: 8px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.stage-box img { width: 74px; height: 34px; object-fit: contain; }
.stage-box.awake { background: var(--awake); color: #111; } .stage-box.leave { background: var(--leave); }
.stage-box.deep { background: var(--deep); } .stage-box.light { background: var(--light); }
.stage-box.waiting { background: var(--waiting); }
.motion-box { width: 92px; height: 76px; border-radius: 8px; background: #e6e8ec; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; opacity: .35; }
.motion-box.on { background: var(--motion); opacity: 1; }
.motion-box [data-icon] { width: 60px; height: 34px; }
.scale { flex: 1; display: flex; justify-content: space-between; margin-left: 6px; color: #9aa1ad; font-size: 18px; }
.scale small { font-size: 12px; margin-left: 2px; }
