/* VFX Screen Generator — in-house styles, no third-party assets */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --panel-bg: rgba(10, 10, 10, 0.96);
  --panel-bg-solid: #0a0a0a;
  --panel-elevated: #101010;
  --panel-border: #1e1e1e;
  --panel-border-strong: #1e1e1e;
  --line-soft: #141414;
  --faint: #5c5c5c;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #00b140;
  --accent-hi: #00c94a;
  --accent-dim: #007a2c;
  --accent-soft: rgba(0, 177, 64, 0.16);
  --danger: #e0483e;
  --ok: #00b140;
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --tap: 44px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-size-base: 15px;
  --font-size-lg: 17px;
  --shadow-panel: none;
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.55);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 180ms;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --chroma-green: #00b140;
  --track-marker: #006c25;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  /* #010101, not #000: iOS samples this for the status-bar band and rejects pure black */
  background: #010101;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

::selection { background: var(--accent); color: #000; }

/* Immersive / fullscreen: fill the visual viewport edge-to-edge */
html.fullscreen-active,
html.fullscreen-active body,
body.immersive {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #010101;
}

body.immersive:not(.show-controls-fs) .controls,
body.immersive:not(.show-controls-fs) .reveal-fab,
html.fullscreen-active body:not(.show-controls-fs) .controls,
html.fullscreen-active body:not(.show-controls-fs) .reveal-fab {
  display: none !important;
}

#chrome-collapse-spacer {
  position: absolute;
  left: 0;
  width: 1px;
  height: 0;
  pointer-events: none;
  opacity: 0;
}

/* ===== Stage ===== */
.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  /* #010101, not #000 — iOS rejects pure black for the status-bar band */
  background: #010101;
}

html.fullscreen-active .stage,
body.immersive .stage {
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: -webkit-fill-available;
}

/* Solid / tracking plates: paint under status bar + into browser chrome area.
   .stage must match the plate — iOS samples the top fixed element's background
   for the status-bar band (same pattern as phone-edge). */
html.solid-plate,
html.solid-plate body,
body.solid-plate {
  background: var(--solid-plate-bg, #010101) !important;
}
html.solid-plate .stage,
html.solid-plate .solid-layer,
html.solid-plate .tracking-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  width: 100vw;
  height: 100%;
  /* lvh = large viewport — extends behind collapsed mobile URL / toolbar */
  height: 100lvh;
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100lvh;
  min-height: -webkit-fill-available;
  background: var(--solid-plate-bg, #010101);
}
html.solid-plate body.immersive:not(.show-controls-fs) .fs-hint,
html.solid-plate body.immersive:not(.show-controls-fs) .pwa-update,
html.solid-plate body.immersive:not(.show-controls-fs) .standalone-toast {
  display: none !important;
}

/* Social: edge-to-edge so UI/media draw behind the device status bar */
html.social-edge,
html.social-edge body,
body.social-edge {
  background: var(--social-edge-bg, #010101) !important;
}
html.social-edge .stage,
html.social-edge .social-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  width: 100vw;
  height: 100%;
  height: 100lvh;
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100lvh;
  min-height: -webkit-fill-available;
  background: var(--social-edge-bg, #010101);
}

/* Phone UI: fill the visual viewport edge-to-edge (no bottom gap).
   --phone-edge-bg is set from JS to match the current mock screen's top edge:
   iOS (status-bar-style: default) derives the system status-bar band color from
   the page background at the top of the viewport — and rejects pure #000000,
   keeping whatever color was shown before (e.g. chroma green). */
html.phone-edge,
html.phone-edge body,
body.phone-edge {
  background: var(--phone-edge-bg, #010101) !important;
  height: 100%;
  height: 100dvh;
  min-height: 100%;
  min-height: -webkit-fill-available;
}
html.phone-edge .stage,
html.phone-edge .phone-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  /* Let inset define size — explicit height + bottom over-constrains and can leave a black gap */
  height: auto;
  min-height: 0;
  background: var(--phone-edge-bg, #010101);
}
html.phone-edge .phone-layer {
  display: block;
  /* Mock chrome overlays the edge; don't reserve a blank safe-area strip */
  --safe-bottom: 0px;
}
html.phone-edge .phone-shell {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  background-color: var(--phone-edge-bg, #010101);
}
/* Wallpapers are gradients (background-image, no background-color); give them a
   solid color matching the mock so the sampled status-bar band blends in */
html.phone-edge .ios-wallpaper,
html.phone-edge .and-wallpaper {
  background-color: var(--phone-edge-bg, #010101);
}
/* Beat base .phone-layer.screen-* rules (same specificity otherwise → #000 won) */
html.phone-edge .phone-layer.screen-asleep,
html.phone-edge .phone-layer.screen-awake {
  background: var(--phone-edge-bg, #010101);
}

.solid-layer,
.tracking-canvas,
.social-layer,
.phone-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.solid-layer { z-index: 1; }
.tracking-canvas { z-index: 2; pointer-events: none; }
/* Green + tracking + scroll: drag / wheel moves markers */
html.track-scroll .tracking-canvas {
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
html.track-scroll .tracking-canvas:active {
  cursor: grabbing;
}
.social-layer { z-index: 1; overflow: hidden; }
.phone-layer {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* #010101, not #000 — iOS rejects pure black and keeps the prior band color */
  background: #010101;
}
.phone-layer.screen-asleep,
.phone-layer.screen-awake {
  background: #010101;
}
.phone-wake-veil {
  position: absolute;
  inset: 0;
  z-index: 40;
  /* Not pure #000 — iOS won't accept it for the status-bar band color */
  background: #010101;
  opacity: 0;
  pointer-events: none;
}

[hidden] { display: none !important; }

/* ===== Controls ===== */
.controls {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(72vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--panel-border);
  border-radius: 0;
  box-shadow: var(--shadow-panel);
  padding: 12px 14px calc(14px + var(--safe-bottom));
  transition: transform var(--duration) var(--ease-out), opacity var(--duration) var(--ease-out);
  color: var(--text);
}

.controls.hidden-panel {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.controls-header h1 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
  min-width: 0;
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.wake-status {
  font-size: 10px;
  color: var(--faint);
  transition: color 0.2s;
}
.wake-status.on { color: var(--ok); }

.control-section {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.control-section:last-of-type { border-bottom: none; }

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-label span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.field-stack { margin-bottom: 8px; }

.slider-row { margin-bottom: 8px; padding: 4px 0; }
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--tap);
  background: transparent;
  cursor: pointer;
  accent-color: var(--accent);
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--panel-border);
  border-radius: 0;
}
.slider-row input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--panel-border);
  border-radius: 0;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -8px;
  background: var(--text);
  border: 2px solid #000;
  box-shadow: 0 0 0 1px var(--panel-border);
  border-radius: 50%;
  transition: background 0.15s;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--text);
  border: 2px solid #000;
  box-shadow: 0 0 0 1px var(--panel-border);
  border-radius: 50%;
}
.slider-row input[type="range"]:active::-webkit-slider-thumb { background: var(--accent); }
.slider-row input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.select, .text-input {
  width: 100%;
  background: var(--panel-elevated);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  margin-bottom: 8px;
}
.select:focus, .text-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.select option { background: #0a0a0a; color: #fff; }
.time-edit { align-items: center; }
.time-edit .time-part {
  flex: 0 0 auto;
  width: auto;
  min-width: 4.2rem;
  padding-left: 8px;
  padding-right: 8px;
}
.time-edit #phone-meridiem { min-width: 4.6rem; }
.time-edit .time-colon {
  flex: 0 0 auto;
  opacity: 0.7;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.time-edit.is-live .time-part { opacity: 0.75; }
.date-input {
  margin-bottom: 0;
  color-scheme: dark;
}
.btn-row.tight { align-items: center; }
.btn-row.tight .text-input { flex: 1; min-width: 0; }
.btn-row.tight .btn { flex: 0 0 auto; min-width: 64px; }
.btn-row.tight .field-stack.grow { flex: 1; min-width: 0; margin-bottom: 0; }
.btn.armed {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.armed:hover {
  background: var(--danger);
  color: #000;
}
.trigger-status.armed {
  color: var(--danger);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.photo-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.photo-row .btn { flex: 0 0 auto; }
.photo-pick {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.contact-photo-preview {
  width: 44px; height: 44px; border-radius: 50%;
  background-size: cover; background-position: center;
  border: 1px solid var(--panel-border); flex-shrink: 0;
}
.app-icon-preview {
  border-radius: 10px;
}
.field-note {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--faint);
}

.btn-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }

/* Remote accordion: space before footer hint */
#remote-section.control-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
#remote-section .btn-row {
  margin-bottom: 6px;
}
#remote-section .field-note {
  margin-bottom: 0;
}
.accordion-item[data-group="remote"] > .accordion-body {
  padding-bottom: 8px;
}
.accordion-item[data-group="remote"] {
  margin-bottom: 20px;
}
#controls > .hint {
  margin-top: 8px;
}

.qa-take-lock-note {
  margin: 0 0 10px;
  padding: 0 2px;
}

.btn {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 0;
  padding: 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { background: var(--panel-elevated); transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 500;
}
.btn.primary:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}
.btn.primary:active {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}
.btn.icon-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.trigger-status {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  min-height: 1.2em;
}

.hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-align: center;
  line-height: 1.6;
}

.donate-note {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: var(--faint);
  text-align: center;
}
.donate-note a {
  color: var(--muted);
  text-decoration: none;
}
.donate-note a:hover { color: var(--text); }

.legal-note {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.45;
  color: var(--faint);
  text-align: center;
}

.legal-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-note a:hover {
  color: #a0a0a8;
}

.donate-note + .legal-note { margin-top: 10px; }

.reveal-fab {
  position: fixed;
  z-index: 101;
  right: 14px;
  bottom: calc(14px + var(--safe-bottom));
  width: 48px;
  height: 48px;
  border-radius: 0;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg-solid);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  box-shadow: none;
}

/* ===== Shared shell (splash + remote + pair + privacy) ===== */
.install-splash,
.pair-overlay,
body.remote-page,
body.privacy-page,
body.help-page {
  --tech-bg: #000000;
  --tech-surface: #0a0a0a;
  --tech-surface-solid: #0a0a0a;
  --tech-line: #1e1e1e;
  --tech-line-strong: #1e1e1e;
  --tech-muted: #9a9a9a;
  --tech-text: #f2f2f2;
  --tech-accent: #00b140;
  --tech-accent-hi: #00c94a;
  --tech-accent-dim: rgba(0, 177, 64, 0.16);
  --tech-radius: 0;
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* ===== Install splash (pre-generator gate) ===== */
.install-splash {
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--tech-text);
  padding: calc(28px + var(--safe-top)) 20px calc(36px + var(--safe-bottom));
  font-family: var(--font-display);
  background: var(--tech-bg);
}
.install-splash[hidden] { display: none !important; }

body.splash-open .controls,
body.splash-open .reveal-fab,
body.splash-open .fs-hint {
  visibility: hidden !important;
  pointer-events: none !important;
}

.install-splash-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  background: var(--tech-surface);
  padding: 28px 22px 20px;
}

.install-splash h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.install-splash-lead {
  margin: 0 0 22px;
  max-width: 42em;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tech-muted);
}

.install-about {
  margin: 0 0 20px;
  padding: 20px 18px 18px;
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  background: rgba(0, 0, 0, 0.22);
  max-width: 46em;
}

.install-about h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.install-about h3 {
  margin: 16px 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tech-accent);
}

.install-about > p,
.install-about li {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--tech-muted);
}

.install-about > p + p { margin-top: 10px; }

.install-about ol,
.install-about ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--tech-muted);
}

.install-about li { margin-bottom: 6px; }
.install-about li:last-child { margin-bottom: 0; }

.install-about strong {
  color: rgba(230, 231, 234, 0.92);
  font-weight: 600;
}

.install-platforms {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 720px) {
  .install-platforms {
    grid-template-columns: repeat(3, 1fr);
  }
}

.install-platform {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  padding: 16px 14px 14px;
}

.install-platform:hover {
  border-color: var(--tech-line-strong);
}

.install-platform.is-current {
  background: #101010;
  border-color: var(--tech-accent);
}

.install-platform h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: #fff;
}

.install-platform.is-current h2 { color: #fff; }

.install-platform ol {
  margin: 0;
  padding-left: 1.15em;
  font-size: 12px;
  line-height: 1.55;
  color: var(--tech-muted);
}

.install-platform.is-current ol { color: rgba(230, 231, 234, 0.88); }

.install-platform li { margin-bottom: 7px; }
.install-platform li:last-child { margin-bottom: 0; }

.install-splash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.install-splash-actions .btn {
  flex: 1 1 160px;
  min-height: var(--tap);
  margin: 0;
  border: 1px solid var(--tech-line-strong);
  border-radius: var(--tech-radius);
  background: transparent;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.install-splash-actions .btn:hover {
  border-color: var(--tech-muted);
  background: #101010;
}

.install-splash-actions .btn:active { opacity: 0.9; }

.install-splash-actions .btn.primary {
  background: var(--tech-accent);
  color: #000;
  border-color: var(--tech-accent);
  font-weight: 500;
}

.install-splash-actions .btn.primary:hover {
  background: var(--tech-accent-hi);
  border-color: var(--tech-accent-hi);
  color: #000;
}

.install-splash-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tech-muted);
}

.install-splash-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--tech-line);
  text-align: center;
}

.install-splash-donate {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: #5c5c5c;
}

.install-splash-donate a {
  color: var(--tech-muted);
  text-decoration: none;
}

.install-splash-donate a:hover { color: #fff; }

.install-splash-legal {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.45;
  color: #5c5c5c;
}

.install-splash-legal a {
  color: var(--tech-muted);
  text-decoration: none;
}

.install-splash-legal a:hover {
  color: #fff;
}

.install-splash-legal + .install-splash-legal {
  margin-top: 2px;
}

.fs-hint {
  position: fixed;
  z-index: 200;
  left: 16px;
  right: 16px;
  bottom: calc(24px + var(--safe-bottom));
  max-width: 420px;
  margin: 0 auto;
  background: var(--panel-bg-solid);
  border: 1px solid var(--panel-border);
  border-radius: 0;
  padding: 16px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: none;
}
.fs-hint h2 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.fs-hint p { margin: 0 0 10px; color: var(--muted); }
.fs-hint-steps {
  margin: 0 0 14px;
  padding-left: 1.2em;
  color: var(--text);
}
.fs-hint-steps li { margin-bottom: 4px; }
.fs-hint-steps a {
  color: var(--accent, #00b140);
  text-decoration: underline;
  word-break: break-all;
}
.fs-hint-actions {
  display: flex;
  gap: 8px;
}
.fs-hint-actions .btn { flex: 1; }

.pwa-update-later-row {
  margin-top: 8px;
}
.pwa-update-later-row .btn {
  flex: 1;
  opacity: 0.85;
}

.standalone-toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  top: calc(12px + var(--safe-top));
  transform: translateX(-50%);
  background: var(--panel-bg-solid);
  color: var(--ok);
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .controls {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 360px;
    max-height: calc(100vh - 32px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--panel-border);
  }
  .controls.hidden-panel {
    transform: translateY(20px) scale(0.98);
  }
}

/* ===== Social: shared ===== */
.social-layer {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  overflow: hidden;
}

/* Phone-shaped social frame: edge-to-edge on phones, device bezel on larger screens */
.phone-shell.social-shell {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  overflow: hidden;
  background: #000;
  border-radius: 0;
  box-shadow: none;
  /* Reserve system status-bar band — solid color only, no app UI in this zone */
  --status-band: var(--safe-top);
}
/* Social uses same multiply grade as phone (temp/tint/luma) */
.social-layer .phone-shell.social-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 80;
  background: var(--phone-grade, #fff);
  mix-blend-mode: multiply;
}
.social-shell > .feed-scroll,
.social-shell > .skin-fb-reels,
.social-shell > .skin-ig-reels,
.social-shell > .skin-tiktok {
  width: 100%;
  height: 100%;
  position: relative;
}

@media (min-width: 700px) {
  .phone-shell.social-shell {
    /* Faux status-bar height inside the desktop device frame */
    --status-band: 47px;
    /* ~iPhone aspect; scales with viewport height/width */
    height: min(844px, 92vh, calc((100vw - 48px) * 19.5 / 9));
    width: min(390px, calc(100vw - 48px), calc(min(844px, 92vh) * 9 / 19.5));
    max-width: min(390px, calc(100vw - 48px));
    max-height: 92vh;
    border-radius: 44px;
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.08),
      0 0 0 11px #111,
      0 0 0 12px #2a2a2a,
      0 28px 70px rgba(0,0,0,0.55);
  }
}

.feed-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-scroll::-webkit-scrollbar { display: none; }

.reel-scroll {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: none;
  scrollbar-width: none;
}
.reel-scroll::-webkit-scrollbar { display: none; }

.reel-card {
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.media-block {
  position: relative;
  width: 100%;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.media-block.filled {
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.15), transparent 50%),
    linear-gradient(45deg, #4a6fa5, #7b5ea7 40%, #c46b8a 70%, #e8a87c);
}
.media-block.filled.has-photo {
  background-image: none;
  background-color: #1a1a1a;
}
.media-block .pexels-img,
.reel-media .pexels-img,
.media-block .pexels-video,
.reel-media .pexels-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-block.green {
  background: var(--chroma-green, #00b140);
}
.media-block.green::before,
.media-block.green::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--track-marker, #006c25);
}
.media-block.green::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.media-block.green::after { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.media-block.green .track-mid {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
}
.media-block.green .track-mid::before,
.media-block.green .track-mid::after {
  content: "";
  position: absolute;
  background: var(--track-marker, #006c25);
}
.media-block.green .track-mid::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
.media-block.green .track-mid::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }

/* ===== Facebook feed ===== */
.skin-fb-feed { background: #f0f2f5; color: #050505; }
.skin-fb-feed .fb-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  /* Solid status band + chrome below it */
  padding: calc(8px + var(--status-band, 0px)) 12px 8px; background: #fff;
  border-bottom: 1px solid #dddfe2;
}
.skin-fb-feed .fb-brand {
  font-size: 26px; font-weight: 800; color: #1877f2; letter-spacing: -0.5px;
}
.skin-fb-feed .fb-top-icons { display: flex; gap: 10px; }
.skin-fb-feed .fb-icon-circle {
  width: 36px; height: 36px; border-radius: 50%; background: #e4e6eb;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.skin-fb-feed .stories {
  display: flex; gap: 10px; padding: 12px; background: #fff; margin-bottom: 8px;
  overflow-x: auto; scrollbar-width: none;
}
.skin-fb-feed .story {
  width: 100px; height: 170px; border-radius: 12px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.skin-fb-feed .story .story-media { width: 100%; height: 100%; }
.skin-fb-feed .story .story-name {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  color: #fff; font-size: 12px; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.skin-fb-feed .story .story-av {
  position: absolute; top: 8px; left: 8px; width: 32px; height: 32px;
  border: 3px solid #1877f2; border-radius: 50%;
}
.skin-fb-feed .post {
  background: #fff; margin-bottom: 8px; padding-bottom: 4px;
}
.skin-fb-feed .post-head {
  display: flex; align-items: center; gap: 10px; padding: 12px;
}
.skin-fb-feed .post-meta { flex: 1; min-width: 0; }
.skin-fb-feed .post-name { font-weight: 650; font-size: 15px; }
.skin-fb-feed .post-time { font-size: 12px; color: #65676b; }
.skin-fb-feed .post-text { padding: 0 12px 10px; font-size: 15px; line-height: 1.35; }
.skin-fb-feed .post-media { aspect-ratio: 16/10; }
.skin-fb-feed .post-stats {
  display: flex; justify-content: space-between; padding: 8px 12px;
  font-size: 13px; color: #65676b; border-bottom: 1px solid #ced0d4;
}
.skin-fb-feed .post-actions {
  display: flex; padding: 4px 8px;
}
.skin-fb-feed .post-actions span {
  flex: 1; text-align: center; padding: 10px 0; font-size: 14px; font-weight: 600; color: #65676b;
}

/* ===== Instagram feed ===== */
.skin-ig-feed { background: #000; color: #fff; }
.skin-ig-feed.light { background: #fff; color: #000; }
.skin-ig-feed .ig-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + var(--status-band, 0px)) 14px 8px; background: inherit;
  border-bottom: 1px solid rgba(128,128,128,0.25);
}
.skin-ig-feed .ig-brand { font-size: 22px; font-weight: 600; font-family: "Segoe Script", "Bradley Hand", cursive, var(--font); }
.skin-ig-feed .ig-top-icons { display: flex; gap: 16px; font-size: 20px; }
.skin-ig-feed .ig-stories {
  display: flex; gap: 14px; padding: 12px 10px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid rgba(128,128,128,0.2);
}
.skin-ig-feed .ig-story { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 70px; flex-shrink: 0; }
.skin-ig-feed .ig-ring {
  width: 62px; height: 62px; border-radius: 50%;
  padding: 2px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.skin-ig-feed .ig-ring .avatar { width: 100%; height: 100%; border: 2px solid #000; }
.skin-ig-feed .ig-story span { font-size: 11px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-ig-feed .ig-post { border-bottom: 1px solid rgba(128,128,128,0.2); margin-bottom: 4px; }
.skin-ig-feed .ig-post-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
}
.skin-ig-feed .ig-post-head .avatar { width: 32px; height: 32px; font-size: 12px; }
.skin-ig-feed .ig-user { font-weight: 650; font-size: 14px; flex: 1; }
.skin-ig-feed .ig-media { aspect-ratio: 4/5; }
.skin-ig-feed .ig-actions { display: flex; gap: 14px; padding: 10px 12px; font-size: 22px; }
.skin-ig-feed .ig-actions .spacer { flex: 1; }
.skin-ig-feed .ig-likes { padding: 0 12px; font-weight: 650; font-size: 14px; }
.skin-ig-feed .ig-caption { padding: 4px 12px 12px; font-size: 14px; line-height: 1.35; }
.skin-ig-feed .ig-caption strong { font-weight: 650; margin-right: 6px; }

/* ===== Linkd ===== */
.skin-linkedin { background: #f3f2ef; color: #000; }
.skin-linkedin .li-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(6px + var(--status-band, 0px)) 12px 6px; background: #fff;
  border-bottom: 1px solid #e0dfdc;
}
.skin-linkedin .li-brand {
  font-size: 24px; font-weight: 800; color: #0a66c2; letter-spacing: -0.5px;
}
.skin-linkedin .li-search {
  flex: 1; background: #eef3f8; border-radius: 4px; padding: 8px 12px;
  font-size: 13px; color: #666;
}
.skin-linkedin .li-post {
  background: #fff; margin: 8px 0; border-radius: 8px;
  border: 1px solid #e0dfdc; overflow: hidden;
}
.skin-linkedin .li-head {
  display: flex; gap: 10px; padding: 12px 12px 8px;
}
.skin-linkedin .li-head .avatar { border-radius: 50%; }
.skin-linkedin .li-name { font-weight: 650; font-size: 14px; }
.skin-linkedin .li-headline { font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.skin-linkedin .li-time { font-size: 12px; color: #666; }
.skin-linkedin .li-text { padding: 0 12px 10px; font-size: 14px; line-height: 1.4; }
.skin-linkedin .li-text .see-more { color: #666; font-weight: 600; }
.skin-linkedin .li-media { aspect-ratio: 16/9; }
.skin-linkedin .li-reacts {
  display: flex; justify-content: space-between; padding: 8px 12px;
  font-size: 12px; color: #666; border-bottom: 1px solid #e0dfdc;
}
.skin-linkedin .li-actions {
  display: flex; padding: 4px;
}
.skin-linkedin .li-actions span {
  flex: 1; text-align: center; padding: 10px 4px; font-size: 13px; font-weight: 600; color: #666;
}

/* ===== Reels / TikTok shared ===== */
.reel-media { position: absolute; inset: 0; }
.reel-media.filled {
  background-image:
    linear-gradient(160deg, rgba(0,0,0,0.15), transparent 40%),
    linear-gradient(45deg, #2b5876, #4e4376 35%, #c33764 70%, #1d2671);
}
.reel-media.filled.has-photo {
  background-image: none;
  background-color: #111;
}
.pexels-credit {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #8a93a3;
}
.pexels-credit a {
  color: #b8c2d1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pexels-credit a:hover { color: #e8edf5; }
.reel-media.green { background: var(--chroma-green, #00b140); }
.reel-media.green .track-mid {
  position: absolute; top: 50%; left: 50%; width: 28px; height: 28px;
  transform: translate(-50%, -50%);
}
.reel-media.green .track-mid::before,
.reel-media.green .track-mid::after {
  content: ""; position: absolute; background: var(--track-marker, #006c25);
}
.reel-media.green .track-mid::before { left: 50%; top: 0; width: 3px; height: 100%; transform: translateX(-50%); }
.reel-media.green .track-mid::after { top: 50%; left: 0; height: 3px; width: 100%; transform: translateY(-50%); }
.reel-media.green::before,
.reel-media.green::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border: 2px solid var(--track-marker, #006c25);
}
.reel-media.green::before { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.reel-media.green::after { bottom: 16px; right: 16px; border-left: none; border-top: none; }

.reel-rail {
  position: absolute; right: 10px; bottom: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  color: #fff; z-index: 3; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.reel-rail .rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.reel-rail .rail-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.reel-bottom {
  position: absolute; left: 12px; right: 70px; bottom: 48px;
  color: #fff; z-index: 3; text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.reel-bottom .reel-user { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.reel-bottom .reel-caption { font-size: 14px; line-height: 1.35; margin-bottom: 8px; }
.reel-bottom .reel-audio { font-size: 13px; opacity: 0.95; }

/* FB Reels */
.skin-fb-reels { background: #000; }
.skin-fb-reels .fb-reels-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  padding: calc(6px + var(--status-band, 0px)) 14px 6px;
  background: #000;
  display: flex; justify-content: space-between; color: #fff; font-weight: 700; font-size: 18px;
}

/* IG Reels */
.skin-ig-reels { background: #000; }
.skin-ig-reels .ig-reels-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  padding: calc(6px + var(--status-band, 0px)) 14px 6px;
  background: #000;
  display: flex; justify-content: space-between; color: #fff; font-weight: 650; font-size: 16px;
}

/* TikTok */
.skin-tiktok { background: #000; }
.skin-tiktok .tt-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  padding: calc(6px + var(--status-band, 0px)) 40px 6px;
  background: #000;
  display: flex; justify-content: center; gap: 20px; color: rgba(255,255,255,0.55); font-weight: 700; font-size: 16px;
}
.skin-tiktok .tt-top .active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; }
.skin-tiktok .tt-rail .avatar {
  width: 48px; height: 48px; border: 2px solid #fff; margin-bottom: 4px;
}
.skin-tiktok .tt-follow {
  width: 20px; height: 20px; border-radius: 50%; background: #fe2c55; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  margin-top: -14px; margin-bottom: 8px; z-index: 1;
}
.skin-tiktok .tt-disc {
  width: 40px; height: 40px; border-radius: 50%;
  background: conic-gradient(#333, #888, #333); border: 6px solid #222;
  animation: spin 4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Phone frame ===== */
.phone-shell {
  width: 100%;
  height: 100%;
  max-width: 430px;
  max-height: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
}

/* Temp / tint / luminance grade for phone mockups (multiply of graded white) */
.phone-layer .phone-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 80;
  background: var(--phone-grade, #fff);
  mix-blend-mode: multiply;
}
.phone-shell.plat-ios {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.phone-shell.plat-android {
  font-family: "Roboto", "Google Sans", "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (min-width: 700px) {
  /* Desktop preview: framed device; phone-edge full-bleed only on real phones */
  html.phone-edge .phone-layer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
  }
  html.phone-edge .phone-shell,
  .phone-shell {
    position: relative;
    inset: auto;
    width: min(390px, 42vh);
    height: min(844px, 92vh);
    max-width: min(390px, calc(100vw - 48px));
    max-height: 92vh;
    border-radius: 44px;
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.08),
      0 0 0 11px #111,
      0 0 0 12px #2a2a2a,
      0 28px 70px rgba(0,0,0,0.55);
  }
}

/* Overlay home indicator — do not reserve a flex strip under the dock */
.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.9);
  margin: 0;
  z-index: 3;
  pointer-events: none;
}

/* Wallpapers */
.ios-wallpaper, .and-wallpaper {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.ios-wallpaper {
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(120, 180, 255, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 60% at 80% 30%, rgba(180, 120, 255, 0.45), transparent 50%),
    radial-gradient(ellipse 90% 70% at 50% 90%, rgba(255, 140, 100, 0.5), transparent 55%),
    linear-gradient(165deg, #1a2a6c, #b21f1f 55%, #fdbb2d);
}
.ios-wallpaper.lock-wall,
.ios-wallpaper.call-wall {
  filter: blur(28px) saturate(1.15) brightness(0.72);
  transform: scale(1.12);
}
.and-wallpaper {
  background:
    radial-gradient(circle at 30% 20%, #3d5a80, transparent 45%),
    radial-gradient(circle at 80% 70%, #98c1d9, transparent 50%),
    linear-gradient(180deg, #0d1b2a, #1b263b 40%, #415a77);
}
.and-wallpaper.lock-wall {
  filter: brightness(0.75) saturate(1.1);
}

/* iOS home */
.ios-home {
  height: 100%;
  position: relative;
  display: flex; flex-direction: column;
  /* Desktop framed mock: reserve faux status-bar band */
  padding-top: calc(54px + var(--safe-top));
  padding-bottom: 22px;
  z-index: 1;
}
/* Mobile full-bleed (status-bar-style: default): system already owns the top band */
html.phone-edge .ios-home {
  padding-top: calc(12px + var(--safe-top));
}
@media (min-width: 700px) {
  html.phone-edge .ios-home {
    padding-top: calc(54px + var(--safe-top));
  }
}
.home-pager {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.home-pages {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.28s ease;
  will-change: transform;
}
.home-page {
  width: 50%;
  height: 100%;
  flex: 0 0 50%;
}
.ios-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 10px;
  padding: 10px 22px 8px;
  height: 100%;
  align-content: start;
}
button.ios-app,
button.and-app,
.ios-dock button.icon,
.and-dock button.icon {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ios-app {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ios-app .icon, .ios-dock .icon {
  width: 62px; height: 62px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), 0 6px 14px rgba(0,0,0,0.18);
}
.ios-app .icon svg, .ios-dock .icon svg,
.and-app .icon svg, .and-dock .icon svg {
  width: 30px; height: 30px; display: block;
}
.ios-app .label {
  font-size: 11px; font-weight: 500; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ios-dots,
.and-dots {
  position: relative; z-index: 1;
  display: flex; justify-content: center; gap: 7px; padding: 10px;
}
.and-dots { padding: 4px 10px 8px; }
.ios-dots span,
.and-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.35);
}
.ios-dots span.on,
.and-dots span.on { background: #fff; }
.ios-dock {
  position: relative; z-index: 1;
  margin: 0 12px 4px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-radius: 32px;
  display: flex; justify-content: space-around;
  padding: 16px 14px;
  border: 1px solid rgba(255,255,255,0.18);
}

/* iOS icon skins */
.ic-photos { background: linear-gradient(145deg, #ffd60a, #ff9f0a 40%, #ff375f 70%, #bf5af2); }
.ic-camera { background: linear-gradient(180deg, #8e8e93, #636366); }
.ic-maps { background: linear-gradient(180deg, #64d2ff, #0a84ff); color: #fff; }
.ic-clock { background: #1c1c1e; color: #fff; }
.ic-weather { background: linear-gradient(180deg, #5ac8fa, #007aff); }
.ic-notes { background: #ffd60a; color: #1c1c1e; }
.ic-cal { background: #ff3b30; }
.ic-wallet { background: #1c1c1e; color: #fff; }
.ic-settings { background: linear-gradient(180deg, #8e8e93, #636366); }
.ic-files { background: linear-gradient(180deg, #5ac8fa, #007aff); }
.ic-music { background: linear-gradient(145deg, #ff2d55, #bf5af2); }
.ic-tv { background: #1c1c1e; }
.ic-books { background: linear-gradient(180deg, #ff9f0a, #ff6b00); }
.ic-health { background: #fff; color: #ff2d55; }
.ic-mail { background: linear-gradient(180deg, #5ac8fa, #007aff); }
.ic-browser { background: linear-gradient(145deg, #64d2ff, #0a84ff 55%, #30d158); }
.ic-phone { background: #30d158; }
.ic-msg { background: #30d158; }

/* Android home */
.android-home {
  height: 100%;
  position: relative;
  display: flex; flex-direction: column;
  padding-top: calc(36px + var(--safe-top));
  padding-bottom: 20px;
  z-index: 1;
}
/* Mobile full-bleed: less top pad when the OS status bar is outside the web view */
html.phone-edge .android-home {
  padding-top: calc(10px + var(--safe-top));
}
@media (min-width: 700px) {
  html.phone-edge .android-home {
    padding-top: calc(36px + var(--safe-top));
  }
}
.and-widget {
  position: relative; z-index: 1;
  text-align: center; padding: 36px 16px 10px; color: #fff;
}
.and-widget .clock {
  font-size: 68px; font-weight: 300; letter-spacing: -2px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.and-widget .meridiem,
.lock-clock .meridiem {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  opacity: 0.85;
  margin-top: 2px;
}
.and-widget .meridiem[hidden],
.lock-clock .meridiem[hidden] { display: none !important; }
.and-widget .date { font-size: 15px; opacity: 0.92; margin-top: 6px; font-weight: 400; }
.and-widget .weather {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; opacity: 0.8; margin-top: 8px;
}
.and-widget .wx-icon { width: 18px; height: 18px; display: inline-flex; }
.and-widget .wx-icon svg { width: 100%; height: 100%; }
.and-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 6px;
  padding: 8px 18px 4px;
  height: 100%;
  align-content: start;
}
.and-app { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.and-app .icon, .and-dock .icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.and-app .label { font-size: 11px; color: #fff; font-weight: 400; }
.and-search {
  position: relative; z-index: 1;
  margin: 6px 20px 10px;
  background: rgba(232, 240, 254, 0.94);
  color: #3c4043;
  border-radius: 28px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.and-search svg { width: 20px; height: 20px; opacity: 0.7; }
.and-search span { flex: 1; }
.and-search .and-mic { flex: 0; display: flex; opacity: 0.65; }
.and-dock {
  position: relative; z-index: 1;
  display: flex; justify-content: space-around;
  padding: 8px 18px 4px;
}
.and-gesture {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 108px;
  height: 4px;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  margin: 0;
  z-index: 3;
  pointer-events: none;
  border: none;
  padding: 0;
}
.home-indicator[data-action],
.and-gesture[data-action] {
  pointer-events: auto;
  cursor: pointer;
}

/* In-home Phone / Messages apps */
.ios-app-screen,
.and-app-screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  z-index: 1;
}
.ios-app-screen { background: #000; }
.and-app-screen { background: #0f1113; }
.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 10px;
  gap: 8px;
}
.app-top.and { padding-top: calc(18px + var(--safe-top)); }
html.phone-edge .app-top { padding-top: calc(8px + var(--safe-top)); }
html.phone-edge .app-top.and { padding-top: calc(10px + var(--safe-top)); }
@media (min-width: 700px) {
  html.phone-edge .app-top { padding-top: calc(14px + var(--safe-top)); }
  html.phone-edge .app-top.and { padding-top: calc(18px + var(--safe-top)); }
}
.app-title {
  font-size: 17px;
  font-weight: 650;
  text-align: center;
  flex: 1;
}
.app-title.thread-title { font-size: 16px; }
.app-edit,
.app-text-btn {
  appearance: none;
  border: none;
  background: none;
  color: #0a84ff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 4px 2px;
  min-width: 44px;
  cursor: pointer;
}
.app-top.and .app-text-btn { color: #8ab4f8; }
.app-edit.ghost { visibility: hidden; }
.phone-seg {
  display: flex;
  margin: 0 16px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.12);
  padding: 2px;
}
.phone-seg span {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: 7px;
  color: rgba(255,255,255,0.7);
}
.phone-seg span.on { background: rgba(255,255,255,0.18); color: #fff; }
.phone-search {
  margin: 0 16px 10px;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
}
.phone-search svg { width: 18px; height: 18px; }
.phone-recent-list,
.msg-list {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 70px;
}
.phone-recent-row,
.msg-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: default;
}
.msg-row[data-action] { cursor: pointer; }
.phone-recent-av,
.msg-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 650;
  flex-shrink: 0;
  color: #fff;
}
.phone-recent-meta,
.msg-meta { flex: 1; min-width: 0; }
.phone-recent-meta strong,
.msg-line strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}
.phone-recent-meta small,
.msg-preview {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.msg-line em {
  font-style: normal;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.phone-recent-info {
  width: 22px;
  height: 22px;
  color: #0a84ff;
  opacity: 0.9;
}
.phone-recent-info svg { width: 100%; height: 100%; }
.phone-recent-row.and .phone-recent-info { color: #8ab4f8; }
.phone-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 6px 22px;
  background: rgba(28,28,30,0.96);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 10px;
  color: rgba(255,255,255,0.45);
}
.phone-tabbar .on { color: #0a84ff; }
.and-phone-fab {
  position: absolute;
  right: 18px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #1a73e8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.and-phone-fab svg { width: 24px; height: 24px; }
.msg-thread {
  flex: 1;
  overflow: auto;
  padding: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.35;
  width: fit-content;
}
.msg-bubble.them {
  background: rgba(255,255,255,0.12);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}
.msg-bubble.me {
  background: #0a84ff;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}
.msg-thread.and .msg-bubble.me { background: #1a73e8; }
.msg-compose {
  margin: 0 12px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 10px 14px;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  flex-shrink: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.msg-compose.and {
  margin-bottom: 28px;
  background: rgba(255,255,255,0.06);
}
.msg-compose:has(+ .msg-keyboard) {
  margin-bottom: 8px;
}
.msg-compose.and:has(+ .msg-keyboard) {
  margin-bottom: 8px;
}
.msg-compose.composing {
  color: #fff;
}
.msg-compose-draft {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.3;
}
.msg-compose-caret {
  display: inline-block;
  width: 2px;
  height: 17px;
  margin-left: 1px;
  background: #0a84ff;
  vertical-align: -3px;
  animation: msg-caret-blink 1s step-end infinite;
}
@keyframes msg-caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.msg-keyboard {
  flex-shrink: 0;
  padding: 6px 4px 18px;
  background: #2c2c2e;
  border-top: 1px solid rgba(255,255,255,0.08);
  user-select: none;
  -webkit-user-select: none;
}
.msg-keyboard.and {
  background: #1c1c1e;
  padding-bottom: 14px;
}
.msg-key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
}
.msg-key-row.mid {
  padding: 0 12px;
}
.msg-key-row.bot {
  padding: 0 28px;
}
.msg-key-row.space-row {
  margin-bottom: 0;
  gap: 6px;
  padding: 0 4px;
}
.msg-key {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  flex: 1;
  max-width: 34px;
  height: 38px;
  border-radius: 5px;
  background: #636366;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,0.35);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.06s ease, transform 0.06s ease;
}
.msg-key:active,
.msg-key.pressed {
  background: #d1d1d6;
  color: #000;
  transform: scale(0.96);
  box-shadow: none;
}
.msg-key.wide {
  flex: 3.2;
  max-width: none;
  font-size: 13px;
  text-transform: none;
  color: rgba(255,255,255,0.85);
}
.msg-key.wide:active,
.msg-key.wide.pressed {
  color: #000;
}
.msg-key.ret {
  flex: 1.4;
  max-width: none;
  font-size: 12px;
  text-transform: none;
  background: #0a84ff;
  color: #fff;
}
.msg-key.ret:active,
.msg-key.ret.pressed {
  background: #5ac8fa;
  color: #000;
}
.msg-keyboard.and .msg-key {
  border-radius: 6px;
  background: #3c4043;
}
.msg-keyboard.and .msg-key:active,
.msg-keyboard.and .msg-key.pressed {
  background: #e8eaed;
  color: #202124;
}
.msg-keyboard.and .msg-key.ret {
  background: #1a73e8;
}
.msg-keyboard.and .msg-key.ret:active,
.msg-keyboard.and .msg-key.ret.pressed {
  background: #8ab4f8;
  color: #202124;
}
.ios-messages-app.thread:has(.msg-keyboard) .home-indicator,
.and-messages-app.thread:has(.msg-keyboard) .and-gesture {
  margin-top: 0;
}

/* Messages light theme (iOS + Android) */
.ios-messages-app.light,
.and-messages-app.light {
  background: #fff;
  color: #000;
}
.and-messages-app.light {
  background: #f8f9fa;
}
.ios-messages-app.light .app-edit,
.ios-messages-app.light .app-text-btn {
  color: #007aff;
}
.and-messages-app.light .app-text-btn {
  color: #1a73e8;
}
.ios-messages-app.light .msg-row,
.and-messages-app.light .msg-row {
  color: #000;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
.ios-messages-app.light .msg-preview,
.and-messages-app.light .msg-preview {
  color: rgba(0, 0, 0, 0.45);
}
.ios-messages-app.light .msg-line em,
.and-messages-app.light .msg-line em {
  color: rgba(0, 0, 0, 0.35);
}
.ios-messages-app.light .msg-bubble.them,
.and-messages-app.light .msg-bubble.them {
  background: #e9e9eb;
  color: #000;
}
.and-messages-app.light .msg-bubble.them {
  background: #e8eaed;
}
.ios-messages-app.light .msg-bubble.photo,
.ios-messages-app.light .msg-bubble.location,
.and-messages-app.light .msg-bubble.photo,
.and-messages-app.light .msg-bubble.location {
  background: #e9e9eb;
}
.and-messages-app.light .msg-bubble.photo,
.and-messages-app.light .msg-bubble.location {
  background: #e8eaed;
}
.ios-messages-app.light .msg-bubble.location .loc-label,
.and-messages-app.light .msg-bubble.location .loc-label {
  color: #000;
}
.ios-messages-app.light .msg-compose,
.and-messages-app.light .msg-compose {
  border-color: rgba(0, 0, 0, 0.14);
  background: #fff;
  color: rgba(0, 0, 0, 0.35);
}
.and-messages-app.light .msg-compose {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}
.ios-messages-app.light .msg-compose.composing,
.and-messages-app.light .msg-compose.composing {
  color: #000;
}
.ios-messages-app.light .msg-compose-caret {
  background: #007aff;
}
.and-messages-app.light .msg-compose-caret {
  background: #1a73e8;
}
.ios-messages-app.light .msg-keyboard {
  background: #d1d3d9;
  border-top-color: rgba(0, 0, 0, 0.1);
}
.and-messages-app.light .msg-keyboard {
  background: #eceff1;
  border-top-color: rgba(0, 0, 0, 0.08);
}
.ios-messages-app.light .msg-key {
  background: #fff;
  color: #000;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.ios-messages-app.light .msg-key:active,
.ios-messages-app.light .msg-key.pressed {
  background: #b0b3b9;
  color: #000;
}
.ios-messages-app.light .msg-key.wide {
  color: rgba(0, 0, 0, 0.75);
  background: #adb1b8;
}
.ios-messages-app.light .msg-key.wide:active,
.ios-messages-app.light .msg-key.wide.pressed {
  background: #fff;
  color: #000;
}
.ios-messages-app.light .msg-key.ret {
  background: #007aff;
  color: #fff;
}
.ios-messages-app.light .msg-key.ret:active,
.ios-messages-app.light .msg-key.ret.pressed {
  background: #5ac8fa;
  color: #000;
}
.and-messages-app.light .msg-key {
  background: #fff;
  color: #202124;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.and-messages-app.light .msg-key:active,
.and-messages-app.light .msg-key.pressed {
  background: #dadce0;
  color: #202124;
}
.and-messages-app.light .msg-key.wide {
  color: rgba(0, 0, 0, 0.7);
  background: #dadce0;
}
.and-messages-app.light .msg-key.wide:active,
.and-messages-app.light .msg-key.wide.pressed {
  background: #fff;
  color: #202124;
}
.and-messages-app.light .msg-key.ret {
  background: #1a73e8;
  color: #fff;
}
.and-messages-app.light .msg-key.ret:active,
.and-messages-app.light .msg-key.ret.pressed {
  background: #8ab4f8;
  color: #202124;
}
.ios-messages-app.light .home-indicator {
  background: rgba(0, 0, 0, 0.85);
}
.and-messages-app.light .and-gesture {
  background: rgba(0, 0, 0, 0.55);
}

.aic-phone { background: #34a853; }
.aic-msg { background: #1a73e8; }
.aic-camera { background: #5f6368; }
.aic-photos { background: linear-gradient(135deg, #fbbc04, #ea4335); }
.aic-browser { background: #4285f4; }
.aic-maps { background: #34a853; }
.aic-clock { background: #1a73e8; }
.aic-play { background: #01875f; }
.aic-settings { background: #5f6368; }
.aic-mail { background: #ea4335; }
.aic-drive { background: #2684fc; }
.aic-tv { background: #ff0000; }

/* iOS call */
.ios-call {
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(62px + var(--safe-top)) 28px 18px;
  text-align: center;
  position: relative;
  z-index: 1;
  color: #fff;
}
html.phone-edge .ios-call {
  padding-top: calc(28px + var(--safe-top));
}
@media (min-width: 700px) {
  html.phone-edge .ios-call {
    padding-top: calc(62px + var(--safe-top));
  }
}
.ios-call .call-wall { z-index: 0; }
.ios-call .call-top,
.ios-call .call-avatar,
.ios-call .call-shortcuts,
.ios-call .call-buttons,
.ios-call .in-call-grid,
.ios-call .video-stage {
  position: relative; z-index: 1;
}
.ios-call.ringing .call-wall { animation: ios-call-pulse 2s ease-in-out infinite; }
@keyframes ios-call-pulse {
  0%, 100% { filter: blur(28px) saturate(1.15) brightness(0.72); }
  50% { filter: blur(28px) saturate(1.25) brightness(0.85); }
}
.ios-call .call-label {
  font-size: 18px; font-weight: 400; opacity: 0.9; margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.ios-call .call-name {
  font-size: 36px; font-weight: 300; letter-spacing: 0.2px; margin-bottom: 4px;
}
.ios-call .call-sub { font-size: 18px; opacity: 0.8; font-weight: 400; }
.ios-call .call-timer {
  font-size: 20px; margin-top: 6px; font-variant-numeric: tabular-nums; opacity: 0.95;
}
.ios-call .call-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 500; color: #fff;
  margin: 36px 0 auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.call-avatar.has-photo,
.an-avatar.has-photo,
.video-pip.has-photo,
.sheet-av.has-photo {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
}
.ios-call .call-shortcuts {
  display: flex; justify-content: space-around; width: 100%;
  margin-bottom: 36px;
}
.ios-call .call-shortcuts .sc-btn {
  background: none; border: none; color: #fff; font: inherit; font-size: 13px;
  font-weight: 400; cursor: pointer; padding: 0; opacity: 0.95;
}
.ios-call .call-shortcuts .sc-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ios-call .call-shortcuts .sc-icon svg { width: 24px; height: 24px; }
.ios-call .call-buttons {
  display: flex; justify-content: space-around; width: 100%; gap: 48px;
  margin-bottom: 18px;
}
.ios-call .call-buttons.labeled { align-items: flex-start; }
.ios-call .btn-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; opacity: 0.95;
}
.ios-call .call-btn {
  width: 76px; height: 76px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.ios-call .call-btn svg { width: 32px; height: 32px; }
.ios-call .call-btn.decline { background: #ff3b30; }
.ios-call .call-btn.accept { background: #30d158; }
.ios-call .call-btn.end { background: #ff3b30; }
.ios-call .in-call-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 14px;
  width: 100%; margin: auto 0 28px; color: #fff;
}
.ios-call.active .call-top { margin-bottom: 8px; }
.ios-call .call-ctrl,
.android-call .call-ctrl {
  background: none; border: none; color: inherit; font: inherit;
  text-align: center; font-size: 12px; font-weight: 400; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.ios-call .in-call-grid .ic {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background 0.15s ease, color 0.15s ease;
}
.ios-call .in-call-grid .ic svg { width: 26px; height: 26px; }
.ios-call .call-ctrl.on .ic {
  background: #fff; color: #111;
}
.ios-call .call-live-status,
.android-call .call-live-status {
  min-height: 1.2em; font-size: 15px; opacity: 0.85; margin-top: 4px;
}
.ios-call.video-on .call-wall { filter: blur(40px) brightness(0.35) !important; }
.video-stage {
  width: 100%; flex: 1; min-height: 140px; margin: 12px 0;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.video-pip {
  width: 110px; height: 160px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
}
.video-badge {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.45); font-size: 12px; font-weight: 600;
}

/* Android call */
.android-call {
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(56px + var(--safe-top)) 24px 12px;
  text-align: center;
  position: relative;
  z-index: 1;
  color: #e8eaed;
  background: #0f1113;
}
html.phone-edge .android-call {
  padding-top: calc(24px + var(--safe-top));
}
@media (min-width: 700px) {
  html.phone-edge .android-call {
    padding-top: calc(56px + var(--safe-top));
  }
}
.and-call-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(138, 180, 248, 0.18), transparent 55%),
    linear-gradient(180deg, #1a1c1e, #0f1113 60%);
}
.and-hole {
  position: absolute; left: 50%; top: calc(10px + var(--safe-top));
  transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  z-index: 2; pointer-events: none;
}
.android-call > *:not(.and-call-bg):not(.and-hole):not(.call-keypad):not(.call-sheet):not(.video-call-stage):not(.video-call-ui) {
  position: relative; z-index: 1;
}
.android-call .call-chip {
  font-size: 12px; font-weight: 500; color: #c4c7c5;
  letter-spacing: 0.2px; margin-bottom: 28px; text-transform: none;
  background: #2e3133; padding: 6px 14px; border-radius: 999px;
}
.and-quick-replies {
  display: flex; gap: 10px; justify-content: center;
  width: 100%; margin-bottom: 22px;
}
.and-quick-replies .and-reply {
  border: none; cursor: pointer;
  background: #2e3133; color: #e8eaed;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 10px 18px; border-radius: 999px;
}
.android-call .call-label { font-size: 14px; color: #9aa0a6; margin-bottom: 18px; font-weight: 500; }
.android-call .call-avatar {
  width: 104px; height: 104px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 500; color: #fff; margin-bottom: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.android-call .call-avatar.lg { width: 120px; height: 120px; font-size: 44px; }
.android-call .call-avatar.pulse { animation: ring-bounce 1.4s ease-in-out infinite; }
.android-call .call-name {
  font-size: 30px; font-weight: 400; margin-bottom: 6px; color: #e8eaed;
}
.android-call .call-sub { font-size: 15px; color: #9aa0a6; }
.android-call .call-timer {
  font-size: 18px; margin-top: 8px; color: #c4c7c5; font-variant-numeric: tabular-nums;
}
.android-call .call-spacer { flex: 1; }
.android-call .call-buttons {
  display: flex; justify-content: center; width: 100%;
  margin-bottom: 8px;
}
.android-call .call-btn {
  width: 72px; height: 72px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.android-call .call-btn svg { width: 30px; height: 30px; }
.android-call .call-btn.decline { background: #e53935; }
.android-call .call-btn.accept { background: #34a853; }
.android-call .call-btn.end { background: #e53935; }
.and-answer-row {
  display: flex; justify-content: space-between; width: 100%; max-width: 280px;
  padding: 0 8px; margin-bottom: 10px;
}
.and-answer-labels {
  display: flex; justify-content: space-between; width: 100%; max-width: 280px;
  padding: 0 18px; font-size: 13px; color: #9aa0a6; margin-bottom: 6px;
}
.android-call .in-call-row {
  display: flex; justify-content: space-around; width: 100%;
  margin-bottom: 28px; color: #c4c7c5;
}
.android-call .in-call-row .ic {
  width: 56px; height: 56px; border-radius: 50%;
  background: #2e3133; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; color: #e8eaed;
}
.android-call .in-call-row .ic svg { width: 24px; height: 24px; }
.android-call .call-ctrl.on .ic {
  background: #8ab4f8; color: #062e6f;
}
@keyframes ring-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.android-call.video-on { background: #0b1a14; }
.android-call.video-on .and-call-bg {
  background: radial-gradient(circle at 50% 40%, rgba(52,168,83,0.25), #0b1a14 60%);
}

/* In-call keypad + sheets */
.call-keypad {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(10, 12, 16, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 24px 20px calc(28px + var(--safe-bottom));
}
.pad-display {
  width: 100%; text-align: center; font-size: 34px; letter-spacing: 2px;
  min-height: 1.2em; margin-bottom: 18px; color: #fff;
  font-variant-numeric: tabular-nums;
}
.pad-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  width: 100%; max-width: 300px; justify-items: center;
}
.pad-key {
  width: 72px; height: 72px; aspect-ratio: 1;
  border-radius: 50%; border: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12); color: #fff;
  font-size: 28px; font-weight: 300; cursor: pointer;
  flex-shrink: 0;
}
.pad-key.pressed { background: rgba(255,255,255,0.28); transform: scale(0.96); }
.pad-hide {
  margin-top: 18px; background: none; border: none; color: #8ab4ff;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; padding: 10px 16px;
}
.call-sheet {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 12px calc(16px + var(--safe-bottom));
}
.sheet-card {
  width: 100%; max-width: 400px; background: #2c2c2e; border-radius: 16px;
  padding: 14px 12px 10px; color: #fff;
}
.plat-android .sheet-card { background: #2e3133; border-radius: 28px; }
.sheet-title {
  text-align: center; font-weight: 650; font-size: 15px; margin-bottom: 10px;
}
.sheet-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: none; color: #fff; text-align: left;
  padding: 10px 8px; border-radius: 10px; cursor: pointer; font: inherit;
}
.sheet-row:active { background: rgba(255,255,255,0.08); }
.sheet-row small { display: block; color: #aaa; font-size: 12px; margin-top: 2px; }
.sheet-av {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sheet-cancel {
  width: 100%; margin-top: 6px; padding: 12px;
  border: none; border-radius: 10px; background: rgba(255,255,255,0.1);
  color: #8ab4ff; font: inherit; font-weight: 650; cursor: pointer;
}

/* Lock / notification screens */
.ios-lock, .android-lock {
  height: 100%;
  position: relative;
  overflow: hidden;
}
.lock-clock {
  position: relative; z-index: 1;
  text-align: center;
  padding-top: calc(88px + var(--safe-top));
  color: #fff;
}
html.phone-edge .lock-clock {
  padding-top: calc(48px + var(--safe-top));
}
@media (min-width: 700px) {
  html.phone-edge .lock-clock {
    padding-top: calc(88px + var(--safe-top));
  }
}
.lock-clock .time {
  font-size: 78px; font-weight: 200; letter-spacing: -2px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plat-android .lock-clock .time { font-weight: 300; font-size: 72px; }
.lock-clock .meridiem { font-size: 18px; margin-top: 4px; }
.lock-clock .date { font-size: 18px; margin-top: 6px; opacity: 0.92; font-weight: 400; }
.ios-lock .lock-icon {
  width: 22px; height: 22px; margin: 0 auto 10px; opacity: 0.9; color: #fff;
}
.ios-lock .lock-icon svg { width: 100%; height: 100%; }

.notif-banner {
  position: relative; z-index: 2;
  margin: 28px 14px 0;
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  color: #000;
  padding: 12px 14px;
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.35s ease;
}
.notif-banner.show { transform: translateY(0); opacity: 1; }
.notif-banner .notif-app-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: #30d158; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.notif-banner .notif-app-icon.has-photo { background-color: #ddd; color: transparent; }
.notif-banner .notif-app-icon svg { width: 20px; height: 20px; }
.notif-banner .notif-app-icon.generic { background: #5b6cff; }
.notif-banner .notif-body { flex: 1; min-width: 0; }
.notif-banner .notif-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: #555; margin-bottom: 2px; font-weight: 500;
}
.notif-banner .notif-sender { font-weight: 700; font-size: 15px; color: #000; }
.notif-banner .notif-msg { font-size: 14px; color: #222; line-height: 1.3; margin-top: 2px; }

.android-notif {
  position: relative; z-index: 2;
  margin: 18px 12px 0;
  border-radius: 24px;
  background: #2e3133;
  color: #e8eaed;
  padding: 14px 16px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.3s ease;
}
.android-notif.show { transform: translateY(0); opacity: 1; }
.android-notif .an-top {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9aa0a6; margin-bottom: 8px;
}
.android-notif .an-app-icon {
  width: 18px; height: 18px; border-radius: 4px; background: #34a853; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.android-notif .an-app-icon.has-photo { background-color: #555; color: transparent; }
.android-notif .an-app-icon svg { width: 12px; height: 12px; }
.android-notif .an-app-icon.generic { background: #8ab4ff; }
.android-notif .an-app-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: #5b6cff; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.android-notif .an-app-mark.has-photo { color: transparent; }
.android-notif .an-now { margin-left: auto; }
.android-notif .an-row { display: flex; gap: 12px; align-items: flex-start; }
.android-notif .an-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; flex-shrink: 0;
}
.android-notif .an-sender { font-weight: 600; font-size: 15px; }
.android-notif .an-msg { font-size: 14px; color: #c4c7c5; margin-top: 2px; line-height: 1.3; }

.lock-bottom {
  position: absolute; bottom: 34px; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; padding: 0 36px;
}
.lock-bottom .lb {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.lock-bottom .lb svg { width: 22px; height: 22px; }
.android-lock .lock-bottom { justify-content: center; bottom: 40px; }
.android-lock .fingerprint {
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.28);
  position: relative;
  opacity: 0.75;
}
.android-lock .fingerprint::before {
  content: "";
  position: absolute; inset: 10px;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(-20deg);
}

.countdown-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  color: #fff; font-size: 72px; font-weight: 200;
  pointer-events: none;
}

/* ===== Remote pairing (phone overlay) ===== */
.remote-status {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.remote-status.on { color: var(--accent); }
.remote-status.waiting { color: var(--muted); }

.pair-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.92);
  font-family: var(--font-display);
}
.pair-overlay[hidden] { display: none !important; }

.pair-overlay-inner {
  width: min(390px, 100%);
  background: var(--tech-surface);
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  padding: 0 0 12px;
  text-align: left;
  color: var(--tech-text);
}

.pair-overlay-inner h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tech-accent);
  border-bottom: 1px solid #141414;
  padding: 14px 16px 10px;
}

.pair-overlay-lead {
  margin: 12px 16px 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #5c5c5c;
  line-height: 1.6;
}

.pair-code {
  margin: 0 0 6px;
  padding: 18px 0 6px;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: #fff;
  text-align: center;
}

.pair-qr {
  display: block;
  margin: 12px auto;
  width: 180px;
  height: 180px;
  padding: 12px;
  border-radius: 0;
  border: 1px solid var(--tech-line);
  background: #fff;
  box-sizing: border-box;
}

.pair-overlay-url {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--tech-muted);
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.pair-overlay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tech-muted);
  text-align: center;
}

.pair-overlay-actions {
  margin: 0 16px;
  gap: 8px;
}
.pair-overlay-actions.btn-row {
  margin-bottom: 0;
}
.pair-overlay-actions .btn {
  flex: 1;
  min-height: var(--tap);
  margin: 0;
  border: 1px solid var(--tech-line-strong);
  border-radius: var(--tech-radius);
  background: transparent;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pair-overlay-actions .btn:active { opacity: 0.85; }
.pair-overlay-actions .btn.primary {
  background: var(--tech-accent);
  border-color: var(--tech-accent);
  color: #000;
  font-weight: 500;
}

/* ===== Remote controller page ===== */
/* Generator locks html to overflow:hidden / 100dvh — unlock document scroll for remote */
html:has(body.remote-page) {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}
body.remote-page {
  width: auto;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  overflow: visible;
  overscroll-behavior: auto;
  touch-action: auto;
  color: var(--tech-text);
  user-select: text;
  -webkit-user-select: text;
  font-family: var(--font-display);
  background: var(--tech-bg);
}

body.remote-page .remote-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 12px calc(24px + var(--safe-bottom));
}

body.remote-page .remote-panel {
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  background: var(--tech-surface);
  padding: 0 0 18px;
}

body.remote-page .remote-header {
  margin-bottom: 0;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #141414;
}

body.remote-page .remote-header h1 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--tech-accent);
}

body.remote-page .remote-header p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--tech-muted);
  max-width: 42em;
}

body.remote-page .remote-status-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--tech-line);
  border-left: 3px solid var(--tech-accent);
  border-radius: 0;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tech-muted);
}

body.remote-page .remote-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #5c5c5c;
  box-shadow: none;
  flex-shrink: 0;
}
body.remote-page .remote-dot.on {
  background: var(--tech-accent);
  box-shadow: 0 0 8px rgba(0, 177, 64, 0.7);
}
body.remote-page .remote-dot.warn { background: #b59a3c; }

body.remote-page #conn-label { color: #fff; }
body.remote-page .remote-status-bar.is-connected,
body.remote-page .remote-status-bar:has(.remote-dot.on) {
  color: var(--tech-accent);
}
body.remote-page #phone-meta { opacity: 0.75; color: var(--tech-muted); }

body.remote-page .remote-status-bar .btn {
  margin-left: auto;
  border-radius: var(--tech-radius);
  border: 1px solid var(--tech-line-strong);
  background: transparent;
  color: #fff;
  min-height: 34px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.remote-page .remote-join {
  padding: 16px;
  background: transparent;
  border: none;
  margin-bottom: 0;
}

body.remote-page .remote-join .field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tech-muted);
}

body.remote-page .remote-join .code-input {
  width: 100%;
  text-align: center;
  font-size: clamp(22px, 7vw, 34px);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  font-weight: 400;
  text-transform: uppercase;
  border-radius: var(--tech-radius);
  border: 1px solid var(--tech-line);
  background: #101010;
  color: #fff;
  font-family: var(--font-mono);
  min-height: 64px;
  font-variant-numeric: tabular-nums;
}

body.remote-page .remote-join .code-input:focus {
  outline: 2px solid var(--tech-accent);
  outline-offset: 2px;
  border-color: var(--tech-line);
  box-shadow: none;
}

body.remote-page .remote-join .btn-row {
  margin: 10px 0 0;
  gap: 8px;
}

body.remote-page .remote-join > .btn-row:first-child {
  margin: 0 0 16px;
}

body.remote-page .remote-join .btn {
  flex: 1;
  min-height: var(--tap);
  margin: 0;
  border: 1px solid var(--tech-line-strong);
  border-radius: var(--tech-radius);
  background: transparent;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.remote-page .remote-join .btn.primary {
  border-color: var(--tech-accent);
  background: var(--tech-accent);
  color: #000;
  font-weight: 500;
}

.qr-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 9, 11, 0.92);
}

.qr-scan-overlay[hidden] { display: none !important; }

.qr-scan-panel {
  width: min(420px, 100%);
  border: 1px solid var(--tech-line);
  border-radius: 0;
  background: var(--tech-surface);
  padding: 16px;
  color: var(--tech-text);
}

.qr-scan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.qr-scan-top h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tech-accent);
}

.qr-scan-top .btn {
  min-height: 36px;
  margin: 0;
  border: 1px solid var(--tech-line-strong);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-scan-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0;
  background: #000;
  border: 1px solid var(--tech-line);
}

.qr-scan-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qr-scan-frame {
  position: absolute;
  inset: 18%;
  border: 2px solid var(--tech-accent);
  border-radius: 0;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.qr-scan-status {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: #5c5c5c;
  text-align: center;
}

.qr-scan-file-btn {
  flex: 1;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 0;
  border: 1px solid var(--tech-line-strong);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

body.remote-page .remote-join .field-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--tech-muted);
  line-height: 1.45;
}

body.remote-page .join-error {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin: 10px 0 0;
  border: 1px solid var(--danger);
  border-radius: 0;
  padding: 10px 12px;
  background: transparent;
}

body.remote-page .remote-controls.controls {
  position: static;
  max-height: none;
  overflow: visible;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 12px 12px calc(14px + var(--safe-bottom));
  color: var(--tech-text);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.remote-page .remote-controls .control-section {
  border: 1px solid var(--tech-line);
  margin-bottom: 0;
  padding: 14px 14px 12px;
  background: var(--tech-surface);
}
body.remote-page .remote-controls .control-section:first-of-type {
  border-top: 1px solid var(--tech-line);
}
body.remote-page .remote-controls .control-section:last-of-type {
  border-bottom: 1px solid var(--tech-line);
}

body.remote-page .remote-controls .field-label {
  color: var(--tech-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

body.remote-page .remote-controls .field-label span {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

body.remote-page .remote-controls .field-note {
  color: #5c5c5c;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

body.remote-page .remote-controls .select,
body.remote-page .remote-controls .text-input {
  width: 100%;
  min-height: var(--tap);
  border-radius: 0;
  border: 1px solid var(--tech-line);
  background: #101010;
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
}

body.remote-page .remote-controls .select:focus,
body.remote-page .remote-controls .text-input:focus {
  outline: 2px solid var(--tech-accent);
  outline-offset: 2px;
  border-color: var(--tech-line);
  box-shadow: none;
}

body.remote-page .remote-controls .select option {
  background: var(--tech-surface-solid);
  color: #fff;
}

body.remote-page .remote-controls .btn {
  min-height: var(--tap);
  border-radius: 0;
  border: 1px solid var(--tech-line-strong);
  background: transparent;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.remote-page .remote-controls .btn-row .btn,
body.remote-page .remote-controls .btn-row .photo-pick {
  flex: 1 1 auto;
  min-width: min(100%, 120px);
}

body.remote-page .remote-controls .segmented {
  margin-bottom: 10px;
  flex-wrap: wrap;
}

body.remote-page .remote-controls .segmented button {
  flex: 1 1 40%;
  min-width: 0;
  font-size: 11px;
  padding: 10px 8px;
}

body.remote-page .remote-controls .row-editor-item {
  padding: 12px;
  gap: 10px;
}

body.remote-page .remote-controls .row-editor-actions {
  width: 100%;
  justify-content: flex-start;
}

body.remote-page .remote-controls .row-editor-actions .btn {
  flex: 1 1 auto;
  min-width: 64px;
}

body.remote-page .remote-controls .btn.primary {
  background: var(--tech-accent);
  color: #000;
  border-color: var(--tech-accent);
  font-weight: 500;
}
body.remote-page .remote-controls .btn.armed {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  font-weight: 400;
}

body.remote-page .remote-controls input[type="range"] {
  accent-color: var(--tech-accent);
}

body.remote-page .remote-controls .contact-photo-preview {
  border-radius: 0;
  border: 1px solid var(--tech-line-strong);
}

body.remote-page .remote-trigger-bar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 4px -12px calc(-14px - var(--safe-bottom));
  padding: 12px 12px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--tech-line);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.remote-page .remote-trigger-bar .btn {
  flex: 1;
  min-width: 64px;
  min-height: 52px;
  margin: 0;
  border: 1px solid var(--tech-line-strong);
  border-radius: 0;
  font-size: 13px;
  font-weight: 400;
}

body.remote-page .remote-trigger-bar .btn.primary {
  background: var(--tech-accent);
  color: #000;
  border-color: var(--tech-accent);
  font-weight: 500;
}

body.remote-page .remote-footer {
  margin: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: #5c5c5c;
  text-align: center;
}

body.remote-page .remote-footer a {
  color: var(--tech-muted);
  text-decoration: none;
}
body.remote-page .remote-footer a:hover {
  color: #fff;
}

body.remote-page .legal-note {
  margin: 6px 16px 0;
  color: #5c5c5c;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

body.remote-page .remote-footer + .legal-note {
  margin-top: 12px;
}

/* Remote — phone narrow tweaks */
@media (max-width: 420px) {
  body.remote-page .remote-status-bar .btn {
    margin-left: 0;
    width: 100%;
  }

  body.remote-page .remote-controls .segmented button {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }

  body.remote-page .remote-controls .segmented button:last-child {
    border-bottom: none;
  }

  body.remote-page .remote-controls .row-editor-item {
    grid-template-columns: 1fr;
  }

  body.remote-page .remote-controls .row-editor-actions {
    justify-content: stretch;
  }
}

/* Remote — tablet / laptop */
@media (min-width: 720px) {
  body.remote-page .remote-shell {
    max-width: 980px;
    padding: calc(28px + var(--safe-top)) 24px calc(36px + var(--safe-bottom));
  }

  body.remote-page .remote-header {
    padding: 20px 24px 16px;
  }

  body.remote-page .remote-header h1 {
    font-size: 13px;
  }

  body.remote-page .remote-header p {
    font-size: 15px;
    max-width: 52em;
  }

  body.remote-page .remote-join {
    max-width: 420px;
    margin: 0 auto;
    padding: 28px 24px 20px;
  }

  body.remote-page .remote-join .code-input {
    font-size: 36px;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
  }

  body.remote-page .remote-status-bar {
    padding: 14px 20px;
    font-size: 12px;
  }

  body.remote-page .remote-controls.controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px calc(18px + var(--safe-bottom));
    max-width: 560px;
  }

  body.remote-page .remote-controls.controls:has(#phone-section:not([hidden]), #video-remote-section:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 14px 16px;
    max-width: none;
    width: 100%;
  }

  body.remote-page .remote-controls.controls:has(#phone-section:not([hidden]), #video-remote-section:not([hidden])) > .control-section {
    grid-column: 1;
  }

  body.remote-page .remote-controls.controls:has(#phone-section:not([hidden]), #video-remote-section:not([hidden])) > #phone-section,
  body.remote-page .remote-controls.controls:has(#phone-section:not([hidden]), #video-remote-section:not([hidden])) > #video-remote-section {
    grid-column: 2;
    grid-row: 1 / span 12;
    min-height: 100%;
    align-self: stretch;
  }

  body.remote-page .remote-trigger-bar {
    grid-column: 1 / -1;
    width: auto;
    margin: 4px -20px calc(-18px - var(--safe-bottom));
    padding: 14px 20px calc(14px + var(--safe-bottom));
    gap: 12px;
  }

  body.remote-page .remote-trigger-bar .btn {
    flex: 0 1 280px;
    min-height: 48px;
  }

  body.remote-page .remote-controls .control-section {
    padding: 16px 18px 14px;
  }

  body.remote-page .remote-controls .field-label {
    font-size: 13px;
  }

  body.remote-page .remote-controls .segmented button {
    flex: 1 1 auto;
    font-size: 12px;
  }

  body.remote-page .remote-controls .btn-row .btn,
  body.remote-page .remote-controls .btn-row .photo-pick {
    flex: 0 1 auto;
    min-width: 110px;
  }

  body.remote-page .remote-controls .row-editor-actions {
    width: auto;
    justify-content: flex-end;
  }

  body.remote-page .remote-footer,
  body.remote-page .legal-note {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1100px) {
  body.remote-page .remote-shell {
    max-width: 1120px;
  }

  body.remote-page .remote-controls.controls:has(#phone-section:not([hidden]), #video-remote-section:not([hidden])) {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 16px 20px;
  }
}

/* ===== Privacy policy document ===== */
html:has(body.privacy-page) {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

body.privacy-page {
  width: auto;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  overflow: visible;
  overscroll-behavior: auto;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  color: var(--tech-text);
  font-family: var(--font-display);
  background: var(--tech-bg);
}

.privacy-shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
}

.privacy-panel {
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  background: var(--tech-surface);
  padding: 24px 18px 18px;
  line-height: 1.65;
  font-size: 15px;
}

.privacy-back {
  margin: 0 0 20px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.privacy-back a,
.privacy-panel a {
  color: var(--tech-muted);
  text-decoration: none;
}

.privacy-back a:hover,
.privacy-panel a:hover {
  color: #fff;
}

.privacy-header {
  margin-bottom: 22px;
}

.privacy-header h1 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--tech-accent);
}

.privacy-subhead {
  margin: 0 0 12px;
  color: var(--tech-muted);
  font-size: 13px;
  line-height: 1.5;
}

.privacy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #5c5c5c;
}

.privacy-panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tech-accent);
}

.privacy-panel h3 {
  margin: 18px 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

.privacy-panel p {
  margin: 0 0 12px;
  color: var(--tech-muted);
}

.privacy-panel ul {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  color: var(--tech-muted);
}

.privacy-panel li {
  margin: 0 0 8px;
}

.privacy-panel li strong {
  color: #fff;
}

.privacy-panel hr {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--tech-line);
}

.privacy-footer {
  margin-top: 16px;
}

.privacy-footer p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tech-muted);
}

.privacy-footer a {
  color: var(--tech-muted);
  text-decoration: none;
}

.privacy-footer a:hover {
  color: #fff;
}

.privacy-footer .legal-note {
  text-align: left;
  color: #5c5c5c;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

/* ===== Help / knowledge base ===== */
html:has(body.help-page) {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

body.help-page {
  width: auto;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  overflow: visible;
  overscroll-behavior: auto;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  color: var(--tech-text);
  font-family: var(--font-display);
  background: var(--tech-bg);
}

.help-shell {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: calc(24px + var(--safe-top)) 16px calc(36px + var(--safe-bottom));
}

.help-shell--wide {
  max-width: 920px;
}

.help-panel {
  border: 1px solid var(--tech-line);
  border-radius: var(--tech-radius);
  background: var(--tech-surface);
  padding: 24px 18px 20px;
  line-height: 1.65;
  font-size: 15px;
}

.help-back {
  margin: 0 0 20px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.help-back a,
.help-panel a,
.help-footer a {
  color: var(--tech-muted);
  text-decoration: none;
}

.help-back a:hover,
.help-panel a:hover,
.help-footer a:hover {
  color: #fff;
}

.help-header {
  margin-bottom: 22px;
}

.help-kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tech-accent);
}

.help-header h1 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.help-lead {
  margin: 0;
  color: var(--tech-muted);
  font-size: 15px;
  max-width: 38em;
}

.help-panel h2 {
  margin: 28px 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tech-accent);
}

.help-panel h3 {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.help-panel p {
  margin: 0 0 12px;
  color: var(--tech-muted);
}

.help-panel ul,
.help-panel ol {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  color: var(--tech-muted);
}

.help-panel li {
  margin: 0 0 8px;
}

.help-panel li strong,
.help-panel p strong {
  color: #fff;
  font-weight: 600;
}

.help-panel hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--tech-line);
}

.help-callout {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--tech-line);
  background: #050505;
  color: var(--tech-muted);
  font-size: 14px;
}

.help-callout strong {
  color: #fff;
}

.help-figure {
  margin: 0 0 18px;
  border: 1px solid var(--tech-line);
  background: #050505;
}

.help-figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.help-figure--phone {
  max-width: 320px;
}

.help-figure--phone img {
  aspect-ratio: 9 / 16;
  object-fit: contain;
  object-position: top center;
  background: #000;
}

.help-figure figcaption {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--tech-line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #5c5c5c;
  line-height: 1.4;
}

.help-toc {
  display: grid;
  gap: 22px;
  margin: 8px 0 0;
}

.help-toc-group h2 {
  margin: 0 0 12px;
}

.help-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.help-toc-list a {
  display: block;
  padding: 14px 14px 12px;
  border: 1px solid var(--tech-line);
  background: #050505;
  color: var(--tech-muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.help-toc-list a:hover {
  border-color: #333;
  color: #fff;
}

.help-toc-list strong {
  display: block;
  margin: 0 0 4px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.help-toc-list span {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: #7a7a7a;
}

.help-steps {
  counter-reset: help-step;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.help-steps li {
  position: relative;
  counter-increment: help-step;
  margin: 0 0 12px;
  padding: 12px 14px 12px 48px;
  border: 1px solid var(--tech-line);
  background: #050505;
}

.help-steps li::before {
  content: counter(help-step, decimal-leading-zero);
  position: absolute;
  left: 12px;
  top: 13px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--tech-accent);
}

.help-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--tech-line);
  font-family: var(--font-mono);
  font-size: 12px;
}

.help-nav a {
  color: var(--tech-muted);
}

.help-nav a:hover {
  color: #fff;
}

.help-footer {
  margin-top: 18px;
}

.help-footer p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tech-muted);
}

.help-footer .legal-note {
  text-align: left;
  color: #5c5c5c;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

@media (min-width: 720px) {
  .help-panel {
    padding: 32px 28px 24px;
  }

  .help-toc-list {
    grid-template-columns: 1fr 1fr;
  }

  .help-figure--phone {
    max-width: 280px;
  }
}

/* ===== Commercial UI kit ===== */

/* Sheet handle */
.sheet-handle {
  display: block;
  width: 36px;
  height: 2px;
  margin: 0 auto var(--space-3);
  border-radius: 0;
  background: var(--panel-border);
  flex-shrink: 0;
}

/* Mobile scrim behind controls panel */
.controls-scrim {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-out);
}
.controls-scrim.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Quick actions bar */
.quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -14px var(--space-3);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--panel-border);
}
.quick-actions .btn {
  flex: 1;
  position: relative;
  min-height: var(--tap);
  border-radius: 0;
  font-size: 12px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.quick-actions .btn.armed {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.quick-actions .btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.qa-countdown {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 0;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
}

/* Cue progress */
.cue-progress {
  width: 100%;
  height: 2px;
  margin: 0 0 var(--space-3);
  border-radius: 0;
  background: var(--panel-border);
  overflow: hidden;
}
.cue-progress i,
.cue-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 0;
  background: var(--accent);
  transition: width 80ms linear;
}

/* Mode picker */
.mode-picker {
  margin-bottom: var(--space-3);
  border: 1px solid var(--panel-border);
  background: var(--panel-bg-solid);
}
.mode-cats {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 1px solid var(--panel-border);
}
.mode-cats::-webkit-scrollbar { display: none; }
.mode-cats .mode-cat {
  flex: 1;
  min-height: var(--tap);
  padding: 0 10px;
  border-radius: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.mode-cats .mode-cat:hover { color: var(--text); }
.mode-cats .mode-cat.on {
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.mode-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 0;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.mode-tile .ui-icon {
  color: var(--faint);
  opacity: 1;
  width: 16px;
  height: 16px;
}
.mode-tile:hover {
  color: var(--text);
  background: var(--panel-elevated);
}
.mode-tile.active {
  background: var(--panel-elevated);
  border-color: transparent;
  border-left-color: var(--accent);
  color: var(--text);
}
.mode-tile.active .ui-icon {
  color: var(--accent);
  opacity: 1;
}
.mode-tile:active { transform: none; }

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.accordion-item {
  border-radius: 0;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg-solid);
  overflow: hidden;
}
.accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 14px 16px 10px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.accordion-head::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  transform: rotate(45deg);
  transition: transform var(--duration) var(--ease-out);
  flex-shrink: 0;
}
.accordion-item.open .accordion-head::after {
  transform: rotate(-135deg);
}
.accordion-body {
  display: none;
  padding: 12px 16px 16px;
  font-size: var(--font-size-sm);
  color: var(--muted);
  line-height: 1.45;
}
.accordion-item.open .accordion-body {
  display: block;
}

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--panel-elevated);
  border: 1px solid var(--panel-border);
  transition: background 0.15s, border-color 0.15s;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: none;
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .switch-track {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
  background: var(--accent-hi);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Segmented control */
.segmented {
  display: flex;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--panel-border);
  gap: 0;
}
.segmented button {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 8px 10px;
  border: none;
  border-right: 1px solid var(--panel-border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button:last-child { border-right: none; }
.segmented button.on {
  background: var(--panel-elevated);
  color: var(--accent);
  box-shadow: none;
}

#media-segmented button {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 0 8px;
}

#msg-play-segmented button {
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 8px 6px;
  line-height: 1.25;
  white-space: normal;
}

/* Home layout visual editor */
.home-layout-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hle-pages {
  margin-bottom: 0;
}
.hle-grid,
.hle-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.35);
  min-height: 72px;
}
.hle-dock {
  grid-template-columns: repeat(6, 1fr);
  background: rgba(255, 255, 255, 0.06);
}
.hle-dock-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hle-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: grab;
  min-width: 0;
  touch-action: manipulation;
}
.hle-tile:active { cursor: grabbing; }
.hle-tile.on {
  border-color: var(--accent);
  background: rgba(0, 177, 64, 0.12);
}
.hle-tile.dragging { opacity: 0.45; }
.hle-tile.hle-drop-target,
[data-hle-drop].hle-drop-target {
  border-color: var(--accent);
  background: rgba(0, 177, 64, 0.18);
}
/* While touch-dragging, lock pan so the finger owns rearrange */
.home-layout-editor.hle-dragging .hle-grid,
.home-layout-editor.hle-dragging .hle-dock,
.home-layout-editor.hle-dragging .hle-tile {
  touch-action: none;
}
.hle-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hle-icon svg { width: 18px; height: 18px; }
.hle-label {
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hle-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  padding: 12px 0;
}
.hle-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

/* Row editor */
.row-editor {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.row-editor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3);
  border-radius: 0;
  border: 1px solid var(--panel-border);
  border-bottom: none;
  background: var(--panel-elevated);
}
.row-editor-item:last-child {
  border-bottom: 1px solid var(--panel-border);
}
.row-editor-summary {
  min-width: 0;
  font-size: var(--font-size-md);
  color: var(--text);
  line-height: 1.35;
}
.row-editor-summary > span:not(.ui-icon) {
  display: block;
  margin-top: 2px;
  font-size: var(--font-size-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-editor-summary .ui-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}
.row-editor-summary small {
  display: block;
  margin-top: 2px;
  font-size: var(--font-size-xs);
  color: var(--muted);
}
.row-editor-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.row-editor-actions .btn {
  flex: 0 0 auto;
  min-width: 36px;
  padding: 8px;
}
.row-editor-item > .text-input,
.row-editor-item > textarea.text-input,
.row-editor-item > .photo-row,
.row-editor-item > .btn-row,
.row-editor-item > .select {
  grid-column: 1 / -1;
  min-width: 0;
  margin-bottom: 0;
}
.row-editor-empty {
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--muted);
  line-height: 1.45;
}

/* Inline SVG icons */
.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}
.ui-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.ui-icon.size-16 { width: 16px; height: 16px; }
.ui-icon.size-18 { width: 18px; height: 18px; }
.ui-icon.size-20 { width: 20px; height: 20px; }

/* Toast host */
.toast-host {
  position: fixed;
  z-index: 400;
  left: 50%;
  bottom: calc(var(--space-4) + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: 0;
  background: var(--panel-bg-solid);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: center;
  box-shadow: var(--shadow-overlay);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.ok {
  border-color: var(--accent);
  color: var(--ok);
}
.toast.err {
  border-color: var(--danger);
  color: var(--danger);
}

.controls.sheet-full {
  max-height: min(92vh, 900px);
}
.controls.sheet-peek {
  max-height: 38vh;
}

/* Video stage layer */
.video-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  /* #010101, not #000 — same iOS status-bar sampling rule as phone/solid */
  background: #010101;
}
/* Temp / tint / luminance — same multiply grade as phone/social */
.video-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: var(--video-grade, #fff);
  mix-blend-mode: multiply;
}
.video-layer video,
.video-layer img {
  width: 100%;
  height: 100%;
  display: block;
}
.video-layer.cover video,
.video-layer.cover img {
  object-fit: cover;
}
.video-layer.contain video,
.video-layer.contain img {
  object-fit: contain;
}

/* Video call UI — full-bleed remote + overlaid chrome */
.ios-call.video-call,
.android-call.video-call {
  padding: 0;
  align-items: stretch;
  text-align: center;
  background: #0a0a0a;
  overflow: hidden;
}
.android-call.video-call {
  color: #fff;
}
.ios-call.video-call > .video-call-stage,
.android-call.video-call > .video-call-stage,
.ios-call.video-call > .video-call-ui,
.android-call.video-call > .video-call-ui {
  position: absolute;
  inset: 0;
}
.video-call-stage {
  z-index: 1;
  overflow: hidden;
  background: #0a0a0a;
}
.video-call-remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.video-call-remote.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}
.video-remote-av {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}
.video-call-pip {
  position: absolute;
  right: 12px;
  top: calc(12px + var(--safe-top));
  width: 96px;
  height: 132px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background: #1a1a1a;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: #fff;
}
.ios-call.video-call .video-call-pip {
  border-radius: 20px;
}
.android-call.video-call .video-call-pip {
  border-radius: 12px;
  border-width: 1.5px;
  border-color: rgba(255, 255, 255, 0.28);
}
.video-call-pip video,
.video-call-pip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-call-pip.mirrored video {
  transform: scaleX(-1);
}
.video-call-ui {
  z-index: 3;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  color: #fff;
}
.video-call-scrim-top,
.video-call-scrim-bottom {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
.video-call-scrim-top {
  top: 0;
  height: 42%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.22) 55%,
    transparent 100%
  );
}
.video-call-scrim-bottom {
  bottom: 0;
  height: 48%;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 50%,
    transparent 100%
  );
}
.video-call-top {
  position: relative;
  z-index: 1;
  padding: calc(52px + var(--safe-top)) 20px 0;
  text-align: center;
}
html.phone-edge .video-call-top {
  padding-top: calc(28px + var(--safe-top));
}
@media (min-width: 700px) {
  html.phone-edge .video-call-top {
    padding-top: calc(52px + var(--safe-top));
  }
}
.video-call-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0 24px calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}
.ios-call.video-call .video-call-bottom .in-call-grid {
  margin: 0 0 20px;
  width: 100%;
}
.android-call.video-call .video-call-bottom .in-call-row {
  margin: 0 0 20px;
  width: 100%;
  color: #fff;
}
.ios-call.video-call .video-call-bottom .call-buttons,
.android-call.video-call .video-call-bottom .call-buttons {
  margin-bottom: 10px;
}
.ios-call.video-call .video-call-top .call-label {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.ios-call.video-call .video-call-top .call-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.1px;
  margin-bottom: 2px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.ios-call.video-call .video-call-top .call-timer {
  font-size: 16px;
  margin-top: 4px;
  opacity: 0.92;
  font-variant-numeric: tabular-nums;
}
.ios-call.video-call .video-call-top .call-live-status {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
  min-height: 0;
}
.android-call.video-call .video-call-top .call-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
  font-weight: 500;
}
.android-call.video-call .video-call-top .call-name {
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.android-call.video-call .video-call-top .call-timer {
  font-size: 15px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}
.android-call.video-call .in-call-row .ic {
  background: rgba(46, 49, 51, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.android-call.video-call .call-ctrl.on .ic {
  background: #8ab4f8;
  color: #062e6f;
}
.ios-call.video-call .call-ctrl,
.android-call.video-call .call-ctrl {
  pointer-events: auto;
}
.ios-call.video-call .home-indicator,
.android-call.video-call .and-gesture {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  margin: 4px auto 0;
}

/* Message bubble variants */
.msg-bubble.photo {
  padding: 4px;
  max-width: 68%;
  background: rgba(255, 255, 255, 0.1);
}
.msg-bubble.photo img {
  display: block;
  width: 100%;
  max-width: 220px;
  border-radius: 14px;
}
.msg-bubble.location {
  padding: 0;
  overflow: hidden;
  max-width: 72%;
  background: rgba(255, 255, 255, 0.1);
}
.msg-bubble.location .loc-map {
  width: 100%;
  height: 120px;
  background: linear-gradient(145deg, #2a3a2e, #1a2420);
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-bubble.location .loc-label {
  padding: 8px 12px 10px;
  font-size: var(--font-size-sm);
}
.msg-bubble.green {
  background: var(--chroma-green);
  color: #fff;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Notification stack — lock screen: same in-flow spot as a Messages banner */
.notif-stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 28px 14px 0;
  pointer-events: none;
}
.android-lock > .notif-stack {
  margin: 18px 12px 0;
}
.notif-stack .notif-banner,
.notif-stack .android-notif {
  margin: 0;
}
/* Home / banner layout: hang from the top like a system banner */
.ios-home > .notif-stack,
.android-home > .notif-stack,
.ios-home > .notif-banner,
.android-home > .android-notif {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: 12px;
  right: 12px;
  margin: 0;
  z-index: 20;
}
.notif-stack .notif-card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: rgba(28, 26, 23, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-overlay);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1.35;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform var(--duration) var(--ease-out),
              opacity var(--duration) var(--ease-out);
}
.notif-stack .notif-card.show {
  transform: translateY(0);
  opacity: 1;
}

/* Feature grid (splash) */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.feature-grid .feature-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: 0;
  border: 1px solid var(--panel-border);
  background: #101010;
}
.feature-grid .feature-card .ui-icon {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
}
.feature-grid .feature-card h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.feature-grid .feature-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--muted);
  line-height: 1.45;
}

/* Splash lockup */
.splash-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.splash-lockup .app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), #2d7fd4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.splash-lockup h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Larger range thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Desktop tweaks */
@media (min-width: 900px) {
  .mode-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .controls-scrim {
    display: none;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 var(--space-2);
  padding: 4px 0;
  font-size: 14px;
  color: var(--text);
  min-height: var(--tap);
}
.switch-row > span { flex: 1; min-width: 0; }
.switch-row .switch { flex: 0 0 auto; }

.splash-lockup {
  flex-direction: row;
  text-align: left;
  align-items: flex-start;
}
.splash-app-icon {
  width: 72px;
  height: 72px;
  border-radius: 0;
  flex-shrink: 0;
  box-shadow: none;
  border: 1px solid var(--tech-line);
}
.splash-lockup .install-splash-lead { margin-bottom: 0; }

.feature-grid .feature-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: var(--font-size-md);
  color: var(--text);
}
.feature-grid .feature-card span {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--muted);
  line-height: 1.45;
}

.coach-marks {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.coach-marks[hidden] { display: none !important; }
.coach-card {
  width: min(420px, 100%);
  background: var(--panel-bg-solid);
  border: 1px solid var(--panel-border);
  border-radius: 0;
  box-shadow: none;
  padding: var(--space-4);
  pointer-events: auto;
}
.coach-card p {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-base);
  line-height: 1.45;
  color: var(--text);
}

.ui-icon svg { width: 1em; height: 1em; display: block; }
.btn.icon-btn .ui-icon { font-size: 18px; }
.reveal-fab .ui-icon { font-size: 20px; }

