:root {
  --page: #ffffff;
  --panel: #f6f6f3;
  --ink: #1c1c1c;
  --ink-2: #585b56;
  --ink-3: #8b8e88;
  --line: #e3e4de;
  --line-strong: #c9cbc3;
  --accent: #3f5a3c;
  --red: #b5432e;
  --red-soft: #fbeeea;
  --green: #1f8a4c;
  --green-soft: #e8f3ec;
  --font: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { display: flex; min-height: 100vh; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 1px solid var(--line-strong); border-radius: 4px; padding: 7px 14px; cursor: pointer; }
button:hover { border-color: var(--ink); }
button.fill { background: var(--ink); color: #fff; border-color: var(--ink); }
button.fill:hover { background: #000; }
button.done { color: var(--green); border-color: var(--green); }
h1 { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--ink-3); }
.lead { color: var(--ink-2); max-width: 60ch; }

/* rail */
.rail { width: 220px; flex: 0 0 220px; border-right: 1px solid var(--line); padding: 26px 22px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.site { font-size: 14px; line-height: 1.4; }
.site span { color: var(--ink-3); }
.rail nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 10px; }
.rail nav a { padding: 7px 0; color: var(--ink-2); border-left: 2px solid transparent; }
.rail nav a.on { color: var(--ink); font-weight: 600; }
.rail nav a:hover { color: var(--ink); }
.box { margin-top: auto; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.box-line { display: flex; align-items: center; gap: 7px; }
.box-note { margin-top: 8px; color: var(--ink-3); line-height: 1.4; }

/* main */
main { flex: 1; min-width: 0; padding: 34px 44px 60px; max-width: 1240px; overflow-x: hidden; }
td.lbl { white-space: nowrap; }
td.sparkcol, th.sparkcol { width: 120px; padding-left: 24px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.head .right { color: var(--ink-3); font-size: 14px; }
.meta { color: var(--ink-2); margin-top: 4px; font-size: 14px; }
.meta b { font-weight: 600; color: var(--ink); }

table { width: calc(100% + 24px); margin: 0 -12px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--ink-3); padding: 0 12px 8px 12px; border-bottom: 1px solid var(--line-strong); font-size: 13px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.row:hover td { background: var(--panel); cursor: pointer; }
tr.sel td { background: var(--panel); }
td.num, th.num { text-align: right; padding-left: 18px; white-space: nowrap; }
td.room { width: 52px; font-weight: 600; font-size: 16px; }
.urgent { color: var(--red); font-weight: 600; }
.routine { color: var(--ink); }
.staff { color: var(--green); font-weight: 600; }
.chip { display: inline-block; font-size: 12px; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 3px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

section { margin-bottom: 34px; }
.two { display: grid; grid-template-columns: 1.55fr 1fr; gap: 36px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; }
.panel.red { border-color: #e7b6ab; background: var(--red-soft); }
.panel h3 { display: flex; justify-content: space-between; }
.actions { display: flex; gap: 8px; margin: 10px 0 12px; }
.actions button { white-space: nowrap; }
.why { margin: 6px 0 10px; }
.panel .kind { font-weight: 600; margin: 0 0 8px; }
.panel .around { margin-top: 14px; }
.why b { font-weight: 600; }
.clip-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.clip { background: #e9eae5; aspect-ratio: 16 / 6; border-radius: 3px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 13px; }
.around { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.around li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.around li:first-child { border-top: 0; }
.around li span:first-child { color: var(--ink-3); }
.around li.alert span:last-child { color: var(--red); font-weight: 600; }
.around li.care span:last-child { color: var(--green); }
.checked-toggle { margin-top: 10px; color: var(--ink-2); font-size: 14px; }

/* video */
.video { position: relative; background: #111; border-radius: 4px; overflow: hidden; aspect-ratio: 16 / 9; }
.video video { width: 100%; height: 100%; display: block; }
.track { position: relative; height: 22px; margin-top: 10px; display: flex; border-radius: 3px; overflow: hidden; border: 1px solid var(--line-strong); }
.track span { display: block; height: 100%; cursor: pointer; border-right: 1px solid #fff; }
.track span:last-child { border-right: 0; }
.track .in_bed { background: #b9c7c3; }
.track .sitting { background: #8ea39e; }
.track .standing { background: #3f5a3c; }
.track .absent { background: #f1f1ee; }
.track .on_floor { background: var(--red); }
.track i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none; }
.legend { display: flex; gap: 16px; font-size: 13px; margin-top: 8px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line-strong); }
.legend .in_bed::before { background: #b9c7c3; }
.legend .standing::before { background: #3f5a3c; }
.legend .absent::before { background: #f1f1ee; }
.caption { font-size: 13px; color: var(--ink-3); margin-top: 10px; max-width: 70ch; }
.now { font-size: 15px; }
.now .big { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin: 2px 0 2px; }
.now .since { color: var(--ink); }

/* stat grid */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
.stat { padding: 14px 16px 14px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.stat:hover { background: var(--panel); }
.stat .l { font-size: 14px; line-height: 1.3; }
.stat .v { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; margin-top: 8px; display: flex; align-items: baseline; gap: 10px; }
.stat .v span { font-size: 15px; font-weight: 400; }
.stat.hot .v { color: var(--red); }

/* changes */
.changes-layout { display: grid; grid-template-columns: 180px 1fr; gap: 36px; align-items: start; }
.reslist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.reslist li { padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; justify-content: space-between; font-size: 14px; }
.reslist li.on { font-weight: 600; }
.reslist li span { font-weight: 400; }
.change { border-top: 1px solid var(--line-strong); padding: 12px 0 14px; }
.change h3 { margin-bottom: 4px; }
.change .first { color: var(--ink-3); font-size: 13px; margin-bottom: 8px; }
.change ol { margin: 0; padding-left: 18px; }
.change ol li { margin: 3px 0; }
.chart { border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px 10px; margin-bottom: 20px; }
.chart svg { width: 100%; height: 190px; display: block; }
.chart .t { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.chart .t b { font-weight: 600; }
.chart .t span { color: var(--ink-3); font-size: 13px; }
.chart .k { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.chart .k i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--ink); margin-right: 6px; vertical-align: 3px; }
.chart .k i.g { border-top-style: dashed; border-color: var(--ink-3); }
.spark { width: 110px; height: 26px; display: block; }
.wk { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.wk b { font-weight: 600; color: var(--ink); }
.ctl { display: flex; gap: 14px; align-items: center; font-size: 14px; margin-bottom: 14px; }
select { font: inherit; border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 8px; background: #fff; color: var(--ink); }
.foot { color: var(--ink-3); font-size: 13px; margin-top: 14px; }

@media (max-width: 980px) {
  body { flex-direction: column; }
  .rail { width: auto; flex: none; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 16px; gap: 14px; }
  .rail nav { flex-direction: row; gap: 14px; border: 0; padding: 0; }
  .box { width: 100%; margin-top: 0; }
  .box-note { margin-top: 2px; }
  main { padding: 20px 16px 40px; }
  .two, .changes-layout { grid-template-columns: 1fr; }
  .two.board > div:first-child { display: contents; }
  .two.board > div:last-child { order: 1; }
  .two.board > div:first-child > section:last-child { order: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .changes-layout > div, .two > div { min-width: 0; }
  .sparkcol { display: none; }
  td.lbl { white-space: normal; }
  .chart svg { height: auto; aspect-ratio: 360 / 190; }
}

details { margin-top: 26px; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details summary::before { content: ""; width: 6px; height: 6px; border-right: 1px solid var(--ink-2); border-bottom: 1px solid var(--ink-2); transform: rotate(-45deg); transition: transform .15s; }
details[open] summary::before { transform: rotate(45deg); }
details table { margin-top: 12px; }
.embedded .brand { display: none; }
.rules { margin-top: 40px; }
.fold, .fold-room { display: none; }
@media (max-width: 980px) {
  .wide { display: none; }
  .fold { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; font-weight: 400; }
  .fold-room { display: inline; font-weight: 600; }
  table { width: 100%; margin: 0; }
  th:first-child, td:first-child { padding-left: 0; }
  th:last-child, td:last-child { padding-right: 0; }
  td.main { padding-left: 0; }
  .rules th { display: none; }
  .rules tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .rules td { display: block; padding: 0; border: 0; }
  .rules td:first-child { font-weight: 600; margin-bottom: 2px; }
  .rules td:nth-child(2)::before { content: "Fires: "; color: var(--ink-3); }
  .rules td:nth-child(3)::before { content: "Not on: "; color: var(--ink-3); }
}
