/* Design v2. One layout, three presentations: html[data-platform="ios|android|web"] (set at startup).
   Every colour comes from tokens.css (generated from brand/tokens.json); the only literal colour is
   black (#000 / rgba black, plus rgba white for the spinner) for scrims and the dim screen.
   Dark is the default look; light follows prefers-color-scheme (or :root[data-theme="light"]).
   System fonts only, no external resources. Space and alignment instead of boxes. */
@import url("tokens.css");   /* for pages that link only style.css (help, privacy, terms) */

:root {
  --tap: 44px; --edge: 20px; --hair: var(--border);
  --on-pic: var(--brand-ivory);
  /* status marks: on the page they use the theme's status colours; on a picture (always dark) the light theme gets lighter ones below */
  --m-live: var(--status-live); --m-rec: var(--status-recording); --m-paused: var(--status-paused); --m-offline: var(--status-offline);
  --seg-thumb: var(--border);
  --body: 16px; --body-lh: 1.5; --small: 15px;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --seg-thumb: var(--surface); } }
:root[data-theme="light"] { --seg-thumb: var(--surface); }
@supports (color: color-mix(in srgb, red, blue)) {
  .on-pic { --m-live: color-mix(in srgb, var(--status-live) 45%, var(--brand-ivory)); --m-rec: color-mix(in srgb, var(--status-recording) 55%, var(--brand-ivory)); --m-paused: color-mix(in srgb, var(--status-paused) 45%, var(--brand-ivory)); --m-offline: color-mix(in srgb, var(--status-offline) 35%, var(--brand-ivory)); }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .on-pic { --m-live: var(--status-live); --m-rec: var(--status-recording); --m-paused: var(--status-paused); --m-offline: var(--status-offline); } }
:root[data-theme="dark"] .on-pic { --m-live: var(--status-live); --m-rec: var(--status-recording); --m-paused: var(--status-paused); --m-offline: var(--status-offline); }

html[data-platform="ios"] { --body: 17px; --body-lh: 1.3; --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
html[data-platform="android"] { --edge: 16px; --tap: 48px; --body-lh: 1.5; --font: Roboto, "Noto Sans", system-ui, "Helvetica Neue", Arial, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html, body { min-height: 100dvh; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--body)/var(--body-lh) var(--font); overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.25rem); line-height: 1.15; margin: .2em 0 .5em; letter-spacing: -.022em; font-weight: 700; }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.012em; font-weight: 600; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; font-weight: 600; }
h4 { margin: .8em 0 .3em; }
p { margin: .4em 0 .8em; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg, video { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
h1:focus, h2:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num, .countdown, .event-time { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.icon { width: 24px; height: 24px; flex: none; display: block; }
.lead { font-size: 1.1rem; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.hint, .small { color: var(--text-muted); font-size: var(--small); line-height: 1.4; }
.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 0; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.title-row h1, .title-row h2 { margin-bottom: .2em; }

/* ================= chrome ================= */
.view { display: block; min-height: 100dvh; }
.appbar { padding: env(safe-area-inset-top) max(var(--edge), env(safe-area-inset-right)) 0 max(var(--edge), env(safe-area-inset-left)); }
.page { max-width: 720px; margin: 0 auto; padding: 8px max(var(--edge), env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(var(--edge), env(safe-area-inset-left)); }
.page-wide { max-width: 1040px; }
.has-tabs .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* web: quiet top bar (no fill, no rule) */
.appbar-web { max-width: 1200px; margin: 0 auto; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; color: var(--text); text-decoration: none; min-height: var(--tap); }
.brand-icon { width: 28px; height: 28px; border-radius: 7px; flex: none; display: block; }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.nav-link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; color: var(--text-muted); text-decoration: none; }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"], .nav-strong { color: var(--text); font-weight: 600; }
.nav-link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.appbar-row { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; padding-top: 8px; }
.appbar-row .back { grid-column: 1 / -1; justify-self: start; }
.appbar-title { margin: 0; grid-column: 1; }
.appbar-actions { grid-column: 2; grid-row: 1 / span 2; align-self: end; display: flex; gap: 4px; }
.appbar-row.has-back .appbar-actions { grid-row: 2; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); text-decoration: none; margin-left: -6px; padding-right: 8px; }
.back .back-md { display: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--tap); min-height: var(--tap); padding: 0 12px 0 8px; border-radius: var(--radius-pill); color: var(--accent); text-decoration: none; font-weight: 600; background: none; border: 0; font: inherit; cursor: pointer; }
.icon-btn .icon { width: 26px; height: 26px; }
.icon-btn-label { font-weight: 600; }

/* iOS: back/action row, large title above the content, translucent bottom tab bar */
html[data-platform="ios"] .appbar-row { grid-template-rows: 44px auto; padding-top: 0; max-width: none; }
html[data-platform="ios"] .appbar-row .back { grid-row: 1; grid-column: 1; font-size: 17px; margin-left: -10px; }
html[data-platform="ios"] .appbar-actions, html[data-platform="ios"] .appbar-row.has-back .appbar-actions { grid-row: 1; grid-column: 2; align-self: center; margin-right: -10px; }
html[data-platform="ios"] .appbar-title { grid-row: 2; grid-column: 1 / -1; font: 700 34px/41px var(--font); letter-spacing: -.022em; padding: 3px 0 8px; }
html[data-platform="ios"] .page > h1:first-child, html[data-platform="ios"] .page > h1 { font: 700 34px/41px var(--font); letter-spacing: -.022em; }
html[data-platform="ios"] .icon-btn { padding: 0; }
html[data-platform="ios"] .icon-btn-label, html[data-platform="android"] .icon-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: var(--bg); color: var(--text-muted); padding: 6px max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left)); border-top: .5px solid var(--hair); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (color: color-mix(in srgb, red, blue)) {
  html[data-platform="ios"] .tabbar { background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(24px); backdrop-filter: saturate(1.6) blur(24px); }
}
.tab-item { flex: 1; max-width: 168px; min-height: 49px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: inherit; text-decoration: none; font: 500 13px/16px var(--font); }
.tab-item .icon { width: 27px; height: 27px; }
.tab-item[aria-current="page"] { color: var(--accent); }
.tab-ind { display: grid; place-items: center; }

/* Android: top app bar, navigation bar with pill indicator */
html[data-platform="android"] .appbar-row { display: flex; align-items: center; min-height: 64px; padding-top: 0; gap: 4px; max-width: none; }
html[data-platform="android"] .appbar-title, html[data-platform="android"] .page > h1 { flex: 1; font: 400 22px/28px var(--font); letter-spacing: 0; }
html[data-platform="android"] .back { width: 48px; height: 48px; justify-content: center; margin-left: -12px; padding: 0; color: var(--text); border-radius: 50%; }
html[data-platform="android"] .back .back-ios { display: none; }
html[data-platform="android"] .back .back-md { display: block; }
html[data-platform="android"] .back-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[data-platform="android"] .appbar-actions { margin-right: -8px; align-self: center; }
html[data-platform="android"] .icon-btn { color: var(--text); padding: 0; width: 48px; height: 48px; }
html[data-platform="android"] .tabbar { background: var(--surface); border-top: 0; padding-top: 12px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
html[data-platform="android"] .tab-item { gap: 4px; font: 500 13px/16px var(--font); letter-spacing: .02em; min-height: 52px; }
html[data-platform="android"] .tab-item .icon { width: 24px; height: 24px; stroke-width: 1.9; }
html[data-platform="android"] .tab-ind { width: 64px; height: 32px; border-radius: 16px; }
html[data-platform="android"] .tab-item[aria-current="page"] { color: var(--text); font-weight: 700; }
html[data-platform="android"] .tab-item[aria-current="page"] .tab-ind { background: var(--surface2); color: var(--accent); }
@supports (color: color-mix(in srgb, red, blue)) { html[data-platform="android"] .tab-item[aria-current="page"] .tab-ind { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); color: var(--text); } }
html[data-platform="android"] .has-tabs .page { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

/* screens that draw their own top (live view, camera device): no bar on phones */
html[data-platform="ios"] .view-immersive .appbar, html[data-platform="android"] .view-immersive .appbar { padding: 0; }
html[data-platform="ios"] .view-immersive .page, html[data-platform="android"] .view-immersive .page { padding-top: 0; }

/* ================= buttons ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); min-width: var(--tap); padding: 10px 18px; border-radius: var(--radius-md); border: 1px solid var(--control-border); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; background: transparent; color: var(--text); text-align: center; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: transparent; border-color: var(--control-border); color: var(--text); }
.btn-outline { background: transparent; border: 1.5px solid var(--text); color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn-danger-outline { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-link { background: none; border: none; color: var(--accent); text-decoration: underline; padding: 10px 8px; font: inherit; cursor: pointer; min-height: var(--tap); }
.btn-block { width: 100%; }
.btn-big { font-size: 1.1rem; padding: 14px 24px; min-height: 56px; border-radius: 14px; }
.btn-small { padding: 8px 12px; font-size: var(--small); }
/* Google / Apple sign-in buttons. Colours are the providers' own (their button rules), not the app theme:
   on the dark look Apple's button is white and Google's is dark; on the light look Apple's is black and Google's white. */
.providers { display: grid; gap: 12px; margin: 20px 0 0; }
.providers > .msg { margin: 0; }
.btn-provider { gap: 10px; min-height: 48px; font-weight: 600; font-size: 17px; }
.btn-apple { background: #fff; color: #000; border-color: #fff; font-family: -apple-system, "SF Pro Text", system-ui, sans-serif; }
.btn-apple .apple-logo { margin-top: -2px; }
.btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn-apple { background: #000; color: #fff; border-color: #000; } :root:not([data-theme="dark"]) .btn-google { background: #fff; color: #1f1f1f; border-color: #747775; } }
:root[data-theme="light"] .btn-apple { background: #000; color: #fff; border-color: #000; }
:root[data-theme="light"] .btn-google { background: #fff; color: #1f1f1f; border-color: #747775; }
.providers-or { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; color: var(--text-muted); font-size: var(--small); }
.providers-or::before, .providers-or::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }
.btn-sub { font-weight: 400; font-size: var(--small); color: var(--text-muted); }
html[data-platform="ios"] .btn { border-radius: 12px; min-height: 50px; }
html[data-platform="ios"] .btn-small { min-height: 44px; }
html[data-platform="android"] .btn { border-radius: var(--radius-pill); padding: 10px 24px; letter-spacing: .01em; font-weight: 500; }

/* ================= forms ================= */
.field { margin: 12px 0; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { margin: 4px 0 0; }
input[type=text], input[type=email], input[type=password], input[type=time], select {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--control-border); border-radius: var(--radius-sm); }
input[type=time] { width: auto; min-width: 8rem; }
input:disabled { opacity: .55; }
.code-input { font-size: 1.6rem; letter-spacing: .15em; font-variant-numeric: tabular-nums; text-transform: uppercase; max-width: 16rem; }
fieldset { border: 0; border-top: 1px solid var(--hair); padding: 12px 0 4px; margin: 12px 0 0; min-width: 0; }
legend { font-weight: 600; padding: 0 8px 0 0; }
.radio, .check { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 2px 0; min-height: var(--tap); }
.radio input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); flex: none; }
.radio label, .check label { flex: 1; cursor: pointer; padding: 8px 0; }
.check .hint { flex-basis: 100%; margin: -2px 0 6px; order: 3; }
/* a checkbox setting is shown as a switch at the end of its row (still a real checkbox) */
.check input[type=checkbox] { order: 2; appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: var(--control-border); position: relative; cursor: pointer; transition: background-color .15s; }
.check input[type=checkbox]::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--brand-ivory); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.check input[type=checkbox]:checked { background: var(--primary); }
.check input[type=checkbox]:checked::after { transform: translateX(20px); }
html[data-platform="android"] .check input[type=checkbox] { width: 52px; height: 32px; }
.quiet-times .field { margin: 4px 0; }
.quiet-times.disabled { opacity: .6; }

/* ================= messages ================= */
.msg { padding: 8px 0 8px 12px; margin: 8px 0; border-left: 3px solid var(--control-border); }
.msg-info { color: var(--text); }
.msg-ok { color: var(--status-live); border-left-color: var(--status-live); }
.msg-error { color: var(--danger); border-left-color: var(--danger); }
.notice { padding: 12px 0 12px 14px; margin: 12px 0; border-left: 3px solid var(--accent-strong); }
.notice h2 { margin-top: 0; }
.notice a:not(.btn) { color: var(--accent-strong); }
.link-device-card { padding: 16px; }
.link-device-card .btn-block { margin-top: 12px; }
.notice-warn { border-left-color: var(--status-paused); }
.notice-danger { border-left-color: var(--danger); }
.pill { display: inline-block; padding: 1px 10px; border-radius: var(--radius-pill); color: var(--accent-strong); border: 1px solid var(--accent-strong); font-size: var(--small); font-weight: 600; margin: 0 6px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: var(--small); line-height: 1.3; white-space: nowrap; }
.badge-icon { font-size: .8em; line-height: 1; }
.badge-live, .badge-pass { color: var(--status-live); }
.badge-recording { color: var(--status-recording); }
.badge-paused, .badge-warn { color: var(--status-paused); }
.badge-offline, .badge-stopped { color: var(--status-offline); }
.badge-fail { color: var(--danger); }
.badge-info { color: var(--text-muted); }
/* claims not verified yet (see build.mjs HC_VERIFIED): always visible, kept quiet */
.claim-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: var(--radius-pill); border: 1px dashed var(--status-paused); color: var(--status-paused); font-size: var(--small); font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: 1px; }

/* status word marks: dot / pause glyph / ring / square, always next to the written word */
.state { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.mark { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.mark-live { background: var(--m-live); }
.mark-rec { background: var(--m-rec); }
.mark-paused { width: 9px; height: 11px; border-radius: 0; border-left: 3px solid var(--m-paused); border-right: 3px solid var(--m-paused); }
.mark-offline { border: 1.6px solid var(--m-offline); }
.mark-stopped { border-radius: 2px; background: var(--m-offline); }

/* ================= grouped content (settings, account, setup) ================= */
.card, .group { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--hair); }
.card > h2, .group > h2, .group > .title-row h2 { font-size: 1.1rem; }
.card-danger h2, .group-danger h2 { color: var(--danger); }
details > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; }
details.more { margin: 12px 0; }
details.more > summary { color: var(--accent); }
.footer { margin-top: 40px; color: var(--text-muted); font-size: var(--small); }
.footer a { display: inline-block; padding: 10px 2px; min-height: var(--tap); color: var(--text-muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 0 12px; }
.facts dt, .facts dd { padding: 11px 0; border-bottom: .5px solid var(--hair); margin: 0; }
.facts dt { padding-right: 16px; }
.facts dd { color: var(--text-muted); text-align: right; overflow-wrap: anywhere; }
.link-list, .device-list { list-style: none; padding: 0; margin: 0; }
.link-list li { border-bottom: .5px solid var(--hair); }
.link-list a { display: flex; align-items: center; min-height: var(--tap); padding: 6px 0; text-decoration: none; color: var(--text); }
.device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: .5px solid var(--hair); flex-wrap: wrap; }
.device p { margin: 2px 0 0; }
.steps { padding-left: 1.4em; }
.steps li { margin: 6px 0; }
/* iOS: inset grouped lists */
html[data-platform="ios"] .card, html[data-platform="ios"] .group { background: var(--surface); border: 0; border-radius: 12px; padding: 14px 16px; margin: 22px 0 0; }
html[data-platform="ios"] .card > h2, html[data-platform="ios"] .group > h2 { font-size: 17px; }
html[data-platform="ios"] .card input[type=text], html[data-platform="ios"] .card select, html[data-platform="ios"] .card input[type=time] { background: var(--surface2); border-color: transparent; border-radius: 10px; }
html[data-platform="ios"] .card ul:not([class]), html[data-platform="ios"] .group ul:not([class]) { padding-left: 1.2em; }
html[data-platform="ios"] .card > :last-child, html[data-platform="ios"] .group > :last-child { margin-bottom: 0; }
/* Android: flat sections with a small coloured header, Material list density */
html[data-platform="android"] .card, html[data-platform="android"] .group { margin: 16px 0 0; padding-top: 16px; }
html[data-platform="android"] .card > h2, html[data-platform="android"] .group > h2 { font: 500 14px/20px var(--font); letter-spacing: .01em; color: var(--accent); }
html[data-platform="android"] .card-danger > h2, html[data-platform="android"] .group-danger > h2 { color: var(--danger); }
html[data-platform="android"] .facts dt, html[data-platform="android"] .facts dd { padding: 14px 0; }
html[data-platform="android"] input[type=text], html[data-platform="android"] input[type=email], html[data-platform="android"] select { border-radius: 4px; min-height: 56px; }

/* ================= My cameras: the picture is the control ================= */
.cam-list { margin: 4px calc(-1 * var(--edge)) 0; }
.cam + .cam { margin-top: 10px; }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 440px; overflow: hidden; background: #000; color: var(--on-pic); text-decoration: none; }
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.35) brightness(.5) contrast(.9); }   /* a stored picture is never shown at full strength */
.tile-offline .tile-img, .tile-stopped .tile-img { filter: grayscale(1) brightness(.4) contrast(.85); }
.tile.has-pic::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 70%; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.66) 55%, rgba(0,0,0,0) 100%); }
.tile-lbl { position: absolute; z-index: 2; left: var(--edge); right: var(--edge); top: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tile-name { font: 600 20px/25px var(--font); letter-spacing: -.015em; padding-right: 130px; }
.tile .state { font: 500 16px/21px var(--font); }
.tile-sub { font: 400 15px/20px var(--font); opacity: .9; }
.tile-rec { position: absolute; z-index: 2; right: var(--edge); top: 17px; display: inline-flex; align-items: center; gap: 6px; font: 600 15px/20px var(--font); }
.tile-empty { background: var(--surface); color: var(--text); }
.tile-empty .tile-sub, .tile-why { color: var(--text-muted); opacity: 1; }
.tile-art { position: absolute; right: -70px; top: -40px; width: 250px; height: 250px; max-width: none; color: var(--border); }
.tile-why { position: absolute; z-index: 2; left: var(--edge); right: 120px; bottom: 14px; font: 400 15px/20px var(--font); }
.tile:focus-visible { outline-offset: -3px; border-radius: 0; }
.strip-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin: 0; padding: 12px var(--edge) 0; font-size: var(--small); color: var(--text-muted); }
.strip-head strong { font-weight: 600; color: var(--text); }
.strip { list-style: none; margin: 0; padding: 4px 0 6px var(--edge); display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.strip::-webkit-scrollbar { display: none; }
.strip-ev { flex: none; }
.strip-ev a { display: flex; flex-direction: column; justify-content: flex-end; min-height: var(--tap); min-width: 92px; padding-right: 14px; color: var(--text); text-decoration: none; }
.strip-ev.has-pic a { padding-right: 0; width: 100px; margin-right: 2px; }
.strip-img { display: block; width: 100px; height: 66px; object-fit: cover; background: var(--surface); }
.strip-ev.has-pic:first-child .strip-img { border-radius: 7px 0 0 7px; }
.strip-t { display: flex; align-items: baseline; gap: 6px; font: 500 15px/20px var(--font); padding: 5px 0; }
.strip-t small { font: 400 15px/20px var(--font); color: var(--text-muted); }
.new-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; flex: none; }
.strip-note { margin: -2px 0 0; padding: 0 var(--edge) 10px; font-size: var(--small); color: var(--text-muted); }
.plan-note { margin: 18px 0 0; font-size: var(--small); color: var(--text-muted); }
.empty { padding: 8px var(--edge) 0; }
.empty h2 { font-size: 1.35rem; }
html[data-platform="android"] .cam + .cam { margin-top: 8px; }
html[data-platform="android"] .tile-name { font: 500 18px/24px var(--font); letter-spacing: .005em; }
html[data-platform="android"] .strip { gap: 8px; }
html[data-platform="android"] .strip-img, html[data-platform="android"] .strip-ev.has-pic:first-child .strip-img { border-radius: 8px; }
@media (min-width: 760px) {
  html[data-platform="web"] .cam-list { margin-left: 0; margin-right: 0; }
  html[data-platform="web"] .cam + .cam { margin-top: 28px; }
  html[data-platform="web"] .tile { border-radius: 6px; }
  html[data-platform="web"] .strip-head, html[data-platform="web"] .strip-note { padding-left: 0; padding-right: 0; }
  html[data-platform="web"] .strip { padding-left: 0; }
  html[data-platform="web"] .empty { padding-left: 0; padding-right: 0; }
}

/* ================= live view ================= */
.live-host { margin: 0 calc(-1 * var(--edge)); }
.live-name { margin: .4em 0; }
.live-wrap { position: relative; background: var(--bg); }
.stage { position: relative; background: #000; color: var(--on-pic); overflow: hidden; width: 100%; aspect-ratio: var(--ar, 16 / 9); min-height: 200px; max-height: 76dvh; }
.live-video, .stage-last { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.stage-last { filter: saturate(.3) brightness(.38) blur(1.2px); z-index: 1; }      /* stored picture: dimmed, never passed off as live */
.stage-top { position: absolute; z-index: 4; inset: 0 0 auto 0; display: flex; align-items: flex-start; gap: 2px; padding: calc(8px + env(safe-area-inset-top)) max(var(--edge), env(safe-area-inset-right)) 30px max(8px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.68) 62%, rgba(0,0,0,0) 100%); }
.stage-back { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--on-pic); border-radius: 50%; }
.stage-back .icon { width: 27px; height: 27px; }
.stage-head { flex: 1; min-width: 0; padding-top: 5px; }
.stage-head .live-name, html[data-platform] .stage-head h1.live-name { margin: 0; font: 700 26px/32px var(--font); letter-spacing: -.022em; color: var(--on-pic); }
.stage-meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font: 500 16px/21px var(--font); }
.stage-conn { font-weight: 400; font-size: 15px; opacity: .9; }
.rec { flex: none; display: inline-flex; align-items: center; gap: 6px; padding-top: 11px; font: 600 15px/20px var(--font); }
.stage-overlay { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding: 96px 24px 18px; text-align: center; color: var(--on-pic); background: rgba(0,0,0,.5); overflow: auto; }
.stage-overlay p { margin: 0; max-width: 34rem; font-size: 15px; line-height: 21px; }
.stage-overlay .stage-title { font: 600 20px/26px var(--font); letter-spacing: -.015em; }
.stage-overlay .stage-title .state { font-weight: 600; gap: 9px; }
.stage-seen { font: 500 16px/22px var(--font) !important; }
.stage-sub { opacity: .88; }
.stage-overlay .btn { margin-top: 6px; }
.stage-overlay .btn-secondary { color: var(--on-pic); border-color: var(--on-pic); }
.stage.is-stale { min-height: 330px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.25); border-top-color: var(--brand-ivory); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.live-ctl { display: flex; justify-content: space-around; gap: 4px; padding: 8px var(--edge) 2px; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 88px; min-height: 56px; padding: 6px 8px; background: none; border: 0; border-radius: var(--radius-md); color: inherit; font: 500 15px/20px var(--font); cursor: pointer; }
.ctl .icon { width: 28px; height: 28px; }
.ctl:disabled { opacity: .45; cursor: default; }
.live-ctl.is-dimmed .ctl:not(:last-child) { opacity: .45; }
.connline { color: var(--text-muted); font-size: var(--small); margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.tabpanel .motion { margin: 0 calc(-1 * var(--edge)); }
/* full screen, and a phone held sideways: the picture takes the whole screen, controls sit on it */
.live-wrap:fullscreen { display: flex; background: #000; color: var(--on-pic); }
.live-wrap:fullscreen .stage { flex: 1; aspect-ratio: auto; max-height: none; height: 100%; }
.live-wrap:fullscreen .live-ctl { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; padding: 44px 24px calc(10px + env(safe-area-inset-bottom)); justify-content: center; gap: 28px; background: linear-gradient(0deg, rgba(0,0,0,.84), rgba(0,0,0,.66) 60%, rgba(0,0,0,0)); }
.live-wrap:fullscreen .stage-overlay { padding-bottom: 110px; }
@media (orientation: landscape) and (max-height: 500px) {
  .view-immersive .appbar { display: none; }
  .view-immersive .page { padding-top: 0; max-width: none; }
  .live-wrap { display: flex; background: #000; color: var(--on-pic); height: 100dvh; }
  .live-wrap .stage { flex: 1; aspect-ratio: auto; max-height: none; min-height: 0; height: 100%; }
  .live-wrap .live-ctl { position: absolute; z-index: 6; right: max(12px, env(safe-area-inset-right)); top: 6px; padding: 0; gap: 0; }
  .live-wrap .ctl { min-width: 76px; }
  .live-wrap .stage-top { padding-right: 250px; }
  .live-wrap .rec { position: absolute; right: max(var(--edge), env(safe-area-inset-right)); bottom: 6px; }
  .stage-overlay { padding-top: 70px; justify-content: center; }
}
@media (min-width: 760px) {
  html[data-platform="web"] .live-host { margin: 8px 0 0; }
  html[data-platform="web"] .live-wrap:not(:fullscreen) .stage { border-radius: 8px; }
  html[data-platform="web"] .tabpanel .motion { margin: 0; }
  html[data-platform="web"] .stage-overlay { justify-content: center; padding-top: 110px; }
}

/* tabs under the picture: segmented control (iOS), underlined tabs (Android, web) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); margin: 10px 0 12px; overflow-x: auto; }
.tab { min-height: var(--tap); padding: 8px 18px; font: inherit; font-weight: 600; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel:focus-visible { outline-offset: 4px; }
html[data-platform="ios"] .tabs { border: 0; background: var(--surface2); padding: 2px; border-radius: 9px; gap: 0; margin: 10px 0 14px; }
html[data-platform="ios"] .tab { flex: 1; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 7px; font: 500 15px/20px var(--font); color: var(--text); }
html[data-platform="ios"] .tab[aria-selected="true"] { background: var(--seg-thumb); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
html[data-platform="android"] .tabs { gap: 0; margin: 4px calc(-1 * var(--edge)) 12px; }
html[data-platform="android"] .tab { flex: 1; font: 500 15px/20px var(--font); letter-spacing: .01em; }
html[data-platform="android"] .tab[aria-selected="true"] { color: var(--accent); border-bottom-width: 3px; }

/* ================= clips timeline ================= */
.storage-summary p { margin: .3em 0; }
.timeline .day { color: var(--text-muted); font-size: var(--small); font-weight: 600; border-bottom: 1px solid var(--hair); padding-bottom: 6px; margin-top: 1.6em; }
.event-list { list-style: none; padding: 0; margin: 0; }
.event { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: .5px solid var(--hair); }
.event-time { font-weight: 600; min-width: 4.5rem; }
.event-main { flex: 1; min-width: 8rem; }
.event-status { color: var(--text-muted); }
.event-icon { width: 1.4em; text-align: center; }
.icon-live { color: var(--status-live); } .icon-paused { color: var(--status-paused); } .icon-offline, .icon-stopped { color: var(--status-offline); }
.event-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.event .msg { flex-basis: 100%; margin: 4px 0 0; }
.player { flex-basis: 100%; min-width: 0; }
.player:empty { display: none; }
.clip-video { width: 100%; max-width: 100%; max-height: 60vh; background: #000; border-radius: var(--radius-sm); margin-top: 6px; }

/* ================= plans (markup in plan.js) ================= */
.plan-current { margin: 0 0 4px; }
.plans-title { margin: 32px 0 0; }
.view:not(.view-immersive):has(> .page-wide) .appbar-row { max-width: calc(1040px - 2 * var(--edge)); }   /* wide screens: keep the back link over the content */
.plan-reason { margin: 8px 0 4px; }
.plan-reason p { margin: 0 0 8px; }
/* Monthly / Yearly switch: two native radios presented as one segmented control */
.period { display: inline-flex; gap: 0; border: 1px solid var(--control-border); border-radius: var(--radius-pill); padding: 3px; margin: 14px 0 4px; }
.seg-opt { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: var(--radius-pill); cursor: pointer; font-weight: 600; color: var(--text-muted); }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt:has(input:checked) { background: var(--primary); color: var(--on-primary); }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg-save { font-weight: 500; }
.plan-grid { display: grid; gap: 16px; margin-top: 12px; }
@media (min-width: 640px) { .plan-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }
.card.plan, html[data-platform] .card.plan { margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; }
.card.plan.plan-best, html[data-platform] .card.plan.plan-best { border: 2px solid var(--accent-strong); padding: 19px; }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.card.plan .plan-head h2, html[data-platform="android"] .card.plan .plan-head h2 { margin: 0; font: 700 1.35rem/1.25 var(--font); color: var(--text); letter-spacing: -.012em; }
.plan-head .pill { margin: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font-size: var(--small); font-weight: 700; }
.plan-desc { margin: 6px 0 0; color: var(--text-muted); }
.plan-price { margin: 14px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; }
.plan-amount { font: 700 2.25rem/1.1 var(--font); letter-spacing: -.02em; }
.plan-per { color: var(--text-muted); font-size: 1.05rem; }
.plan-save { margin: 4px 0 12px; min-height: 1.5em; color: var(--accent-strong); font-weight: 600; font-size: var(--small); }
.plan-buy { margin: 4px 0 0; min-height: 50px; font-size: 1.05rem; }
.card.plan .plan-buy:disabled { opacity: 1; background: transparent; color: var(--text-muted); border: 1px dashed var(--control-border); }
.plan-views { margin: 10px 0 0; font-weight: 600; }
.card.plan .hint { margin: 6px 0 0; }
.card.plan h3 { margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 1rem; }
.plan-gets { list-style: none; padding: 0; margin: 0; }
.plan-gets li { position: relative; padding: 3px 0 3px 26px; }
.plan-gets li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 10px; height: 5px; border-left: 2px solid var(--accent-strong); border-bottom: 2px solid var(--accent-strong); transform: rotate(-45deg); }
.card.owned { margin-top: 12px; }
.plan-more { display: grid; gap: 0 32px; }
@media (min-width: 900px) { .plan-more { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; } }
/* "Get the app" (store-links.js): plain store-name buttons, never the stores' badge artwork */
.get-app { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--hair); }
.get-app > h2, .get-app > h3 { font-size: 1.1rem; margin: 0 0 .5em; }
.get-app-body { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.get-app-body > div { flex: 1 1 220px; }
.get-app .store-qr { margin: 0; width: 132px; padding: 8px; border-radius: 12px; }
.get-app-soon { font-weight: 600; color: var(--text); }
.store-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.store-btn { min-width: 140px; }
.store-btn:disabled { border-style: dashed; }
.new-here .get-app { border-top: 0; padding-top: 0; margin-top: 12px; }

/* ================= My cameras, empty account: "How it works" (cameras.js) ================= */
.how .lead { margin-top: 0; max-width: 60ch; }
.how-steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; counter-reset: none; }
@media (min-width: 760px) { .how-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.how-step { display: flex; flex-direction: column; align-items: flex-start; padding: 18px 20px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.how-step h3 { margin: 12px 0 4px; font-size: 1.1rem; }
.how-step p { margin: 0 0 14px; color: var(--text-muted); flex: 1; }
.how-step p strong { color: var(--text); }
.how-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent-strong); color: var(--accent-strong); font-weight: 700; }
.how-step.is-done .how-num { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.how-link { display: inline-flex; align-items: center; min-height: var(--tap); }
.notice-return { font-size: 1.05rem; }
.plan-restore { margin: 12px 0; }
.web-subscribe { margin: 8px 0 16px; }
.web-subscribe .btn-link { font-size: inherit; padding: 6px 4px; }
.web-choices { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.web-choices[hidden] { display: none; }
.web-choices .hint { flex-basis: 100%; margin: 0 4px; }

/* ================= pairing ================= */
.pair-sheet { text-align: center; max-width: 26rem; margin: 0 auto; padding-top: 8px; }
.pair-sheet h2 { font: 700 26px/32px var(--font); letter-spacing: -.022em; margin: 0; }
.pair-how { margin: 8px 0 0; color: var(--text-muted); text-wrap: balance; }
.pair-how strong { color: var(--text); font-weight: 600; }
.qr-wrap { margin: 22px auto 0; width: 232px; max-width: 100%; background: var(--brand-ivory); padding: 12px; border-radius: 16px; }
.qr { width: 100%; height: auto; display: block; border-radius: 4px; }
.pair-code { margin: 20px 0 0; font: 600 clamp(1.9rem, 9.5vw, 2.4rem)/1.15 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.expire { margin: 14px auto 0; width: 232px; max-width: 100%; }
.expire-track { height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.expire-bar { display: block; height: 100%; width: 100%; background: var(--accent); transition: width 1s linear; }
.countdown { margin: 8px 0 0; font-size: var(--small); color: var(--text-muted); }
.countdown.expired { color: var(--danger); }
.pair-sheet .msg { border: 0; padding: 0; margin: 14px 0 0; color: var(--text-muted); }
.pair-sheet .hint { margin: 14px 0 12px; }
.success h2 { color: var(--status-live); }
.sas { text-align: center; }
/* iOS: the add-camera screen presents as a sheet over the app */
html[data-platform="ios"] body:has(.view-sheet) { background: #000; }
html[data-platform="ios"] .view-sheet { margin-top: calc(10px + env(safe-area-inset-top)); min-height: calc(100dvh - 10px - env(safe-area-inset-top)); background: var(--surface); border-radius: 14px 14px 0 0; position: relative; }
html[data-platform="ios"] .view-sheet::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--control-border); opacity: .6; }
html[data-platform="ios"] .view-sheet .appbar { padding-top: 14px; }
html[data-platform="ios"] .view-sheet .appbar-row { grid-template-rows: 44px; grid-template-columns: 1fr auto 1fr; }
html[data-platform="ios"] .view-sheet .back { margin-left: -4px; }
html[data-platform="ios"] .view-sheet .back .icon { display: none; }
html[data-platform="ios"] .view-sheet .appbar-title { grid-row: 1; grid-column: 2; font: 600 17px/22px var(--font); letter-spacing: -.01em; padding: 0; }
html[data-platform="ios"] .view-sheet .group { background: var(--surface2); }
html[data-platform="ios"] .view-sheet input[type=text] { background: var(--bg); }

/* ================= first screen in the phone apps: two actions ================= */
.chooser { display: flex; flex-direction: column; min-height: calc(100dvh - env(safe-area-inset-top)); padding-top: 12vh; }
.chooser .chooser-title, html[data-platform] .chooser h1.chooser-title { font: 700 clamp(30px, 8.6vw, 38px)/1.12 var(--font); letter-spacing: -.03em; margin: 0; max-width: 11em; text-wrap: balance; }
.chooser .lead { margin: 14px 0 0; font-size: var(--body); }
.choices { margin: 28px calc(-1 * var(--edge)) 0; border-top: .5px solid var(--hair); }
.choice { display: flex; align-items: center; gap: 16px; padding: 18px var(--edge); min-height: 88px; color: var(--text); text-decoration: none; border-bottom: .5px solid var(--hair); }
.choice-icon { flex: none; color: var(--accent); }
.choice-icon .icon { width: 34px; height: 34px; stroke-width: 1.4; }
.choice-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-text strong { font: 600 20px/25px var(--font); letter-spacing: -.015em; }
.choice-hint { color: var(--text-muted); font-size: var(--small); line-height: 1.35; }
.choice-go { color: var(--text-muted); width: 20px; height: 20px; }
.chooser .footer { margin-top: auto; padding-top: 32px; }

/* ================= camera device ================= */
.indicator { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 14px; flex-wrap: wrap; margin: 0 calc(-1 * var(--edge)); padding: calc(12px + env(safe-area-inset-top)) max(var(--edge), env(safe-area-inset-right)) 12px max(var(--edge), env(safe-area-inset-left)); background: var(--bg); color: var(--text); border-bottom: .5px solid var(--hair); }
html[data-platform="web"] .indicator { padding-top: 12px; }
.indicator .back { flex: none; }
.indicator.on-pic .back { color: inherit; }
.indicator.on-pic { background: #000; color: var(--on-pic); border-bottom-color: transparent; }
.ind-main { display: flex; flex-direction: column; min-width: 0; }
.ind-line { display: flex; align-items: center; gap: 9px; font: 600 20px/25px var(--font); letter-spacing: -.01em; }
.ind-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--m-offline); flex: none; }
.ind-where { font: 400 15px/20px var(--font); opacity: .88; padding-left: 21px; }
.ind-where:empty { display: none; }
.ind-viewers { display: inline-flex; align-items: center; gap: 6px; font: 500 15px/20px var(--font); padding-top: 3px; }
.ind-viewers .icon { width: 20px; height: 20px; }
.ind-on .ind-dot, .ind-rec .ind-dot, .ind-warn .ind-dot { background: var(--m-rec); }
.ind-starting .ind-dot { background: var(--m-rec); opacity: .6; }
.ind-paused .ind-dot { width: 11px; height: 13px; border-radius: 0; background: transparent; border-left: 4px solid var(--m-paused); border-right: 4px solid var(--m-paused); }
.camdev { margin: 0 calc(-1 * var(--edge)); }
.finder { position: relative; background: #000; color: var(--on-pic); overflow: hidden; aspect-ratio: 16 / 9; min-height: 440px; max-height: 72dvh; width: 100%; }
html[data-platform="ios"] .finder, html[data-platform="android"] .finder { aspect-ratio: auto; max-height: none; height: calc(100dvh - 74px - env(safe-area-inset-top)); min-height: 380px; }
.preview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
html[data-platform="ios"] .preview, html[data-platform="android"] .preview { object-fit: cover; }
.finder .scrim-t { position: absolute; inset: 0 0 auto 0; height: 60px; background: linear-gradient(180deg, #000, rgba(0,0,0,0)); z-index: 1; }
.finder .scrim-b { position: absolute; inset: auto 0 0 0; height: 250px; max-height: 80%; background: linear-gradient(0deg, rgba(0,0,0,.86), rgba(0,0,0,.66) 62%, rgba(0,0,0,0)); z-index: 1; }
.cam-note { position: absolute; z-index: 2; left: 24px; right: 24px; bottom: calc(126px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font: 400 15px/20px var(--font); opacity: .92; }
.cam-ctl { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: clamp(8px, 6vw, 40px); }
.ctl-ring { min-width: 92px; }
.ctl-ring .ctl-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--on-pic); }
@supports (color: color-mix(in srgb, red, blue)) { .ctl-ring .ctl-icon { border-color: transparent; background: color-mix(in srgb, var(--brand-ivory) 18%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); } }
.ctl-ring.ctl-main .ctl-icon { background: var(--on-pic); color: var(--brand-navy); border-color: var(--on-pic); }
.start-box { padding: 4px 0 8px; }
.checks { list-style: none; padding: 0; margin: 0; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: .5px solid var(--hair); }
.check-item p { margin: 2px 0 0; color: var(--text-muted); font-size: var(--small); }
.check-item .badge { min-width: 5.6rem; padding-top: 2px; }
.scan-box { margin-top: 8px; }
.scan-video { width: 100%; max-height: 50vh; background: #000; border-radius: var(--radius-sm); }
.perm-help ol { padding-left: 1.4em; }
.meter { position: relative; height: 22px; border-radius: 11px; background: var(--surface2); border: 1px solid var(--control-border); overflow: hidden; margin: 12px 0; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--primary); transition: width .2s; }
.meter-over .meter-fill { background: var(--status-recording); }
.meter-mark { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--text); left: 50%; }
.motion-flash { min-height: 1.6em; font-weight: 700; font-size: 1.1rem; color: var(--status-recording); }
.motion-flash.on { animation: flash .5s ease-in-out 2; }
@keyframes flash { 50% { opacity: .3; } }
/* Motion zones: 16×9 grid over the camera picture. Shaded (hatched) cells are ignored; cells light up where the picture is changing. */
.zone-stage { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: calc(60vh * 16 / 9); margin: 12px auto; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.zone-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }   /* fill: matches the 160×90 frame the detector sees */
.zone-grid { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(9, 1fr); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.zone-row { display: grid; grid-template-columns: repeat(16, 1fr); }
.zone-cell { position: relative; box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--brand-ivory) 35%, transparent); }
.zone-cell::before { content: ""; position: absolute; inset: 0; background: var(--status-recording); opacity: var(--heat, 0); transition: opacity .15s; }
.zone-ignored::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--brand-navy) 80%, transparent) 0 4px, color-mix(in srgb, var(--brand-navy) 45%, transparent) 4px 8px); }
.zone-ignored.zone-hot::before { opacity: calc(var(--heat, 0) * .5); }
.zone-cell:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 0; z-index: 1; }
.zone-summary { font-weight: 600; margin: .4em 0; }

/* dim mode: near-black; a thin clock with a small dim red dot and the status word, moved every minute.
   Kept deliberately dark, still readable (about 4.6:1 on black); the indicator is never removed. */
.dim { position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; background: #000; border: 0; margin: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; border-radius: 0; color: var(--brand-ivory); }
.dim:focus-visible { outline: none; }
.dim-box { position: absolute; display: flex; flex-direction: column; gap: 8px; max-width: 80vw; transition: left 1.2s ease, top 1.2s ease; }
.dim-clock { font: 300 54px/58px var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; opacity: .48; }
.dim-line { display: flex; align-items: center; gap: 8px; font: 500 15px/20px var(--font); }
.dim-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-recording); opacity: .62; flex: none; }
.dim-paused { background: transparent; border: 2px solid var(--status-paused); }
.dim-off { background: var(--status-offline); }
.dim-text { opacity: .52; }
.dim-hint { position: absolute; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; font-size: 15px; opacity: .48; }
/* Dim mode keeps the preview element alive (so frames keep flowing for motion detection) but invisible. */
.preview-hidden { position: fixed !important; left: 0; top: 0; width: 2px !important; height: 2px !important; opacity: 0; pointer-events: none; }
@media (min-width: 760px) {
  html[data-platform="web"] .camdev, html[data-platform="web"] .indicator { margin-left: 0; margin-right: 0; }
  html[data-platform="web"] .indicator { padding-left: 16px; padding-right: 16px; }
  html[data-platform="web"] .indicator:not(.on-pic) { padding-left: 0; padding-right: 0; }
  html[data-platform="web"] .indicator.on-pic { border-radius: 8px 8px 0 0; }
  html[data-platform="web"] .finder { border-radius: 0 0 8px 8px; }
}

/* ================= dialogs ================= */
.backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .16s ease-out; }
.dialog { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 30rem; max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.dialog h2 { font-size: 1.25rem; }
.dialog-body ul { padding-left: 1.2em; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog .pair-code { text-align: center; margin: 10px 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
/* iOS: sheet from the bottom edge, full-width stacked actions */
html[data-platform="ios"] .backdrop { align-items: flex-end; padding: 0; }
html[data-platform="ios"] .dialog { max-width: none; border-radius: 14px 14px 0 0; padding: 26px 20px calc(18px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 44px - env(safe-area-inset-top)); animation: rise .22s ease-out; position: relative; }
html[data-platform="ios"] .dialog::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--control-border); opacity: .6; }
html[data-platform="ios"] .dialog h2 { font: 700 22px/28px var(--font); letter-spacing: -.02em; }
html[data-platform="ios"] .dialog-actions { flex-direction: column-reverse; flex-wrap: nowrap; }
html[data-platform="ios"] .dialog-actions .btn { width: 100%; }
/* Android: Material dialog with text buttons */
html[data-platform="android"] .backdrop { padding: 24px; }
html[data-platform="android"] .dialog { border-radius: 28px; padding: 24px; max-width: 35rem; background: var(--surface2); }
html[data-platform="android"] .dialog h2 { font: 400 24px/32px var(--font); letter-spacing: 0; }
html[data-platform="android"] .dialog-actions .btn { border-color: transparent; background: none; color: var(--accent); padding: 10px 12px; }
html[data-platform="android"] .dialog-actions .btn-danger { color: var(--danger); }

/* ================= website homepage: editorial, one drawn scene ================= */
.view-home { overflow-x: clip; }
.view-home .appbar-web { min-height: 88px; }
.home { max-width: 1240px; padding-top: 0; }
.hero { display: grid; gap: 28px; padding: 20px 0 0; }
.hero h1 { font-size: clamp(3rem, 6.2vw + .9rem, 5.25rem); line-height: 1; letter-spacing: -.04em; margin: 0; text-wrap: balance; }
.lede { margin: 24px 0 0; max-width: 30rem; font-size: clamp(1.15rem, 1.1vw + .9rem, 1.45rem); line-height: 1.42; color: var(--text-muted); letter-spacing: -.008em; }
.hero-stage { margin: 0; background: var(--brand-ivory); color: var(--brand-navy); border-radius: 20px; overflow: hidden; }
.hero-stage img { display: block; width: 100%; height: auto; max-width: 640px; margin: 0 auto; }
.hero-stage figcaption { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 4px 24px 24px; }
.cap { margin: 0; font-size: var(--small); line-height: 1.4; border-top: 1px solid var(--brand-navy); padding-top: 10px; }
.cap strong { display: block; font-weight: 600; }
.hero-stage .claim-tag { color: var(--brand-navy); border-color: var(--brand-navy); margin: 4px 0 0; }
.story { padding: clamp(72px, 11vw, 150px) 0 0; }
.story h2 { font-size: clamp(2.1rem, 3.4vw + 1rem, 3.75rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; margin: 0; max-width: 12em; text-wrap: balance; }
.story-lede { margin: 26px 0 0; max-width: 30rem; font-size: 1.18rem; line-height: 1.55; color: var(--text-muted); }
.ledger { margin: 40px 0 0; max-width: 34rem; border-top: 1px solid var(--text); }
.ledger > div { display: flex; gap: 8px 24px; padding: 16px 0 17px; border-bottom: 1px solid var(--hair); font-size: 1.05rem; line-height: 1.5; }
.ledger dt { width: 10.5rem; flex: none; font-weight: 600; }
.ledger dd { margin: 0; color: var(--text-muted); }
.ledger-strong dd { color: var(--text); }
.pending-list { list-style: none; margin: 0; padding: 0; }
.pending-list li { padding: 3px 0; }
.story-band { margin: 0 calc(50% - 50vw); padding: clamp(72px, 9vw, 130px) calc(50vw - 50%); background: var(--brand-navy); color: var(--brand-ivory); }
.story-headrow { display: grid; gap: 24px 48px; align-items: end; }
.story-headrow p { margin: 0; max-width: 26rem; font-size: 1.1rem; line-height: 1.55; opacity: .82; }
.states { margin-top: clamp(40px, 6vw, 84px); display: grid; gap: 28px 46px; }
.state-fig { border-top: 1px solid var(--brand-ivory); padding-top: 18px; --m-live: var(--brand-teal); }
.state-fig h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 600 1.4rem/1.25 var(--font); letter-spacing: -.015em; }
.state-fig .mark { width: 11px; height: 11px; }
.state-fig .mark-paused { height: 13px; }
.state-fig p { margin: 0; font-size: 1.02rem; line-height: 1.5; opacity: .82; }
.story-band .mark-live { background: var(--brand-teal); } .story-band .mark-paused { border-color: var(--brand-ivory); } .story-band .mark-offline { border-color: var(--brand-ivory); }
.story-3 { display: grid; gap: 8px 64px; }
.story-3 .story-txt > p:last-child { color: var(--text-muted); max-width: 30rem; margin-top: 18px; }
.story-4 { margin-top: clamp(72px, 11vw, 150px); padding-top: 56px; border-top: 1px solid var(--text); display: grid; gap: 24px 64px; }
.story-4 h2 { font-size: clamp(2.6rem, 5.4vw + 1rem, 6rem); line-height: .96; letter-spacing: -.045em; max-width: 7em; }
.story-side { max-width: 26rem; }
.story-side p { margin: 0 0 14px; color: var(--text-muted); font-size: 1.1rem; line-height: 1.55; }
.story-side .small { font-size: 1rem; }
.more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 1.1rem; color: var(--accent); text-decoration: none; border-bottom: 1.5px solid var(--accent); padding: 10px 0 2px; }
.site-footer { margin-top: clamp(72px, 11vw, 150px); padding-top: 40px; border-top: 1px solid var(--hair); }
.footer-tagline { margin: 0 0 10px; color: var(--text); font: 600 clamp(1.25rem, 1.2vw + 1rem, 1.6rem)/1.25 var(--font); letter-spacing: -.02em; }
@media (min-width: 640px) { .states { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 40px; align-items: start; padding-top: 28px; }
  .hero-copy { padding-top: 64px; }
  .story-headrow { grid-template-columns: 1.4fr 1fr; }
  .story-3 { grid-template-columns: 1fr 1fr; align-items: end; }
  .story-3 .ledger { margin-top: 0; }
  .story-4 { grid-template-columns: 1.3fr 1fr; }
  .story-side { padding-top: 12px; }
}
@media (max-width: 520px) {
  .ledger > div { flex-direction: column; gap: 2px; }
  .ledger dt { width: auto; }
  .hero-stage { margin: 0 calc(-1 * var(--edge)); border-radius: 0; }
}

/* ================= generated policy and help pages ================= */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.doc table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.doc th, .doc td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--border); background: var(--surface); }
.doc code { background: var(--surface2); padding: 1px 4px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .spinner { border-top-color: rgba(255,255,255,.25); border-right-color: var(--brand-ivory); }
  .zone-cell::before { transition: none; }
}

/* Phone apps: an opaque strip behind the status bar so scrolled content never shows under the clock (not on the immersive live/camera screens). */
html[data-platform="ios"] .view:not(.view-immersive)::before, html[data-platform="android"] .view:not(.view-immersive)::before { content: ""; position: fixed; z-index: 50; inset: 0 0 auto 0; height: env(safe-area-inset-top); background: var(--bg); pointer-events: none; }

/* ---- "What is this phone?" (one decision per screen) and the share button ---- */
.this-device.chooser { padding-top: 8vh; }
button.choice { width: 100%; background: none; border: 0; border-bottom: .5px solid var(--hair); font: inherit; text-align: left; cursor: pointer; }
.choice-big { min-height: 108px; }
.choice-big .choice-text strong { font-size: 24px; line-height: 30px; }
.choice-big .choice-icon .icon { width: 42px; height: 42px; }
button.choice:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.this-device .btn-block { margin-top: 14px; }
.this-device .same-account { margin: 14px 0 0; }
.this-device .hint { margin-top: 18px; }
.share { margin-top: 16px; }
.share .msg { margin-top: 8px; }
.pair-sheet .pair-or { margin: 18px 0 0; color: var(--text-muted); font-size: var(--small); }
.pair-ways { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: way; text-align: left; }
.pair-ways > li { counter-increment: way; padding: 16px 0; border-top: .5px solid var(--hair); }
.pair-ways h3 { margin: 0 0 4px; font: 600 18px/24px var(--font); }
.pair-ways h3::before { content: counter(way) ". "; color: var(--accent); }
.pair-ways p { margin: 0; color: var(--text-muted); }
.pair-ways .qr-wrap { margin-top: 14px; }
.pair-ways .pair-code { margin: 10px 0 0; color: var(--text); text-align: center; }
.pair-ways .share { margin-top: 12px; }
.this-device .have-code { margin: 22px 0 0; }
.this-device .have-code .btn { margin-top: 10px; }
.pair-ways { margin-top: 10px; }
.pair-ways > li { padding: 12px 0; }
.pair-ways .qr-wrap { margin-top: 10px; width: 190px; padding: 10px; }
.pair-ways .share { margin-top: 8px; }
.pair-ways .pair-code { margin-top: 6px; }
.pair-sheet h2 { margin-bottom: 0; }

/* Pairing: role cards are the focus, not the empty space around them. */
.chooser:not(.this-device) { padding-top: clamp(24px, 5vh, 60px); }
.chooser .choices { display: grid; gap: 14px; margin: 24px 0; }
.chooser:not(.this-device) .choice { margin: 0; min-height: 122px; border: 1px solid var(--hair); border-radius: 18px; padding: 18px; }
.chooser:not(.this-device) .choice:first-child { background: var(--panel, transparent); }
.chooser .legacy-pair { align-self: center; padding: 12px; }
.setup-steps { line-height: 1.55; margin-block: 20px; padding-inline-start: 25px; }
.setup-steps li + li { margin-top: 8px; }
/* Android's generic page heading grows inside flex containers; not on this screen. */
html[data-platform="android"] .chooser:not(.this-device) > h1.chooser-title { flex: 0 0 auto; }
.chooser:not(.this-device) .choices { border-top: 0; }


/* First-run buttons occupy the remaining screen; only the support links sit below. */
.chooser.role-start { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.role-start .role-choices {
  flex: 1 0 auto; display: grid; grid-template-rows: repeat(2, minmax(104px, 1fr));
  border: 0; gap: 12px; margin: 22px 0 8px;
}
.role-start .role-choices > .choice {
  min-height: 104px; margin: 0; padding: clamp(14px, 4vw, 26px);
  border: 1px solid var(--control-border); border-radius: 18px;
  background: var(--surface); text-align: left;
}
.role-start .role-choices > .choice-camera { background: var(--surface2); }
.role-start .choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-start .choice-text strong { font-size: clamp(19px, 5.4vw, 28px); line-height: 1.15; }
.role-start .choice-text { gap: 6px; }
.role-start .choice-go { flex: none; }
.chooser.role-start .legacy-pair { padding: 4px 8px; }
.chooser.role-start .footer { margin-top: 0; padding-top: 4px; text-align: center; }
.hero.role-start .hero-copy { display: flex; flex-direction: column; min-width: 0; }
.hero.role-start .legacy-pair { align-self: flex-start; padding-block: 6px; }
@media (max-width: 839px) {
  .hero.role-start .hero-copy { min-height: calc(100dvh - 108px - env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .role-start .choice { gap: 10px; }
  .role-start .choice-icon .icon { width: 32px; height: 32px; }
}

/* Keep account access beside the device instructions without shrinking the touch target. */
.role-start .role-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.role-start .role-intro > p { flex: 1 1 auto; min-width: 0; margin: 0; }
.role-start .role-intro .account-entry { flex: 0 0 auto; }
.role-start .role-intro .account-entry .btn { min-height: 44px; padding: 8px 12px; white-space: nowrap; }
@media (max-width: 440px) {
  .chooser.role-start .role-intro { gap: 8px; }
  .chooser.role-start .role-intro .lead { font-size: clamp(14px, 4vw, 17px); }
  .chooser.role-start .role-intro .account-entry .btn { font-size: 14px; padding-inline: 10px; }
}

/* ---- Running camera: its QR code and short code over the preview (build 22) ---- */
.pair-overlay { position: absolute; z-index: 4; top: 84px; left: 50%; transform: translateX(-50%); width: min(248px, calc(100% - 32px)); background: var(--brand-ivory, #F6F3EC); color: #0B1726; border-radius: 16px; padding: 12px 14px 8px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.pair-overlay p { margin: 0; color: #0B1726; font-size: var(--small, 14px); line-height: 1.35; }
.pair-overlay .qr-wrap { margin: 8px auto 0; width: 168px; padding: 6px; background: #fff; border-radius: 10px; }
.pair-overlay .pair-code { margin: 6px 0 0; font-size: 1.55rem; letter-spacing: .06em; color: #0B1726; }
.pair-overlay .pair-count { margin-top: 2px; opacity: .8; }
.pair-overlay .btn-link { color: #0B4F4A; min-height: 36px; }
.pair-overlay .btn-primary { margin: 8px auto 0; }
.pair-toggle { position: absolute; z-index: 4; top: 84px; right: 12px; }
.link-camera { margin-top: 24px; }
.link-camera h2 { margin: 0 0 10px; }
.pair-overlay strong { color: inherit; }
.pair-overlay.pair-inline { position: static; transform: none; margin: 12px auto 0; box-shadow: none; }
.pair-toggle.pair-inline { position: static; display: block; margin: 12px auto 0; }
