/* Covers: the host-stand screen. Service lighting by default. */

html, body { height: 100%; }
body.floor { overflow: hidden; transition: background-color .5s var(--ease), color .5s var(--ease); }
.app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 56px 1fr; grid-template-columns: minmax(0, 1fr); min-height: 0; }

/* ---------- top bar ---------- */
.topbar { display: grid; grid-template-columns: auto auto 1fr auto auto auto; align-items: center; gap: 22px; padding: 0 18px; border-bottom: 1px solid var(--rule); min-width: 0; }
.logo { display: flex; align-items: center; gap: 9px; }
.mark { width: 22px; height: 22px; }
.mark .m-top { fill: var(--seated); }
.mark .m-ch rect { fill: none; stroke: currentColor; stroke-width: 1.5; }
.logo-word { font-family: var(--display); font-weight: 750; font-stretch: 88%; font-size: 21px; letter-spacing: -.02em; line-height: 1; }
.site { display: flex; align-items: baseline; gap: 10px; padding-left: 18px; border-left: 1px solid var(--rule); white-space: nowrap; }
.site b { font-weight: 500; font-size: 15px; }
.site .mono { color: var(--ink-3); font-size: 10px; }
.tabs { display: flex; justify-self: center; border: 1px solid var(--rule); }
.tabs button { height: 34px; padding: 0 20px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background-color .25s var(--ease), color .25s var(--ease); }
.tabs button + button { border-left: 1px solid var(--rule); }
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--paper); }
.tabs button:not([aria-selected='true']):hover { color: var(--ink); background: var(--paper-2); }
.clock { display: flex; align-items: center; gap: 12px; }
.clock-day { color: var(--ink-3); font-size: 10px; }
.clock > b { font-family: var(--mono); font-weight: 500; font-size: 17px; letter-spacing: .02em; min-width: 82px; }
.seg { display: inline-flex; border: 1px solid var(--rule); }
.seg button { min-width: 36px; height: 30px; padding: 0 10px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); transition: background-color .25s var(--ease), color .25s var(--ease); }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button:hover { background: var(--paper-2); color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.sq-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--rule); transition: background-color .25s var(--ease); }
.sq-btn:hover { background: var(--paper-2); }
.sq-btn svg { width: 12px; height: 12px; }
.sq-btn svg rect, .sq-btn svg .i-play { fill: var(--ink); }
.sq-btn svg path { stroke: var(--ink); stroke-width: 1.5; }
.sq-btn .i-play { display: none; }
.sq-btn[aria-pressed='true'] .i-play { display: block; stroke: none; }
.sq-btn[aria-pressed='true'] .i-pause { display: none; }
.lights { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 12px 4px; border: 1px solid var(--rule); height: 36px; justify-content: center; }
.lights .mono { font-size: 9px; color: var(--ink-3); }
.lights b { font-size: 12.5px; font-weight: 500; line-height: 1; }
.back { color: var(--ink-2); font-size: 10.5px; white-space: nowrap; }
.back:hover { color: var(--ink); }

/* ---------- floor view ---------- */
.view { min-height: 0; min-width: 0; }
.view[hidden] { display: none !important; }
.view-floor { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.kpis { grid-column: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.kpi { padding: 12px 16px 13px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .mono { font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.kpi b { font-family: var(--display); font-weight: 750; font-stretch: 76%; font-size: 30px; line-height: .9; letter-spacing: -.02em; white-space: nowrap; }
.kpi small { font-size: 15px; color: var(--ink-3); margin-left: 3px; font-weight: 600; letter-spacing: 0; }
.kpi.is-bad b { color: var(--markup); }

.floor-wrap { grid-column: 1; grid-row: 2; position: relative; display: flex; flex-direction: column; min-height: 0; padding: 14px 18px 12px; }
.floor-tools { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; }
.legend li { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.legend b { font-weight: 500; color: var(--ink); }
.cams-toggle { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 10px; cursor: pointer; }
.cams-toggle input:focus-visible { outline: 2px solid var(--markup); outline-offset: 3px; }
/* a zone with a table that needs someone gets a small delta on its button */
.zones button { position: relative; }
.zones button.has-alert::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 6px; background: var(--markup); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.cams-toggle input { appearance: none; -webkit-appearance: none; width: 28px; height: 16px; border: 1px solid var(--ink-2); position: relative; margin: 0; cursor: pointer; transition: background-color .25s var(--ease); }
.cams-toggle input::after { content: ''; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; background: var(--ink-2); transition: transform .3s var(--ease-out), background-color .25s var(--ease); }
.cams-toggle input:checked { background: var(--ink); border-color: var(--ink); }
.cams-toggle input:checked::after { transform: translateX(12px); background: var(--paper); }
.floor-plan { flex: 1 1 0; min-height: 0; position: relative; margin-top: 8px; }
.floor-plan .plan { width: 100%; height: 100%; }
.floor-plan:not(.show-cams) .fov, .floor-plan:not(.show-cams) .cams { display: none; }
.floor-plan.is-tight .grid .bub, .floor-plan.is-tight .north { display: none; }
.hint { position: absolute; left: 18px; bottom: 48px; color: var(--ink-3); font-size: 9.5px; pointer-events: none; }
.hint-z { display: none; }
@media (max-width: 700px) { .hint-z { display: inline; } .hint { font-size: 10px; } }
.ticker { display: flex; gap: 26px; overflow: hidden; white-space: nowrap; height: 30px; align-items: center; border-top: 1px solid var(--rule); font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; text-transform: none; }
.ticker li:nth-child(n+4) { opacity: .6; }
.ticker li { flex: none; animation: tick-in .6s var(--ease-out) both; }
.ticker li:first-child { color: var(--ink); }
.ticker b { font-weight: 500; color: var(--ink-2); margin-right: 8px; }
.ticker li:first-child b { color: var(--ink); }
.ticker i { font-style: normal; display: inline-block; width: 7px; height: 7px; margin-right: 8px; vertical-align: 0; }
.ticker .k-info { background: none; border: 1px solid var(--ink-3); }
.ticker .k-seat { background: var(--seated); } .ticker .k-left { background: var(--clear); } .ticker .k-clear { background: var(--free); } .ticker .k-walk, .ticker .k-visit { background: var(--ink-3); } .ticker .k-walkin { background: var(--ink); }
@keyframes tick-in { from { opacity: 0; transform: translateX(-10px); } }

/* ---------- rail ---------- */
.rail { grid-column: 2; grid-row: 1 / 3; border-left: 1px solid var(--rule); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.rail-sec { padding: 16px 18px 20px; border-bottom: 1px solid var(--rule); }
.rail-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); font-weight: 400; }
.rail-h > .mono:first-child { color: var(--ink); font-weight: 500; }
.rail-h .dim, .dim { color: var(--ink-3); font-size: 9.5px; }
.rail-h-r { display: inline-flex; align-items: center; gap: 10px; }
.count { font-family: var(--mono); font-size: 11px; font-weight: 500; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border: 1px solid var(--ink); }
.count.is-hot { background: var(--markup); border-color: var(--markup); color: #fff; }

.al-list li { display: grid; grid-template-columns: 26px 1fr auto; column-gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--rule); animation: row-in .5s var(--ease-out) both; }
.al-list .tri { grid-row: 1 / 3; margin: 3px 0 0; width: 18px; height: 16px; color: var(--markup); display: grid; place-items: center; }
.al-list .tri-n { position: relative; display: block; width: 18px; height: 16px; }
.al-list .tri-n::before { content: ''; position: absolute; inset: 0; background: var(--markup); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.al-list .tri-n span { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font-family: var(--mono); font-size: 9px; color: #fff; font-weight: 500; }
.al-list .al-t { font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; }
.al-list .al-t b { font-family: var(--display); font-stretch: 80%; font-weight: 750; font-size: 17px; margin-right: 4px; }
.al-list .al-age { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--markup); text-align: right; }
.al-list .al-s { grid-column: 2 / 4; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.al-list .al-act { grid-column: 2 / 4; display: flex; gap: 8px; margin-top: 10px; }
.al-list .empty { display: block; padding: 16px 0 6px; color: var(--ink-3); font-size: 14px; border: 0; animation: none; }
.mini-btn { height: 28px; padding: 0 11px; font-size: 12px; font-weight: 500; border: 1px solid var(--ink); transition: background-color .2s var(--ease), color .2s var(--ease); white-space: nowrap; }
.mini-btn:hover, .mini-btn.solid { background: var(--ink); color: var(--paper); }
.mini-btn.solid:hover { background: var(--seated); border-color: var(--seated); color: #fff; }
.mini-btn.ghost { border-color: var(--rule); color: var(--ink-2); }
.mini-btn.ghost:hover { background: var(--paper-2); color: var(--ink); }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }

.nx-list li { display: grid; grid-template-columns: 46px 1fr 44px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 9px 0 10px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.nx-list li:focus-visible { outline: 2px solid var(--markup); outline-offset: -2px; }
.nx-list li:hover .t { color: var(--seated); }
.nx-list .t { grid-row: 1 / 3; font-family: var(--display); font-weight: 750; font-stretch: 78%; font-size: 22px; letter-spacing: -.02em; line-height: 1; transition: color .2s var(--ease); }
.nx-list .meta { font-size: 12.5px; color: var(--ink-2); }
.nx-list .eta { grid-row: 1 / 3; grid-column: 3; text-align: right; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.nx-list .bar { position: relative; height: 5px; background: var(--rule-2); margin-top: 6px; }
.nx-list .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--seated-tint); border: 1px solid var(--seated); max-width: 100%; }
.nx-list li.late .bar i { background: var(--seated); }
.nx-list li.clr .bar i { width: 100% !important; border-color: var(--clear); background: repeating-linear-gradient(-45deg, var(--clear) 0 1.5px, var(--clear-tint) 1.5px 5px); }
.nx-list li.first .t, .nx-list li.first .eta { color: var(--free); }

.wl-cols { display: grid; grid-template-columns: 22px 1fr 48px 40px 62px; gap: 6px; color: var(--ink-3); font-size: 9px; padding: 9px 0 7px; border-bottom: 1px solid var(--rule); }
.wl-cols span:nth-child(3), .wl-cols span:nth-child(4) { text-align: right; }
.wl-list li { display: grid; grid-template-columns: 22px 1fr 48px 40px 62px; gap: 6px; align-items: center; min-height: 42px; border-bottom: 1px solid var(--rule); animation: row-in .5s var(--ease-out) both; }
.wl-list .n { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.wl-list .who { font-size: 14.5px; font-weight: 500; display: flex; gap: 7px; align-items: center; min-width: 0; letter-spacing: -.01em; }
.wl-list .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-list .who em { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--ink-2); border: 1px solid var(--rule); padding: 0 4px; flex: none; }
.wl-list .w, .wl-list .q { font-family: var(--mono); font-size: 12px; text-align: right; }
.wl-list .q { color: var(--ink-3); }
.wl-list li.over .w { color: var(--markup); }
.wl-list li.mine .who span { color: var(--free); }
.wl-list .act { text-align: right; }
.wl-list .mini-btn { height: 24px; padding: 0 7px; font-size: 11px; }
.wl-list .empty { display: block; padding: 14px 0; color: var(--ink-3); font-size: 14px; animation: none; border: 0; }
.wl-more { padding: 8px 0 0; color: var(--ink-3); font-size: 10px; }
.walkin { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-top: 14px; }
.walkin > .mono { color: var(--ink-2); font-size: 10px; }
.walkin-out { color: var(--free); font-size: 9.5px; flex-basis: 100%; min-height: 12px; }

/* ---------- table detail ---------- */
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 400px; z-index: 20;
  background: var(--paper); border-left: 1px solid var(--ink); overflow-y: auto; overscroll-behavior: contain;
  transform: translate3d(102%, 0, 0); visibility: hidden; transition: transform .55s var(--ease-io), visibility 0s linear .55s;
  scrollbar-width: thin;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform .55s var(--ease-io), visibility 0s; }
.drawer:focus { outline: none; }
.scrim { display: none; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 18px 14px; border-bottom: 1px solid var(--rule); }
.dr-title b { display: block; font-family: var(--display); font-weight: 800; font-stretch: 72%; font-size: 64px; line-height: .8; letter-spacing: -.035em; }
.dr-title .mono { display: block; color: var(--ink-3); margin-top: 10px; font-size: 10px; }
.dr-state { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.pill { grid-row: 1 / 3; align-self: start; display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px; border: 1px solid; font-size: 10px; margin-top: 4px; }
.pill::before { content: ''; width: 8px; height: 8px; background: currentColor; }
.dr-state[data-s='free'] .pill { color: var(--free); }
.dr-state[data-s='seated'] .pill { color: var(--seated); }
.dr-state[data-s='clear'] .pill { color: var(--clear); }
.dr-state > b { font-family: var(--display); font-weight: 800; font-stretch: 72%; font-size: 52px; line-height: .85; letter-spacing: -.03em; justify-self: end; }
.dr-state > .mono { grid-column: 2; justify-self: end; color: var(--ink-3); font-size: 9.5px; margin-top: 6px; }
.dr-state.is-late > b { color: var(--markup); }
.dr-facts { padding: 4px 18px; }
.dr-facts div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule-2); }
.dr-facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-top: 2px; }
.dr-facts dd { font-size: 14px; font-weight: 500; text-align: right; }
.dr-facts dd.late { color: var(--markup); }
.dr-act { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 18px; border-bottom: 1px solid var(--rule); }
.dr-act:empty { display: none; }
.dr-act .mini-btn { height: 34px; padding: 0 14px; font-size: 13px; }
.dr-strip, .dr-hist { padding: 16px 18px; }
.dr-strip { border-bottom: 1px solid var(--rule); }
.dr-strip > .mono, .dr-hist > .mono { color: var(--ink-3); margin-bottom: 12px; font-size: 10px; }
.dr-ev { display: block; width: 100%; height: auto; overflow: visible; }
#dr-strip { min-height: 54px; }
.dr-ev text { font-family: var(--mono); font-size: 9.5px; fill: var(--ink-3); }
.dr-ev .seg-free { fill: var(--free-tint); stroke: var(--free); }
.dr-ev .seg-seated { fill: var(--seated-tint); stroke: var(--seated); }
.dr-ev .seg-clear { fill: var(--clear-tint); stroke: var(--clear); }
.dr-ev rect { stroke-width: 1; }
.dr-ev .vis { stroke: var(--ink); stroke-width: 1.2; }
.dr-ev .ax { stroke: var(--rule); }
.dr-ev .now { stroke: var(--ink); stroke-dasharray: 2 2; }
.dr-hist ol { position: relative; }
.dr-hist ol::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--rule); }
.dr-hist li { position: relative; display: grid; grid-template-columns: 22px 46px 1fr; align-items: baseline; padding: 6px 0; font-size: 13px; }
.dr-hist li::before { content: ''; position: absolute; left: 0; top: 11px; width: 9px; height: 9px; background: var(--paper); border: 1.5px solid var(--ink-3); }
.dr-hist li.k-seated::before { background: var(--seated); border-color: var(--seated); }
.dr-hist li.k-left::before { background: var(--clear); border-color: var(--clear); }
.dr-hist li.k-cleared::before, .dr-hist li.k-open::before { background: var(--free); border-color: var(--free); }
.dr-hist li.k-visit::before { width: 5px; height: 5px; left: 2px; top: 13px; background: var(--ink-3); border: 0; }
.dr-hist li.k-visit { color: var(--ink-3); font-size: 12px; padding: 3px 0; }
.dr-hist li.k-gap { color: var(--markup); font-size: 12px; }
.dr-hist li.k-gap::before { border-color: var(--markup); background: var(--markup); clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; }
.dr-hist .tm { grid-column: 2; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.dr-hist .tx { grid-column: 3; }

/* ---------- reports ---------- */
.view-reports { overflow-y: auto; padding: 26px 22px 40px; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.rp-head .mono { color: var(--ink-3); }
.rp-title { font-family: var(--display); font-weight: 800; font-stretch: 70%; font-size: clamp(48px, 5.4vw, 84px); line-height: .85; letter-spacing: -.035em; margin-top: 12px; }
.rp-note { max-width: 300px; text-align: right; font-size: 10px; line-height: 1.5; }
.rp-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.card { grid-column: span 3; border: 1px solid var(--rule); padding: 16px 18px 18px; position: relative; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; flex-wrap: wrap; }
.card-h > .mono:first-child { color: var(--ink); font-weight: 500; }
.card-foot { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; line-height: 1.45; }
.heat-card { grid-column: span 8; }
.kpi-card { grid-column: span 4; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.tonight-card { grid-column: span 6; }
.rp-kpis > div { padding: 10px 0 12px; border-bottom: 1px solid var(--rule); }
.rp-kpis > div:first-child { padding-top: 0; }
.rp-kpis dt { color: var(--ink-3); font-size: 9.5px; }
.rp-kpis dd { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.rp-kpis dd b { font-family: var(--display); font-weight: 800; font-stretch: 72%; font-size: 46px; line-height: .85; letter-spacing: -.03em; }
.rp-kpis dd span { color: var(--ink-2); font-size: 13px; }
.rp-shift { border-left: 2px solid var(--markup); padding: 2px 0 2px 14px; }
.rp-shift .mono { color: var(--markup); font-size: 10px; }
.rp-shift p:last-child { font-size: 14px; margin-top: 8px; line-height: 1.45; }
.tri { display: inline-block; width: 10px; height: 9px; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); margin-right: 7px; vertical-align: -1px; }

.heat { display: block; width: 100%; height: auto; overflow: visible; }
.heat .hx, .heat .hy { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-3); letter-spacing: .06em; }
.heat .cell rect { fill: var(--ink); }
.heat .cell text { font-family: var(--mono); font-size: 11px; fill: var(--ink-2); pointer-events: none; }
.heat .cell.dark text { fill: var(--paper); }
.heat .cell.hot rect { fill: var(--seated); }
.heat .cell.hot text { fill: #fff; }
@media (hover: hover) { .heat .cell:hover rect { stroke: var(--ink); stroke-width: 2; } }
.heat .closed { fill: url(#heat-closed); }
.heat .hc { stroke: var(--rule); stroke-width: 1; }
.heat .closed-l { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; fill: var(--ink-3); text-anchor: middle; }
.heat-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--paper); padding: 8px 10px 9px; font-size: 10.5px; line-height: 1.5; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.heat-tip.below { transform: translate(-50%, 10px); }
.heat:focus { outline: none; }
.heat:focus-visible { outline: 2px solid var(--markup); outline-offset: 4px; }
.heat .cell.is-cur rect { stroke: var(--ink); stroke-width: 2; }
.heat.is-compact .cell text { font-size: 10.5px; }
.heat-tip b { display: block; font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 20px; letter-spacing: -.01em; text-transform: none; }

.bars, .turn, .tn { display: block; width: 100%; height: auto; overflow: visible; }
.bars text, .turn text, .tn text { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-3); letter-spacing: .05em; }
.bars .b-l { fill: var(--ink-3); } .bars .b-d { fill: var(--ink); }
.bars .bv { fill: var(--ink); font-weight: 500; }
.turn .tg { stroke: var(--rule-2); stroke-width: 1; }
.turn .tx { text-anchor: middle; }
.turn .tr { stroke: var(--ink-2); stroke-width: 1.4; fill: none; }
.turn .tm { fill: var(--seated); }
.turn .tv { fill: var(--ink); font-weight: 500; text-anchor: middle; }
.tn .tb-bar { fill: var(--ink); }
.tn .tb-bar.cur { fill: var(--seated); }
.tn .occ { fill: none; stroke: var(--free); stroke-width: 2; }
.tn .occ-a { fill: var(--free); opacity: .1; }
.tn .g { stroke: var(--rule-2); }
.tn .now { stroke: var(--ink); stroke-dasharray: 2 3; }
.tn .tn-key text { font-size: 10px; }
#tonight, #turn, #foot { min-height: 120px; }

/* fast replay: states change faster than any fade could show */
.is-fast .plan *, .is-fast .plan .tb { transition-duration: 0s !important; transition-delay: 0s !important; }
.is-fast .plan .cloud > path, .is-fast .plan .delta { animation: none; }
.is-fast .ticker li, .is-fast .al-list li, .is-fast .wl-list li { animation: none; }

/* ---------- smaller screens ----------
   >1240   plan + 400px rail, KPIs over the plan
   901-1240  plan + 340px rail, KPIs across the top (tablets in landscape keep the rail beside the plan)
   <=900   one column that scrolls: plan, then the rail; the table detail becomes a bottom sheet
   <=700   the plan frames one zone at a time (see floor.js), the top bar takes two rows */
@media (max-width: 1240px) {
  .site .mono, .clock-day { display: none; }
  .topbar { gap: 14px; padding: 0 14px; }
  .view-floor { grid-template-columns: minmax(0, 1fr) 340px; }
  .kpis { grid-column: 1 / 3; }
  .rail { grid-row: 2; }
  .drawer { width: 340px; }
  .kpi { padding: 10px 14px 11px; }
  .kpi b { font-size: 26px; }
  .rail-sec { padding: 14px 16px 18px; }
  .card { grid-column: span 6; }
  .heat-card, .kpi-card, .tonight-card { grid-column: span 12; }
  .kpi-card { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 18px 30px; }
}
@media (max-width: 1000px) {
  .site { display: none; }
  .back { display: none; }
  .topbar { grid-template-columns: auto 1fr auto auto; }
}
@media (max-width: 900px) {
  body.floor { overflow: auto; }
  body.floor.sheet-open { overflow: hidden; }
  .app { height: auto; min-height: 100vh; min-height: 100dvh; grid-template-rows: auto 1fr; }
  .topbar { position: sticky; top: 0; z-index: 30; background: var(--paper); min-height: 56px; padding: 8px 16px; }
  .view-floor { display: block; overflow: visible; }
  .kpis { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .kpi { grid-column: span 3; border-bottom: 1px solid var(--rule); }
  .kpi:nth-child(n+5) { grid-column: span 4; border-bottom: 0; }
  .kpi:nth-child(4) { border-right: 0; }
  .floor-wrap { padding: 14px 16px 10px; }
  .floor-plan { flex: none; margin-top: 10px; }
  .floor-plan .plan { height: auto; }
  .hint { position: static; margin: 6px 0 4px; }
  .rail { border-left: 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); overflow: visible; }
  .rail-sec { border-right: 1px solid var(--rule); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(10, 10, 9, .5); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s linear .4s; }
  .scrim.is-on { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
  .drawer { position: fixed; z-index: 45; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; max-height: 82dvh; border-left: 0; border-top: 1px solid var(--ink); transform: translate3d(0, 102%, 0); box-shadow: 0 -30px 60px rgba(0, 0, 0, .25); }
  .dr-title b { font-size: 52px; }
  .rp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .heat-card, .kpi-card, .tonight-card { grid-column: span 6; }
  .card { grid-column: span 3; }
}
/* phones held sideways: little height, plenty of width, so the KPIs go back to one row */
@media (max-width: 900px) and (max-height: 500px) {
  .kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .kpi, .kpi:nth-child(n+5) { grid-column: auto; border-bottom: 0; }
  .kpi:nth-child(4) { border-right: 1px solid var(--rule); }
  .kpi { padding: 8px 10px 9px; gap: 4px; }
  .kpi .mono { white-space: normal; font-size: 9px; }
  .kpi b { font-size: 21px; }
  .kpi small { font-size: 12px; }
}
@media (max-width: 700px) {
  .topbar { grid-template-columns: auto 1fr auto; grid-template-areas: 'logo tabs lights' 'clock clock clock'; row-gap: 8px; }
  .logo { grid-area: logo; } .tabs { grid-area: tabs; } .clock { grid-area: clock; justify-content: space-between; } .lights { grid-area: lights; }
  .tabs button { padding: 0 14px; }
  .clock { gap: 8px; }
  .clock > b { font-size: 15px; min-width: 72px; }
  .seg button { min-width: 32px; padding: 0 7px; }
  .floor-tools { gap: 12px 16px; }
  .zones { display: flex; width: 100%; }
  .zones button { flex: 1 1 auto; }
  .legend { gap: 8px 14px; }
  .cams-toggle { margin-left: 0; }
  .rail { grid-template-columns: 1fr; }
  .rail-sec { border-right: 0; }
  .kpi { padding: 9px 10px 10px; gap: 5px; }
  .kpi .mono { white-space: normal; font-size: 9.5px; line-height: 1.25; }
  .kpi b { font-size: 22px; }
  .kpi small { font-size: 12px; margin-left: 2px; }
  .card { grid-column: span 6; }
  .kpi-card { grid-template-columns: 1fr; }
  .view-reports { padding: 20px 14px 40px; }
  .rp-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .rp-note { text-align: left; }
  .card { padding: 14px 14px 16px; }
}
@media (max-width: 380px) {
  .kpi .mono { font-size: 9px; letter-spacing: .05em; }
  .tabs button { padding: 0 11px; }
}
/* thumbs: every control at least 40px tall on touch screens */
@media (pointer: coarse) {
  .seg button, .tabs button { height: 40px; }
  .sq-btn { width: 40px; height: 40px; }
  .lights { height: 40px; }
  .cams-toggle { min-height: 40px; }
  .cams-toggle input { width: 40px; height: 22px; }
  .cams-toggle input::after { width: 14px; height: 14px; }
  .cams-toggle input:checked::after { transform: translateX(18px); }
  .mini-btn { height: 36px; }
  .wl-list .mini-btn { height: 32px; padding: 0 9px; }
  .wl-list li { min-height: 48px; }
  .walkin .seg button { min-width: 44px; }
}
