@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&family=SF+Pro+Text:wght@300;400;500;600&display=swap');

:root {
  --bg-main: #000000;
  --bg-sidebar: #000000;
  --sheet-bg: #1c1c1e;
  --group-bg: #1c1c1e;
  --fill: rgba(118, 118, 128, 0.24);
  --segment-on: #636366;
  --border-color: #38383a;
  --text-main: #ffffff;
  --text-sub: #ebebf599;
  --input-bg: #1c1c1e;
  --input-border: #3a3a3c;
  --bubble-received: #262628;
  --bubble-received-text: #ffffff;
  --accent-color: #0A84FF;
  --chat-bg: #000000;
  --glass-blur: 28px;
  --glass-sat: 180%;
  --glass-alpha: 0.6;
  --glass-tint: rgba(28, 28, 30, var(--glass-alpha));
  --glass-edge: rgba(255, 255, 255, 0.16);
  --glass-hi: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] {
  --bg-main: #ffffff;
  --bg-sidebar: #ffffff;
  --sheet-bg: #f2f2f7;
  --group-bg: #ffffff;
  --fill: rgba(118, 118, 128, 0.12);
  --segment-on: #ffffff;
  --border-color: #d1d1d6;
  --text-main: #000000;
  --text-sub: #8e8e93;
  --input-bg: #e5e5ea;
  --input-border: #c7c7cc;
  --bubble-received: #e9e9eb;
  --bubble-received-text: #000000;
  --accent-color: #007AFF;
  --chat-bg: #ffffff;
  --glass-tint: rgba(255, 255, 255, var(--glass-alpha));
  --glass-edge: rgba(0, 0, 0, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.9);
}

html, body {
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-main);
  color: var(--text-main);
  user-select: none;
  height: 100%;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

input, textarea { user-select: text; font-family: "SF Pro Text", sans-serif; }

/* ---------- Liquid glass ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 0.5px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 28px rgba(0, 0, 0, 0.22);
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
  z-index: -1;
}
html[data-glass="off"] .glass {
  background: var(--sheet-bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
html[data-glass="off"] .glass::before { display: none; }
html[data-glass="off"] .ios-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }

.ios-backdrop {
  background: rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 0.4));
  backdrop-filter: blur(calc(var(--glass-blur) * 0.4));
}

.sidebar-glass { background-color: var(--bg-sidebar); border-right: 0.5px solid var(--border-color); }
.chat-container-bg { background-color: var(--chat-bg); }

.sent-bubble { background-color: var(--accent-color); color: #ffffff; border-radius: 20px 20px 4px 20px; letter-spacing: -0.2px; }
.received-bubble { background-color: var(--bubble-received); color: var(--bubble-received-text); border-radius: 20px 20px 20px 4px; letter-spacing: -0.2px; }

.big-emoji-bubble { background: transparent !important; color: inherit !important; font-size: 3.5rem; line-height: 1; padding: 0 !important; box-shadow: none !important; }

.apple-input { background-color: var(--input-bg); border: 0.5px solid var(--input-border); color: var(--text-main); }
.apple-input:focus { border-color: var(--accent-color); outline: none; background-color: var(--bg-main); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(150, 150, 150, 0.3); border-radius: 10px; }

@keyframes scaleIn { from { transform: scale(0.92) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-anim { animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes bannerIn { from { transform: translateY(-140%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.banner-anim { animation: bannerIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.typing-indicator { background-color: var(--bubble-received); border-radius: 18px; padding: 10px 14px; display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 6px; height: 6px; background-color: var(--text-sub); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

.safe-top { padding-top: max(env(safe-area-inset-top), 16px); }
.safe-bottom { padding-bottom: max(env(safe-area-inset-bottom), 28px); }

#localVideoContainer { touch-action: none; cursor: grab; }
#localVideoContainer:active { cursor: grabbing; }

.touch-btn { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* ---------- Shimmer loading placeholders ---------- */
.skel {
  background: linear-gradient(90deg, var(--fill) 25%, rgba(255, 255, 255, 0.16) 37%, var(--fill) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Apple-style header ---------- */
.large-title { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.icon-pill { width: 38px; height: 38px; border-radius: 9999px; background: var(--fill); display: flex; align-items: center; justify-content: center; color: var(--text-main); position: relative; }
.avatar-btn { width: 38px; height: 38px; border-radius: 9999px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; background: var(--input-bg); flex-shrink: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.search-field { width: 100%; padding: 9px 12px 9px 36px; border-radius: 12px; background: var(--fill); color: var(--text-main); font-size: 16px; border: 0; outline: none; }
.search-wrap { position: relative; }
.search-wrap > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-sub); width: 16px; height: 16px; }

/* ---------- Bottom dock ---------- */
.dock { position: absolute; bottom: max(env(safe-area-inset-bottom), 18px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 22px; padding: 8px 16px; border-radius: 9999px; z-index: 30; }
.dock-btn { width: 48px; height: 48px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; color: var(--text-main); }
.dock-plus { width: 56px; height: 56px; border-radius: 9999px; background: var(--accent-color); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(10, 132, 255, 0.45); }
.dock-plus:active, .dock-btn:active { transform: scale(0.94); }

/* ---------- Stories ---------- */
.story-bar { scrollbar-width: none; align-items: flex-start; }
.story-bar::-webkit-scrollbar { display: none; }
.story-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; width: 70px; flex-shrink: 0; padding: 0; background: none; border: 0; color: var(--text-main); }
.story-tile-ring { position: relative; width: 66px; height: 66px; flex-shrink: 0; }
.story-tile-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.story-tile-avatar { position: absolute; inset: 6px; border-radius: 9999px; overflow: hidden; background: var(--input-bg); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; }
.story-tile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-tile-name { font-size: 11px; line-height: 14px; width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.story-bar-track { flex: 1; height: 3px; background: rgba(255, 255, 255, 0.3); border-radius: 9px; overflow: hidden; }
.story-bar-fill { height: 100%; width: 0; background: #fff; }
.story-bar-fill.done { width: 100%; }
.story-bar-fill.active { animation: storyFill 6s linear forwards; }
@keyframes storyFill { from { width: 0; } to { width: 100%; } }
#storyTouch { touch-action: none; }

/* ---------- Apple-style sheets ---------- */
.ios-backdrop { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-end; justify-content: center; }
.ios-backdrop.open { display: flex; }
.ios-sheet { width: 100%; max-width: 560px; max-height: 92vh; color: var(--text-main); border-radius: 22px 22px 0 0; overflow: hidden; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); animation: sheetUp 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
@media (min-width: 768px) {
  .ios-backdrop { align-items: center; }
  .ios-sheet { border-radius: 22px; max-height: 88vh; }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ios-grabber { width: 36px; height: 5px; border-radius: 9px; background: var(--text-sub); opacity: 0.4; margin: 8px auto 2px; }
.ios-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 10px; gap: 8px; }
.ios-title { font-size: 17px; font-weight: 600; }
.ios-circle-btn { width: 30px; height: 30px; border-radius: 9999px; background: var(--fill); display: flex; align-items: center; justify-content: center; color: var(--text-main); flex-shrink: 0; }
.ios-text-btn { font-size: 16px; color: var(--accent-color); font-weight: 600; min-height: 44px; padding: 0 4px; }
.ios-text-btn.muted { color: var(--text-sub); font-weight: 400; }
.ios-section { font-size: 13px; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.3px; padding: 0 16px 6px; }
.ios-list { background: var(--group-bg); border-radius: 12px; overflow: hidden; }
.ios-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 0.5px solid var(--border-color); width: 100%; text-align: left; background: none; color: var(--text-main); font-size: 16px; min-height: 48px; }
.ios-row:last-child { border-bottom: 0; }
.ios-row input, .ios-row textarea { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text-main); font-size: 16px; }
.ios-row .ios-label { width: 84px; font-size: 15px; color: var(--text-sub); flex-shrink: 0; }
.ios-field { width: 100%; background: var(--group-bg); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--text-main); border: 0; outline: none; }
.ios-primary { width: 100%; background: var(--accent-color); color: #fff; font-weight: 600; border-radius: 14px; padding: 14px; font-size: 16px; min-height: 48px; }
.ios-danger { color: #FF3B30; font-weight: 600; justify-content: center; }
.ios-segment { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.ios-segment button { flex: 1; padding: 7px 8px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-main); min-height: 36px; }
.ios-segment button.on { background: var(--segment-on); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.ios-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--group-bg); border-radius: 12px; }

.ios-switch { width: 51px; height: 31px; border-radius: 9999px; background: var(--fill); position: relative; transition: background 0.25s; flex-shrink: 0; }
.ios-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 9999px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1.2); }
.ios-switch.on { background: #34C759; }
.ios-switch.on::after { transform: translateX(20px); }

.swatch { width: 30px; height: 30px; border-radius: 9999px; border: 2px solid transparent; }
.swatch.on { border-color: var(--text-main); }

.story-preview { min-height: 240px; border-radius: 24px; display: flex; align-items: center; justify-content: center; padding: 18px; color: #fff; text-align: center; font-size: 24px; font-weight: 700; line-height: 1.25; width: 100%; border: 0; resize: none; outline: none; }

/* ---------- Waveform clip picker ---------- */
.wave-wrap { position: relative; height: 72px; cursor: pointer; touch-action: none; }
.wave-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.wave-bars > div { flex: 1; border-radius: 9999px; background: var(--text-sub); opacity: 0.45; }
.wave-sel { position: absolute; top: 0; bottom: 0; border-radius: 10px; border: 2px solid var(--accent-color); background: rgba(10, 132, 255, 0.15); pointer-events: none; }
.wave-thumb { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 9999px; background: var(--accent-color); pointer-events: none; }
.wave-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text-main); pointer-events: none; }

/* ---------- In-app toasts ---------- */
.toast { pointer-events: auto; max-width: 420px; padding: 11px 18px; border-radius: 18px; font-size: 14px; font-weight: 500; text-align: center; color: var(--text-main); animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards; }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-12px); opacity: 0; } }

/* ---------- NEW: Nudge + links ---------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px); }
  30% { transform: translateX(9px); }
  45% { transform: translateX(-7px); }
  60% { transform: translateX(5px); }
  80% { transform: translateX(-2px); }
}
.shake { animation: shake 0.6s ease; }
.msg-link { text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }

@media (max-width: 768px) {
  .mobile-hidden { display: none !important; }
  .mobile-full { width: 100% !important; }
  input, textarea { font-size: 16px !important; }
}
/* Group features */
.gx-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; font-size: 13px; white-space: pre-wrap; color: inherit; }
.gx-label { display: block; font-size: 10px; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.3px; }
.gx-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9999px; font-size: 9px; font-weight: 700; background: #0A84FF; color: #fff; vertical-align: middle; }
.gx-sender { display: block; font-size: 10px; font-weight: 700; opacity: 0.8; margin-bottom: 4px; }
.gx-poll { min-width: 220px; max-width: 280px; }
.gx-opt { position: relative; display: block; width: 100%; text-align: left; padding: 8px 10px; margin-top: 6px; border-radius: 12px; overflow: hidden; background: rgba(118, 118, 128, 0.18); color: inherit; font-size: 13px; }
.gx-opt span, .gx-opt .gx-names { position: relative; }
.gx-opt .gx-names { font-size: 10px; opacity: 0.7; margin-top: 2px; }
.gx-opt .gx-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(10, 132, 255, 0.35); }
.gx-opt.on { box-shadow: inset 0 0 0 2px #0A84FF; }
.gx-opt:disabled { opacity: 0.85; }
.gx-foot { font-size: 10px; opacity: 0.7; margin-top: 8px; }
.gx-body { overflow-y: auto; max-height: 75vh; }
#gxVO { position: fixed; inset: 0; z-index: 200; background: #000; display: none; align-items: center; justify-content: center; }
#gxVO.open { display: flex; }
#gxVO canvas { max-width: 100%; max-height: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
#gxVO.blurred canvas { filter: blur(30px); }
/* Search icon fix: Lucide replaces <i> with <svg> */
.search-wrap { position: relative; }
.search-wrap > svg,
.search-wrap > i {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-sub); pointer-events: none; z-index: 1;
}

/* Verification ticks, Inbox Dump, trust bar */
.vf-tick { display: inline-block; vertical-align: -2px; margin-left: 4px; flex-shrink: 0; }
.vf-dump-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--accent-color); background: var(--fill); }
.vf-dump-row small { margin-left: auto; font-weight: 400; color: var(--text-sub); }
.vf-trustbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 12px 0; padding: 8px 12px; border-radius: 14px; font-size: 12px; }
.vf-trustbar button { flex-shrink: 0; padding: 6px 14px; border-radius: 9999px; background: var(--accent-color); color: #fff; font-weight: 600; font-size: 12px; }
.vf-trustbar.hidden { display: none; }
/* Settings hub */
.stg-card { display: flex; align-items: center; gap: 12px; padding: 14px; width: 100%; text-align: left; color: var(--text-main); }
.stg-iconbox { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.stg-iconbox svg { width: 16px; height: 16px; }
/* ===== Apple-style call screens ===== */
.call-screen { position: fixed; inset: 0; z-index: 50; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; }
.call-screen.hidden { display: none !important; }
.call-audio { background: #1c1c1e; }
.call-video { background: #000; }

.call-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(48px) saturate(1.3); transform: scale(1.1); background-color: #3a3a3c; }
.call-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.15) 35%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.6) 100%); }
.call-scrim-video { background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,.7) 100%); }

.call-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: max(env(safe-area-inset-top), 14px) 16px 10px; z-index: 5; }
.call-top-meta { text-align: center; flex: 1; min-width: 0; padding: 0 8px; }
.call-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; opacity: .85; background: rgba(0,0,0,.25); padding: 5px 10px; border-radius: 9999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.call-round { width: 42px; height: 42px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); flex-shrink: 0; }
.call-round:active { transform: scale(.94); }

.call-center { position: absolute; top: 22%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px; z-index: 4; }
.call-avatar { width: 128px; height: 128px; border-radius: 9999px; overflow: hidden; background: linear-gradient(135deg, #0A84FF, #5E5CE6); display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 600; box-shadow: 0 14px 40px rgba(0,0,0,.35); margin-bottom: 18px; }
.call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-name { font-size: 30px; font-weight: 600; letter-spacing: -.3px; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-status { font-size: 16px; opacity: .8; margin-top: 4px; font-variant-numeric: tabular-nums; }
.call-name-small { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-status-small { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }

.call-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 20px max(env(safe-area-inset-bottom), 28px); z-index: 5; }
.call-controls-video { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px max(env(safe-area-inset-bottom), 24px); z-index: 5; }
.call-control-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; margin: 0 auto 26px; }
.call-ctl { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.call-ctl-btn { width: 66px; height: 66px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background .2s, color .2s; }
.call-ctl-btn.on { background: #fff; color: #000; }
.call-ctl:active .call-ctl-btn { transform: scale(.95); }
.call-ctl-label { font-size: 12px; font-weight: 500; opacity: .9; }

.call-end-wrap { display: flex; justify-content: center; }
.call-end { width: 74px; height: 74px; border-radius: 9999px; background: #FF3B30; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(255,59,48,.45); }
.call-end:active { transform: scale(.94); }

.call-incoming { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 28px max(env(safe-area-inset-bottom), 40px); z-index: 5; }
.call-incoming-row { display: flex; justify-content: space-around; max-width: 340px; margin: 0 auto; }
.call-incoming-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.call-accept-btn { width: 76px; height: 76px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.call-accept-btn.decline { background: #FF3B30; }
.call-accept-btn.accept { background: #34C759; animation: callPulse 1.6s ease-in-out infinite; }
@keyframes callPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.call-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call-video-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #1c1c1e; z-index: 2; }
.call-video-fallback.hidden { display: none; }
.call-selfview { position: absolute; right: 14px; top: calc(max(env(safe-area-inset-top), 14px) + 72px); width: 108px; height: 150px; border-radius: 18px; overflow: hidden; border: 1.5px solid rgba(255,255,255,.35); box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 4; background: #111; touch-action: none; cursor: grab; }
.call-selfview.hidden { display: none; }
.call-selfview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.call-pill { position: fixed; left: 50%; transform: translateX(-50%); top: max(env(safe-area-inset-top), 8px); z-index: 200; display: none; align-items: center; gap: 8px; padding: 8px 16px; background: #000; color: #fff; font-size: 13px; font-weight: 600; border-radius: 9999px; box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: nowrap; }
.call-pill.flex { display: flex; }
.call-pill-dot { width: 8px; height: 8px; border-radius: 9999px; background: #34C759; animation: callBlink 1.2s ease-in-out infinite; }
@keyframes callBlink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
/* View once */
.vo-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.14); color: inherit; min-width: 190px; }
.vo-open { cursor: pointer; text-align: left; }
.vo-done { opacity: .6; }

#voViewer { position: fixed; inset: 0; z-index: 400; background: #000; display: none; flex-direction: column; color: #fff; user-select: none; -webkit-user-select: none; }
#voViewer.open { display: flex; }

.vo-progress { position: absolute; top: max(env(safe-area-inset-top), 10px); left: 10px; right: 10px; height: 3px; background: rgba(255,255,255,.3); border-radius: 9px; overflow: hidden; z-index: 5; }
.vo-progress-fill { height: 100%; width: 0; background: #fff; animation: voFill 15s linear forwards; }
@keyframes voFill { from { width: 0; } to { width: 100%; } }

.vo-head { position: absolute; top: calc(max(env(safe-area-inset-top), 10px) + 14px); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; z-index: 5; }
.vo-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vo-av { width: 36px; height: 36px; border-radius: 9999px; overflow: hidden; background: #555; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.vo-av img { width: 100%; height: 100%; object-fit: cover; }
.vo-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vo-sub { font-size: 12px; opacity: .7; }
.vo-x { width: 40px; height: 40px; border-radius: 9999px; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.vo-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 90px 16px 40px; z-index: 2; }
.vo-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 16px; pointer-events: none; }
.vo-text { font-size: 28px; font-weight: 700; text-align: center; line-height: 1.25; padding: 26px; background: linear-gradient(135deg, #0A84FF, #AF52DE); border-radius: 24px; max-width: 92%; word-break: break-word; }
.vo-cap { position: absolute; bottom: 44px; left: 16px; right: 16px; text-align: center; font-size: 16px; background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 14px; }

.vo-wm { position: absolute; inset: 0; pointer-events: none; z-index: 4; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; opacity: .12; transform: rotate(-24deg) scale(1.6); overflow: hidden; }
.vo-wm span { font-size: 12px; white-space: nowrap; padding: 18px; }
