/* AFKPal web app — /app/* surfaces. Keep in sync with landing-page tokens in
   docs/LANDING_PAGE_DESIGN.md. Do not touch static/styles.css (marketing). */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* The HTML `hidden` attribute is a boolean equivalent to display:none, but
   any explicit `display:` rule wins (e.g. .btn { display: inline-flex }).
   That has bitten us in modals, CTA buttons, and status pills — bake the
   override in once so [hidden] reliably hides regardless of class styles. */
[hidden] { display: none !important; }

:root {
  --bg: #050505;
  --bg-2: #0a0a0a;
  --surface: #101010;
  --surface-2: #161616;
  --surface-3: #1c1c1c;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.16);
  --text: #ffffff;
  --text-dim: #a1a1a1;
  --text-mute: #6b6b6b;
  --accent: #d2ff3a;
  --accent-dim: #a9d11f;
  --accent-glow: rgba(210,255,58,0.35);
  --danger: #ff3a5c;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --page-max: 1200px;
}

html, body { background: var(--bg); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: var(--accent); color: #000; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { letter-spacing: -0.02em; }

/* --- App shell ---------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  z-index: 40;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem;
  color: var(--text);
}
.sidebar-brand:hover { color: var(--accent); }
.sidebar-logo { color: var(--accent); font-size: 1.1rem; }
.sidebar-close {
  display: none;
  background: transparent; border: 0; color: var(--text-dim);
  cursor: pointer; padding: 6px; border-radius: 8px;
}
.sidebar-close:hover { background: var(--surface); color: var(--text); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.94rem; font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
  position: relative;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-count {
  margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px; margin-top: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 700; font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-email {
  font-size: 0.85rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 160px;
}
.user-plan {
  font-size: 0.72rem; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.12em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.user-plan.premium { color: var(--accent); }
.sign-out {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-mute);
  font-size: 0.88rem;
}
.sign-out:hover { background: var(--surface); color: var(--danger); }

/* --- Main content ------------------------------------------------------- */
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 20;
  align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(5,5,5,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.sidebar-toggle {
  background: transparent; border: 0; color: var(--text);
  cursor: pointer; padding: 6px; border-radius: 8px;
}
.sidebar-toggle:hover { background: var(--surface); }
.topbar-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1rem;
}

.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px 40px 96px;
}

.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}
.sidebar-backdrop.open { opacity: 1; }

/* --- Auth shell (login) ------------------------------------------------- */
.auth-body { background: radial-gradient(1200px 600px at 50% -10%, rgba(210,255,58,0.06), transparent), var(--bg); }
.auth-shell {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 32px 20px 40px;
}
.auth-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem;
  color: var(--text);
}
.auth-shell-inner {
  width: 100%; max-width: 460px;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 0;
}
.auth-foot { color: var(--text-mute); font-size: 0.85rem; }
.auth-foot a:hover { color: var(--accent); }

/* --- Type ramp --------------------------------------------------------- */
.kicker {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  margin-bottom: 14px;
}
h1 { font-size: clamp(1.75rem, 2.6vw, 2.3rem); font-weight: 800; margin-bottom: 8px; }
h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 6px; }
.sub { color: var(--text-dim); font-size: 1rem; margin-bottom: 28px; max-width: 68ch; }

/* --- Page header shared across pages ----------------------------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-head h1 { margin-bottom: 4px; }

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 0.94rem;
  padding: 11px 18px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #000;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 10px 28px var(--accent-glow); color: #000; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* --- Cards ------------------------------------------------------------- */
.auth-card, .account-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
}
.account-card { margin-bottom: 24px; }

/* --- Stripe purchase return modal ------------------------------------- */
body.modal-open { overflow: hidden; }

.purchase-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: purchaseModalFade 220ms ease-out;
}
.purchase-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.purchase-modal-card {
  position: relative;
  z-index: 1;
  width: 100%; max-width: 480px;
  padding: 36px 32px 32px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(140% 180% at 0% 0%, rgba(210,255,58,0.14), transparent 55%),
    radial-gradient(140% 180% at 100% 100%, rgba(210,255,58,0.08), transparent 55%),
    var(--surface);
  border: 1px solid rgba(210,255,58,0.4);
  box-shadow: 0 30px 80px -20px var(--accent-glow), 0 18px 50px rgba(0,0,0,0.55);
  text-align: left;
  animation: purchaseModalIn 360ms cubic-bezier(.2,.8,.2,1);
}
.purchase-modal.soft .purchase-modal-card {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
}
.purchase-modal.soft .purchase-modal-burst,
.purchase-modal.soft .purchase-modal-glyph { display: none; }
.purchase-modal-card h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  font-weight: 800; margin-bottom: 8px;
}
.purchase-modal-card .sub { margin-bottom: 22px; }
.purchase-modal-glyph {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(210,255,58,0.12);
  color: var(--accent);
  margin-bottom: 18px;
  animation: purchaseGlyphPop 520ms cubic-bezier(.2,1.4,.4,1) 80ms backwards;
}
.purchase-modal-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.purchase-modal-close {
  position: absolute; top: 12px; right: 12px;
  z-index: 3;
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.purchase-modal-close:hover {
  background: var(--surface-2);
  color: var(--accent);
  border-color: rgba(210,255,58,0.45);
  transform: scale(1.06);
}
.purchase-modal-close:active { transform: scale(0.96); }
.purchase-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.purchase-modal-close svg { display: block; pointer-events: none; }

/* Confetti burst — particles fan out from the modal's center across the
   full viewport, behind the card. */
.purchase-modal-burst {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.purchase-modal-burst span {
  position: absolute;
  top: 50%; left: 50%;
  width: 9px; height: 14px;
  border-radius: 1px;
  opacity: 0;
  transform-origin: center;
  animation: confettiFly 1800ms cubic-bezier(.18,.78,.36,1) forwards;
}
.purchase-modal-burst span:nth-child(1)  { background: var(--accent); --dx: -260px; --dy: -180px; --r:  720deg; animation-delay:  40ms; }
.purchase-modal-burst span:nth-child(2)  { background: #7be3ff;       --dx:  240px; --dy: -200px; --r: -680deg; animation-delay:  60ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(3)  { background: #ffffff;       --dx: -360px; --dy:  -60px; --r:  540deg; animation-delay:  80ms; }
.purchase-modal-burst span:nth-child(4)  { background: var(--accent); --dx:  340px; --dy:  -80px; --r: -480deg; animation-delay: 100ms; }
.purchase-modal-burst span:nth-child(5)  { background: #ff8aa9;       --dx: -120px; --dy: -260px; --r:  600deg; animation-delay: 120ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(6)  { background: #7be3ff;       --dx:  150px; --dy: -270px; --r: -520deg; animation-delay: 140ms; }
.purchase-modal-burst span:nth-child(7)  { background: var(--accent); --dx: -440px; --dy:   60px; --r:  720deg; animation-delay: 160ms; }
.purchase-modal-burst span:nth-child(8)  { background: #ffffff;       --dx:  420px; --dy:   80px; --r: -660deg; animation-delay: 180ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(9)  { background: #ff8aa9;       --dx: -200px; --dy:  220px; --r:  580deg; animation-delay: 200ms; }
.purchase-modal-burst span:nth-child(10) { background: var(--accent); --dx:  220px; --dy:  240px; --r: -500deg; animation-delay: 220ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(11) { background: #7be3ff;       --dx:  -60px; --dy: -320px; --r:  640deg; animation-delay: 240ms; }
.purchase-modal-burst span:nth-child(12) { background: var(--accent); --dx:   80px; --dy: -310px; --r: -740deg; animation-delay: 260ms; }
.purchase-modal-burst span:nth-child(13) { background: #ffffff;       --dx: -300px; --dy:  150px; --r:  560deg; animation-delay: 280ms; }
.purchase-modal-burst span:nth-child(14) { background: var(--accent); --dx:  300px; --dy:  170px; --r: -620deg; animation-delay: 300ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(15) { background: #ff8aa9;       --dx: -180px; --dy:  -40px; --r:  500deg; animation-delay: 320ms; }
.purchase-modal-burst span:nth-child(16) { background: #7be3ff;       --dx:  170px; --dy:  -30px; --r: -560deg; animation-delay: 340ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(17) { background: var(--accent); --dx:    0px; --dy: -380px; --r:  680deg; animation-delay: 360ms; }
.purchase-modal-burst span:nth-child(18) { background: #ffffff;       --dx:    0px; --dy:  300px; --r: -540deg; animation-delay: 380ms; }
.purchase-modal-burst span:nth-child(19) { background: var(--accent); --dx: -500px; --dy:  -10px; --r:  640deg; animation-delay: 400ms; }
.purchase-modal-burst span:nth-child(20) { background: var(--accent); --dx:  500px; --dy:    0px; --r: -640deg; animation-delay: 420ms; border-radius: 50%; }
.purchase-modal-burst span:nth-child(21) { background: #7be3ff;       --dx: -90px;  --dy:  340px; --r:  580deg; animation-delay: 440ms; }
.purchase-modal-burst span:nth-child(22) { background: #ff8aa9;       --dx:  90px;  --dy:  340px; --r: -580deg; animation-delay: 460ms; }
.purchase-modal-burst span:nth-child(23) { background: var(--accent); --dx: -380px; --dy: -260px; --r:  700deg; animation-delay: 480ms; }
.purchase-modal-burst span:nth-child(24) { background: #ffffff;       --dx:  380px; --dy: -260px; --r: -700deg; animation-delay: 500ms; border-radius: 50%; }

@keyframes confettiFly {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 220px)) rotate(var(--r, 540deg)); }
}
@keyframes purchaseModalFade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes purchaseModalIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}
@keyframes purchaseGlyphPop {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .purchase-modal-burst { display: none; }
  .purchase-modal,
  .purchase-modal-card,
  .purchase-modal-glyph { animation: none; }
}
@media (max-width: 540px) {
  .purchase-modal-card { padding: 28px 22px 24px; }
}

/* --- Auth form --------------------------------------------------------- */
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.82rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.auth-form input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 140ms ease, background 140ms ease;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.form-note { color: var(--text-mute); font-size: 0.82rem; text-align: center; margin-top: 4px; }

.auth-divider {
  position: relative; text-align: center;
  margin: 28px 0 20px;
  color: var(--text-mute); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.18em;
}
.auth-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: var(--border);
}
.auth-divider span { position: relative; background: var(--surface); padding: 0 12px; }

.social-buttons { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* --- Alerts ------------------------------------------------------------ */
.error {
  color: var(--danger);
  background: rgba(255,58,92,0.08);
  border: 1px solid rgba(255,58,92,0.24);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 16px;
  font-size: 0.9rem;
}
.info {
  color: var(--accent);
  background: rgba(210,255,58,0.06);
  border: 1px solid rgba(210,255,58,0.24);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Account / subscription ------------------------------------------- */
.status-row {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  margin: 20px 0 28px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.status-pill .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-mute);
}
.status-pill.active { color: var(--accent); border-color: rgba(210,255,58,0.3); }
.status-pill.active .status-dot { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.status-pill.warning { color: #f7c948; border-color: rgba(247,201,72,0.32); background: rgba(247,201,72,0.06); }
.status-pill.warning .status-dot { background: #f7c948; box-shadow: 0 0 10px rgba(247,201,72,0.45); }

.plans { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.plan-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 160ms ease, transform 160ms ease;
}
.plan-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan-card.featured {
  border-color: rgba(210,255,58,0.3);
  box-shadow: 0 12px 48px rgba(210,255,58,0.08);
}
.plan-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.7rem;
}
.plan-price { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-interval { font-size: 0.88rem; font-weight: 500; color: var(--text-dim); margin-left: 4px; }

/* --- Devices list ------------------------------------------------------ */
.devices-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.device-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: border-color 160ms ease, background 160ms ease;
}
.device-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.device-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-mute);
  flex-shrink: 0;
}
.device-dot.online { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.device-info { flex: 1; min-width: 0; }
.device-name {
  font-weight: 600;
  margin-bottom: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.device-meta {
  color: var(--text-mute);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.devices-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.devices-section { margin-bottom: 32px; }
.devices-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.devices-section-head h2 {
  font-size: 1.1rem; font-weight: 700;
}
.devices-section-link {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.empty {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius-lg); padding: 40px 32px; text-align: center;
  color: var(--text-dim);
  grid-column: 1 / -1;
}

/* --- Cloud phone tiles (portrait cards with preview) ------------------- */
.devices-list.cloud-tiles {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.cloud-tile {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.cloud-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.cloud-tile-preview {
  position: relative;
  display: block;
  aspect-ratio: 9 / 19;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(210,255,58,0.08), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--bg-2));
  color: var(--text-mute);
  overflow: hidden;
}
.cloud-tile-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cloud-tile-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.cloud-tile-placeholder svg {
  width: 42%; height: auto;
}
.cloud-tile-status {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.cloud-tile.is-online .cloud-tile-status { color: var(--text); }
.cloud-tile-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.cloud-tile-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cloud-tile-meta {
  color: var(--text-mute);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.cloud-tile-action {
  margin-top: 10px;
  align-self: stretch;
}

/* --- Pair dialog ------------------------------------------------------- */
.pair-dialog {
  margin: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  max-width: 440px; width: 92vw;
  padding: 32px;
}
.pair-dialog::backdrop {
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
}
.pair-dialog h2 { margin-bottom: 8px; }
.pair-qr {
  margin: 24px auto; width: 240px; height: 240px;
  background: #fff; border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; justify-content: center;
}
.pair-qr img { width: 100%; height: 100%; display: block; }
.pair-code {
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.6rem; font-weight: 600;
  letter-spacing: 0.3em;
  margin: 16px 0 8px;
  color: var(--accent);
}
.pair-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* --- Cloud page (multi-device) ---------------------------------------- */

/* Hero band: title + seat counter + progress bar. Sets the tone for the
   whole page (you have a farm, not just one phone). */
.cloud-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.cloud-hero-copy { min-width: 0; }
.cloud-hero-copy h1 {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  margin-bottom: 10px;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-dim) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cloud-hero-sub {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 56ch;
  margin: 0;
}
.cloud-hero-stat {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  min-width: 220px;
}
.cloud-stat-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 2rem; font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.cloud-stat-sep {
  color: var(--text-mute);
  margin: 0 6px;
  font-weight: 500;
}
.cloud-stat-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-mute);
}
.cloud-seats-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.cloud-seats-bar-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 260ms cubic-bezier(.16,.78,.32,1);
}

/* Section containers used for "Running phones" + "Scale up". */
.cloud-section {
  margin-bottom: 44px;
}
.cloud-section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.cloud-section-head h2 {
  font-size: 1.3rem;
  font-weight: 700;
}
.cloud-section-head .kicker { margin-bottom: 4px; }

.cloud-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Empty state — a gradient trio of phone silhouettes to hint at "farm". */
.cloud-empty {
  text-align: center;
  padding: 48px 24px 32px;
  background: radial-gradient(520px 300px at 50% 0%, rgba(210,255,58,0.08), transparent 70%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 40px;
}
.cloud-empty-visual {
  display: flex; justify-content: center; align-items: flex-end; gap: 12px;
  margin-bottom: 28px;
  min-height: 110px;
}
.cloud-empty-phone {
  width: 56px; height: 100px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  padding: 6px;
  position: relative;
  transform: translateY(0);
  transition: transform 260ms ease;
}
.cloud-empty-phone::after {
  content: '';
  position: absolute; left: 50%; bottom: 4px;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  background: var(--border-strong);
  border-radius: 2px;
}
.cloud-empty-phone-screen {
  width: 100%; height: calc(100% - 8px);
  background: linear-gradient(160deg, var(--accent) 0%, rgba(210,255,58,0.35) 60%, transparent 100%);
  border-radius: 4px;
  opacity: 0.85;
}
.cloud-empty-phone-dim { opacity: 0.55; transform: scale(0.92) translateY(4px); }
.cloud-empty-phone-dim .cloud-empty-phone-screen { opacity: 0.55; }
.cloud-empty-phone-dimmer { opacity: 0.3; transform: scale(0.85) translateY(8px); }
.cloud-empty-phone-dimmer .cloud-empty-phone-screen { opacity: 0.3; }
.cloud-empty h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cloud-empty .sub { max-width: 46ch; margin: 0 auto 24px; }

/* Portrait-tile grid — shared with the paired/devices list (.devices-list
   .cloud-tiles). .cloud-grid is the legacy alias still referenced by the
   mobile breakpoint. */
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.cloud-tile-row {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
}
.cloud-tile-row .btn-primary { flex: 1; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 10px;
  flex-shrink: 0;
}
.link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text); }

/* "+ Add phone" tile — lives inline with cloud-tile cards. Matches the
   portrait aspect so the grid stays consistent; dashed border reads as
   "slot". */
.cloud-add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  min-height: 240px;
  color: var(--text-dim);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
  text-align: center;
}
.cloud-add-tile:hover {
  border-color: var(--accent);
  background: rgba(210,255,58,0.04);
  color: var(--text);
  transform: translateY(-2px);
}
.cloud-add-tile.loading { opacity: 0.6; cursor: wait; }
.cloud-add-plus {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 600; color: var(--accent);
  transition: background 160ms ease, transform 160ms ease;
}
.cloud-add-tile:hover .cloud-add-plus {
  background: var(--accent);
  color: #000;
  transform: rotate(90deg);
}
.cloud-add-label {
  font-weight: 600;
  font-size: 0.98rem;
  display: flex; flex-direction: column; gap: 2px;
}
.cloud-add-label small {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-mute);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Plan cards (cloud page variant) ---------------------------------- */
.cloud-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.plan-card-cloud {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 22px;
  display: flex; flex-direction: column;
  gap: 14px;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}
.plan-card-cloud:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.plan-card-cloud.featured {
  border-color: rgba(210,255,58,0.35);
  box-shadow: 0 12px 48px rgba(210,255,58,0.08);
}
.plan-card-cloud.featured::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(210,255,58,0.08) 0%, transparent 60%);
}
.plan-card-cloud.premium {
  border-color: rgba(210,255,58,0.22);
}
.plan-badge {
  position: absolute; top: 14px; right: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  z-index: 1;
}
.plan-card-cloud.premium .plan-badge {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.plan-card-cloud .plan-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
}
.plan-price-row {
  display: flex; align-items: baseline; gap: 2px;
}
.plan-price {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.plan-price-row .plan-interval {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 500;
}
.plan-perday {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  margin: 0;
}
.plan-save {
  color: var(--accent);
  font-weight: 700;
}
.plan-features {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 0;
}
.plan-features li {
  position: relative;
  padding-left: 22px;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.plan-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 12px; height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plan-cta {
  margin-top: auto;
}
.cloud-plans-foot {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-mute);
}
.cloud-plans-foot a { color: var(--accent); }

/* --- Features row (social proof / value reinforcement) --------------- */
.cloud-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.cloud-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  transition: border-color 160ms ease, background 160ms ease;
}
.cloud-feature:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cloud-feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.cloud-feature h3 {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 4px;
}
.cloud-feature p {
  font-size: 0.88rem; color: var(--text-dim); line-height: 1.5;
  margin: 0;
}

/* --- Stream page (multi-device) --------------------------------------- */
.stream-page { max-width: 1400px; margin: 0 auto; }
.stream-head { margin-bottom: 16px; }
.stream-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stream-subtext { margin-bottom: 20px; }

.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-mute);
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.working { background: var(--text-dim); animation: pulse-dot 1.2s infinite; }
.status-dot.ok { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.status-dot.warn { background: #ffb14f; }
.status-dot.error { background: var(--danger); }
.status-dot.closed { background: var(--text-mute); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Device picker — shown before streams start when user has 2+ cloud
   phones, so they consent to which ones to decode. */
.stream-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
}
.stream-picker-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.stream-picker-head h2 {
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 4px;
}
.stream-picker-head .sub {
  font-size: 0.9rem;
  margin: 0;
  max-width: 52ch;
}
.stream-picker-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.stream-picker-list { margin-bottom: 20px; }
.stream-picker-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.picker-tile {
  /* Button reset — tiles are <button> so whole card is the click target. */
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  position: relative;
}
.picker-tile.is-offline { opacity: 0.78; }
.picker-tile.is-selected,
.picker-tile.is-selected:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 30px rgba(0,0,0,0.45);
}
.picker-tile .cloud-tile-body { text-align: left; }
.picker-tile .cloud-tile-name,
.picker-tile .cloud-tile-meta { display: block; }
.picker-tile-check {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,0.25);
  color: transparent;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.picker-tile.is-selected .picker-tile-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  transform: scale(1.05);
}
.stream-picker-foot {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.stream-picker-hint {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Grid layout — 1–4 tiles, auto-fit. */
.stream-root {
  display: grid;
  gap: 16px;
}
.stream-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.stream-exclusive {
  /* Single visible tile; fills the content area. */
  grid-template-columns: 1fr;
}

.stream-tile {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
  cursor: pointer;
}
.stream-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stream-tile-canvas-wrap {
  position: relative;
  background: #050505;
  width: 100%;
  /* Portrait phone aspect by default; real canvas reshapes on first frame. */
  aspect-ratio: 9 / 16;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.stream-tile-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  /* Prevent browser-native touch scrolling from eating drag gestures
     that should go to scrcpy. */
  touch-action: none;
  /* Each tile is independently interactive in grid mode — surface that. */
  cursor: pointer;
}
.stream-tile-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(5,5,5,0.72);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.stream-tile-overlay.hidden { opacity: 0; }

.stream-tile-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.stream-tile-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stream-tile-controls { display: flex; gap: 6px; align-items: center; }
.stream-tile-expand {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.stream-tile-expand:hover {
  background: var(--surface-2);
  color: var(--accent);
  border-color: rgba(210,255,58,0.4);
}
body.exclusive .stream-tile.exclusive-active .stream-tile-expand { display: none; }

/* Exclusive mode — one tile fills the stage, siblings hidden. */
.stream-tile.exclusive-hidden { display: none !important; }
.stream-tile.exclusive-active {
  cursor: default;
  border-color: transparent;
  background: transparent;
  transform: none;
}
.stream-tile.exclusive-active:hover { transform: none; }
.stream-tile.exclusive-active .stream-tile-canvas-wrap {
  aspect-ratio: auto;
  /* Let the canvas drive the height up to the viewport. */
  min-height: min(80dvh, 800px);
  max-height: 85dvh;
  background: #050505;
  border-radius: var(--radius-lg);
}
.stream-tile.exclusive-active .stream-tile-canvas {
  max-height: 85dvh;
}
.stream-tile.exclusive-active .stream-tile-head {
  border-top: 0;
  padding: 10px 4px 0;
}

/* On phones in exclusive mode: go fullscreen-ish, hide page chrome. */
body.exclusive .stream-page .stream-head h1 {
  display: none;
}
body.exclusive .stream-subtext { display: none; }
body.exclusive .kicker { display: none; }

.stream-logs {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.stream-logs summary {
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}
.stream-logs pre {
  margin-top: 12px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.45;
}
body.exclusive .stream-logs { display: none; }

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 1100px) {
  .page { padding: 32px 28px 80px; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; width: 280px;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    box-shadow: 0 0 0 transparent;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 24px 0 48px rgba(0,0,0,0.5);
  }
  .sidebar-close { display: inline-flex; }
  .topbar { display: flex; }
  .page { padding: 20px 16px 72px; }
  .plan-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .devices-list { grid-template-columns: 1fr; }
  .devices-list.cloud-tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stream-picker-tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cloud-grid { grid-template-columns: 1fr; }
  .cloud-plan-grid { grid-template-columns: 1fr; }
  .cloud-features { grid-template-columns: 1fr; }
  .cloud-hero { grid-template-columns: 1fr; align-items: flex-start; }
  .cloud-hero-stat { min-width: 0; }
  .stream-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .auth-card, .account-card { padding: 24px; }
}

/* Phones: exclusive mode fills the viewport. Tap targets grow to ≥44px. */
@media (max-width: 640px) {
  .page { padding: 16px 12px 60px; }
  .btn-sm { padding: 10px 14px; font-size: 0.88rem; }

  /* Condense the hero on phones: smaller type, stat card below title. */
  .cloud-hero { padding: 4px 0 20px; margin-bottom: 24px; gap: 16px; }
  .cloud-hero-copy h1 { font-size: 1.7rem; }
  .cloud-hero-stat { padding: 14px 18px; flex-direction: row; align-items: center; gap: 14px; }
  .cloud-hero-stat .cloud-seats-bar { flex: 1; min-width: 60px; }
  .cloud-stat-num { font-size: 1.5rem; }
  .cloud-empty { padding: 36px 18px 24px; }
  .cloud-empty-visual { transform: scale(0.9); min-height: 90px; margin-bottom: 18px; }
  .cloud-add-tile { min-height: 110px; padding: 22px 16px; }
  .plan-card-cloud { padding: 22px 20px 20px; }
  .plan-price { font-size: 1.7rem; }
  .cloud-section { margin-bottom: 32px; }

  /* In exclusive mode on a phone, bleed the canvas edge-to-edge. */
  body.exclusive .page { padding: 8px 0 8px; }
  body.exclusive .app-main { min-height: 100dvh; }
  body.exclusive .topbar { position: fixed; width: 100%; }
  body.exclusive .stream-page { padding: 0 8px; }
  body.exclusive .stream-head {
    position: sticky; top: var(--topbar-h);
    background: var(--bg);
    z-index: 10;
    padding: 8px 4px;
    margin-bottom: 4px;
  }
  body.exclusive .stream-head h1 { display: none; }
  body.exclusive .stream-tile.exclusive-active .stream-tile-canvas-wrap {
    min-height: calc(100dvh - var(--topbar-h) - 110px);
    max-height: calc(100dvh - var(--topbar-h) - 110px);
    border-radius: var(--radius);
  }
  body.exclusive .stream-tile.exclusive-active .stream-tile-canvas {
    max-height: calc(100dvh - var(--topbar-h) - 110px);
  }
  body.exclusive .stream-tile.exclusive-active .stream-tile-head {
    padding: 8px 4px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
