/* All Paws TV: dark by default (a TV at night). Tokens first, then type scale, then pieces.
 * Written for old devices too (iOS 9/10 iPad Safari, Safari 15, TV browsers): no `inset`, no flex `gap`, no `aspect-ratio`,
 * no logical properties. Where left/right matters, a [dir=rtl] rule flips it. */
:root {
  color-scheme: dark;
  --bg: #0b0e14; --surface: #131825; --surface-2: #1b2232; --line: #2a3347; --line-soft: #1f2738;
  --text: #eef1f7; --muted: #9aa5bb; --faint: #8a94aa;
  --accent: #ffb454; --accent-ink: #20150a; --blue: #7aa7ff; --ok: #5fd6a0; --warn: #ffcf6b; --bad: #ff8080;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 20px; --t-xl: 28px; --t-2xl: 40px; --t-3xl: 64px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --safe-b: 0px; --safe-t: 0px;
}
@supports (padding: constant(safe-area-inset-bottom)) { :root { --safe-b: constant(safe-area-inset-bottom); --safe-t: constant(safe-area-inset-top); } }
@supports (padding: env(safe-area-inset-bottom)) { :root { --safe-b: env(safe-area-inset-bottom); --safe-t: env(safe-area-inset-top); } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0b0e14; background: var(--bg); color: #eef1f7; color: var(--text); font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--t-xl); line-height: 1.15; letter-spacing: -.01em; font-weight: 700; }
h2 { font-size: var(--t-lg); font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: var(--t-md); font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: var(--t-sm); } .xs { font-size: var(--t-xs); }
button, input, select { font: inherit; color: inherit; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke-width: 0; } .ic.sm { width: 18px; height: 18px; } .ic.lg { width: 32px; height: 32px; }
:focus { outline: 3px solid #7aa7ff; outline-offset: 2px; }
:focus:not(:focus-visible) { outline: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

#app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
.view { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.hidden { display: none !important; }

/* a vertical stack with even spacing (stands in for grid/flex gap on old browsers) */
.stack > * + * { margin-top: 16px; } .stack.tight > * + * { margin-top: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 52px; padding: 0 24px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; text-align: center; }
.btn > * + * { margin-left: 8px; } [dir=rtl] .btn > * + * { margin-left: 0; margin-right: 8px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.quiet { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.on { background: #2b2414; border-color: var(--accent); color: var(--accent); }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* pills: only for choosing ONE of several options (never for on/off) */
.chips { display: flex; flex-wrap: wrap; margin-bottom: -8px; }
.chips > * { margin: 0 8px 8px 0; } [dir=rtl] .chips > * { margin: 0 0 8px 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; }
.chip > * + * { margin-left: 6px; } [dir=rtl] .chip > * + * { margin-left: 0; margin-right: 6px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg { display: -webkit-box; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.seg button { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; min-height: 44px; margin: 0 2px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; padding: 0 6px; }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
/* real switches: for anything that is simply on or off */
.switch { position: relative; flex: none; width: 56px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: #3a4358; cursor: pointer; -webkit-transition: background .2s; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; -webkit-transition: -webkit-transform .2s; transition: transform .2s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true]::after { -webkit-transform: translateX(24px); transform: translateX(24px); }
[dir=rtl] .switch::after { left: auto; right: 4px; } [dir=rtl] .switch[aria-checked=true]::after { -webkit-transform: translateX(-24px); transform: translateX(-24px); }
.switch:focus { outline-offset: 3px; }

/* ---------- start + setup ---------- */
.center { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px 32px; padding-top: calc(32px + var(--safe-t)); padding-bottom: calc(32px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.center > * + * { margin-top: 24px; }
.brand { display: flex; align-items: center; color: var(--accent); font-weight: 750; font-size: var(--t-lg); }
.brand > * + * { margin-left: 12px; } [dir=rtl] .brand > * + * { margin-left: 0; margin-right: 12px; }
.brand .ic { width: 36px; height: 36px; fill: var(--accent); stroke: none; }
.lead { font-size: var(--t-lg); color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 20px; }
.card > * + * { margin-top: 16px; }
.card.flat { padding: 16px; }
.setup-grid > * + * { margin-top: 24px; }
@media (min-width: 900px) { .setup-grid { display: flex; align-items: flex-start; } .setup-grid > * + * { margin-top: 0; } .setup-grid > :first-child { width: 340px; flex: none; margin-right: 24px; } [dir=rtl] .setup-grid > :first-child { margin-right: 0; margin-left: 24px; } .setup-grid > :last-child { flex: 1 1 0; min-width: 0; } .center.wide { max-width: 1040px; } }
.qr { background: #fff; border-radius: var(--r-md); padding: 8px; width: 280px; height: 280px; max-width: 100%; margin: 0 auto; } .qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 340px) { .qr { width: 240px; height: 240px; } }
.code { font: 700 var(--t-xl)/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-align: center; white-space: nowrap; direction: ltr; }
.steps { margin-left: 0; margin-right: 0; margin-bottom: 0; padding: 0 0 0 1.2em; color: var(--muted); } [dir=rtl] .steps { padding: 0 1.2em 0 0; }
.steps li + li { margin-top: 8px; }
.status { display: flex; align-items: center; font-size: var(--t-sm); color: var(--muted); }
.status > * + * { margin-left: 8px; } [dir=rtl] .status > * + * { margin-left: 0; margin-right: 8px; }
.light { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.light.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 214, 160, .13); } .light.warn { background: var(--warn); } .light.bad { background: var(--bad); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 207, 107, .3); border-top-color: var(--warn); -webkit-animation: spin 1s linear infinite; animation: spin 1s linear infinite; flex: none; }
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } } @keyframes spin { to { transform: rotate(360deg); } }
label.row, .row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
label.row > * + *, .row > * + * { margin-left: 16px; } [dir=rtl] label.row > * + *, [dir=rtl] .row > * + * { margin-left: 0; margin-right: 16px; }
.row > span:first-child { min-width: 0; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; }
input[type=text], select { width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.choice { display: flex; } .choice button { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; min-height: 64px; margin: 0 4px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; font-size: var(--t-lg); cursor: pointer; } .choice button.on { border-color: var(--accent); color: var(--accent); background: #2b2414; }
.pairbox { font: 700 var(--t-lg)/1.2 ui-monospace, Menlo, monospace; letter-spacing: .12em; text-align: center; direction: ltr; text-transform: uppercase; }

/* ---------- her screen: 10-foot, almost nothing on it ---------- */
.stage { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #000; overflow: hidden; }
.stage .drift { position: absolute; top: -20%; right: -20%; bottom: -20%; left: -20%; background: radial-gradient(60% 60% at 30% 40%, #1d2b44, transparent 70%), radial-gradient(50% 50% at 75% 65%, #2a2236, transparent 70%), #0a0d14; -webkit-animation: drift 40s ease-in-out infinite alternate; animation: drift 40s ease-in-out infinite alternate; }
@-webkit-keyframes drift { to { -webkit-transform: translate(6%, -4%) scale(1.08); } } @keyframes drift { to { transform: translate(6%, -4%) scale(1.08); } }
.stage video, .stage canvas, .stage img.sent { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.stage video { opacity: 0; transition: opacity 2s ease; } .stage video.show { opacity: 1; } .stage video.dip { opacity: .35; transition-duration: .6s; }
.stage.gl video { opacity: .002 !important; }
.stage.fade { transition: opacity 1s; }
.hud { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 48px; display: flex; align-items: flex-end; justify-content: space-between; background: linear-gradient(transparent, rgba(0, 0, 0, .67)); opacity: 0; transition: opacity .5s; pointer-events: none; }
.hud > * + * { margin-left: 24px; } [dir=rtl] .hud > * + * { margin-left: 0; margin-right: 24px; }
.hud.on { opacity: 1; pointer-events: auto; }
.hud .t { font-size: var(--t-lg); font-weight: 650; text-shadow: 0 1px 8px #000; } .hud .c { color: #d6dbe7; font-size: var(--t-md); }
.hud .btn { min-height: 64px; font-size: var(--t-lg); }
.hud .acts { display: flex; } .hud .acts > * + * { margin-left: 12px; } [dir=rtl] .hud .acts > * + * { margin-left: 0; margin-right: 12px; }
.start-tap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .8); z-index: 5; }
.start-tap .btn { min-height: 88px; font-size: var(--t-xl); padding: 0 48px; }
/* the "Staying awake" light: small, but readable across a room, and bright enough to see in the dark */
.awake-light { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; padding: 10px 18px; border-radius: 999px; background: rgba(0, 0, 0, .72); border: 2px solid rgba(255, 255, 255, .55); font-size: 22px; font-weight: 700; color: #fff; opacity: 0; transition: opacity .5s; pointer-events: none; z-index: 4; }
[dir=rtl] .awake-light { right: auto; left: 16px; }
.awake-light > * + * { margin-left: 12px; } [dir=rtl] .awake-light > * + * { margin-left: 0; margin-right: 12px; }
.awake-light .light { width: 20px; height: 20px; } .awake-light .light.ok { box-shadow: 0 0 0 4px rgba(95, 214, 160, .35), 0 0 14px 2px rgba(95, 214, 160, .8); }
.hud.on ~ .awake-light, .awake-light.show { opacity: 1; }
.black { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #000; display: flex; align-items: center; justify-content: center; color: var(--faint); z-index: 6; }

/* ---------- sheets (menus, credits) ---------- */
.sheet-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, .67); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; max-height: 88%; overflow-y: auto; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 24px 24px 24px; padding-bottom: calc(24px + var(--safe-b)); border: 1px solid var(--line); }
.sheet > * + * { margin-top: 16px; } .sheet [data-body] > * + * { margin-top: 16px; }
@media (min-width: 900px) { .sheet-wrap { align-items: center; } .sheet { border-radius: var(--r-lg); } }
.sheet header { display: flex; justify-content: space-between; align-items: center; }
.iconbtn { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; padding: 0; }

/* ---------- the phone remote ---------- */
.remote { display: flex; flex-direction: column; height: 100%; max-width: 100%; overflow: hidden; }
.topbar { flex: none; max-height: 60%; overflow-y: auto; padding: 12px 16px; padding-top: calc(12px + var(--safe-t)); border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.topbar > * + * { margin-top: 8px; }
.topbar .row1 { display: flex; align-items: center; justify-content: space-between; min-height: 0; } .topbar .brand { font-size: var(--t-md); } .topbar .brand .ic { width: 24px; height: 24px; }
.linkbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-soft); font-size: var(--t-sm); }
.linkbar > .lead-in { display: flex; align-items: center; min-width: 0; } .linkbar > .lead-in > * + * { margin-left: 10px; } [dir=rtl] .linkbar > .lead-in > * + * { margin-left: 0; margin-right: 10px; }
.linkbar .btn { min-height: 40px; padding: 0 14px; font-size: var(--t-sm); border-radius: 12px; }
.linkbar.amber { background: #33270f; border-color: #5a4415; color: var(--warn); } .linkbar.red { background: #381616; border-color: #6a2626; color: var(--bad); } .linkbar.grey { background: var(--surface); color: var(--muted); }
.linkbar.green { color: var(--text); }
.banner { display: flex; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: #3a2a10; color: var(--warn); font-size: var(--t-sm); }
.banner > * + * { margin-left: 8px; } [dir=rtl] .banner > * + * { margin-left: 0; margin-right: 8px; }
.banner.bad { background: #3a1616; color: var(--bad); }
.checklist { margin-left: 0; margin-right: 0; margin-bottom: 0; padding: 0 0 0 1.2em; color: var(--text); font-size: var(--t-sm); } [dir=rtl] .checklist { padding: 0 1.2em 0 0; } .checklist li + li { margin-top: 6px; }
.pane { -webkit-box-flex: 1; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 16px 16px 32px; }
.pane > * + * { margin-top: 16px; }
.section > h2 { margin: 8px 0 12px; font-size: var(--t-lg); } .section > .card + .card { margin-top: 16px; }
.section + .section { margin-top: 32px; }
.tabs { flex: none; display: flex; border-top: 1px solid var(--line-soft); background: var(--bg); padding-bottom: var(--safe-b); }
.tabs button { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: none; border: 0; color: var(--faint); font-size: 13px; font-weight: 650; cursor: pointer; padding: 0 2px; }
.tabs button > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.tabs button.on { color: var(--accent); }
.viewer { position: relative; height: 0; padding-bottom: 56.25%; border-radius: var(--r-md); overflow: hidden; background: #000; border: 1px solid var(--line-soft); }
.viewer video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.viewer .tag { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .67); font-size: var(--t-xs); font-weight: 650; } [dir=rtl] .viewer .tag { left: auto; right: 10px; }
.viewer .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .73)); font-size: var(--t-sm); }
.under { font-size: var(--t-xs); color: var(--muted); }
/* equal columns that can shrink: nothing can push the phone screen wider than the phone */
.grid2, .grid3 { display: flex; margin: 0 -6px; } .grid2 > *, .grid3 > * { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; margin: 0 6px; }
@supports (display: grid) { .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 12px; margin: 0; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 12px; margin: 0; } .grid2 > *, .grid3 > * { margin: 0; } }
.big { min-height: 72px; flex-direction: column; font-size: var(--t-sm); padding: 0 4px; line-height: 1.2; }
.big > * + * { margin-left: 0; margin-top: 4px; } [dir=rtl] .big > * + * { margin-right: 0; }
.listrow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.listrow > * + * { margin-left: 12px; } [dir=rtl] .listrow > * + * { margin-left: 0; margin-right: 12px; }
.listrow > span:first-child { min-width: 0; overflow-wrap: break-word; word-wrap: break-word; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; } .meter i { display: block; height: 100%; background: var(--accent); width: 0; }
.rec { color: var(--bad); }
.volrow { display: flex; align-items: center; } .volrow .btn { -webkit-box-flex: 1; flex: 1 1 0; min-width: 0; } .volrow .btn + .btn { margin-left: 12px; } [dir=rtl] .volrow .btn + .btn { margin-left: 0; margin-right: 12px; }
#toast { position: fixed; left: 50%; bottom: 88px; bottom: calc(88px + var(--safe-b)); -webkit-transform: translateX(-50%) translateY(20px); transform: translateX(-50%) translateY(20px); background: #222a3c; border: 1px solid var(--line); padding: 10px 16px; border-radius: 22px; font-size: var(--t-sm); opacity: 0; transition: .3s; pointer-events: none; z-index: 40; max-width: 92%; text-align: center; }
#toast.on { opacity: 1; -webkit-transform: translateX(-50%); transform: translateX(-50%); pointer-events: auto; }
#toast button { margin-left: 12px; background: none; border: 0; color: var(--accent); font-weight: 700; font-size: var(--t-sm); cursor: pointer; padding: 6px 4px; } [dir=rtl] #toast button { margin-left: 0; margin-right: 12px; }
@media (prefers-reduced-motion: reduce) { .stage .drift, .spin { -webkit-animation: none; animation: none; } .stage video { transition-duration: .01s; } }

/* right-to-left: layout follows <html dir>; arrows that point somewhere are mirrored */
[dir=rtl] .ic.flip { -webkit-transform: scaleX(-1); transform: scaleX(-1); }
[dir=rtl] input[type=text] { unicode-bidi: plaintext; }
.btn.big { padding: 0 4px; }
.scanbox { position: relative; width: 100%; background: #000; border-radius: var(--r-md); overflow: hidden; height: 0; padding-bottom: 100%; } .scanbox video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.daybar { display: flex; height: 34px; align-items: stretch; } .daybar i { -webkit-box-flex: 1; flex: 1 1 0; border-radius: 2px; margin-right: 1px; } [dir=rtl] .daybar i { margin-right: 0; margin-left: 1px; }

/* camera / listening light: always visible on the home screen while the camera or room listening is on, for anyone */
.watch-light { display: none; right: auto; left: 16px; opacity: 1; }
[dir=rtl] .watch-light { left: auto; right: 16px; }
.watch-light.live { display: flex; }

/* who's watching badge and the one-tap heart (owner phone) */
.watchbadge { display: inline-flex; align-items: center; min-height: 40px; min-width: 52px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 650; cursor: pointer; }
.watchbadge > * + * { margin-left: 6px; } [dir=rtl] .watchbadge > * + * { margin-left: 0; margin-right: 6px; }
.viewer .heartbtn { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; padding: 0; }
[dir=rtl] .viewer .heartbtn { right: auto; left: 10px; }
.viewer .heartbtn.on { background: var(--accent); color: var(--accent-ink); }
.viewer .heartbtn.on .ic { fill: currentColor; }
