[hidden] { display: none !important; }
/* Otsego Door Portal
 * Colors: Otsego Local Schools palette (black #000, white #fff, Otsego Orange #FF5600,
 * grays #4F4F4F / #BDBDBD, light orange #FFBB99). Type: system UI fonts on purpose.
 * Orange is for actions and emphasis only; small text uses ink or the darker
 * --link orange so it stays readable (orange on white is ~3.4:1).
 */
:root {
  --orange: #ff5600; --orange-hover: #e64d00; --orange-soft: #fff1ea; --orange-line: #ffbb99;
  --link: #b83f00;
  --bg: #f6f6f5; --panel: #ffffff; --ink: #0b0b0b; --ink-2: #4f4f4f; --muted: #6b6b6b;
  --line: #e6e5e3; --line-2: #bdbdbd; --hover: #faf9f8;
  --side: #0b0b0b; --side-ink: #f2f2f2; --side-muted: #a3a3a3; --side-hover: #1c1c1c;
  --ok: #157a3c; --ok-bg: #e7f6ec; --bad: #c0261b; --bad-bg: #fdecea;
  --warn: #9a5b00; --warn-bg: #fff4dd; --info: #1f5fad; --info-bg: #e8f0fb;
  --neutral-bg: #f0efed;
  --bar: #ff5600; --bar-hol: #6d5bd0; --track: #f0efed;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --orange-soft: #2a1a10; --orange-line: #6b3416; --link: #ff8a4c;
    --bg: #0f0f0f; --panel: #181818; --ink: #f1f1f1; --ink-2: #c9c9c9; --muted: #9a9a9a;
    --line: #2a2a2a; --line-2: #3a3a3a; --hover: #1f1f1f;
    --side: #000000; --side-hover: #161616;
    --ok: #5fd08a; --ok-bg: #12301d; --bad: #ff8a80; --bad-bg: #3a1714;
    --warn: #f3b85a; --warn-bg: #36270c; --info: #8ab8f5; --info-bg: #142640;
    --neutral-bg: #242424; --track: #262626; --bar-hol: #a597ee;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  line-height: 1.4; font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- app shell ---------- */
body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--side-ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand b { display: block; font-size: 1.02rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--side-muted); font-size: .75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--side-muted); font-weight: 500; position: relative; }
.nav a:hover { background: var(--side-hover); color: var(--side-ink); text-decoration: none; }
.nav a.on { background: var(--side-hover); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--orange); }
.nav a.on .ico { color: var(--orange); }
.side-foot { display: flex; flex-direction: column; gap: 10px; font-size: .78rem; color: var(--side-muted); }
.sync { display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #3ccf6e; box-shadow: 0 0 0 3px rgba(60,207,110,.18); }
.sync.stale i { background: #f3b85a; box-shadow: 0 0 0 3px rgba(243,184,90,.2); }
.mode { display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.mode .ico { width: 14px; height: 14px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid #222; margin-top: 2px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #000; font-weight: 700;
  display: grid; place-items: center; flex: none; }
.me-txt { flex: 1; min-width: 0; }
.me-txt b { display: block; color: var(--side-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { color: var(--side-muted); }
.me button { background: transparent; border: 0; color: var(--side-muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.me button:hover { color: #fff; background: var(--side-hover); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 28px; }
.omni { display: flex; align-items: center; gap: 8px; max-width: 560px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); box-shadow: var(--shadow); }
.omni:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.omni input { flex: 1; border: 0 !important; background: transparent !important; padding: 9px 0 !important;
  font-size: .95rem; color: var(--ink); outline: none; box-shadow: none !important; }
.content { padding: 16px 22px 32px; max-width: 1600px; width: 100%; }
body.bare .content { margin: 0 auto; }

/* ---------- type ---------- */
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 4px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 18px 0 6px; font-weight: 650; letter-spacing: -.005em; }
.sub { color: var(--muted); margin: 0 0 8px; max-width: 130ch; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
b, strong { font-weight: 650; }

/* ---------- surfaces ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px;
  margin-bottom: 10px; box-shadow: var(--shadow); }
a.panel { display: block; color: inherit; transition: border-color .15s, transform .15s; }
a.panel:hover { text-decoration: none; border-color: var(--orange-line); transform: translateY(-1px); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); color: inherit; position: relative; overflow: hidden; }
a.stat:hover { text-decoration: none; border-color: var(--orange-line); }
.stat .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.stat.s-granted::after { background: var(--ok); } .stat.s-denied::after { background: var(--bad); }
.stat.s-alarm::after { background: var(--bad); } .stat.s-remote::after { background: var(--warn); }
.stat.s-unlock::after { background: var(--info); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600;
  background: var(--panel); position: sticky; top: 0; }
tbody tr:hover td, tr:hover td { background: var(--hover); }
td a { font-weight: 550; }

/* ---------- pills ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .76rem;
  font-weight: 600; white-space: nowrap; line-height: 1.6; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.t-granted { background: var(--ok-bg); color: var(--ok); }
.t-denied, .t-alarm { background: var(--bad-bg); color: var(--bad); }
.t-remote { background: var(--warn-bg); color: var(--warn); }
.t-unlock { background: var(--info-bg); color: var(--info); }
.t-intercom { background: var(--info-bg); color: var(--info); }
.evgrp summary { cursor: pointer; list-style: none; }
.evgrp summary::-webkit-details-marker { display: none; }
.evgrp summary::after { content: ' ▸'; color: var(--ink-2); }
.evgrp[open] summary::after { content: ' ▾'; }
.evgrp-raw { margin: 6px 0 0; padding-left: 18px; }
.t-system, .t-io, .t-other { background: var(--neutral-bg); color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--neutral-bg); border-radius: 999px; padding: 2px 10px; font-size: .84rem; color: var(--ink); }
a.chip:hover { background: var(--orange-soft); text-decoration: none; }

/* ---------- alerts ("Needs attention") ---------- */
.issue { display: block; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line-2);
  border-radius: 8px; padding: 6px 12px; margin: 4px 0; }
.issue b { display: inline; margin-right: .5em; }
.issue b a { color: var(--ink); }
.issue .small { color: var(--ink-2); }
.issue.high { border-left-color: var(--bad); }
.issue.high b::before { content: "Urgent"; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  background: var(--bad-bg); color: var(--bad); border-radius: 4px; padding: 1px 6px; margin-right: 8px; vertical-align: 2px; }
.issue.medium { border-left-color: var(--orange); }
.issue.low { border-left-color: var(--info); }
.flash { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }

/* ---------- forms & buttons ---------- */
input, select, button { font: inherit; }
input[type=text], input[type=date], input[type=email], input[type=search], input[type=password], input[type=number], input[type=time], select {
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink);
  min-width: 0; outline: none; }
input:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
form.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.filters label { display: flex; flex-direction: column; font-size: .78rem; color: var(--muted); gap: 4px; font-weight: 500; }
button.primary, a.button { background: var(--orange); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; white-space: nowrap; }
button.primary:hover, a.button:hover { background: var(--orange-hover); text-decoration: none; }
a.button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); font-weight: 550; }
a.button.secondary:hover { background: var(--hover); border-color: var(--ink-2); }
.search-big { display: flex; gap: 8px; }
.search-big input { flex: 1; font-size: 1.02rem; padding: 11px 14px; }
.pager { display: flex; gap: 6px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.pager b, .pager a { min-width: 32px; text-align: center; padding: 4px 8px; border-radius: 6px; }
.pager b { background: var(--ink); color: var(--panel); }
details.panel summary { cursor: pointer; list-style: none; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary b::after { content: " ▸"; color: var(--muted); }
details[open].panel summary b::after { content: " ▾"; }
details.panel summary .small { display: block; margin-top: 2px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* ---------- page header ---------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.eyebrow { font-size: .74rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--link); margin-bottom: 4px; }

/* ---------- week chart ---------- */
.week { display: grid; grid-template-columns: 7.5rem 1fr; gap: 4px 10px; align-items: center; font-size: .82rem; }
.week .day { color: var(--muted); text-align: right; }
.week .track { position: relative; height: 16px; background: var(--track); border-radius: 5px; overflow: hidden; }
.week .track .blk { position: absolute; top: 0; bottom: 0; background: var(--bar); border-radius: 4px; }
.week .track.hol .blk { background: var(--bar-hol); }
.week .hours { position: relative; height: 1rem; color: var(--muted); font-size: .7rem; }
.week .hours span { position: absolute; transform: translateX(-50%); }
.week .txt { grid-column: 2; color: var(--muted); font-size: .75rem; margin-top: -3px; }
.week.mini { grid-template-columns: 2.4rem 1fr; gap: 3px 6px; font-size: .72rem; }
.week.mini .track { height: 8px; border-radius: 4px; }

/* ---------- sign-in ---------- */
.signin { max-width: 880px; margin: 6vh auto; display: grid; grid-template-columns: 1fr 1fr; border-radius: 18px;
  overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.signin .art { background: #000; display: grid; place-items: center; padding: 40px; position: relative; }
.signin .art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: var(--orange); }
.signin .art img { width: auto; height: auto; max-width: 100%; max-height: 260px; object-fit: contain; }
.signin .form { padding: 40px 36px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.signin .form form { display: grid; gap: 10px; }
.signin .button { justify-content: center; padding: 11px 16px; }
.signin .notice { margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; line-height: 1.45; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- small screens: sidebar becomes a top bar ---------- */
@media (max-width: 860px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; height: auto; z-index: 10; flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 8px 12px; gap: 6px; }
  .brand { padding: 4px 6px; flex: 1; }
  .brand img { height: 30px; }
  .nav { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav a { flex: none; padding: 7px 10px; }
  .nav a.on::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; border-radius: 2px; }
  .side-foot { flex-direction: row; align-items: center; }
  .sync, .mode, .me-txt { display: none; }
  .me { border: 0; padding: 0; margin: 0; }
  .topbar { position: static; padding: 10px 16px; }
  .content { padding: 18px 16px 40px; }
  .hide-sm { display: none; }
  th, td { padding: 8px 10px; }
  .signin { grid-template-columns: 1fr; margin: 16px auto; }
  .signin .art { padding: 28px; } .signin .art img { max-height: 140px; }
  .signin .form { padding: 24px 20px; }
}

/* ===================== v2: task-first components ===================== */
kbd { font: 600 .72rem/1 var(--font); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 5px; padding: 3px 6px; }

/* launcher */
.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.lt { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--ink); transition: .15s; }
.lt:hover { text-decoration: none; border-color: var(--orange); }
.lt b { font-size: .98rem; grid-column: 2; }
.lt small { color: var(--muted); font-size: .8rem; line-height: 1.3; grid-column: 2; }
.lt b:first-child, .lt small:first-child { grid-column: 1 / -1; }
.lt-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--orange-soft);
  color: var(--link); grid-row: span 2; }
.lt-ic .ico { width: 18px; height: 18px; }
.lt-hero { background: #0b0b0b; color: #fff; border-color: #0b0b0b; }
.lt-hero small { color: #c8c8c8; }
.lt-hero .lt-ic { background: var(--orange); color: #000; }
details.more summary { cursor: pointer; color: var(--link); font-weight: 600; margin: 6px 0; }

/* segmented control + building tabs */
.seg { display: inline-flex; background: var(--neutral-bg); border-radius: 10px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.seg a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.tabs a { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2);
  font-weight: 550; font-size: .88rem; background: var(--panel); }
.tabs a.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tabs a:hover { text-decoration: none; border-color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }

/* state pills */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-unlocked { background: var(--warn-bg); color: var(--warn); }
.st-locked { background: var(--ok-bg); color: var(--ok); }
.st-offline { background: var(--bad-bg); color: var(--bad); }
.st-disabled { background: var(--neutral-bg); color: var(--muted); }

/* door tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; color: var(--ink); box-shadow: var(--shadow); transition: .12s; }
.tile:hover { text-decoration: none; border-color: var(--ink-2); transform: translateY(-1px); }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile-top b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.tile-st { font-size: .82rem; color: var(--ink-2); }
.tile.t-unlocked { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.tile.t-unlocked .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.tile.t-offline .dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.tile.t-offline { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.tile.t-disabled { opacity: .6; } .tile.t-disabled .dot { background: var(--line-2); }

/* timeline */
.tl { position: relative; height: 10px; background: var(--track); border-radius: 5px; }
.tl i { position: absolute; top: 0; bottom: 0; background: var(--orange); border-radius: 5px; }
.tl .now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.tlwrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.tlhead, .tlrow { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: center; padding: 10px 16px; }
.tlhead { border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
.tlscale { position: relative; height: 14px; font-size: .72rem; color: var(--muted); }
.tlscale span { position: absolute; }
.tlrow { color: var(--ink); border-bottom: 1px solid var(--line); }
.tlrow:last-child { border-bottom: 0; }
.tlrow:hover { background: var(--hover); text-decoration: none; }
.tlrow .tl { height: 14px; }
.tlname { font-weight: 550; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* action buttons (inactive until approved) */
.act { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--ink); border-radius: 9px; padding: 9px 14px; font-weight: 650; cursor: not-allowed; position: relative; }
.act.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.act .soon { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px;
  border-radius: 4px; background: var(--neutral-bg); color: var(--muted); }
.act.primary .soon { background: rgba(0,0,0,.18); color: #fff; }
.act.nudge { animation: nudge .35s; }
@keyframes nudge { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* steps (closing planner) */
.steps { display: grid; gap: 18px; }
.steps > button { justify-self: start; }
.step { display: flex; flex-direction: column; gap: 10px; }
.step > b { font-size: 1rem; }
.step .num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--panel); display: inline-grid;
  place-items: center; font-weight: 700; font-size: .8rem; }
.step { position: relative; padding-left: 36px; } .step .num { position: absolute; left: 0; top: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input[type=radio] { position: absolute; opacity: 0; }
.choice > span { display: flex; flex-direction: column; gap: 2px; min-width: 112px; padding: 10px 14px; border: 1.5px solid var(--line-2);
  border-radius: 10px; cursor: pointer; background: var(--panel); }
.choice small { color: var(--muted); font-size: .78rem; }
.choice input:checked + span { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 0 0 3px var(--orange-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--orange); }
.confirm-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 40; opacity: 0; transition: opacity .18s; }
.drawer-scrim.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg); z-index: 41;
  box-shadow: -12px 0 40px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .18s ease-out; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; z-index: 1; }
.pn { padding: 22px 22px 32px; display: flex; flex-direction: column; gap: 14px; }
.drawer .pn { padding-top: 20px; }
.pn-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-right: 40px; }
.pn-title { margin: 0; font-size: 1.35rem; }
.pn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pn-kv { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pn-check { display: flex; gap: 8px; } .pn-check input { flex: 1; }
.pn-h { font-size: .95rem; margin: 6px 0 0; }
.pn-more { font-size: .9rem; margin: 4px 0 0; }

@media (max-width: 860px) {
  .tlhead, .tlrow { grid-template-columns: 120px 1fr; padding: 8px 12px; }
  .launch { grid-template-columns: 1fr 1fr; }
  .lt { min-height: 0; padding: 12px; }
  .lt small { display: none; }
}

/* live states */
.st-open { background: var(--bad-bg); color: var(--bad); }
.st-alarm { background: var(--bad-bg); color: var(--bad); }
.tile.t-open, .tile.t-alarm { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.tile.t-open .dot, .tile.t-alarm .dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); animation: pulse 1.6s infinite; }
.tile-flag { font-size: .74rem; font-weight: 650; color: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.livetag { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ok); }
.livetag i { width: 8px; height: 8px; border-radius: 50%; background: #3ccf6e; animation: pulse 1.6s infinite; box-shadow: 0 0 0 3px rgba(60,207,110,.2); }
@media (prefers-reduced-motion: reduce) { .tile .dot, .livetag i { animation: none; } }

form.inline { display: inline; }
.issue.done { border-left-color: var(--ok); }
.issue.done form { margin-top: 8px; display: block; }
button.primary.big { padding: 11px 18px; font-size: 1rem; }
.act-real { border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); border-radius: 8px;
  padding: 7px 12px; font-weight: 600; cursor: pointer; }
.act-real:hover { border-color: var(--bad); color: var(--bad); }
.act-real.sm { padding: 4px 10px; font-size: .82rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }

/* collapsible section with a scrolling table */
details.sect > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
details.sect > summary::-webkit-details-marker { display: none; }
.sect-t { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; }
.sect-t::after { content: "Show"; margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--link); }
details[open].sect .sect-t::after { content: "Hide"; }
.sect-sub { color: var(--muted); font-size: .85rem; }
details.sect > p { margin: 10px 0 8px; }
.scrollbox { max-height: 380px; overflow-y: auto; }
.scrollbox th { position: sticky; top: 0; z-index: 1; }
.grid2.top { align-items: start; }

/* Admin → Alerts & email */
.settings h2 { margin: 12px 0 4px; font-size: 1.05rem; }
.settings h2:first-of-type { margin-top: 4px; }
.settings label { display: grid; grid-template-columns: 150px minmax(0, 460px); align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 600; }
.settings p { margin: 4px 0 8px; }
.settings label input[type=text], .settings label input[type=password] { font-weight: 400; max-width: 100%; }
.settings label > span { font-weight: 400; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.settings label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; padding-left: 160px; }
@media (max-width: 640px) { .settings label { grid-template-columns: 1fr; gap: 2px; } .settings label.check { padding-left: 0; } }

/* Controller health */
.sev-high { color: var(--bad); font-weight: 600; margin-top: 3px; }
.sev-medium { color: var(--orange); margin-top: 3px; }
.sev-low { color: var(--ink-2); margin-top: 3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
a.vid { white-space: nowrap; font-weight: 600; margin-left: 4px; }
.camcell { display: flex; flex-wrap: wrap; gap: 6px; }
.camcell select.cam-extra { color: var(--muted); }
input.renamed { border-color: var(--orange); }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }

/* door cameras: snapshot strip, watch page, camera wall */
.camstrip { display: flex; gap: 8px; align-items: stretch; margin: 10px 0; overflow-x: auto; }
.camstrip img { height: 84px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #111; display: block; }
.camstrip-go { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-width: 96px;
  padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 600; font-size: .86rem; color: var(--ink); }
.camstrip-go:hover { text-decoration: none; border-color: var(--orange); }
.camgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin: 12px 0; }
.camgrid.one { grid-template-columns: minmax(0, 960px); }
.camgrid.wall { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.camtile { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.camimg, .camvideo { display: block; width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #0b0b0b; }
.camimg.broken { opacity: .25; }
.camtile figcaption { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 8px 12px; }
.camacts { margin-left: auto; }
@media (max-width: 560px) { .camgrid, .camgrid.wall { grid-template-columns: 1fr; } }

/* ---------- density: one line per row wherever it fits ---------- */
td > div:is(.small, .muted):not([class*="sev-"]) { display: inline; margin-left: .45em; }
td > div:is(.small, .muted):not([class*="sev-"])::before { content: "· "; color: var(--muted); }
.clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
td.fill { max-width: 0; width: 100%; }
.compact-panel { padding: 8px 12px; margin-bottom: 8px; }
.compact-panel p { margin: 2px 0; }
details > summary { cursor: pointer; padding: 3px 0; }
.week.micro { display: flex; flex-direction: column; gap: 2px; }
.week.micro .track { height: 3px; border-radius: 2px; }
.week.micro .track:nth-child(8) { margin-top: 2px; }
td.wkcol, th.wkcol { width: 45%; min-width: 260px; vertical-align: middle; }
/* closing planner: label and choices on one row */
.steps { gap: 8px; }
.step { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-left: 32px; }
.step > b { min-width: 150px; }
.step .num { top: 50%; transform: translateY(-50%); }
.choices { gap: 6px; }
.choice > span { padding: 4px 10px; min-width: 90px; gap: 0; }
.choice input[type=date] { padding: 2px 6px; }
/* tighter defaults for cards that remain */
.grid2 { gap: 10px; }
dl.kv { gap: 3px 14px; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.tile { padding: 7px 10px; gap: 2px; border-radius: 8px; }
.week { gap: 2px 10px; }
.week .track { height: 12px; }
.week .txt { margin-top: -1px; }
/* ePTZ (straightened fisheye) */
canvas.eptz { display: block; width: 100%; aspect-ratio: 16/9; background: #0b0b0b; cursor: grab; touch-action: none; }
canvas.eptz:active { cursor: grabbing; }
.camstrip canvas.eptz { height: 84px; width: auto; aspect-ratio: 16/9; border-radius: 8px; cursor: pointer; }
.camstrip-i { display: block; flex: none; }
.camgrid.wall canvas.eptz { cursor: pointer; }
.eptz-bar { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.eptz-bar button { padding: 2px 10px; font-size: .82rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.eptz-bar button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.camtile figcaption.clip { display: block; }
.camgrid.wall { gap: 8px; }
.camtile figcaption { padding: 5px 10px; }
/* full week chart: hours text beside each bar, not under it */
.week:not(.mini) { grid-template-columns: 7rem 1fr 10rem; gap: 3px 10px; }
.week:not(.mini) .txt { grid-column: 3; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week:not(.mini) .hours span:last-child { transform: translateX(-100%); }
/* home launcher: roomier than the rest (Luke, 2026-11-14) */
.launch { gap: 12px; margin: 12px 0 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lt { padding: 14px 16px; column-gap: 14px; min-height: 78px; border-radius: 12px; box-shadow: var(--shadow); }
.lt b { font-size: 1.04rem; }
.lt small { font-size: .85rem; }
.lt-ic { width: 40px; height: 40px; border-radius: 10px; }
.lt-ic .ico { width: 22px; height: 22px; }
.launch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .launch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .launch { grid-template-columns: 1fr; } }
/* access editing */
.chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 1rem; line-height: 1; }
.chip-x:hover { color: var(--bad); }
.inline-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.inline-row select, .inline-row input { max-width: 100%; }
.badge-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.linkbtn { border: 0; background: none; color: var(--link); cursor: pointer; padding: 0; font: inherit; font-size: .85rem; }
.linkbtn:hover { text-decoration: underline; }
.sched-edit input[type=time] { width: 7.2rem; padding: 2px 4px; }
.sched-edit tr.chg td { background: var(--orange-soft); }
.rename-link { font-size: .8rem; font-weight: 500; margin-left: 8px; vertical-align: middle; color: var(--muted); }
/* admin: one tab bar on every admin page */
.admintop { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-h { margin: 0; }
.switches { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sw { font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.sw.on { background: var(--ok-bg); color: var(--ok); }
.sw.off { background: var(--neutral-bg); color: var(--muted); text-decoration: line-through; }
.admintabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.admintabs a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); }
.admintabs a:hover { text-decoration: none; border-color: var(--orange); }
.admintabs a.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--orange); }
.at-ic { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--orange-soft); color: var(--link); }
.at-ic .ico { width: 18px; height: 18px; }
.at-t { display: flex; flex-direction: column; min-width: 0; }
.at-t b { font-size: .95rem; }
.at-t small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-t small.warn { color: var(--warn); font-weight: 600; }
@media (max-width: 1000px) { .admintabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .admintabs { grid-template-columns: 1fr 1fr; } }
.rolekey { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 10px; }
.userrow select { padding: 2px 6px; }
/* door board: building bands of slim rows with a day strip */
.bldg { margin: 10px 0 14px; }
.bldg-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 0 2px 4px; }
.bldg-h h2 { margin: 0; }
.ok-t { color: var(--ok); font-weight: 600; }
.bldg-scale { display: none; }
.drows { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 0 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px; }
.drow { display: grid; grid-template-columns: 12px minmax(150px, 1.2fr) minmax(120px, 1fr) minmax(120px, auto) 18px; gap: 10px;
  align-items: center; padding: 5px 2px; border-bottom: 1px solid var(--line); color: var(--ink); min-height: 32px; }
.drow:hover { background: var(--hover); text-decoration: none; }
.drow .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.drow.s-unlocked .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.drow.s-open .dot, .drow.s-alarm .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); animation: pulse 1.6s infinite; }
.drow.s-offline .dot { background: var(--bad); }
.drow.s-disabled { color: var(--muted); } .drow.s-disabled .dot { background: var(--line-2); }
.drow.s-open, .drow.s-alarm, .drow.s-offline { background: color-mix(in srgb, var(--bad-bg) 55%, transparent); }
.drow.s-unlocked { background: color-mix(in srgb, var(--warn-bg) 45%, transparent); }
.dname { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dflag { font-style: normal; font-size: .72rem; font-weight: 650; color: var(--bad); margin-left: 4px; }
.dstrip .tl { margin: 0; height: 8px; }
.dnext { font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcam { color: var(--muted); } .dcam .ico { width: 15px; height: 15px; }
.drows-more { margin-top: 4px; } .drows-more summary { padding: 2px 4px; }
@media (max-width: 700px) {
  .drows { grid-template-columns: 1fr; }
  .drow { grid-template-columns: 12px 1fr auto; } .drow .dstrip, .drow .dcam { display: none; }
}
.eptz-bar[hidden] { display: none; }

/* reports: after-hours heat strip */
.heat th.hc, .heat td.hc { text-align: center; font-size: .72rem; padding: 3px 2px; min-width: 26px; font-variant-numeric: tabular-nums; }
.heat th.hc { line-height: 1.15; font-weight: 500; }
.heat th.hc.off { color: var(--muted); background: var(--neutral-bg); }
.heat td.hc[style] { background: color-mix(in srgb, var(--orange) var(--h), transparent); }
tr.late td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
form.grants { display: flex; flex-wrap: wrap; gap: 2px 10px; }
form.grants label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
table.heat { width: auto; }
table.heat td.num, table.heat th.num { padding-left: 14px; }

/* event unlocks */
.evrow { display: grid; grid-template-columns: 120px minmax(220px, 1fr) minmax(260px, 1.3fr); gap: 4px 14px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--panel); align-items: start; }
.evrow:first-of-type { border-top: 1px solid var(--line); }
.evrow.ev-done { opacity: .75; }
.ev-when, .ev-what { display: flex; flex-direction: column; gap: 1px; }
.ev-when span { font-size: .82rem; color: var(--muted); }
.evform { display: flex; flex-direction: column; gap: 4px; }
.evdoors { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: .82rem; }
.evdoors label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.evform input[type=time] { padding: 2px 4px; }
@media (max-width: 760px) { .evrow { grid-template-columns: 1fr; } }
.chip.on { background: var(--orange-soft); outline: 1px solid var(--orange-line); font-weight: 600; }

/* printable building sheet */
.sheet-h { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.sheet-t td, .sheet-t th { font-size: .8rem; padding: 4px 6px; }
.sheet-t td.off { color: var(--muted); text-align: center; }
.sheet-t .hol { background: var(--neutral-bg); }
@media print {
  .side, .topbar, .noprint, .flash, .drawer, .drawer-scrim { display: none !important; }
  body, .main, .content { background: #fff !important; color: #000 !important; margin: 0 !important; padding: 0 !important; }
  .app .main { margin-left: 0 !important; }
  .tbl, .tablewrap { box-shadow: none !important; border-color: #999 !important; }
  .sheet-t td, .sheet-t th { border: 1px solid #999 !important; color: #000 !important; }
  .sheet-t .hol { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000 !important; }
  @page { size: landscape; margin: 12mm; }
}
.evdoorcfg .evcfg-row { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.evdoorcfg .evcfg-row:last-of-type { border-bottom: 0; }
@media (max-width: 760px) { .evdoorcfg .evcfg-row { grid-template-columns: 1fr; } }

/* schedules: one-line rows, a 7-day strip, plain hours */
button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 14px; font-weight: 550; cursor: pointer; white-space: nowrap; }
button.secondary:hover { background: var(--hover); border-color: var(--ink-2); }
button.sm, a.button.sm, select.sm { padding: 5px 10px; font-size: .84rem; }
button.linkish { background: none; border: 0; color: var(--link, var(--orange)); cursor: pointer; padding: 0 4px; text-decoration: underline; }
.d-block { display: block; }
.wk7 { display: inline-grid; grid-template-columns: repeat(7, 22px); gap: 2px; vertical-align: middle; }
.wk7 i { position: relative; height: 12px; background: var(--track); border-radius: 3px; overflow: hidden; }
.wk7 i.we { background: var(--neutral-bg); }
.wk7 i b { position: absolute; top: 0; bottom: 0; background: var(--bar); border-radius: 2px; }
.wk7.head i { background: none; height: auto; font-style: normal; font-size: .66rem; color: var(--muted); text-align: center; font-weight: 600; }
.schbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.schbar input[type=search] { flex: 1; min-width: 200px; max-width: 360px; padding: 6px 10px; }
.sbld h2, .ssec h2 { margin: 14px 0 6px; font-size: 1.02rem; display: inline-flex; gap: 8px; align-items: baseline; }
.srows { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.srow { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 1.6fr) 168px 110px minmax(130px, 1fr);
  gap: 12px; align-items: center; padding: 5px 12px; border-top: 1px solid var(--line); font-size: .88rem; }
.srow.all { grid-template-columns: minmax(170px, 1.1fr) minmax(200px, 1.5fr) 168px minmax(200px, 1.6fr); }
.srow:first-child { border-top: 0; }
.srow.shead { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 4px 12px; background: var(--neutral-bg); }
.srow:not(.shead):hover { background: var(--hover); }
.s-door { font-weight: 600; color: var(--ink); }
.s-line { color: var(--ink-2); }
.s-today { font-variant-numeric: tabular-nums; font-weight: 600; }
.bonly { margin: 6px 2px 0; line-height: 1.6; }
.bonly a { color: var(--ink-2); }
.ssec > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ssec > summary::-webkit-details-marker { display: none; }
.ssec > summary h2::before { content: "▸"; color: var(--muted); font-size: .8em; margin-right: 2px; }
.ssec[open] > summary h2::before { content: "▾"; }
@media (max-width: 900px) {
  .srow, .srow.all { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .srow.shead { display: none; }
  .srow .s-line, .srow .s-sch, .srow .s-who { grid-column: 1 / -1; font-size: .82rem; }
}

/* hours, as words */
.hlines { display: grid; gap: 1px; font-size: .9rem; }
.hlines > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 10px; }
.hlines span { color: var(--muted); }
.hlines em { color: var(--muted); font-style: normal; }
.hlines .hol { font-size: .82rem; }
.hlines .hol:first-of-type, .hlines div:not(.hol) + .hol { margin-top: 4px; }
.unlockcard .uc-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.uc-today { font-size: .84rem; font-weight: 600; background: var(--neutral-bg); padding: 2px 8px; border-radius: 999px; }
.uc-src { margin: 6px 0 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.schtop { align-items: stretch; }

/* door unlock editor / picker */
.uhead { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.uprev { margin-bottom: 10px; }
.uprev table { margin-top: 6px; max-width: 640px; }
.starts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.starts .chip { text-decoration: none; }
.heditor .hgrid { display: grid; grid-template-columns: 9rem 1fr; gap: 5px 12px; align-items: center; }
.hg-d { font-weight: 600; font-size: .9rem; display: flex; flex-direction: column; }
.hg-d a { font-weight: 400; }
.rng { display: inline-flex; align-items: center; gap: 3px; margin: 0 10px 0 0; }
.rng input[type=time] { padding: 4px 6px; width: 7.2rem; }
.rng i { color: var(--muted); font-style: normal; }
.holdays { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.holdays summary { cursor: pointer; margin-bottom: 6px; }
.scope { border: 1px solid var(--orange-line); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; display: grid; gap: 6px; }
.scope label { display: block; }
.ubar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.picklist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pk-group { padding: 6px 12px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 650; background: var(--neutral-bg); display: flex; justify-content: space-between; align-items: center; }
.pick { display: grid; grid-template-columns: 22px minmax(150px, 1fr) minmax(170px, 1.4fr) 168px minmax(150px, 1.2fr);
  gap: 10px; align-items: center; padding: 5px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: .88rem; }
.pick:hover { background: var(--hover); }
.pick.sel { background: var(--orange-soft); }
.pick.cur .pk-name { text-decoration: underline dotted; }
.pk-name { font-weight: 600; display: flex; flex-direction: column; }
.pk-name small { font-weight: 400; color: var(--muted); }
.pk-who em { font-style: normal; font-weight: 700; color: var(--ink); }
@media (max-width: 900px) {
  .pick { grid-template-columns: 22px 1fr auto; }
  .pick .pk-line, .pick .pk-who { grid-column: 2 / -1; }
  .heditor .hgrid { grid-template-columns: 1fr; }
}
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk7 { grid-template-columns: repeat(7, 26px); }
.srow { grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.7fr) 196px 150px minmax(140px, 1fr); }
.srow.all { grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.6fr) 196px minmax(200px, 1.5fr); }
.s-today { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.pick { grid-template-columns: 22px minmax(150px, 1fr) minmax(200px, 1.5fr) 196px minmax(150px, 1.1fr); }
.pick.phead { cursor: default; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 650; padding: 4px 12px; background: var(--neutral-bg); border-top: 0; }
.pick.phead:hover { background: var(--neutral-bg); }
.ubar { position: sticky; bottom: 0; background: var(--bg, var(--panel)); padding: 10px 0; z-index: 2; border-top: 1px solid var(--line); }
.rng input[type=time] { width: 8.4rem; }
.heditor .hgrid > div:nth-child(even) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.rowbar { position: relative; display: inline-block; width: 120px; height: 14px; background: var(--track); border-radius: 4px;
  overflow: hidden; margin-right: 12px; flex: none; }
.rowbar b { position: absolute; top: 0; bottom: 0; background: var(--bar); border-radius: 3px; }
.rowbar.head { background: none; height: auto; overflow: visible; display: inline-flex; justify-content: space-between; vertical-align: bottom; }
.rowbar.head i { font-style: normal; font-size: .64rem; }
@media (max-width: 760px) { .rowbar { display: none; } }
.rowbar.head { display: inline-block; height: 1em; position: relative; }
.rowbar.head i { position: absolute; transform: translateX(-50%); }
.rowbar.head i:nth-child(1) { left: 4%; } .rowbar.head i:nth-child(2) { left: 25%; }
.rowbar.head i:nth-child(3) { left: 50%; } .rowbar.head i:nth-child(4) { left: 75%; }

/* live video sits where the snapshot was, never underneath it */
.camvideo[hidden], video.prev[hidden] { display: none !important; }
[data-live] { position: relative; }
[data-live] video.prev { cursor: pointer; }
.camstrip video.prev { height: 84px; width: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #111; display: block; }
[data-live].is-loading::after, [data-live].is-live::after { position: absolute; top: 6px; left: 6px; z-index: 3; font-size: .62rem;
  font-weight: 750; letter-spacing: .05em; padding: 2px 6px; border-radius: 4px; pointer-events: none; color: #fff; }
[data-live].is-loading::after { content: "CONNECTING…"; background: rgba(0,0,0,.6); }
[data-live].is-live::after { content: "● LIVE"; background: #d92d20; }
.camtile .camwait { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 4px; }
.camtile { position: relative; }

/* "Needs attention" -> the door page opens on what to check */
.checkbox { border: 1px solid var(--orange-line); border-left: 4px solid var(--bad, #d92d20); background: var(--panel);
  border-radius: var(--radius); padding: 10px 14px; margin: 8px 0 12px; }
.checkbox.resolved { border-left-color: var(--good, #2e7d32); }
.ck-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 1.02rem; }
.ck-steps { margin: 4px 0 6px 18px; padding: 0; }
.ck-h { margin: 8px 0 4px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.undo-f { margin-left: 10px; }
.undo-b { background: var(--panel); border: 1px solid var(--line-2); color: var(--ink); border-radius: 6px; padding: 3px 10px;
  font-weight: 650; cursor: pointer; }
.undo-b:hover { border-color: var(--ink-2); }
.undo-t tr.done td { color: var(--muted); }
.undo-t td { padding: 4px 10px; }

/* day timeline (Schedules > Day, door page) */
:root { --hold: #2f6fde; }
.ph-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.days { display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch; margin: 2px 0 10px; }
.days a { display: flex; flex-direction: column; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-2); background: var(--panel); min-width: 74px; }
.days a b { font-size: .88rem; }
.days a small { font-size: .7rem; color: var(--muted); }
.days a.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.days a.on small { color: var(--panel); opacity: .75; }
.days a:hover { text-decoration: none; border-color: var(--ink-2); }
.days input[type=date] { padding: 6px 8px; height: 100%; }
.dlegend span { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--ink-2); margin-right: 10px; }
.dlegend i { width: 18px; height: 8px; border-radius: 3px; display: inline-block; }
.dlegend i.reg, .dbar i.reg { background: var(--bar); }
.dlegend i.hold, .dbar i.hold { background: var(--hold); }
.dlegend b.now { width: 2px; height: 12px; background: var(--ink); display: inline-block; }
.dbld h2 { margin: 12px 0 4px; font-size: 1rem; display: flex; gap: 8px; align-items: baseline; }
.tlrows { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tlhead, .tlrow { display: grid; grid-template-columns: minmax(150px, 220px) 1fr minmax(150px, 230px); gap: 14px; align-items: center; padding: 0 12px; }
.tlhead { height: 22px; background: var(--neutral-bg); }
.tlrow { height: 34px; border-top: 1px solid var(--line); color: var(--ink); }
.tlrow:hover { background: var(--hover); text-decoration: none; }
.tlrow .dn { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlrow .dw { font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw .hw { color: var(--hold); font-weight: 600; }
.daxis { position: relative; height: 100%; }
.daxis span { white-space: nowrap; position: absolute; top: 4px; transform: translateX(-50%); font-size: .66rem; color: var(--muted); font-weight: 600; }
.daxis span:first-child { transform: none; } .daxis span:last-child { transform: translateX(-100%); }
.dbar { position: relative; height: 14px; background: var(--track); border-radius: 4px; }
.dbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.dbar i.hold { top: 3px; bottom: 3px; box-shadow: 0 0 0 2px var(--panel); }
.dbar i.hold.live { animation: holdpulse 2s infinite; }
@keyframes holdpulse { 50% { opacity: .55; } }
.dbar b.now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.bonly2 { margin: 4px 2px; }
.bonly2 summary { cursor: pointer; }
.bonly2 p { margin: 4px 0; line-height: 1.6; }
@media (max-width: 760px) {
  .tlhead { display: none; }
  .tlrow { grid-template-columns: 1fr; height: auto; gap: 3px; padding: 6px 12px; }
}
.holdform { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(260px, 340px); gap: 16px; }
.hf-doors { display: flex; flex-direction: column; gap: 6px; }
.hf-doorlist { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.hf-doorlist label { display: flex; gap: 6px; align-items: center; padding: 2px 0; font-size: .88rem; }
.hf-area { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-top: 6px; }
.hf-when { display: flex; flex-direction: column; gap: 8px; }
.hf-when label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.hf-times { display: flex; gap: 8px; }
.hf-presets .chip { cursor: pointer; }
.tag.t-hold { background: #e3ecfc; color: var(--hold); }
.holdt tr.h-done td, .holdt tr.h-cancelled td { color: var(--muted); }
@media (max-width: 760px) { .holdform { grid-template-columns: 1fr; } }

/* door page */
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dhead h1 { margin: 2px 0; }
.dstate { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dstate .st { font-size: .95rem; padding: 6px 12px; }
.dhero { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 14px; align-items: start; margin-bottom: 14px; }
.dhero.nocam { grid-template-columns: 1fr; }
.dcams { display: flex; flex-wrap: wrap; gap: 6px; }
.dcam-i { display: block; width: calc(33% - 4px); }
.dcam-i.big { width: 100%; }
.dcam-i img, .dcam-i video, .dcam-i canvas.eptz { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; display: block;
  background: #111; border: 1px solid var(--line); }
.dcams > .small { width: 100%; }
.dtoday { display: flex; flex-direction: column; gap: 6px; }
.dt-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.dt-h b { font-size: 1.05rem; }
.dt-now { font-weight: 650; }
.dtoday .daxis { height: 14px; }
.dtoday .daxis span { top: 0; }
.dtoday .dbar { height: 22px; }
.dt-words { margin: 0; }
.dcards { margin-bottom: 14px; align-items: start; }
.dcards h2 { margin: 0; font-size: 1.05rem; }
.two-line { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; padding-top: 4px; padding-bottom: 4px; }
.two-line small { font-size: .68rem; font-weight: 500; color: var(--muted); }
.hlist { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.hitem { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.hitem > span:first-child { flex: 1; min-width: 180px; }
.hold-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.hold-inline input[type=time] { width: 7.6rem; padding: 5px 6px; }
.hold-inline input[type=date] { padding: 5px 6px; }
.hold-inline input[type=text] { flex: 1; min-width: 140px; padding: 5px 8px; }
.hold-inline .chips { width: 100%; }
.ddetails { margin-top: 14px; }
@media (max-width: 900px) { .dhero { grid-template-columns: 1fr; } }
/* the live video loads on top of the snapshot, invisible until it plays (display:none would stop it starting) */
.camtile .camvideo.pending { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; pointer-events: none; }

/* ---------- Home: tasks, live band, needs-a-look, agenda, feed (v25) ---------- */
.hm-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.hm-top h1 { margin: 0; }
.hm-date { color: var(--muted); font-size: .95rem; }
.hm-ask { margin-top: 14px; }
h2 .count { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.task { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink);
  box-shadow: var(--shadow); transition: border-color .12s, transform .12s; min-height: 76px; }
.task:hover { text-decoration: none; border-color: var(--orange); transform: translateY(-1px); }
.task b { font-size: 1.04rem; grid-column: 2; align-self: end; }
.task small { color: var(--muted); font-size: .82rem; grid-column: 2; align-self: start; line-height: 1.3; }
.tk-ic { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--orange-soft); color: var(--link); }
.tk-ic .ico { width: 22px; height: 22px; }

.live { margin: 18px 0 8px; background: #0b0b0b; color: #f2f2f2; border-radius: 16px; padding: 16px 18px 12px; }
.lv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lv-head b { font-size: 1.05rem; }
.lv-head span { color: #a3a3a3; font-size: .82rem; display: inline-flex; align-items: center; gap: 6px; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ccf73; box-shadow: 0 0 0 0 rgba(60,207,115,.6); animation: lvpulse 2s infinite; }
@keyframes lvpulse { 0% { box-shadow: 0 0 0 0 rgba(60,207,115,.55); } 70% { box-shadow: 0 0 0 7px rgba(60,207,115,0); } 100% { box-shadow: 0 0 0 0 rgba(60,207,115,0); } }
@media (prefers-reduced-motion: reduce) { .lv-dot { animation: none; } }
.lv-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lv-col { display: flex; flex-direction: column; gap: 8px; }
.lv-b { display: flex; flex-direction: column; color: #f2f2f2; padding: 2px 0; }
.lv-b:hover { text-decoration: none; }
.lv-b:hover .lv-t { color: #fff; }
.lv-t { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #a3a3a3; font-weight: 600; }
.lv-h { font-size: 1.25rem; font-weight: 700; margin-top: 2px; }
.lv-ok { color: #f2f2f2; } .lv-on { color: #ff8a4c; } .lv-warn { color: #f3b85a; } .lv-bad { color: #ff6b5e; }
.lv-s { font-size: .78rem; color: #a3a3a3; min-height: 1.1em; }
.sq-grid { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.sq { width: 16px; height: 16px; border-radius: 4px; display: inline-block; background: #3a3a3a; flex: none; }
a.sq:hover { outline: 2px solid #fff; outline-offset: 1px; }
.sq-locked { background: #4a4a4a; }
.sq-unlocked { background: var(--orange); }
.sq-open, .sq-alarm { background: #ff4a3d; box-shadow: 0 0 0 2px rgba(255,74,61,.35); }
.sq-offline { background: repeating-linear-gradient(45deg, #5a4a20 0 3px, #2a2414 3px 6px); }
.sq-disabled { background: transparent; border: 1px dashed #4a4a4a; }
.lv-curve { display: flex; align-items: flex-end; gap: 2px; height: 46px; margin-top: 16px; border-bottom: 1px solid #333; }
.lv-curve i { flex: 1; background: #ff5600; border-radius: 2px 2px 0 0; opacity: .9; }
.lv-curve i.past { background: #5c5c5c; opacity: 1; }
.lv-curve i.nowbar { background: #fff; opacity: 1; }
.lv-axis { display: flex; justify-content: space-between; font-size: .72rem; color: #8a8a8a; margin-top: 4px; gap: 8px; }
.lv-axis span:nth-child(2) { text-align: center; }
.lv-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: .72rem; color: #a3a3a3; margin-top: 10px; }
.lv-key span { display: inline-flex; align-items: center; gap: 5px; }
.lv-key .sq { width: 11px; height: 11px; border-radius: 3px; box-shadow: none; }

.hm-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 8px; }
.nl { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px 10px 16px; margin-bottom: 8px; color: var(--ink); position: relative; overflow: hidden; }
.nl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.nl-high::before { background: var(--bad); } .nl-medium::before { background: #e8a33c; } .nl-ok::before { background: var(--ok); }
a.nl:hover { text-decoration: none; border-color: var(--line-2); }
.nl b { font-size: .95rem; }
.nl span { font-size: .82rem; color: var(--muted); }
.ag { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px 8px 8px; margin-bottom: 8px; color: var(--ink); }
a.ag:hover { text-decoration: none; border-color: var(--line-2); }
.ag-d { display: flex; flex-direction: column; align-items: center; border-radius: 8px; padding: 4px 0; background: var(--neutral-bg); line-height: 1.05; }
.ag-d b { font-size: 1.35rem; }
.ag-d small { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ag-closed .ag-d { background: #0b0b0b; color: #fff; } .ag-closed .ag-d small { color: #bdbdbd; }
.ag-delay .ag-d, .ag-early .ag-d { background: var(--info-bg); color: var(--info); }
.ag-event .ag-d, .ag-hold .ag-d { background: var(--orange-soft); color: var(--link); }
.ag-todo .ag-d { background: var(--warn-bg); color: var(--warn); }
.ag-w { display: flex; flex-direction: column; min-width: 0; }
.ag-w b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-w small { color: var(--muted); font-size: .8rem; }
.ag-k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ag .button.sm { padding: 5px 12px; font-size: .82rem; }

.feed { margin-top: 10px; }
.fd { display: grid; grid-template-columns: 64px 22px 1fr auto; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.fd-t { color: var(--muted); font-size: .82rem; text-align: right; }
.fd-i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700;
  background: var(--neutral-bg); color: var(--ink-2); }
.fd-granted .fd-i { background: var(--ok-bg); color: var(--ok); }
.fd-denied .fd-i, .fd-alarm .fd-i { background: var(--bad-bg); color: var(--bad); }
.fd-remote .fd-i { background: var(--info-bg); color: var(--info); }
.fd-w { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-w a { color: var(--ink); font-weight: 500; }
.fd-n { font-size: .75rem; font-weight: 700; background: var(--neutral-bg); border-radius: 999px; padding: 2px 8px; color: var(--ink-2); }

.answer { border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: .95rem; border: 1px solid var(--line); background: var(--panel); }
.answer.a-yes { border-color: var(--ok); background: var(--ok-bg); }
.answer.a-later { border-color: #e8a33c; background: var(--warn-bg); }
.answer.a-no { border-color: var(--bad); background: var(--bad-bg); }
.hold-clash ul { margin: 4px 0; padding-left: 18px; }
.hold-inline .hold-clash { flex-basis: 100%; }
.ck-clear { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

@media (max-width: 1100px) { .tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lv-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tasks, .hm-cols { grid-template-columns: 1fr; } .lv-blocks { grid-template-columns: 1fr; }
  .fd { grid-template-columns: 52px 20px 1fr auto; } }

.nav-g { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: #6f6f6f; font-weight: 600; padding: 14px 10px 4px; }
.nav a { padding: 6px 10px; }

/* ---------- door page: state plate, week, who comes through (v25) ---------- */
.plate { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; border-radius: 12px; padding: 14px 16px;
  background: #0b0b0b; color: #f2f2f2; }
.pl-ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: #2a2a2a; color: #d0d0d0; }
.pl-ic .ico { width: 30px; height: 30px; }
.pl-t b { display: block; font-size: 1.6rem; line-height: 1.1; }
.pl-t small { color: #a3a3a3; font-size: .85rem; }
.pl-n { text-align: right; } .pl-n b { display: block; font-size: 1.4rem; } .pl-n small { color: #a3a3a3; font-size: .75rem; }
.plate-unlocked .pl-ic { background: var(--orange); color: #000; }
.plate-unlocked .pl-t b { color: #ff8a4c; }
.plate-open .pl-ic, .plate-alarm .pl-ic { background: #ff4a3d; color: #fff; }
.plate-open .pl-t b, .plate-alarm .pl-t b { color: #ff6b5e; }
.plate-offline .pl-ic { background: repeating-linear-gradient(45deg, #5a4a20 0 5px, #2a2414 5px 10px); color: #f3b85a; }
.plate-offline .pl-t b { color: #f3b85a; }
.plate-disabled { background: var(--neutral-bg); color: var(--ink); } .plate-disabled .pl-t small, .plate-disabled .pl-n small { color: var(--muted); }
.dtoday .dt-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-top: 8px; }

.wkp { margin-bottom: 14px; }
.wk { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 8px; }
.wk-r { display: grid; grid-template-columns: 120px minmax(0, 1fr) 210px; gap: 12px; align-items: center; padding: 3px 6px; border-radius: 8px; }
.wk-r.today { background: var(--orange-soft); }
.wk-r.wknd .wk-d { color: var(--muted); }
.wk-ax { padding-top: 0; padding-bottom: 0; }
.wk-ax .daxis { height: 14px; }
.wk-d { font-size: .88rem; display: flex; flex-direction: column; line-height: 1.15; }
.wk-d small { color: var(--bar-hol); font-size: .72rem; font-weight: 600; }
.wk .dbar { height: 16px; }
.wk-w { font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-key { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.wk-key i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.k-reg { background: var(--bar); } .k-hold { background: var(--hold); }
.wk-exact { margin-top: 8px; }

.who-top { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.wt { display: grid; grid-template-columns: 30px minmax(0, 150px) 1fr 30px; gap: 10px; align-items: center; color: var(--ink); }
.wt:hover { text-decoration: none; } .wt:hover .wt-n { text-decoration: underline; }
.wt-i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-bg); font-size: .72rem; font-weight: 700; color: var(--ink-2); }
.wt-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.wt-b { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; } .wt-b i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.wt b { text-align: right; font-size: .9rem; }
.heat { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(0, 1fr)); gap: 2px; align-items: center; }
.heat .hx { font-size: .64rem; color: var(--muted); }
.heat .hy { font-size: .7rem; color: var(--muted); }
.heat i { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 86, 0, var(--a)); outline: 1px solid var(--line); outline-offset: -1px; max-height: 18px; }
.askbox { margin: 6px 0 4px; max-width: 760px; }
@media (max-width: 760px) { .wk-r { grid-template-columns: 70px minmax(0, 1fr); } .wk-w { display: none; } .plate { grid-template-columns: 44px 1fr; } .pl-n { display: none; } }
.wk-none { margin: 6px 0 10px; color: var(--ink-2); }
.wkp .uc-head h2 { margin: 0; }

/* ---------- Doors board: tiles (v25) ---------- */
.dtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.dtile { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; color: var(--ink); position: relative; transition: border-color .12s, transform .12s; }
.dtile:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-1px); }
.dt-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dt-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--neutral-bg); color: var(--ink-2); flex: none; }
.dt-ic .ico { width: 17px; height: 17px; }
.dt-nm { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.dtile .dcam { color: var(--muted); } .dtile .dcam .ico { width: 15px; height: 15px; }
.dt-st { font-size: .85rem; font-weight: 600; display: flex; flex-direction: column; line-height: 1.2; }
.dt-st small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.dt-bar { margin-top: auto; } .dt-bar .tl { height: 8px; }
.dt-bo { font-size: .72rem; color: var(--muted); }
.dtile .dflag { font-style: normal; font-size: .74rem; color: var(--bad); font-weight: 600; }
.dtile.s-unlocked { border-color: var(--orange-line); background: linear-gradient(var(--orange-soft), var(--panel) 70%); }
.dtile.s-unlocked .dt-ic { background: var(--orange); color: #000; } .dtile.s-unlocked .dt-st { color: var(--link); }
.dtile.s-open, .dtile.s-alarm { border-color: var(--bad); background: linear-gradient(var(--bad-bg), var(--panel) 70%); }
.dtile.s-open .dt-ic, .dtile.s-alarm .dt-ic { background: var(--bad); color: #fff; } .dtile.s-open .dt-st, .dtile.s-alarm .dt-st { color: var(--bad); }
.dtile.s-offline { border-style: dashed; border-color: #c99a3a; } .dtile.s-offline .dt-ic { background: var(--warn-bg); color: var(--warn); } .dtile.s-offline .dt-st { color: var(--warn); }
.dtile.s-disabled { opacity: .65; }
.dtile.s-locked .dt-ic { color: var(--ok); background: var(--ok-bg); }
.bldg-sq { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: auto; max-width: 50%; }
.bldg-sq .sq { width: 10px; height: 10px; border-radius: 3px; box-shadow: none; }
.bldg-sq .sq-locked { background: #c9c9c9; } .bldg-sq .sq-disabled { border-color: #bdbdbd; }
@media (prefers-color-scheme: dark) { .bldg-sq .sq-locked { background: #4a4a4a; } }
.arr-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.arr-help { background: #0b0b0b; color: #f2f2f2; border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: .9rem; position: sticky; top: 8px; z-index: 5; }
.arr-help .arr-saved { color: #9be7b3; margin-left: 6px; }
body.arranging .dtile { cursor: grab; touch-action: none; user-select: none; outline: 1px dashed var(--line-2); outline-offset: 2px; }
body.arranging .dtile:focus { outline: 2px solid var(--orange); }
body.arranging .drows-more { display: none; }

/* ---------- Snow day: three-month calendar (v25) ---------- */
.cal3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin: 10px 0 14px; }
.cal-t { display: block; margin-bottom: 6px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-g > span:not(.cd) { font-size: .66rem; color: var(--muted); font-weight: 600; }
.cd { display: grid; place-items: center; aspect-ratio: 1; max-height: 38px; border-radius: 8px; font-size: .85rem; color: var(--ink);
  background: var(--neutral-bg); border: 2px solid transparent; font-style: normal; }
a.cd:hover { text-decoration: none; border-color: var(--orange); }
.cd.out { background: none; }
.cd.wknd { background: transparent; color: var(--muted); }
.cd.past { opacity: .4; }
.cd.today { border-color: var(--ink); font-weight: 700; }
.cd.t1 { background: #0b0b0b; color: #fff; }
.cd.t2 { background: var(--info); color: #fff; }
.cd.t3 { background: var(--bar-hol); color: #fff; }
.cd.miss { border: 2px dashed var(--bad); background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.cd.sel { background: var(--orange); color: #fff; }
.cal-key { grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--ink-2); }
.cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.cal-key .cd { width: 16px; height: 16px; border-radius: 4px; font-size: 0; }
@media (prefers-color-scheme: dark) { .cd.t1 { background: #f1f1f1; color: #000; } }
@media (max-width: 900px) { .cal3 { grid-template-columns: 1fr; } }
.hold-prev:empty { display: none; }
.hold-prev { flex-basis: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; display: flex; flex-direction: column; gap: 5px; }
.hp-r, .hp-ax { display: grid; grid-template-columns: 150px minmax(0, 1fr) 200px; gap: 10px; align-items: center; font-size: .8rem; }
.hp-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-r .dbar { height: 14px; }
.hp-ax div { position: relative; height: 12px; font-size: .66rem; color: var(--muted); font-weight: 600; }
.hp-ax i { font-style: normal; position: absolute; transform: translateX(-50%); } .hp-ax i:first-child { transform: none; } .hp-ax i:last-child { transform: translateX(-100%); }
.hp-warn { color: var(--warn); font-weight: 600; }
.hp-key i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: middle; }
@media (max-width: 760px) { .hp-r, .hp-ax { grid-template-columns: 90px minmax(0, 1fr); } .hp-r > span:last-child { grid-column: 1 / -1; } }
.holdform .hold-prev { grid-column: 1 / -1; }

/* ---------- Alerts: cards + 14-day strip (v25) ---------- */
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.acard { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 3px;
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; color: var(--ink); }
a.acard:hover { text-decoration: none; border-color: var(--line-2); }
.acard.acs-high { border-left-color: var(--bad); } .acard.acs-medium { border-left-color: #e8a33c; }
.ac-sev { grid-column: 1; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.acs-high .ac-sev { color: var(--bad); }
.ac-t { grid-column: 1; font-size: 1rem; }
.ac-d { grid-column: 1; font-size: .82rem; color: var(--muted); }
.ac-long { grid-column: 2; grid-row: 1 / 4; text-align: right; display: flex; flex-direction: column; justify-content: center; min-width: 96px; }
.ac-long b { font-size: 1.7rem; line-height: 1.05; white-space: nowrap; } .acs-high .ac-long b { color: var(--bad); }
.ac-long small { font-size: .72rem; color: var(--muted); }
.astrip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 8px; }
.as-c { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.as-c span { font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.15; }
.as-c.today span { color: var(--ink); font-weight: 700; }
.as-bar { height: 70px; width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; background: var(--track); border-radius: 5px; overflow: hidden; }
.as-bar i, .as-key i { display: block; } .hi { background: var(--bad); } .md { background: #e8a33c; } .lo { background: var(--line-2); }
.as-key { margin: 6px 0 14px; } .as-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: middle; }

/* ---------- Person: ID card + door map (v25) ---------- */
.idcard { display: grid; grid-template-columns: 72px 1fr auto; gap: 18px; align-items: center; background: #0b0b0b; color: #f2f2f2;
  border-radius: 16px; padding: 18px 22px; margin-bottom: 14px; position: relative; overflow: hidden; }
.idcard::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 6px; background: var(--ok); }
.idcard.id-off::after { background: var(--bad); }
.id-av { width: 72px; height: 72px; border-radius: 16px; background: var(--orange); color: #000; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }
.id-main h1 { margin: 0; color: #fff; }
.id-sub { color: #bdbdbd; }
.id-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 22px; margin: 0; }
.id-facts dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: #8f8f8f; }
.id-facts dd { margin: 0; font-weight: 600; display: flex; flex-direction: column; }
.id-facts dd small { font-weight: 400; color: #bdbdbd; font-size: .75rem; max-width: 220px; }
.id-st.on { color: #5fd08a; } .id-st.off { color: #ff8a80; } .id-st.tmp { color: #f3b85a; }
.dmap { margin-bottom: 14px; }
.dm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 8px 0; }
.dm-t { display: block; font-size: .78rem; font-weight: 700; margin-bottom: 5px; } .dm-t small { color: var(--muted); font-weight: 500; }
.dm-sq { display: flex; flex-wrap: wrap; gap: 4px; }
.pm { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
a.pm:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.pm-now { background: var(--ok); } .pm-later { background: #e8a33c; } .pm-off { background: var(--bad); opacity: .55; }
.pm-none { background: var(--neutral-bg); border: 1px solid var(--line); }
.dm-key { display: flex; gap: 14px; flex-wrap: wrap; } .dm-key span { display: inline-flex; gap: 5px; align-items: center; } .dm-key .pm { width: 11px; height: 11px; }
@media (max-width: 900px) { .idcard { grid-template-columns: 56px 1fr; } .id-av { width: 56px; height: 56px; } .id-facts { grid-column: 1 / -1; grid-template-columns: repeat(2, auto); } }
tr.evday td { background: var(--neutral-bg); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding-top: 6px; padding-bottom: 6px; }
.evsec { display: none; }

/* ---------- Activity log chart (v25) ---------- */
.quickd { margin: 6px 0 10px; } .quickd .chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.lfilters > summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; }
.lchart { margin: 10px 0; }
.lc-h { margin-bottom: 8px; }
.lc-bars { display: flex; gap: 3px; align-items: flex-end; height: 120px; }
.lc-c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; color: var(--muted); min-width: 0; }
.lc-c:hover { text-decoration: none; } .lc-c:hover .lc-bar { outline: 2px solid var(--ink); outline-offset: 1px; }
.lc-bar { flex: 1; width: 100%; display: flex; flex-direction: column-reverse; background: var(--track); border-radius: 4px; overflow: hidden; }
.lc-c.on .lc-bar { outline: 2px solid var(--orange); outline-offset: 1px; }
.lc-bar i { display: block; } .lc-bar .g, .lc-key .g { background: var(--ok); } .lc-bar .d, .lc-key .d { background: var(--bad); } .lc-bar .o, .lc-key .o { background: var(--line-2); }
.lc-l { font-size: .64rem; height: 12px; }
.lc-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: middle; }

/* ---------- Changes: before/after cards (v25) ---------- */
.chg-list { display: flex; flex-direction: column; gap: 12px; }
.chg2 { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.c2-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.src { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--neutral-bg); color: var(--ink-2); }
.src-portal { background: var(--orange-soft); color: var(--link); } .src-zk { background: var(--info-bg); color: var(--info); }
.c2-item { display: grid; grid-template-columns: 110px minmax(120px, 220px) 1fr; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.c2-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.c2-n { font-weight: 600; }
.c2-ba { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.c2-l { font-size: .78rem; color: var(--muted); width: 100%; }
.c2-b { background: var(--bad-bg); color: var(--bad); padding: 2px 8px; border-radius: 6px; text-decoration-thickness: 1px; }
.c2-a { background: var(--ok-bg); color: var(--ok); padding: 2px 8px; border-radius: 6px; }
.c2-arrow { color: var(--muted); }
@media (max-width: 760px) { .c2-item { grid-template-columns: 1fr; gap: 3px; } }

/* ---------- Controllers: cards (v25) ---------- */
.ctl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.ctl { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ctl-bad { border-color: var(--bad); }
.ctl-h { display: flex; align-items: center; gap: 8px; }
.ctl-h a { color: var(--ink); }
.ctl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.ctl-offline .ctl-dot { background: var(--bad); } .ctl-partial .ctl-dot { background: #e8a33c; }
.ctl-st { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--ok); }
.ctl-offline .ctl-st { color: var(--bad); } .ctl-partial .ctl-st { color: var(--warn); }
.ctl-p-high { color: var(--bad); font-weight: 600; } .ctl-p-medium { color: var(--warn); font-weight: 600; } .ctl-p-low { color: var(--muted); }
.ctl-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; height: 22px; margin-top: 4px; }
.ctl-week span { background: var(--ok); border-radius: 3px; display: flex; flex-direction: column-reverse; overflow: hidden; opacity: .85; }
.ctl-week i { display: block; background: var(--bad); }
.ctl-wk-l { display: flex; justify-content: space-between; font-size: .64rem; color: var(--muted); }
.ctl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0; }
.ctl-stats b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ctl-stats small { font-size: .66rem; color: var(--muted); }
.ctl-doors { display: flex; flex-wrap: wrap; gap: 4px; } .ctl-doors .chip { font-size: .72rem; padding: 2px 8px; } .ctl-doors .chip.off { opacity: .5; text-decoration: line-through; }
.side .nav { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.side { overflow: hidden; }
body.arranging .dtile.dt-gap { background: transparent; border: 2px dashed var(--orange); outline: none; box-shadow: none; }
body.arranging .dtile.dt-gap > * { visibility: hidden; }
.dt-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; cursor: grabbing;
  transform: scale(1.04) rotate(-1.2deg); box-shadow: 0 14px 34px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.18);
  transition: transform 120ms ease, box-shadow 120ms ease; outline: none !important; }
.dt-ghost.dt-drop { transform: none; box-shadow: var(--shadow); }
body.arranging { cursor: default; }
body.arranging.dragging-now, body.arranging.dragging-now * { cursor: grabbing !important; }
body.arranging .dtile:hover { transform: none; }
.dtiles { position: relative; }

/* ---------- Doors: building headings as dark bands (v26) ---------- */
.bldg { margin: 26px 0 14px; }
.bldg:first-of-type { margin-top: 12px; }
.bldg-h { align-items: center; background: #0b0b0b; color: #f2f2f2; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; gap: 12px; }
.bldg-h h2 { color: #fff; font-size: 1.3rem; font-weight: 800; letter-spacing: .01em; }
.bldg-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--orange); color: #000; display: grid; place-items: center; flex: none; }
.bldg-ic .ico { width: 20px; height: 20px; }
.bldg-h .small.muted { color: #a3a3a3; }
.bldg-h .ok-t { color: #5fd08a; font-weight: 600; }
.bldg-h .st-open { background: #3a1714; color: #ff8a80; }
.bldg-h .st-unlocked { background: #36270c; color: #f3b85a; }
.bldg-h .bldg-sq .sq-locked { background: #4a4a4a; }
.bldg-h .bldg-sq .sq-disabled { border-color: #4a4a4a; }

/* ---------- Help (v27) ---------- */
.hhero { background: #0b0b0b; color: #f2f2f2; border-radius: 18px; padding: 28px 30px 22px; margin-bottom: 18px; }
.hhero h1 { color: #fff; margin: 0 0 4px; font-size: 1.9rem; }
.hhero p { color: #bdbdbd; margin: 0 0 14px; }
.hsearch { position: relative; max-width: 720px; }
.hsearch input { width: 100%; font-size: 1.05rem; padding: 13px 16px; border-radius: 12px; border: 0; }
.hres { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); max-height: 60vh; overflow: auto; }
.hres a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.hres a:hover, .hres a.sel { background: var(--orange-soft); text-decoration: none; }
.hres small { color: var(--muted); }
.hres .none { padding: 10px; color: var(--muted); }
.hquick { margin-top: 14px; } .hquick .chip { background: #1f1f1f; color: #f2f2f2; border-color: #333; } .hquick .chip:hover { background: var(--orange); color: #000; }
.hgroup { margin: 22px 0; }
.hgroup h2 { border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.hcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hcard { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 0 12px; color: var(--ink); overflow: hidden; transition: border-color .12s, transform .12s; }
.hcard:hover { text-decoration: none; border-color: var(--orange); transform: translateY(-1px); }
.hcard > b, .hcard > small { padding: 0 14px; } .hcard > b { margin-top: 10px; } .hcard > small { color: var(--muted); font-size: .82rem; }
.hc-img { display: block; height: 120px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--neutral-bg); }
.hc-img img { width: 100%; display: block; }
.htopic { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.hside { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.hside b { margin: 10px 0 4px; } .hside nav { display: flex; flex-direction: column; gap: 1px; }
.hside nav a { padding: 5px 9px; border-radius: 7px; color: var(--ink-2); } .hside nav a.on { background: var(--orange-soft); color: var(--link); font-weight: 600; }
.hs-back { color: var(--muted); padding: 4px 0; }
.harticle { max-width: 980px; }
.harticle h1 { font-size: 1.8rem; margin: 4px 0 6px; }
.hsum { font-size: 1.08rem; color: var(--ink-2); }
.hshot { margin: 16px 0 22px; }
.hs-img { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--neutral-bg); }
.hs-img img { width: 100%; height: 100%; display: block; }
.hs-box { position: absolute; border: 3px solid var(--orange); border-radius: 8px; opacity: 0; transition: opacity .15s; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.0); }
.hs-box.on { opacity: 1; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.hs-pin { position: absolute; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; padding: 0;
  background: var(--orange); color: #000; font-weight: 800; font-size: .85rem; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; z-index: 2; }
.hs-pin:hover, .hs-pin.on { background: #000; color: #fff; }
.hs-legend { list-style: none; padding: 0; margin: 12px 0 6px; counter-reset: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }
.hs-legend li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: default; }
.hs-legend li.on { background: var(--orange-soft); }
.hs-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #000; font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.hsteps { counter-reset: st; list-style: none; padding: 0; margin: 8px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.hsteps li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hsteps li::before { content: counter(st); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--panel); font-weight: 800; display: grid; place-items: center; }
.htips { background: var(--info-bg); border-radius: 12px; padding: 12px 16px; margin: 14px 0; } .htips ul { margin: 6px 0 0; padding-left: 20px; }
.hfaq { display: flex; flex-direction: column; gap: 6px; }
.hfaq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.hfaq summary { font-weight: 600; cursor: pointer; } .hfaq details p { margin: 8px 0 0; color: var(--ink-2); }
.hpn { display: flex; justify-content: space-between; gap: 10px; margin: 28px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.gloss { display: grid; gap: 8px; } .gl-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.gl-row dt { font-weight: 700; } .gl-row dd { margin: 0; color: var(--ink-2); }
/* "?" quick help */
.qh { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; }
.qh-b { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: .72rem; font-weight: 800; padding: 0; line-height: 1; cursor: pointer; }
.qh-b:hover, .qh-b[aria-expanded="true"] { border-color: var(--orange); color: var(--link); }
.qh-pop { position: fixed; z-index: 1000; width: 300px; background: #0b0b0b; color: #f2f2f2; border-radius: 10px; padding: 10px 12px;
  font-size: .84rem; font-weight: 400; line-height: 1.4; letter-spacing: 0; text-transform: none; box-shadow: 0 10px 28px rgba(0,0,0,.3); white-space: normal; text-align: left; }
.qh-pop a { color: #ffb38a; } .qh-pop b { color: #fff; }
.side-help { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); background: #1c1c1c; font-weight: 600; }
.side-help:hover { text-decoration: none; background: #262626; } .side-help.on { box-shadow: inset 3px 0 0 var(--orange); }
@media (max-width: 900px) { .htopic { grid-template-columns: 1fr; } .hside { position: static; } .gl-row { grid-template-columns: 1fr; gap: 4px; } }
.pl-t .qh-b, .lv-head .qh-b, .side .qh-b, .bldg-h .qh-b { background: transparent; color: #bdbdbd; border-color: #555; }
.nav a { padding: 5px 10px; } .nav-g { padding: 10px 10px 3px; }
.side-foot { gap: 6px; } .side-help { padding: 6px 10px; }
h1 .qh, h2 .qh, h3 .qh { vertical-align: 3px; }
.hs-pin { background: #111; color: #fff; border: 2px solid var(--orange); box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,.4); }
.hs-pin:hover, .hs-pin.on { background: var(--orange); color: #000; }
.hs-n { background: #111; color: #fff; border: 2px solid var(--orange); }
.hsteps li > span { min-width: 0; }
.hs-pin.abs { transform: none; }
/* alert cards: how long sits top-right; title and text use the full width (v32) */
.acards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.acard { display: flex; flex-direction: column; gap: 4px; }
.ac-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ac-top .ac-sev { line-height: 1.3; padding-top: 4px; }
.acard .ac-long { display: block; min-width: 0; text-align: right; font-size: 1.45rem; line-height: 1.1; white-space: nowrap; }
.acs-high .ac-long { color: var(--bad); }
.ac-t { font-size: 1.05rem; line-height: 1.3; }
.ac-d { line-height: 1.4; }
.ac-when { font-size: .74rem; color: var(--muted); margin-top: 4px; }
/* PTZ controls under a live i-PRO camera (camera page) */
.ptzpad { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ptz-dirs { display: grid; grid-template-columns: repeat(3, 2.4em); gap: 4px; }
.ptz-dirs button, .ptz-zf button { touch-action: none; user-select: none; -webkit-user-select: none; }
.ptz-dirs button { padding: 4px 0; }
.ptz-zf { display: flex; flex-wrap: wrap; gap: 4px; }
.ptzpad button.held { outline: 2px solid var(--accent, #e8590c); }

/* All-cameras page: arrange + personal names (same arrange mode as the door board) */
body.arranging .camtile[data-id] { cursor: grab; touch-action: none; user-select: none; outline: 1px dashed var(--line-2); outline-offset: 2px; }
body.arranging .camtile[data-id]:focus { outline: 2px solid var(--orange); }
body.arranging .camtile.dt-gap { background: transparent; border: 2px dashed var(--orange); outline: none; box-shadow: none; }
body.arranging .camtile.dt-gap > * { visibility: hidden; }
body.arranging .camtile img { pointer-events: none; }
.camtile .cam-edit { border: 0; background: none; padding: 0 2px; color: var(--muted, #777); cursor: pointer; font-size: .85em; }
.camtile .cam-edit:hover { color: var(--orange); }
body.arranging .camtile .cam-edit { display: none; }
.camtile input.cam-rename { font: inherit; font-weight: 600; width: 70%; padding: 1px 4px; }
.camtile .cam-sub { display: block; }
.camtile { position: relative; }
.camtile .cam-off { position: absolute; top: 8px; left: 8px; z-index: 2; background: #b42318; color: #fff; padding: 2px 8px; border-radius: 6px; }

/* ---------- player deck: the console under a recorded camera (always dark, like the picture above it) ---------- */
.deck {
  --dk-bg: #121212; --dk-bg2: #0a0a0a; --dk-ink: #f4f4f4; --dk-mut: #9b9b9b; --dk-line: rgba(255,255,255,.08);
  --dk-btn: rgba(255,255,255,.06); --dk-btn-h: rgba(255,255,255,.13); --dk-live: #ff3b30; --dk-rec: #4f7cac;
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 12px;
  background: radial-gradient(120% 140% at 50% 0%, #1d1d1d 0%, var(--dk-bg) 45%, var(--dk-bg2) 100%);
  color: var(--dk-ink); border-top: 1px solid rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  font-variant-numeric: tabular-nums;
}
.deck::before {        /* a thin orange glow line where the deck meets the picture, red when live */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; opacity: .85;
  background: linear-gradient(90deg, transparent, var(--orange) 20%, var(--orange) 80%, transparent);
}
.deck[data-mode="live"]:not([data-paused="1"])::before { background: linear-gradient(90deg, transparent, var(--dk-live) 20%, var(--dk-live) 80%, transparent); }
.deck .ico { width: 20px; height: 20px; }

.deck-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.deck-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  background: var(--dk-btn); color: var(--dk-mut); border: 1px solid var(--dk-line); white-space: nowrap;
}
.deck-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.deck[data-mode="live"] .deck-status { color: #fff; background: rgba(255,59,48,.16); border-color: rgba(255,59,48,.45); }
.deck[data-mode="live"] .deck-dot { background: var(--dk-live); box-shadow: 0 0 0 0 rgba(255,59,48,.7); animation: deck-pulse 1.6s infinite; }
.deck[data-mode="play"] .deck-status { color: #cfe0f5; background: rgba(79,124,172,.2); border-color: rgba(79,124,172,.55); }
.deck[data-mode="step"] .deck-status { color: #ffd1b8; background: rgba(255,86,0,.16); border-color: rgba(255,86,0,.5); }
.deck[data-paused="1"] .deck-status { color: #e9e9e9; background: var(--dk-btn); border-color: var(--dk-line); }
.deck[data-paused="1"] .deck-dot { animation: none; background: var(--dk-mut); box-shadow: none; }
@keyframes deck-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,48,.7); } 70% { box-shadow: 0 0 0 7px rgba(255,59,48,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); } }
.deck-time .dvr-clock { display: inline-flex; align-items: baseline; gap: 9px; }
.deck-hms { font-size: 1.32rem; font-weight: 700; letter-spacing: -.01em; }
.deck-date { font-size: .84rem; color: var(--dk-mut); }
.deck-tools { margin-left: auto; display: inline-flex; gap: 6px; }
.deck-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--dk-ink); text-decoration: none;
  background: var(--dk-btn); border: 1px solid var(--dk-line); transition: background .15s, border-color .15s;
}
.deck-chip .ico { width: 16px; height: 16px; }
.deck-chip:hover { background: var(--dk-btn-h); color: #fff; text-decoration: none; }
.deck-chip.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.deck-goto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; margin: 0;
  border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--dk-line); }
.deck-goto[hidden] { display: none; }
.deck-goto label { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--dk-mut); margin-right: auto; }
.deck-goto input { font: inherit; font-size: .9rem; padding: 5px 8px; border-radius: 8px; color: var(--dk-ink);
  background: #050505; border: 1px solid rgba(255,255,255,.18); color-scheme: dark; }
.deck-goto input:focus { outline: 2px solid var(--orange); outline-offset: 1px; }

.deck-tl { display: flex; align-items: flex-start; gap: 10px; }
.deck-day { display: inline-flex; align-items: center; gap: 2px; height: 34px; flex: none; }
.deck-day .dvr-day { min-width: 6.6em; text-align: center; font-size: .84rem; font-weight: 600; }
.deck-track { position: relative; flex: 1; min-width: 0; padding-bottom: 18px; }
.deck-track canvas { display: block; width: 100%; height: 34px; border-radius: 9px; cursor: pointer;
  background: #050505; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 2px 6px rgba(0,0,0,.6); }
.deck .dvr-hours { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; margin: 0; display: block; font-size: .68rem; color: var(--dk-mut); }
.deck .dvr-hours span { position: absolute; transform: translateX(-50%); }
.deck .dvr-hours span:first-child { transform: none; }
.deck .dvr-hours span:last-child { transform: translateX(-100%); }
.deck-hover { position: absolute; top: -30px; transform: translateX(-50%); pointer-events: none; white-space: nowrap; z-index: 3;
  padding: 3px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; background: #fff; color: #111; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.deck-hover::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: #fff; }
.deck-hover[hidden] { display: none; }

.deck-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.deck-legend { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--dk-mut); }
.deck-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.deck-legend i.rec { background: var(--dk-rec); } .deck-legend i.mot { background: #ff6a1a; margin-left: 8px; }
.deck-transport { display: inline-flex; align-items: center; gap: 8px; padding: 5px; border-radius: 999px;
  background: rgba(255,255,255,.035); border: 1px solid var(--dk-line); }
.deck-ibtn {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 0; background: transparent; color: var(--dk-ink); cursor: pointer; transition: background .15s, transform .1s, color .15s;
}
.deck-ibtn .ico { width: 22px; height: 22px; }
.deck-ibtn.sm { width: 30px; height: 30px; } .deck-ibtn.sm .ico { width: 16px; height: 16px; }
.deck-ibtn:hover { background: var(--dk-btn-h); }
.deck-ibtn:active, .deck-play:active, .deck-live:active { transform: scale(.93); }
.deck-ibtn.on { color: var(--orange); background: rgba(255,86,0,.14); }
.deck-x { position: absolute; right: -2px; top: -4px; min-width: 0; font-size: .64rem; font-weight: 800; line-height: 1;
  padding: 2px 4px; border-radius: 6px; background: var(--orange); color: #fff; }
.deck-x:empty { display: none; }
.deck-play {
  display: inline-grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: radial-gradient(circle at 35% 30%, #ff8a45 0%, var(--orange) 55%, #d84700 100%);
  box-shadow: 0 6px 22px rgba(255,86,0,.45), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .1s, box-shadow .2s;
}
.deck-play:hover { box-shadow: 0 8px 28px rgba(255,86,0,.65), inset 0 1px 0 rgba(255,255,255,.35); }
.deck-play .ico { width: 26px; height: 26px; }
.deck-play .i-pause, .deck-play.is-playing .i-play { display: none; }
.deck-play.is-playing .i-pause { display: inline; }
.deck-play .i-play .ico { margin-left: 3px; }
.deck-live {
  justify-self: end; display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px 8px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: rgba(255,59,48,.14); border: 1px solid rgba(255,59,48,.55); transition: background .15s, box-shadow .2s;
}
.deck-live .ico { width: 18px; height: 18px; color: var(--dk-live); }
.deck-live:hover { background: rgba(255,59,48,.28); box-shadow: 0 0 18px rgba(255,59,48,.35); }
.deck[data-mode="live"]:not([data-paused="1"]) .deck-live { color: var(--dk-mut); background: transparent; border-color: var(--dk-line); box-shadow: none; }
.deck[data-mode="live"]:not([data-paused="1"]) .deck-live .ico { color: var(--dk-live); }
.deck button:focus-visible, .deck a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.deck-note { display: block; padding: 7px 10px; border-radius: 8px; font-size: .82rem; color: #e2e2e2;
  background: rgba(255,255,255,.05); border-left: 3px solid var(--orange); }
.deck-note[hidden] { display: none; }
.deck-note a { color: #ff9a62; }

/* clip panel */
.deck-clip { display: flex; flex-direction: column; gap: 10px; padding: 11px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,214,10,.07), rgba(255,255,255,.03)); border: 1px solid rgba(255,214,10,.3); }
.deck-clip[hidden] { display: none; }
.deck-clip-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.deck-clip-head b { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; }
.deck-clip-head b .ico { width: 18px; height: 18px; color: #ffd60a; }
.deck-clip-len { font-weight: 700; font-size: .85rem; padding: 2px 9px; border-radius: 999px; background: rgba(255,214,10,.16); color: #ffe27a; }
.deck-clip-len:empty { display: none; }
.deck-clip-len.bad { background: rgba(255,59,48,.18); color: #ff9d97; }
.deck-clip-hint { font-size: .78rem; color: var(--dk-mut); margin-left: auto; }
.deck-clip-hint kbd { font: inherit; font-size: .72rem; font-weight: 700; padding: 0 5px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); color: var(--dk-ink); }
.deck-clip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.deck-clip-pt { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--dk-mut); }
.deck-clip-pt input { font: inherit; font-size: .88rem; padding: 5px 8px; border-radius: 8px; color: var(--dk-ink);
  background: #050505; border: 1px solid rgba(255,255,255,.18); color-scheme: dark; }
.deck-clip-pt input:focus { outline: 2px solid #ffd60a; outline-offset: 1px; }
.deck-clip-go { margin-left: auto; display: inline-flex; gap: 6px; }
.deck-chip:disabled { opacity: .45; cursor: not-allowed; }
.deck-clip-job { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.deck-clip-job[hidden] { display: none; }
.deck-prog { flex: 1 1 200px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.deck-prog i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .6s ease;
  background: linear-gradient(90deg, #ffd60a, var(--orange)); }
.deck-clip[data-state="running"] .deck-prog i { background-size: 200% 100%; animation: deck-shimmer 1.4s linear infinite;
  background-image: linear-gradient(90deg, #ffd60a, var(--orange), #ffd60a); }
.deck-clip[data-state="done"] .deck-prog i { background: #34c759; width: 100% !important; }
.deck-clip[data-state="error"] .deck-prog i { background: var(--dk-live); }
.deck-clip[data-state="error"] .deck-clip-msg { color: #ff9d97; }
@keyframes deck-shimmer { to { background-position: -200% 0; } }
.deck-clip-msg { font-size: .82rem; color: #e2e2e2; }
.admin-users .clip-grant, label.clip-grant { display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; font-weight: 600; }

@media (max-width: 640px) {
  .deck-clip-hint { margin-left: 0; }
  .deck-clip-go { margin-left: 0; width: 100%; }
  .deck { padding: 10px; gap: 9px; }
  .deck-tools { margin-left: 0; width: 100%; }
  .deck-tl { flex-direction: column; align-items: stretch; gap: 4px; }
  .deck-day { justify-content: center; height: auto; }
  .deck-bar { grid-template-columns: 1fr auto; }
  .deck-legend { display: none; }
  .deck-transport { gap: 2px; justify-self: start; }
  .deck-ibtn { width: 38px; height: 38px; }
  .deck-play { width: 50px; height: 50px; }
  .deck-live span { display: none; } .deck-live { padding: 9px; }
}
@media (prefers-reduced-motion: reduce) { .deck-dot { animation: none !important; } }

/* drag to arrange without "Arrange tiles" (mouse: drag; touch: press and hold) */
.dtile.dt-gap, .camtile.dt-gap { background: transparent; border: 2px dashed var(--orange); outline: none; box-shadow: none; }
.dtile.dt-gap > *, .camtile.dt-gap > * { visibility: hidden; }
.dtile.dt-lift, .camtile.dt-lift { transform: scale(1.03); box-shadow: var(--shadow); transition: transform 120ms ease; }
body.tile-dragging, body.tile-dragging * { cursor: grabbing !important; user-select: none; }
.dtile, .camtile { -webkit-touch-callout: none; }
.arr-bar .arr-saved { margin-left: 6px; }

.camgrid { position: relative; }   /* tile drag works out drop spots from offsetLeft/Top within the grid */

/* snapshot tiles: grey placeholder (no alt text or broken icon) until the first picture loads */
img.camimg { color: transparent; background: #2a2a2a; }
img.camimg.loading { background: linear-gradient(90deg, #2a2a2a 0%, #383838 50%, #2a2a2a 100%); background-size: 200% 100%; animation: camshimmer 1.4s linear infinite; }
img.camimg.broken { background: #2a2a2a; }
@keyframes camshimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { img.camimg.loading { animation: none; } }

.camtile .cam-edit .ico { width: 15px; height: 15px; vertical-align: -2px; }

/* the drag ghost must float above the page; .camtile sets position: relative, which would otherwise win */
.dt-ghost.camtile, .dt-ghost.dtile { position: fixed; }
.dt-ghost.camtile .dvr, .dt-ghost.camtile .cam-edit { display: none; }

/* sortable table headings */
th.sortable{cursor:pointer;user-select:none;white-space:nowrap}
th.sortable:hover{color:var(--ink);text-decoration:underline}
th.sortable::after{content:" ↕";opacity:.35;font-size:.9em}
th.sort-asc::after{content:" ▲";opacity:.8}
th.sort-desc::after{content:" ▼";opacity:.8}

.cam-readout{margin-top:3px;font-weight:600;color:var(--ink)}
.cam-readout.warn{color:var(--warn)}

/* ---------- admin: settings-style shell (2026-11-19) ---------- */
.adm-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 28px; align-items: start; }
.adm-main { min-width: 0; }
.adm-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.adm-nav-h { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; padding: 2px 10px 0; }
.adm-sec { display: flex; flex-direction: column; gap: 1px; }
.adm-sec-t { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0 10px 4px; }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2, var(--ink));
  font-size: .92rem; font-weight: 520; text-decoration: none; position: relative; transition: background .12s; }
.adm-nav a .ico { width: 17px; height: 17px; flex: none; color: var(--muted); }
.adm-nav a:hover { background: var(--hover); text-decoration: none; }
.adm-nav a.on { background: var(--orange-soft); color: var(--ink); font-weight: 650; }
.adm-nav a.on::before { content: ""; position: absolute; left: -6px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--orange); }
.adm-nav a.on .ico { color: var(--link); }
.adm-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-b { font-size: .7rem; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px;
  background: var(--neutral-bg); color: var(--muted); }
.adm-b.warn { background: var(--warn-bg); color: var(--warn); }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 4px 0 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line); }
.adm-head h1 { margin: 0; font-size: 1.55rem; }
.adm-head p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; }
.adm-main > .sub:first-of-type { margin-top: 0; }

.adm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.adm-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.adm-card-h h2 { margin: 0; font-size: 1rem; }
.attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attn li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); }
.attn-warn { background: var(--warn-bg); border-color: transparent !important; }
.attn-ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--panel); color: var(--warn); }
.attn-info .attn-ic { background: var(--info-bg); color: var(--info); }
.attn-ic .ico { width: 18px; height: 18px; }
.attn-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attn-t small { color: var(--muted); font-size: .82rem; }
.allclear { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; background: var(--ok-bg); color: var(--ok); }
.allclear .ico { width: 20px; height: 20px; flex: none; }
.allclear span { color: var(--ink); }
.adm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); text-decoration: none; transition: border-color .12s, transform .12s; }
.adm-stat:hover { border-color: var(--orange); text-decoration: none; transform: translateY(-1px); }
.adm-stat b { font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; }
.adm-stat span { color: var(--muted); font-size: .82rem; }
.adm-2col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.adm-2col .adm-card { margin-bottom: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.feed li:first-child { border-top: 0; }
.feed-w { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-a { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed time { font-size: .8rem; font-variant-numeric: tabular-nums; }
.swgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.swi { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); font-size: .85rem; }
.swi i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.swi.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.swi small { margin-left: auto; color: var(--muted); font-size: .74rem; }
.swi.on small { color: var(--ok); font-weight: 600; }

/* users page */
.u-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.u-search { flex: 1 1 220px; max-width: 340px; }
.seg { display: inline-flex; background: var(--neutral-bg); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; font: inherit; font-size: .84rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg button span { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.u-add { margin-left: auto; }
.u-add summary { list-style: none; cursor: pointer; }
.u-add summary::-webkit-details-marker { display: none; }
.u-add[open] summary { display: none; }
.u-add form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ulist { display: flex; flex-direction: column; gap: 10px; }
.ucard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.ucard.off { opacity: .62; }
.ucard-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.uav { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none;
  background: var(--orange-soft); color: var(--link); text-transform: uppercase; }
.uid { flex: 1 1 200px; min-width: 0; }
.uid b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uid small { color: var(--muted); font-size: .82rem; }
.ucard-top form { display: flex; gap: 6px; align-items: center; margin: 0; }
.ucard-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ucard-body h4 { margin: 0 0 6px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ucard-body form { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tog { position: relative; display: inline-flex; }
.tog input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tog span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: .82rem; color: var(--ink); background: var(--panel); transition: background .12s, border-color .12s; user-select: none; }
.tog span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.tog input:checked + span { background: var(--orange-soft); border-color: var(--orange); color: var(--link); font-weight: 600; }
.tog input:checked + span::before { background: var(--orange); border-color: var(--orange); }
.tog input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.tog input:disabled + span { opacity: .5; }
.tog.na span { border-style: dashed; color: var(--muted); }
.ucard-body .cam-readout { flex-basis: 100%; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.ucard-body .cam-readout.warn { color: var(--warn); font-weight: 600; }
.u-note { color: var(--muted); font-size: .85rem; }
.rolekeys { margin: 0 0 12px; }
.rolekeys summary { cursor: pointer; color: var(--link); font-size: .86rem; }
.rolekeys dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0 0; font-size: .86rem; }
.rolekeys dt { font-weight: 650; }
.rolekeys dd { margin: 0; color: var(--muted); }
.u-empty { padding: 24px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .adm-shell { grid-template-columns: 1fr; gap: 12px; }
  .adm-nav { position: static; flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 6px; margin: 0 -4px;
    scrollbar-width: none; }
  .adm-nav::-webkit-scrollbar { display: none; }
  .adm-nav-h, .adm-sec-t { display: none; }
  .adm-sec { flex-direction: row; gap: 4px; }
  .adm-nav a { white-space: nowrap; border: 1px solid var(--line); background: var(--panel); }
  .adm-nav a.on::before { display: none; }
  .adm-nav a.on { border-color: var(--orange); }
  .adm-stats { grid-template-columns: 1fr 1fr; }
  .adm-2col, .ucard-body { grid-template-columns: 1fr; }
  .u-add { margin-left: 0; }
}
.u-add summary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; background: var(--orange);
  color: #fff; font-weight: 650; font-size: .88rem; }
.u-add summary:hover { background: var(--orange-hover); }
.adm-main > .sub { font-size: .86rem; color: var(--muted); margin: -4px 0 14px; }
.upd { display: flex; flex-direction: column; }
.upd-row { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.upd-row:first-child { border-top: 0; padding-top: 0; }
.upd-row b { display: block; font-size: .92rem; }
.upd-row small { color: var(--muted); font-size: .84rem; }
.upd-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.upd-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.upd-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
/* back arrow, top left of every page (2026-11-19); the top bar is sticky so it stays in reach */
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar .omni { flex: 1; }
.topback { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow); transition: border-color .12s, color .12s, transform .12s; }
.topback svg { width: 20px; height: 20px; }
.topback:hover { border-color: var(--orange); color: var(--link); text-decoration: none; transform: translateX(-1px); }
.topback:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
/* panel top bar: Back (or Close) on the left, × on the right; stays at the top while the panel scrolls (2026-11-19) */
.drawer:focus { outline: none; }
.drawer-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.drawer-back { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 9px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.drawer-back svg { width: 19px; height: 19px; }
.drawer-back:hover { border-color: var(--orange); color: var(--link); }
.drawer .drawer-x { position: static; flex: none; width: 36px; height: 36px; }
.drawer-back:focus-visible, .drawer .drawer-x:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.drawer .pn { padding-top: 14px; }
.drawer .pn-head { padding-right: 0; }
