/* Vantage "Signal" look for The Vault.
   Black and white; red (--live, set from src/brand.js) only for live pictures and the main button.
   The framing corners from the logo mark are the one recurring device. */
:root {
  --black: #000; --white: #fff; --steel: #8a8e93; /* steel lifted from #6B6F73 so small text stays readable on black */
  --panel: #111; --line: #2a2a2a; --line-strong: #4a4a4a;
  --well: #0a0a0a; --box-a: #1a1a1a; --box-b: #0f0f0f;
  --corner: 18px; --corner-weight: 2px;
  --font: 'Archivo', system-ui, sans-serif;
  color-scheme: dark;
}
/* Light mode: the same Signal look, inverted. --black is "the page" and --white is "the ink",
   so they swap; things that sit on video (badges, clock, corners) stay white on purpose. */
:root[data-theme="light"] {
  --black: #fff; --white: #000; --steel: #6b6f73;
  --panel: #f1f1f1; --line: #dcdde0; --line-strong: #b4b7bb;
  --well: #e7e8ea; --box-a: #fafafa; --box-b: #eeeff1;
  color-scheme: light;
}

/* Theme toggle */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 0; padding: 6px 0; background: none; border: 0;
                color: var(--white); font-weight: 400; text-decoration: none; }
.theme-toggle:hover { opacity: 1; }
.theme-toggle .theme-dot { width: 18px; height: 18px; }
.theme-toggle .theme-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor;
                           background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.login-theme { position: fixed; top: 16px; right: 20px; z-index: 5; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--black); color: var(--white); font: 400 16px/1.5 var(--font); }
a { color: var(--white); text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--white); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
h1, h2, h3 { font-weight: 800; font-stretch: 115%; letter-spacing: -.01em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(26px, 3vw, 34px); }
h2 { font-size: 20px; margin-bottom: 12px; }
h3 { font-size: 16px; margin-bottom: 8px; }
p { margin: 0 0 12px; }
.muted, .who { color: var(--steel); }
.error { border-left: 3px solid var(--live); padding: 8px 12px; background: var(--panel); }
.ok { border-left: 3px solid var(--white); padding: 8px 12px; background: var(--panel); }
.empty { color: var(--steel); max-width: 52ch; }

/* Logo lockup: mark beside VANTAGE, optional tagline spread to the name's width */
.lockup { display: inline-flex; align-items: center; gap: calc(var(--s, 18px) * .42); --s: 18px; line-height: 1; }
.lockup-mark { width: calc(var(--s) * 1.3); height: calc(var(--s) * 1.3); flex: none; color: var(--white); }
.lockup-mark path { stroke: currentColor; }
.lockup-words { display: inline-grid; gap: calc(var(--s) * .14); }
.lockup-name { font-size: var(--s); font-weight: 800; font-stretch: 125%; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.lockup-tag { display: flex; justify-content: space-between; font-size: calc(var(--s) * .28); font-weight: 500; font-stretch: 100%; opacity: .75; white-space: nowrap; }
.lockup-lg { --s: clamp(34px, 7vw, 52px); }

/* Top bar */
/* Top bar: brand + welcome left, menu centred, tools right. On phones the menu gets its own centred row. */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "brand menu tools";
       align-items: center; gap: 10px 24px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.top-brand { grid-area: brand; display: grid; gap: 4px; justify-items: start; }
.top-menu { grid-area: menu; justify-content: center; }
.top-tools { grid-area: tools; display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.top-tools form { margin: 0; }
.welcome { margin: 0; font-size: 13px; color: var(--steel); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; }
.room { padding-left: 16px; border-left: 1px solid var(--line-strong); font-weight: 600; font-stretch: 105%; color: var(--white); white-space: nowrap; }
.top nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.top nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a[aria-current] { border-bottom-color: var(--white); }
.top nav a:hover { border-bottom-color: var(--line-strong); }
.top nav form { margin: 0; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.live-count { margin: 0; color: var(--steel); font-variant-numeric: tabular-nums; }
.back { margin-bottom: 8px; }
.back a { color: var(--steel); }

/* The framing corners */
.frame { position: relative; }
.frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  --g: linear-gradient(var(--white), var(--white));
  background:
    var(--g) top left / var(--corner) var(--corner-weight), var(--g) top left / var(--corner-weight) var(--corner),
    var(--g) top right / var(--corner) var(--corner-weight), var(--g) top right / var(--corner-weight) var(--corner),
    var(--g) bottom left / var(--corner) var(--corner-weight), var(--g) bottom left / var(--corner-weight) var(--corner),
    var(--g) bottom right / var(--corner) var(--corner-weight), var(--g) bottom right / var(--corner-weight) var(--corner);
  background-repeat: no-repeat;
}

/* Players */
.player { background: #000; aspect-ratio: 16 / 9; outline: 1px solid var(--line); }
.player::after, .photo::after { --g: linear-gradient(#fff, #fff); } /* corners on video stay white */
.player::after { inset: 10px; opacity: .55; }
.player:hover::after { opacity: 1; }
video-stream, video-stream video { display: block; width: 100%; height: 100%; }
main > .player { max-width: max(480px, calc((100vh - 190px) * 16 / 9)); } /* one camera: fit the screen height */
video-stream .info { display: none; } /* go2rtc's own "MSE" label */
.badge { position: absolute; right: 14px; top: 14px; /* top-right: the camera prints its clock top-left */ z-index: 3; display: inline-flex; align-items: center; gap: 6px;
         padding: 2px 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em; background: rgba(0,0,0,.7); color: #fff; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--steel); }
[data-state="live"] > .badge { background: var(--live); }
[data-state="live"] > .badge::before { background: var(--white); animation: blink 1.6s steps(1) infinite; }
[data-state="offline"] > .badge::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--steel); }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { [data-state="live"] > .badge::before { animation: none; } }

.photo { display: block; aspect-ratio: 16 / 9; background: #000; outline: 1px solid var(--line); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo::after { inset: 10px; opacity: .55; }
.photo:hover::after, .photo:focus-visible::after { opacity: 1; }
.photo .badge::before { display: none; }
.no-photo { display: grid; place-items: center; height: 100%; color: var(--steel); }
/* Live date/time on players */
.player { overflow: clip; }
.clock { position: absolute; left: 14px; bottom: 14px; transition: bottom .15s; z-index: 3; padding: 2px 8px; background: rgba(0,0,0,.7); color: #fff;
         font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 28px 20px; }
.tile-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 10px; }
.tile-meta a { font-weight: 700; font-stretch: 110%; text-decoration: none; }
.tile-meta a:hover { text-decoration: underline; }
.tile-meta span { color: var(--steel); font-size: 14px; }

/* Panels, forms, tables */
.panel { background: var(--panel); border: 1px solid var(--line); padding: 20px; margin: 24px 0; overflow-x: auto; }
.timelapse .tl-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.snap { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption { color: var(--steel); font-size: 14px; margin-top: 6px; }
.films { list-style: none; padding: 0; margin: 0; }
.films li { padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--black); color: var(--white); font-weight: 400; font-size: 16px; }
input::placeholder { color: var(--steel); }
button { min-height: 42px; padding: 8px 16px; border: 1px solid var(--white); border-radius: 0; background: var(--white); color: var(--black); font-weight: 700; cursor: pointer; }
button:hover { opacity: .85; }
button.primary { background: var(--live); border-color: var(--live); color: #fff; }
button.primary:hover { filter: brightness(1.1); background: var(--live); }
button.link { min-height: 0; background: none; border: none; color: var(--white); padding: 6px 0; font-weight: 400; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
button.danger { background: none; border-color: var(--line-strong); color: var(--white); font-weight: 600; }
button.danger:hover { border-color: var(--white); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 16px; }
.check input { min-height: 0; accent-color: var(--white); }
.inline { display: inline-flex; gap: 6px; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; font-weight: 600; color: var(--steel); padding: 8px; border-bottom: 1px solid var(--line-strong); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.actions { white-space: nowrap; text-align: right; }
tr.revoked { opacity: .45; }
textarea { width: 100%; min-width: 220px; font-family: ui-monospace, monospace; font-size: 12px; }
code { font-size: 14px; }

/* Login */
.login { min-height: calc(100vh - 92px); display: grid; place-content: center; justify-items: center; gap: 40px; }
.login .panel { width: min(100%, 400px); margin: 0; overflow: visible; display: grid; gap: 16px; padding: 28px; }
.login .panel::after { inset: -8px; }
.login h1 { font-size: 20px; }
.login button { margin-top: 4px; }

/* Clear labels: what each view is */
.section { margin: 0 0 40px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.section-head p { margin: 0; color: var(--steel); max-width: 60ch; }
.is-live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--live); flex: none; }
.tile-kind { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: .01em; color: var(--steel);
             display: flex; align-items: center; gap: 8px; }
.tile-kind.is-live { color: var(--white); }
.tile-kind.is-live::before { width: 7px; height: 7px; }

/* Captures: big photo, control bar, strip of thumbnails */
.cap-cam { display: flex; align-items: center; gap: 10px; }
.cap-stage { position: relative; aspect-ratio: 16 / 9; background: #000; outline: 1px solid var(--line); max-height: calc(100vh - 330px); margin: 0 auto; }
.cap-stage::after { --g: linear-gradient(#fff, #fff); inset: 10px; opacity: .55; }
.cap-stage:fullscreen { max-height: none; aspect-ratio: auto; }
.cap-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cap-when { position: absolute; right: 14px; top: 14px; z-index: 3; padding: 3px 10px; background: rgba(0,0,0,.7); color: #fff; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cap-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9a9a9a; margin: 0; }
.cap-empty[hidden] { display: none; }
.cap-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding: 8px; background: var(--panel); border: 1px solid var(--line); }
.cap-btn { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0 10px; background: none; border: 1px solid var(--line-strong);
           color: var(--white); font-size: 20px; font-weight: 600; text-decoration: none; }
.cap-btn:hover { border-color: var(--white); opacity: 1; }
.cap-btn .icon { width: 18px; height: 18px; }
.cap-day { min-height: 40px; }
.cap-spacer { flex: 1; }
.cap-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.cap-thumb { position: relative; flex: none; width: 160px; padding: 0; background: #000; border: 0; scroll-snap-align: center; opacity: .62; }
.cap-thumb img { display: block; width: 160px; height: 90px; object-fit: cover; }
.cap-thumb span { position: absolute; left: 6px; bottom: 6px; padding: 0 5px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cap-thumb:hover { opacity: 1; }
.cap-thumb.on { opacity: 1; }
/* The selected thumbnail gets the framing corners, like the logo. */
.cap-thumb.on::after { content: ""; position: absolute; inset: -4px; pointer-events: none; --c: 12px; --w: 2px;
  --g: linear-gradient(var(--white), var(--white));
  background: var(--g) top left / var(--c) var(--w), var(--g) top left / var(--w) var(--c), var(--g) top right / var(--c) var(--w), var(--g) top right / var(--w) var(--c),
              var(--g) bottom left / var(--c) var(--w), var(--g) bottom left / var(--w) var(--c), var(--g) bottom right / var(--c) var(--w), var(--g) bottom right / var(--w) var(--c);
  background-repeat: no-repeat; }
@media (max-width: 700px) { .cap-thumb, .cap-thumb img { width: 120px; } .cap-thumb img { height: 68px; } .cap-stage { max-height: none; } }

/* Activity log */
.act-filter { display: flex; border: 1px solid var(--line-strong); }
.act-filter a { padding: 7px 14px; text-decoration: none; color: var(--steel); font-weight: 600; font-size: 14px; }
.act-filter a.on { background: var(--white); color: var(--black); }
.act-day h2 { font-size: 16px; margin: 26px 0 10px; color: var(--steel); font-weight: 600; font-stretch: 100%; }
.act-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.act-item { display: grid; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--white); }
.act-item:hover { border-color: var(--white); }
.act-item img, .act-noimg { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; background: #000; }
.act-meta { display: grid; gap: 4px; padding: 10px 12px; font-size: 14px; }
.act-meta > span { color: var(--steel); font-variant-numeric: tabular-nums; }
.act-meta .pill { justify-self: start; color: var(--white); }
.pill-alert { border-color: var(--live); }
.alerts-form { display: grid; gap: 8px; justify-items: start; font-size: 14px; }

/* Sign-up and People */
.form-foot { margin: 4px 0 0; font-size: 14px; color: var(--steel); text-align: center; }
.signup .panel { width: min(100%, 440px); }
.consent { align-items: flex-start; font-size: 14px; line-height: 1.4; }
.consent input { margin-top: 3px; flex: none; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border: 1px solid var(--line-strong); }
.pill-wait { border-color: var(--white); }
tr.pending td { background: var(--well); }
.button-link { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); text-decoration: none; font-weight: 600; font-size: 14px; }
.button-link:hover { border-color: var(--white); }
.inline-more { display: inline-block; vertical-align: middle; margin-left: 6px; }
.inline-more summary { cursor: pointer; color: var(--steel); font-size: 14px; }

/* Admin switches */
.switches { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 34px; height: 18px; border: 1.5px solid var(--line-strong); background: var(--black); flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; background: var(--steel); transition: transform .15s; }
.switch input:checked + .switch-track { border-color: var(--white); background: var(--white); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--black); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--white); outline-offset: 2px; }

/* Menu layout: icon + label links, and the live landing page */
.top nav .icon, .top-tools .icon { width: 18px; height: 18px; flex: none; display: block; }
@media (max-width: 700px) { .top nav.has-menu .icon { width: 22px; height: 22px; } }
.top nav.has-menu a { display: inline-flex; align-items: center; gap: 7px; }
.top nav.has-menu a:not([aria-current]) .icon { opacity: .7; }
.icon .icon-live { fill: var(--live); stroke: none; }
.admin-key { display: inline-flex; padding: 6px 0; border-bottom: 2px solid transparent; color: var(--steel) !important; }
.admin-key:hover, .admin-key[aria-current] { color: var(--white) !important; }
#site { margin-top: 32px; }
.stage-grid { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stage-grid.one { grid-template-columns: minmax(0, 1fr); }
.stage-main, .stage-side { display: grid; gap: 24px; }
.stage-main .player { max-width: calc((100vh - 170px) * 16 / 9); }
.page-head.stacked { display: block; }
.page-head.stacked p { color: var(--steel); margin: 6px 0 0; max-width: 60ch; }
@media (max-width: 900px) {
  .stage-grid { grid-template-columns: minmax(0, 1fr); }
  .top nav.has-menu a span { display: none; } /* icons only on small screens */
  .top nav.has-menu a .icon { opacity: 1; }
}

/* Site panel: map, place, weather, daylight */
.site-card { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); border: 1px solid var(--line); background: var(--panel); }
.site-map { position: relative; min-height: 320px; overflow: clip; background: var(--well); color: var(--white); }
.site-map::after { inset: 10px; }
.site-tiles { position: absolute; inset: 0; filter: grayscale(1) contrast(1.05); }
:root:not([data-theme="light"]) .site-tiles { filter: grayscale(1) invert(1) contrast(.9) brightness(.85); }
.site-tiles img { position: absolute; display: block; user-select: none; }
.site-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; line-height: 0;
            filter: drop-shadow(0 0 6px var(--black)); }
.site-attrib { position: absolute; right: 6px; bottom: 4px; z-index: 3; font-size: 11px; color: var(--steel); background: var(--black); padding: 0 4px; opacity: .85; }
.site-info { display: grid; align-content: space-between; gap: 22px; padding: 22px 24px; }
.site-info p { margin: 0; }
.site-town { font-size: 28px; font-weight: 800; font-stretch: 115%; line-height: 1.05; }
.site-sub, .site-coords, .site-wind { color: var(--steel); font-size: 14px; }
.site-coords { font-variant-numeric: tabular-nums; margin-top: 6px !important; }
.site-weather { display: flex; align-items: center; gap: 16px; }
.site-temp { font-size: 52px; font-weight: 800; font-stretch: 112%; line-height: 1; font-variant-numeric: tabular-nums; }
.site-cond { font-weight: 700; font-size: 17px; }
.daylight-bar { position: relative; height: 10px; background: var(--well); border: 1px solid var(--line); }
.daylight-sun { position: absolute; top: 0; bottom: 0; background: var(--white); opacity: .85; }
.daylight-now { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--live); }
.daylight-labels { position: relative; height: 18px; font-size: 13px; color: var(--steel); margin-top: 6px; font-variant-numeric: tabular-nums; }
.daylight-labels span { position: absolute; top: 0; white-space: nowrap; }
.daylight-rise { transform: translateX(-60%); }
.daylight-set { transform: translateX(-40%); }
.grid { margin-bottom: 40px; }
.daylight-text { font-size: 14px; margin-top: 6px !important; }
@media (max-width: 760px) { .site-card { grid-template-columns: minmax(0, 1fr); } }

/* Then and now slider */
.compare-pick { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.compare-pick label { display: flex; align-items: center; gap: 10px; }
.compare-pick select { min-width: 12em; }
.compare-stage { --split: 50%; position: relative; aspect-ratio: 16 / 9; background: #000; overflow: clip; outline: 1px solid var(--line);
                 cursor: ew-resize; touch-action: pan-y; user-select: none; }
.compare-stage::after { --g: linear-gradient(#fff, #fff); inset: 10px; opacity: .55; }
.compare-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare-then-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff; z-index: 3; pointer-events: none; }
.compare-handle span { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%);
                       border: 2px solid #fff; background: rgba(0,0,0,.55); }
.compare-handle span::before, .compare-handle span::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px;
                       border: 5px solid transparent; }
.compare-handle span::before { left: 4px; border-right-color: #fff; }
.compare-handle span::after { right: 4px; border-left-color: #fff; }
.compare-tag { position: absolute; top: 14px; z-index: 3; padding: 2px 8px; font-size: 13px; font-weight: 700; background: rgba(0,0,0,.7); color: #fff; pointer-events: none; }
.compare-tag-then { left: 14px; }
.compare-tag-now { right: 14px; }
.compare-range { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; margin: 0; z-index: 2; pointer-events: none; } /* keyboard only; the mouse drags the picture */
.compare-range:focus-visible + .compare-empty, .compare-stage:focus-within { outline: 2px solid var(--white); outline-offset: 3px; }
.compare-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9a9a9a; margin: 0; z-index: 4; background: #000; }
.compare-empty[hidden] { display: none; }
.compare-modes { display: flex; margin-left: auto; border: 1px solid var(--line-strong); }
.compare-modes button { min-height: 38px; background: none; border: 0; color: var(--steel); font-weight: 600; padding: 6px 12px; }
.compare-modes button[aria-pressed="true"] { background: var(--white); color: var(--black); }
.compare-modes button:hover:not([aria-pressed="true"]) { color: var(--white); opacity: 1; }
/* Side by side: each photo gets half, shown whole. */
.compare-stage[data-mode="side"] { cursor: default; aspect-ratio: 32 / 9; }
.compare-stage[data-mode="side"] .compare-then-wrap { clip-path: none; right: 50%; }
.compare-stage[data-mode="side"] .compare-now { left: 50%; width: 50%; }
.compare-stage[data-mode="side"] img { object-fit: cover; }
.compare-stage[data-mode="side"] .compare-handle { left: 50%; }
.compare-stage[data-mode="side"] .compare-handle span { display: none; }
/* Flick: tap to swap between the two photos in the same place. */
.compare-stage[data-mode="flick"] { cursor: pointer; }
.compare-stage[data-mode="flick"] .compare-then-wrap { clip-path: none; }
.compare-stage[data-mode="flick"] .compare-handle { display: none; }
.compare-stage[data-mode="flick"].show-now .compare-then-wrap { opacity: 0; }
.compare-stage[data-mode="flick"] .compare-tag-now { opacity: .35; }
.compare-stage[data-mode="flick"].show-now .compare-tag-now { opacity: 1; }
.compare-stage[data-mode="flick"].show-now .compare-tag-then { opacity: .35; }
.compare-stage.is-empty .compare-handle, .compare-stage.is-empty .compare-tag { display: none; }

/* Film archive: safe-deposit boxes */
.latest { max-width: 720px; }
.archive { margin: 32px 0; }
.archive-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.archive-head .section-head { margin: 0; }
.archive-tabs { display: flex; border: 1px solid var(--line-strong); }
.archive-tabs button { min-height: 38px; background: none; border: 0; color: var(--steel); font-weight: 600; padding: 6px 16px; }
.archive-tabs button[aria-selected="true"] { background: var(--white); color: var(--black); }
.archive-tabs button:hover:not([aria-selected="true"]) { color: var(--white); background: none; }
.boxes[hidden], .archive-viewer[hidden] { display: none; }
.archive-viewer { background: #000; border: 1px solid var(--line); margin-bottom: 16px; }
.archive-viewer video { display: block; width: 100%; max-height: 70vh; background: #000; }
.archive-viewer-bar { background: var(--panel); display: flex; align-items: center; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.archive-viewer-bar h3 { margin: 0 auto 0 0; }

.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px;
         padding: 6px; background: var(--well); border: 1px solid var(--line); }
.box { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; background: #000; color: var(--white);
       perspective: 600px; overflow: visible; font: inherit; text-align: left; min-height: 0; }
.box:hover { background: #000; opacity: 1; }
.box-inside { position: absolute; inset: 0; background: #000 center / cover no-repeat; }
.box-door { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 10px 12px;
            background: linear-gradient(180deg, var(--box-a), var(--box-b)); border: 1px solid var(--line-strong);
            box-shadow: inset 0 0 0 4px var(--box-b), inset 0 0 0 5px var(--line);
            transform-origin: 0 50%; transition: transform .45s cubic-bezier(.4, 0, .2, 1); backface-visibility: hidden; }
.box-num { font-size: 28px; font-weight: 800; font-stretch: 115%; line-height: 1; }
.box-label { align-self: end; font-size: 13px; color: var(--steel); font-variant-numeric: tabular-nums; }
.box-state { font-size: 12px; color: var(--steel); }
.keyhole { position: absolute; right: 12px; top: 12px; width: 10px; height: 16px; }
.keyhole::before { content: ""; position: absolute; left: 1px; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--white); }
.keyhole::after { content: ""; position: absolute; left: 3px; top: 6px; width: 4px; height: 9px; background: var(--white); }
button.box:hover .box-door, button.box:focus-visible .box-door { transform: rotateY(-28deg); }
button.box.open .box-door { transform: rotateY(-100deg); }
button.box.open { outline: 2px solid var(--white); outline-offset: 2px; z-index: 1; }
.box.empty .box-door { background: var(--well); border-color: var(--line); box-shadow: inset 0 0 0 4px var(--well), inset 0 0 0 5px var(--line); }
.box.empty .box-num { color: var(--line-strong); }
.box.current .box-door { border-style: dashed; }
@media (prefers-reduced-motion: reduce) { .box-door { transition: none; } }

/* Vault door (login) */
.login { gap: 28px; }
.vault { position: relative; width: clamp(160px, 28vh, 240px); aspect-ratio: 1; perspective: 900px; }
.vault svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vault-frame { position: absolute; inset: 0; }
.vault-door { position: absolute; inset: 0; transform-origin: 8% 50%; transition: transform .9s cubic-bezier(.5, 0, .2, 1); }
.vault .wheel { transform-box: view-box; transform-origin: 120px 120px; transition: transform 1.1s cubic-bezier(.6, 0, .3, 1); }
.vault .bolt { transform-box: fill-box; transition: transform .35s ease-in .95s; }
.vault.unlocking .wheel { transform: rotate(-300deg); }
.vault.unlocking .bolt { transform: translateY(18px); }
.vault.open .vault-door { transform: rotateY(-105deg); }
/* After unlocking: fly into the vault, then the next page fades up */
html.entering { overflow: hidden; }
html.entering .login > :not(.vault) { opacity: 0; transition: opacity .35s; }
.vault.enter { transform: scale(16); transition: transform 1s cubic-bezier(.55, 0, .85, .35); }
.vault.enter .vault-door { opacity: 0; transition: transform .9s, opacity .3s; }
html.vault-in body { animation: vault-fade-up .9s ease-out both; }
@keyframes vault-fade-up { from { opacity: 0; } }
.vault.denied { animation: vault-shake .45s; }
.vault.denied .wheel { animation: wheel-jiggle .45s; }
@keyframes vault-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes wheel-jiggle { 30% { transform: rotate(-25deg); } 70% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) {
  .vault *, .vault { transition: none !important; animation: none !important; }
}

/* Embeds */
body.bare { background: #000; }
body.bare .player { width: 100vw; height: 100vh; aspect-ratio: auto; outline: 0; }
body.bare .player::after { display: none; }
.embed-mark { position: fixed; right: 12px; bottom: 12px; opacity: .8; z-index: 3; line-height: 0; }

@media (max-width: 700px) {
  main { padding: 20px 16px 48px; }
  .top { padding: 12px 16px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand tools" "menu menu"; }
  .top-menu { justify-content: center; gap: 34px; border-top: 1px solid var(--line); padding-top: 8px; }
  .room { display: none; }
  .timelapse .tl-cols { grid-template-columns: minmax(0, 1fr); }
}

.cap-age { display: inline-flex; align-items: center; gap: 7px; }
.age-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--white); }
.age-dot.stale { background: transparent; box-shadow: inset 0 0 0 1.5px var(--steel); }

/* Captures, take two: photo and strip as one block, then a centred "deck" of controls underneath. */
.cap-viewer { background: var(--panel); border: 1px solid var(--line); }
.cap-viewer .cap-stage { outline: 0; max-height: calc(100vh - 420px); min-height: 220px; }
.cap-viewer .cap-strip { padding: 10px 10px 8px; margin: 0; border-top: 1px solid var(--line); background: var(--well); }
.cap-deck { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 18px 0 4px; }
.cap-count { color: var(--steel); font-size: 14px; font-variant-numeric: tabular-nums; }
.cap-transport { display: flex; align-items: center; gap: 8px; }
.cap-tools { display: flex; gap: 8px; justify-content: flex-end; }
.cap-transport .cap-btn { border-radius: 50%; min-width: 44px; min-height: 44px; }
.cap-transport [data-go="prev"], .cap-transport [data-go="next"] { min-width: 52px; min-height: 52px; font-size: 26px; border-color: var(--white); }
.cap-readout { display: grid; justify-items: center; min-width: 210px; padding: 0 14px; }
.cap-time { font-size: 40px; font-weight: 800; font-stretch: 112%; line-height: 1; font-variant-numeric: tabular-nums; }
.cap-meta { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.cap-readout .cap-day { min-height: 0; padding: 2px 4px; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; color: var(--white); font-size: 14px; font-weight: 600; cursor: pointer; }
.cap-readout .cap-day:hover { border-bottom-color: var(--white); }
.cap-ago { color: var(--steel); font-size: 13px; white-space: nowrap; }
@media (max-width: 700px) {
  .cap-deck { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t t" "c tools"; row-gap: 14px; }
  .cap-transport { grid-area: t; justify-content: center; }
  .cap-count { grid-area: c; }
  .cap-tools { grid-area: tools; }
  .cap-readout { min-width: 0; padding: 0 6px; }
  .cap-time { font-size: 30px; }
  .cap-transport [data-go="day-prev"], .cap-transport [data-go="day-next"] { display: none; }
}

/* Activity: clips */
button.act-item { padding: 0; text-align: left; font: inherit; cursor: pointer; }
button.act-item:hover { opacity: 1; background: var(--panel); }
.act-media { position: relative; display: block; }
.act-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; background: rgba(0,0,0,.55); }
.act-play::after { content: ""; position: absolute; left: 17px; top: 12px; border: 9px solid transparent; border-left: 14px solid #fff; border-right: 0; }
.act-view { width: min(96vw, 1100px); padding: 0; border: 1px solid var(--line-strong); background: var(--black); color: var(--white); }
.act-view::backdrop { background: rgba(0,0,0,.75); }
.act-view-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--panel); }
.act-view-bar h2 { margin: 0 auto 0 0; font-size: 18px; }
.act-view-media video, .act-view-media img { display: block; width: 100%; max-height: 78vh; background: #000; }

/* Super user: data use */
.data-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 22px; }
.data-stats > div { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); background: var(--black); }
.data-stats span:last-child { color: var(--steel); font-size: 13px; }
.data-big { font-size: 26px; font-weight: 800; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.data-calc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 22px; }
.data-calc label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; }
.data-calc input { width: 5.5em; min-height: 36px; }
.data-result { flex-basis: 100%; margin: 4px 0 0; font-size: 16px; }
.data-table td, .data-table th { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Monitor */
.mon-head { align-items: flex-end; }
.mon-summary { margin: 6px 0 0; font-size: 16px; }
.mon-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 20px; align-items: start; }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.mon-cam { background: var(--panel); border: 1px solid var(--line); }
.mon-cam.bad { border-color: var(--live); }
.mon-img { position: relative; aspect-ratio: 16 / 9; background: #000; }
.mon-img::after { --g: linear-gradient(#fff, #fff); inset: 8px; opacity: .5; }
.mon-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mon-state { position: absolute; left: 10px; top: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 13px; font-weight: 700; }
.mon-state i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.mon-cam.warn .mon-state i { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
.mon-cam.bad .mon-state { background: var(--live); }
.mon-body { padding: 14px 16px 16px; }
.mon-body h2 { margin: 0 0 4px; font-size: 18px; }
.mon-body p { margin: 0 0 10px; font-size: 14px; }
.mon-body dl { display: grid; gap: 6px; margin: 0; font-size: 14px; }
.mon-body dl div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.mon-body dt { color: var(--steel); }
.mon-body dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mon-feed { background: var(--panel); border: 1px solid var(--line); padding: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.mon-feed h2 { margin: 0 0 10px; font-size: 18px; }
.mon-feed-list { display: grid; gap: 8px; }
.mon-ev { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: center; }
.mon-ev .act-meta { padding: 0; }
.mon-ev .act-play { width: 30px; height: 30px; }
.mon-ev .act-play::after { left: 11px; top: 7px; border-width: 7px; border-left-width: 11px; }
@media (max-width: 900px) { .mon-layout { grid-template-columns: minmax(0, 1fr); } .mon-feed { position: static; max-height: none; } }

/* The player's own buttons appear along the bottom on hover: lift the clock out of their way. */
.player:hover .clock { bottom: 52px; }

/* Activity timeline */
.tlv { position: relative; }
.tlv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.tlv-sum { margin: 6px 0 0; color: var(--steel); white-space: pre-wrap; }
.tlv-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tlv-day { display: flex; align-items: stretch; border: 1px solid var(--line); }
.tlv-day button { min-height: 38px; width: 38px; padding: 0; background: none; border: 0; color: var(--white); font-size: 20px; line-height: 1; }
.tlv-day button:disabled { opacity: .25; cursor: default; }
.tlv-day select { min-height: 38px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: none; color: var(--white); padding: 0 10px; font: inherit; font-size: 14px; }
.tlv-filter { display: flex; border: 1px solid var(--line); }
.tlv-filter button { min-height: 38px; padding: 0 14px; background: none; border: 0; color: var(--steel); font-weight: 600; font-size: 14px; }
.tlv-filter button.on { background: var(--white); color: var(--black); }

/* The board: row names on the left, the day on the right */
.tlv-board { display: grid; grid-template-columns: 116px minmax(0, 1fr); border: 1px solid var(--line); background: var(--well); }
.tlv-labels { border-right: 1px solid var(--line); }
.tlv-labels span { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--steel); }
.tlv-labels span:first-child { height: 26px; border-top: 0; }
.tlv-labels span[hidden] { display: none; }
.tlv-labels svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.tlv-scroll { overflow-x: auto; scrollbar-width: thin; }
.tlv-track { position: relative; min-width: 960px; padding-top: 26px; }
.tlv-hours { position: absolute; inset: 0; pointer-events: none; }
.tlv-hours span { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-strong); padding: 6px 0 0 7px; font-size: 11px; letter-spacing: .04em; color: var(--steel); font-variant-numeric: tabular-nums; }
.tlv-hours span b { color: var(--white); font-weight: 700; }
.tlv-hours span.odd { top: 26px; border-left: 1px solid var(--line); opacity: .6; }
.tlv-hours span:first-child { border-left: 0; }
.tlv-now { position: absolute; top: 22px; bottom: 0; width: 2px; margin-left: -1px; background: var(--live); z-index: 4; }
.tlv-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.tlv-row { position: relative; height: 36px; border-top: 1px solid var(--line); }
.tlv-row + .tlv-row { background: color-mix(in srgb, var(--white) 2.5%, transparent); }
.tlv-row[hidden] { display: none; }

/* A detection: a person or car icon where it started; longer ones carry on as a thin bar. */
.tlv-mark { position: absolute; height: 24px; min-height: 0; padding: 0; z-index: 2; background: none; border: 0; color: var(--white); }
.tlv-mark::before { content: ""; position: absolute; left: 12px; right: 0; top: 50%; height: 2px; margin-top: -1px; background: currentColor; opacity: .4; }
.tlv-icon { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--white); color: var(--black);
            transition: transform .15s, box-shadow .15s; }
.tlv-icon svg { width: 15px; height: 15px; fill: currentColor; }
.tlv-mark:hover { z-index: 4; opacity: 1; }
.tlv-mark:hover .tlv-icon { transform: scale(1.15); }
.tlv-mark.on { z-index: 4; }
.tlv-mark.on .tlv-icon { box-shadow: 0 0 0 2px var(--well), 0 0 0 4px var(--white); }
.tlv-mark.alerted { color: var(--live); }
.tlv-mark.alerted .tlv-icon { background: var(--live); color: #fff; }
.tlv-mark.alerted.on .tlv-icon { box-shadow: 0 0 0 2px var(--well), 0 0 0 4px var(--live); }
/* Hover preview */
.tlv-tip { position: absolute; z-index: 20; width: 240px; background: var(--black); border: 1px solid var(--line-strong); pointer-events: none; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.tlv-tip[hidden] { display: none; }
.tlv-tip img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel); }
.tlv-tip div { display: grid; padding: 8px 10px; font-size: 13px; }
.tlv-tip span { color: var(--steel); font-size: 12px; }

/* The player */
.tlv-player { margin-top: 24px; }
.tlv-player[hidden] { display: none; }
.tlv-screen { background: #000; outline: 1px solid var(--line); }
.tlv-screen::after { --g: linear-gradient(#fff, #fff); inset: 10px; opacity: .5; }
.tlv-screen video { display: block; width: 100%; max-height: 62vh; background: #000; }
.tlv-tag { position: absolute; right: 16px; top: 16px; /* top-right: the camera prints its clock top-left */ z-index: 3; display: flex; align-items: center; gap: 8px; margin: 0;
           padding: 4px 10px 4px 6px; font-size: 12px; letter-spacing: .08em; background: rgba(0,0,0,.72); color: #fff; font-variant-numeric: tabular-nums; pointer-events: none; transition: opacity .2s; }
.tlv-tag-icon svg { display: block; width: 16px; height: 16px; fill: #fff; }
.tlv-screen:hover .tlv-tag { opacity: 0; }
.tlv-bar { display: flex; align-items: center; gap: 10px; padding: 14px 0; }
.tlv-info { display: grid; margin-right: auto; }
.tlv-info strong { font-size: 18px; font-weight: 700; }
.tlv-info span { font-size: 13px; color: var(--steel); white-space: pre-wrap; }
.tlv-count { font-size: 13px; color: var(--steel); font-variant-numeric: tabular-nums; margin-right: 6px; }
.tlv-bar button, .tlv-bar a { display: grid; place-items: center; width: 38px; height: 38px; min-height: 0; padding: 0; background: none; border: 1px solid var(--line); color: var(--white); font-size: 20px; text-decoration: none; }
.tlv-bar button:hover, .tlv-bar a:hover { border-color: var(--white); opacity: 1; }
.tlv-bar a svg { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .tlv-board { grid-template-columns: 44px minmax(0, 1fr); }
  .tlv-labels span { padding: 0; justify-content: center; font-size: 0; }
  .tlv-count { display: none; }
  .tlv-tag { font-size: 11px; top: 10px; right: 10px; }
}

/* Phone alerts (client) */
.alerts-page { max-width: 680px; }
.alerts-page h1 { margin-bottom: 10px; }
.alerts-page h2 { margin-top: 34px; }
.alerts-switch { margin: 22px 0 0; padding: 18px 20px; border: 1px solid var(--line); background: var(--panel); }
.alerts-switch .switch { gap: 14px; align-items: center; }
.alerts-switch .switch > span:last-child { display: grid; }
.alerts-switch .muted { font-size: 14px; }
.alerts-steps { padding-left: 22px; display: grid; gap: 22px; }
.alerts-steps li { padding-left: 6px; }
.alerts-steps form { display: block; margin-top: 10px; }
.alerts-topic { display: flex; align-items: center; gap: 14px; margin: 10px 0 6px; padding: 10px 14px; border: 1px solid var(--line-strong); background: var(--well); }
.alerts-topic code { font-size: 15px; word-break: break-all; }
.tlv-count-badge { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--black); color: var(--white); border: 1px solid var(--white); font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }
