/* WholeHomeCam — light/professional theme */
:root {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #5b6b7c;
  --line: #dde4ea;
  --accent: #1463d8;
  --accent-ink: #ffffff;
  --ok: #1a8f4a;
  --warn: #b3541e;
  --danger: #c0392b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding: 12px 22px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.nav .brand { font-weight: 700; letter-spacing: .04em; color: var(--accent); }
.nav a {
  color: var(--muted); text-decoration: none; margin-left: 30px;
  font-weight: 500;
}
.nav a:hover { color: var(--accent); }
.nav a.cta {
  background: var(--accent); color: var(--accent-ink);
  padding: 6px 14px; border-radius: 999px;
}
.nav a.cta:hover { filter: brightness(1.08); }
main#page { max-width: 1080px; margin: 0 auto; padding: 28px 22px 60px; }
h1 { font-size: 1.6rem; margin: 0 0 14px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
p { margin: 8px 0; }
a { color: var(--accent); }
.muted, .meta { color: var(--muted); font-size: .9rem; }
.err { color: var(--danger); font-weight: 600; }

/* member nav */
.nav-me { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.nav-me .who { color: var(--ink); font-weight: 600; font-size: .9rem; }
.navform { display: inline; margin: 0 0 0 30px; }
.linklike {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-weight: 500; padding: 0; margin: 0;
}
.linklike:hover { color: var(--accent); text-decoration: underline; }

/* camera grouping + status */
.camgroup {
  margin: 28px 0 6px; font-size: 1.02rem; color: var(--ink);
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.cam .pill { float: right; margin-top: 4px; }
.badge {
  display: inline-block; background: #eef2f6; border-radius: 5px;
  padding: 1px 7px; font-size: .78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.usbrow {
  display: flex; align-items: center; gap: 8px 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.usbrow button { margin: 0; padding: 4px 14px; }

/* forms */
.frm { max-width: 420px; display: grid; gap: 8px; }
.frm.wide { max-width: 720px; }
.frm.inline { display: inline-flex; gap: 8px; align-items: center; max-width: none; }
.frm label { font-weight: 600; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.frm input, .frm select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 16px;   /* <16px makes iOS zoom on focus */
  background: var(--panel); color: var(--ink);
}
.frm label input:not([type="checkbox"]):not([type="radio"]),
.frm label select {
  display: block; width: 100%; margin-top: 4px;
  font-weight: 400; color: var(--ink);
}
.frm input:focus, .frm select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.frm button, button {
  margin-top: 10px; padding: 10px 18px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; cursor: pointer; width: max-content;
}
.frm button:hover, button:hover { filter: brightness(1.08); }
button.danger { background: var(--danger); }
button.ghost { background: transparent; color: var(--ink);
  border: 1px solid var(--line); margin-top: 4px; }
button.ghost:hover { filter: none; border-color: var(--accent);
  color: var(--accent); }

/* camera grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 14px 0; }
.cam {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.cam h3 { margin: 8px 0 2px; }
img.snap, img.live {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: #10141a url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="36"><text x="8" y="24" fill="%23566" font-size="10">no signal</text></svg>') center no-repeat;
  border-radius: 8px; display: block;
}
img.live { max-width: 860px; }

/* auth gate (rnd_login interstitial) */
.auth-gate {
  max-width: 460px; margin: 12vh auto; text-align: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px 28px;
}
.auth-gate h1 { font-size: 1.3rem; }

/* connector page */
.connector { max-width: 880px; margin: 0 auto; padding: 20px; }
.connector video {
  width: 100%; max-height: 420px; background: #000;
  border-radius: var(--radius); display: block;
}
.connector .row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.connector select, .connector button { padding: 8px 12px; margin-top: 0; }
#cstat { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.on { background: #dff3e5; color: var(--ok); }
.pill.off { background: #f3e2df; color: var(--danger); }
.pill.warn { background: #faecd8; color: var(--warn); }

/* landing */
.hero { text-align: center; padding: 70px 20px 40px; }
.hero h1 { font-size: clamp(1.7rem, 5.5vw, 2.3rem); margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto 26px; }
.hero .cta-row a {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font-weight: 600; text-decoration: none; margin: 0 6px;
}
.hero .cta-row a.primary { background: var(--accent); color: var(--accent-ink); }
.hero .cta-row a.ghost { border: 1px solid var(--line); color: var(--ink); background: var(--panel); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 40px 0; }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feat h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feat p { color: var(--muted); font-size: .92rem; margin: 0; }
.how { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 20px 0; }
.how ol { margin: 0; padding-left: 22px; }
.how li { margin: 8px 0; }
footer {
  border-top: 1px solid var(--line); background: var(--panel);
  padding: 18px 22px; margin-top: 40px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .85rem;
  flex-wrap: wrap; gap: 6px 18px;
}
footer .brand { font-weight: 700; color: var(--accent); }
footer .motto { margin: 0; }
footer .fam { margin: 0; }
footer .fam a { color: var(--muted); text-decoration: none; }
footer .fam a:hover { color: var(--accent); text-decoration: underline; }
code { background: #eef2f6; padding: 1px 6px; border-radius: 5px; font-size: .9em;
  overflow-wrap: anywhere; }
pre { background: #10141a; color: #d7e1ea; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: .85rem; }
/* live mosaic grid */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0; }
.mosaic .cell { position: relative; display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.mosaic .cell img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #0b0e12; }
.mosaic .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: .8rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.mosaic .dev { position: absolute; top: 6px; left: 6px; padding: 1px 7px; font-size: .7rem; color: #fff; background: rgba(0,0,0,.55); border-radius: 4px; }
.frm.inline button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* MFA setup */
.qrbox { display: inline-block; padding: 14px; background: #fff; border-radius: 8px; margin: 8px 0; }
.qrbox svg { display: block; width: 220px; height: 220px; }
pre.codes { letter-spacing: .12em; font-size: 1rem; user-select: all; }

/* camera wall (dashboard) � console layout: rail + collapsible groups */
#page:has(.wall) { max-width: 1560px; padding: 14px 14px 40px; }
.wall { display: flex; gap: 14px; align-items: flex-start; }
.rail {
  flex: 0 0 214px; position: sticky; top: 74px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.rsum { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.rsum b { color: var(--ink); }
.rsep { margin: 0 4px; opacity: .45; }
.rail .frm.inline { margin: 6px 0 4px; }
.rnav {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.rnav a {
  padding: 7px 9px; border-radius: 7px; color: var(--ink);
  text-decoration: none; font-weight: 500; font-size: .92rem;
}
.rnav a:hover { background: var(--bg); color: var(--accent); }
.wall-main { flex: 1; min-width: 0; }
details.grp {
  margin: 0 0 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
details.grp summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; font-weight: 600;
}
details.grp summary::-webkit-details-marker { display: none; }
details.grp summary::before {
  content: "\25B8"; margin-right: 8px; color: var(--muted);
  display: inline-block; transition: transform .15s;
}
details.grp[open] summary::before { transform: rotate(90deg); }
.gcount {
  font-weight: 500; font-size: .8rem; color: var(--muted);
  background: var(--bg); padding: 2px 10px; border-radius: 999px;
}
.wallgrid {
  display: grid; gap: 6px; padding: 0 10px 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tile {
  position: relative; display: block; aspect-ratio: 16/9;
  background: #10151b; border-radius: 8px; overflow: hidden;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .nm {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px;
  font-size: .8rem; color: #fff; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.tile .dot {
  position: absolute; top: 7px; left: 7px; width: 9px; height: 9px;
  border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.35);
}
.tile .dot.on { background: #2ecc71; }
.tile .dot.warn { background: #f39c12; }
.tile .dot.off { background: #e74c3c; }
.tile .chb {
  position: absolute; top: 5px; right: 6px; font-size: .68rem;
  color: #fff; background: rgba(0,0,0,.55);
  padding: 1px 6px; border-radius: 4px;
}
h2[id] { scroll-margin-top: 76px; }
@media (max-width: 780px) {
  .wall { flex-direction: column; }
  .rail { position: static; flex: none; width: 100%; }
  .rnav { flex-direction: row; flex-wrap: wrap; }
  .wallgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* wall view variants + rail nav state */
.wallflat { padding: 0; }
.rnav a.cur { background: var(--accent); color: var(--accent-ink); }
.rnav a.cur:hover { color: var(--accent-ink); filter: brightness(1.06); }
@media (max-width: 780px) {
  .nav a { margin-left: 14px; }
  .navform { margin-left: 14px; }
}

/* polish: a11y + rail status dots + events list */
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.rsd {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin: 0 4px 0 0;
}
.rsd.on { background: #2ecc71; }
.rsd.warn { background: #f39c12; }
.rsd.off { background: #e74c3c; }
.rsd + b { margin-right: 8px; }
.evts {
  list-style: none; margin: 8px 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
}
.evts li {
  padding: 7px 12px; font-size: .86rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, Consolas, monospace;
}
@media (max-width: 780px) {
  /* bigger tap targets for replay rows on touch */
  .evts li { padding: 10px 12px; }
}
.evts li:last-child { border-bottom: 0; }
.evts .badge { text-transform: none; margin-right: 6px; }
/* settings page: card sections */
.setc {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px 16px 16px; margin: 14px 0;
}
.setc h2 { margin-top: 16px; }

/* live wall � toolbar + full-bleed mosaic */
#page:has(.wbar) { max-width: 1560px; padding: 12px 14px 40px; }
.wbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  position: sticky; top: 62px; z-index: 4;
}
.wbar .rsum { margin: 0; }
.wlinks { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.wlinks a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); text-decoration: none;
  font-weight: 500; font-size: .88rem; line-height: 1;
}
.wlinks a:hover {
  background: var(--bg); border-color: var(--accent); color: var(--accent);
}
.wlinks a.cur {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.wlinks a.cur:hover { filter: brightness(1.06); }
.ico { width: 15px; height: 15px; flex: none; }
/* segmented SD/HD quality control */
.seg {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: var(--panel);
}
.seg .seg-label {
  font-size: .82rem; color: var(--muted); padding: 0 9px 0 11px;
}
.seg button {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0; padding: 7px 11px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted);
  font-weight: 600; font-size: .85rem; width: auto; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button:not(.on):hover {
  background: var(--bg); color: var(--accent); filter: none;
}
@media (max-width: 780px) {
  .wbar { position: static; }
  .wlinks { margin-left: 0; }
  .wlinks a { padding: 8px 12px; }   /* ~34px tap targets */
}

/* camera viewer � toolbar, stage, pan/zoom, motion overlay */
#page:has(.cvstage) { max-width: 1320px; }
.cvbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.cvt {
  font-weight: 600; display: inline-flex; align-items: center;
  gap: 8px; font-size: 1.02rem;
}
.cvsp { flex: 1; }
.cvbtns {
  display: flex; gap: 6px; align-items: center;
  flex-wrap: wrap; row-gap: 5px;
}
.cvbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; margin: 0;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.cvbtn:hover {
  background: var(--bg); border-color: var(--accent);
  color: var(--accent); filter: none;
}
.cvbtn.on {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.cvz {
  min-width: 46px; text-align: center; font-size: .8rem;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.cvmb {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted);
}
.cvmdot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #c7ccd4; display: inline-block;
}
.cvmb.hot { color: var(--danger); }
.cvmb.hot .cvmdot {
  background: var(--danger); animation: cvpulse 1s infinite;
}
@keyframes cvpulse { 50% { opacity: .2; } }
.cvsens {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 8px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: .88rem;
}
.cvsens input[type="range"] {
  flex: 1; max-width: 280px; accent-color: var(--accent);
}
.cvstage {
  position: relative; overflow: hidden;
  background: #0b0e12; border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 16/9; max-height: 74vh; margin: 0 auto;
  touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.cvstage.drag { cursor: grabbing; }
.cvstage:fullscreen {
  border-radius: 0; max-height: none; aspect-ratio: auto; border: 0;
}
.cvzoom { position: absolute; will-change: transform; }
img.cvframe {
  width: 100%; height: 100%; display: block; object-fit: fill;
  -webkit-user-drag: none; pointer-events: none;
}
canvas.cvov {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.cvhint {
  position: absolute; left: 50%; bottom: 12px;
  transform: translateX(-50%);
  background: rgba(10,13,17,.82); color: #e8ebf0;
  font-size: .82rem; padding: 6px 13px; border-radius: 999px;
  pointer-events: none; white-space: nowrap;
  max-width: calc(100% - 20px); overflow: hidden;
  text-overflow: ellipsis;
}
.cvadv {
  margin-top: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel);
  padding: 0 16px;
}
.cvadv summary {
  padding: 12px 0; cursor: pointer; font-weight: 600;
}
.cvadv[open] summary { border-bottom: 1px solid var(--line); }
.cvcbar { flex-wrap: wrap; row-gap: 8px; }
.cvcbar .cvcl { white-space: nowrap; }
.cvcbar .cvcl input[type="number"] { width: 64px; }
.cvcbar .cvcl input[type="range"] { max-width: 150px; }
@media (max-width: 780px) {
  .cvbar { gap: 6px; }
  .cvt { font-size: .92rem; }
  .cvstage { border-radius: 8px; }
  .cvbtns {
    gap: 5px; flex: 1 1 100%;
    justify-content: flex-start;
  }
  .cvbtn { width: 40px; height: 40px; }
  .cvbtn .ico { width: 18px; height: 18px; }
  .cvz { min-width: 38px; font-size: .74rem; }
  .cvsens { flex-wrap: wrap; gap: 8px; padding: 9px 11px; }
  .cvzbar .meta { margin-left: 0; flex-basis: 100%; }
}
.cvmb[hidden], .cvsens[hidden], .cvhint[hidden] { display: none; }

/* sentinel zones + replay + wall activity */
.cvchk {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 500; margin: 0;
}
.cvchk input { width: auto; margin: 0; accent-color: var(--accent); }
.cvbtn.cvw { width: auto; padding: 0 12px; font-size: .84rem; font-weight: 600; }
.cvbtn.cvzok { background: var(--ok); border-color: var(--ok); color: #fff; }
.cvbtn.cvzok:hover { filter: brightness(1.08); color: #fff; }
.cvzbar .meta { margin-left: auto; }
.cvzbar { flex-wrap: wrap; }
.cvbtn .ico { width: 15px; height: 15px; flex: none; }
.cvbtn.cvw { gap: 5px; }
.cvbtn.zmode.on { background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); }
#cvZignore.zmode.on { background: var(--danger); border-color: var(--danger);
  color: #fff; }
#cvZwatch.zmode.on { background: var(--ok); border-color: var(--ok);
  color: #fff; }
.cvbtn:disabled { opacity: .38; cursor: default; pointer-events: none; }
.cvrec { display: inline-flex; align-items: center; gap: 5px;
  font-size: .84rem; font-weight: 600; color: var(--muted); }
.cvrec select { padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; font-weight: 600;
  background: var(--panel); color: var(--ink); }
#cvZbar .cvchk { margin-right: 2px; }
.cvstage.editing { cursor: crosshair; }
.cvstage.editing .cvov { pointer-events: auto; }
.spark {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 12px;
}
.spark svg {
  width: 220px; height: 18px; color: var(--accent);
}
.spark rect { fill: var(--accent); }
.spark span { font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* 7-day activity heatmap — rows are days (oldest top), cells are hours */
.heat {
  display: grid; grid-template-columns: 34px 1fr; gap: 3px;
  margin: 4px 0 14px; max-width: 560px;
}
.heat > div { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.heat > b {
  font-size: .62rem; font-weight: 500; color: var(--muted);
  align-self: center; text-align: right; padding-right: 2px;
}
.heat .hm {
  display: block; aspect-ratio: 1; border-radius: 2px;
  background: #e8edf3; min-height: 9px;
}
.heat .hm[data-ts] { cursor: pointer; }
.heat .hm[data-ts]:hover { outline: 2px solid var(--accent); }
.heat .h1 { background: #bcd4f6; }
.heat .h2 { background: #7fade8; }
.heat .h3 { background: #3d7fd9; }
.heat .h4 { background: #1463d8; }

/* storage lifecycle table */
.stbl {
  border-collapse: collapse; width: 100%; max-width: 640px;
  font-size: .9rem; margin: 6px 0 12px;
}
.stbl th, .stbl td {
  text-align: left; padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
.stbl th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.stbl .meta { font-size: .78rem; }
.stbl .retin { width: 74px; padding: 6px 8px; }
@media (max-width: 640px) {
  /* 5 columns can't squeeze — let the form scroll horizontally instead
     of crushing camera names into unreadable slivers */
  .frm.wide { overflow-x: auto; }
  .stbl { min-width: 540px; }
}
.tile.hot {
  box-shadow: 0 0 0 2px var(--danger), 0 0 14px rgba(231,76,60,.55);
  animation: tilehot 1.6s ease-in-out infinite;
}
@keyframes tilehot {
  50% { box-shadow: 0 0 0 2px rgba(231,76,60,.35), 0 0 6px rgba(231,76,60,.2); }
}
.evts li[data-kind="motion"],
.evts li[data-kind="wire"],
.evts li[data-kind="loiter"] { cursor: pointer; }
.evts li[data-kind="motion"]:hover,
.evts li[data-kind="wire"]:hover,
.evts li[data-kind="loiter"]:hover { background: var(--bg); }
.cvrep {
  position: absolute; left: 8px; bottom: 8px;
  display: flex; align-items: center; gap: 7px;
  max-width: calc(100% - 16px);
  background: rgba(10,13,17,.55); border-radius: 999px;
  padding: 4px 10px; color: #e8ebf0; z-index: 3;
  opacity: .7; backdrop-filter: blur(3px);
}
.cvrep:hover { opacity: 1; background: rgba(10,13,17,.85); }
@media (max-width: 480px) {
  /* play+slider+time+dl+x can't fit a 320px stage — wrap to two rows */
  .cvrep { flex-wrap: wrap; border-radius: 14px; }
}
.cvrep input[type="range"] {
  flex: 1; min-width: 70px; max-width: 240px;
  accent-color: var(--accent);
}
.cvrep .cvrtime { font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cvrep button, .cvrep a {
  background: none; border: 0; color: #e8ebf0; cursor: pointer;
  font-size: .95rem; padding: 2px 6px; border-radius: 6px;
  text-decoration: none; display: inline-flex; align-items: center;
}
.cvrep button:hover, .cvrep a:hover { background: rgba(255,255,255,.12); }

/* ---- 3D world model: bird's-eye panel + calibration bar ---- */
canvas.cvworld {
  position: absolute; right: 10px; bottom: 10px; z-index: 4;
  width: 220px; height: 150px; border-radius: 9px;
  border: 1px solid rgba(70,196,255,.35);
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  pointer-events: none;
}
canvas.cvworld[hidden] { display: none; }
@media (max-width: 780px) {
  canvas.cvworld { width: 150px; height: 102px; right: 6px; bottom: 6px; }
}
.cvcbar .cvpt {
  font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; min-width: 62px;
}
.cvcbar .cvcl {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0;
}
.cvcbar .cvcl input {
  width: 62px; padding: 4px 6px; font: inherit; font-weight: 600;
  font-size: 16px;   /* iOS zooms on focused inputs under 16px */
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel); color: var(--ink);
}
.cvcbar .cvcl input:focus { border-color: var(--accent); outline: none; }
.cvcbar .meta { flex: 1; min-width: 180px; }

/* ---- settings: sidebar nav + sections ---- */
.setwrap {
  display: grid; grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px; align-items: start; margin: 18px 0 40px;
}
.setnav {
  position: sticky; top: 16px; display: flex; flex-direction: column;
  gap: 2px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px;
}
.setnav .sn {
  display: flex; align-items: center; gap: 9px; margin: 0;
  padding: 8px 10px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: .9rem; font-weight: 600;
}
.setnav .sn .ico { width: 17px; height: 17px; flex: 0 0 17px; }
.setnav .sn:hover { background: var(--bg); color: var(--ink); }
.setnav .sn.on { background: #eaf2ff; color: var(--accent); }
.setnav .sdot {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  background: #c7d0d9; flex: 0 0 7px;
}
.setnav .sdot.on {
  background: #2eb872; box-shadow: 0 0 0 3px rgba(46,184,114,.18);
}
.setbody { min-width: 0; }
.setsec {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  scroll-margin-top: 74px;
}
.setsec.hero { padding: 0; overflow: hidden; position: relative; }
.sechead {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px;
}
.sechead .secico {
  display: grid; place-items: center; width: 40px; height: 40px;
  flex: 0 0 40px; border-radius: 10px;
  background: #eaf2ff; color: var(--accent);
}
.sechead .secico .ico { width: 22px; height: 22px; }
.sechead h2 { margin: 2px 0 3px; font-size: 1.06rem; }
.sechead .meta { margin: 0; }

/* overview hero + member card */
.sethero {
  display: block; width: 100%; height: 120px;
  background: linear-gradient(180deg, #f4f8fe 0%, #ffffff 100%);
}
.member {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px 4px;
}
.member h2 { margin: 0 0 2px; }
.mav {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 1.4rem; font-weight: 700; flex: 0 0 52px;
}
.chips {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 20px 18px;
}
.chip {
  display: flex; align-items: center; gap: 10px; min-width: 150px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfdff;
}
.chip .ico { width: 20px; height: 20px; color: var(--accent); }
.chip b { display: block; font-size: .92rem; }
.chip .meta { font-size: .78rem; }
.setring { width: 40px; height: 40px; flex: 0 0 40px; }
.pulse {
  width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px;
  margin: 0 4px; background: #c7d0d9;
}
.pulse.live {
  background: #2eb872;
  box-shadow: 0 0 0 0 rgba(46,184,114,.5);
  animation: plive 1.8s ease-out infinite;
}
@keyframes plive {
  0% { box-shadow: 0 0 0 0 rgba(46,184,114,.45); }
  70% { box-shadow: 0 0 0 9px rgba(46,184,114,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,184,114,0); }
}

/* enroll topology diagram */
.topo {
  display: block; width: 100%; max-width: 680px; height: auto;
  margin: 4px 0 14px;
}

/* narrow screens: sidebar collapses to a top rail */
@media (max-width: 760px) {
  .setwrap { grid-template-columns: 1fr; }
  .setnav {
    position: static; flex-direction: row; overflow-x: auto; gap: 4px;
  }
  .setnav .sn { flex: 0 0 auto; padding: 7px 9px; }
  .setnav .sn span { display: none; }
  .setnav .sn.on span { display: inline; }
}
