/* واجهة التطبيق — الهوية: ليل نيلي + جمر برتقالي + رمل دافئ + نجمة ثمانية */
:root {
  /* ألوان الهوية الأساسية */
  --night: #14112B;
  --night-2: #2A2560;
  --ember: #F4623A;
  --ember-grad: linear-gradient(160deg, #FF9A5C, #E8461F);
  --gold: #F5B83D;

  --app-bg: #EFE7DD;
  --panel: #FFFFFF;
  --panel-2: #FBF7F2;
  --head: #FBF7F2;
  --rail: #14112B;
  --hover: #F8F2EB;
  --active: #FFEFE6;
  --line: #EEE5DA;
  --text: #1F1B2E;
  --text-2: #3D3752;
  --muted: #6E6880;
  --icon: #5E5873;
  --primary: #D9461F;
  --primary-dark: #B8391A;
  --primary-soft: #FFE9DF;
  --badge: #E8461F;
  --on-primary: #ffffff;
  --out: #FFE3D4;
  --in: #FFFFFF;
  --bubble-text: #1F1B2E;
  --meta: #8A8399;
  --chat-bg: #F6EFE6;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88' fill='none' stroke='%23B8391A' stroke-opacity='.07' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M44.0 29.0L48.0 34.3L54.6 33.4L53.7 40.0L59.0 44.0L53.7 48.0L54.6 54.6L48.0 53.7L44.0 59.0L40.0 53.7L33.4 54.6L34.3 48.0L29.0 44.0L34.3 40.0L33.4 33.4L40.0 34.3Z'/%3E%3Cpath d='M0.0 -15.0L4.0 -9.7L10.6 -10.6L9.7 -4.0L15.0 0.0L9.7 4.0L10.6 10.6L4.0 9.7L0.0 15.0L-4.0 9.7L-10.6 10.6L-9.7 4.0L-15.0 0.0L-9.7 -4.0L-10.6 -10.6L-4.0 -9.7Z'/%3E%3Cpath d='M88.0 -15.0L92.0 -9.7L98.6 -10.6L97.7 -4.0L103.0 0.0L97.7 4.0L98.6 10.6L92.0 9.7L88.0 15.0L84.0 9.7L77.4 10.6L78.3 4.0L73.0 0.0L78.3 -4.0L77.4 -10.6L84.0 -9.7Z'/%3E%3Cpath d='M0.0 73.0L4.0 78.3L10.6 77.4L9.7 84.0L15.0 88.0L9.7 92.0L10.6 98.6L4.0 97.7L0.0 103.0L-4.0 97.7L-10.6 98.6L-9.7 92.0L-15.0 88.0L-9.7 84.0L-10.6 77.4L-4.0 78.3Z'/%3E%3Cpath d='M88.0 73.0L92.0 78.3L98.6 77.4L97.7 84.0L103.0 88.0L97.7 92.0L98.6 98.6L92.0 97.7L88.0 103.0L84.0 97.7L77.4 98.6L78.3 92.0L73.0 88.0L78.3 84.0L77.4 77.4L84.0 78.3Z'/%3E%3Ccircle cx='44' cy='0' r='2'/%3E%3Ccircle cx='0' cy='44' r='2'/%3E%3Ccircle cx='88' cy='44' r='2'/%3E%3Ccircle cx='44' cy='88' r='2'/%3E%3C/svg%3E");
  --danger: #D92D4B;
  --read: #6D5BD0;
  --online: #2FBF71;
  --banner: #FFF1D6;
  --banner-text: #7A5418;
  --input-bg: #FFFFFF;
  --chip: #F3ECE3;
  --tint: rgba(20, 17, 43, .06);
  --shadow: 0 2px 6px rgba(20, 17, 43, .08), 0 8px 24px rgba(20, 17, 43, .08);
  --bubble-shadow: 0 1px 2px rgba(20, 17, 43, .08);
  --font: "Hayyakum", "Plex Arabic", "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
  --display-font: "Tajarib", "Hayyakum", "Plex Arabic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --app-bg: #0B0A1A; --panel: #14112B; --panel-2: #1A1735; --head: #1A1735; --rail: #0E0C20; --hover: #1E1A3D; --active: #2A2252;
    --line: #262245; --text: #F1EEF8; --text-2: #D6D2E6; --muted: #9690AE; --icon: #B3ADC9;
    --primary: #EE5E33; --primary-dark: #FF9A6E; --primary-soft: #3B2131; --badge: #F06A3E;
    --out: #5A2E2C; --in: #221E42; --bubble-text: #F1EEF8; --meta: rgba(241, 238, 248, .55); --chat-bg: #100E22;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88' fill='none' stroke='%23FFFFFF' stroke-opacity='.035' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M44.0 29.0L48.0 34.3L54.6 33.4L53.7 40.0L59.0 44.0L53.7 48.0L54.6 54.6L48.0 53.7L44.0 59.0L40.0 53.7L33.4 54.6L34.3 48.0L29.0 44.0L34.3 40.0L33.4 33.4L40.0 34.3Z'/%3E%3Cpath d='M0.0 -15.0L4.0 -9.7L10.6 -10.6L9.7 -4.0L15.0 0.0L9.7 4.0L10.6 10.6L4.0 9.7L0.0 15.0L-4.0 9.7L-10.6 10.6L-9.7 4.0L-15.0 0.0L-9.7 -4.0L-10.6 -10.6L-4.0 -9.7Z'/%3E%3Cpath d='M88.0 -15.0L92.0 -9.7L98.6 -10.6L97.7 -4.0L103.0 0.0L97.7 4.0L98.6 10.6L92.0 9.7L88.0 15.0L84.0 9.7L77.4 10.6L78.3 4.0L73.0 0.0L78.3 -4.0L77.4 -10.6L84.0 -9.7Z'/%3E%3Cpath d='M0.0 73.0L4.0 78.3L10.6 77.4L9.7 84.0L15.0 88.0L9.7 92.0L10.6 98.6L4.0 97.7L0.0 103.0L-4.0 97.7L-10.6 98.6L-9.7 92.0L-15.0 88.0L-9.7 84.0L-10.6 77.4L-4.0 78.3Z'/%3E%3Cpath d='M88.0 73.0L92.0 78.3L98.6 77.4L97.7 84.0L103.0 88.0L97.7 92.0L98.6 98.6L92.0 97.7L88.0 103.0L84.0 97.7L77.4 98.6L78.3 92.0L73.0 88.0L78.3 84.0L77.4 77.4L84.0 78.3Z'/%3E%3Ccircle cx='44' cy='0' r='2'/%3E%3Ccircle cx='0' cy='44' r='2'/%3E%3Ccircle cx='88' cy='44' r='2'/%3E%3Ccircle cx='44' cy='88' r='2'/%3E%3C/svg%3E");
    --read: #A99BFF; --banner: #2A2440; --banner-text: #FFD58A; --input-bg: #221E42; --chip: #221E42; --tint: rgba(255, 255, 255, .06);
    --shadow: 0 2px 6px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4); --bubble-shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --app-bg: #0B0A1A; --panel: #14112B; --panel-2: #1A1735; --head: #1A1735; --rail: #0E0C20; --hover: #1E1A3D; --active: #2A2252;
  --line: #262245; --text: #F1EEF8; --text-2: #D6D2E6; --muted: #9690AE; --icon: #B3ADC9;
  --primary: #EE5E33; --primary-dark: #FF9A6E; --primary-soft: #3B2131; --badge: #F06A3E;
  --out: #5A2E2C; --in: #221E42; --bubble-text: #F1EEF8; --meta: rgba(241, 238, 248, .55); --chat-bg: #100E22;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88' fill='none' stroke='%23FFFFFF' stroke-opacity='.035' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M44.0 29.0L48.0 34.3L54.6 33.4L53.7 40.0L59.0 44.0L53.7 48.0L54.6 54.6L48.0 53.7L44.0 59.0L40.0 53.7L33.4 54.6L34.3 48.0L29.0 44.0L34.3 40.0L33.4 33.4L40.0 34.3Z'/%3E%3Cpath d='M0.0 -15.0L4.0 -9.7L10.6 -10.6L9.7 -4.0L15.0 0.0L9.7 4.0L10.6 10.6L4.0 9.7L0.0 15.0L-4.0 9.7L-10.6 10.6L-9.7 4.0L-15.0 0.0L-9.7 -4.0L-10.6 -10.6L-4.0 -9.7Z'/%3E%3Cpath d='M88.0 -15.0L92.0 -9.7L98.6 -10.6L97.7 -4.0L103.0 0.0L97.7 4.0L98.6 10.6L92.0 9.7L88.0 15.0L84.0 9.7L77.4 10.6L78.3 4.0L73.0 0.0L78.3 -4.0L77.4 -10.6L84.0 -9.7Z'/%3E%3Cpath d='M0.0 73.0L4.0 78.3L10.6 77.4L9.7 84.0L15.0 88.0L9.7 92.0L10.6 98.6L4.0 97.7L0.0 103.0L-4.0 97.7L-10.6 98.6L-9.7 92.0L-15.0 88.0L-9.7 84.0L-10.6 77.4L-4.0 78.3Z'/%3E%3Cpath d='M88.0 73.0L92.0 78.3L98.6 77.4L97.7 84.0L103.0 88.0L97.7 92.0L98.6 98.6L92.0 97.7L88.0 103.0L84.0 97.7L77.4 98.6L78.3 92.0L73.0 88.0L78.3 84.0L77.4 77.4L84.0 78.3Z'/%3E%3Ccircle cx='44' cy='0' r='2'/%3E%3Ccircle cx='0' cy='44' r='2'/%3E%3Ccircle cx='88' cy='44' r='2'/%3E%3Ccircle cx='44' cy='88' r='2'/%3E%3C/svg%3E");
  --read: #A99BFF; --banner: #2A2440; --banner-text: #FFD58A; --input-bg: #221E42; --chip: #221E42; --tint: rgba(255, 255, 255, .06);
  --shadow: 0 2px 6px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.4); --bubble-shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); background: var(--app-bg); color: var(--text); font-size: 14.5px;
  -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.hidden { display: none !important; }
.grow { flex: 1; }
.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
a { color: var(--primary); }

/* ── أزرار وحقول ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 22px;
  border-radius: 14px; font-weight: 600; background: transparent; color: var(--primary-dark); border: 1px solid var(--line); transition: background .15s, filter .15s, transform .05s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(232, 70, 31, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: #fff; background: var(--danger); border-color: transparent; }
.btn.block { width: 100%; height: 48px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--icon); transition: background .15s, color .15s; flex: none; }
.icon-btn:hover, .icon-btn.on { background: var(--tint); color: var(--text); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgba(255,255,255,.12); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--input-bg); outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; padding: 10px 14px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.at-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); direction: ltr; }
.at-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.at-input b { padding-left: 14px; color: var(--muted); font-weight: 500; }
.field .at-input input { border: 0; padding-left: 4px; box-shadow: none; }
.error { color: var(--danger); font-size: 13.5px; min-height: 1em; margin: 4px 0 10px; }
.hint { display: flex; gap: 8px; font-size: 13px; color: var(--muted); background: var(--head); padding: 10px 12px; border-radius: 12px; line-height: 1.7; margin: 0 0 8px; }
.hint .ic { width: 18px; height: 18px; color: var(--primary); margin-top: 2px; }

/* ── الدخول ── */
.auth { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); overflow: auto; gap: 18px;
  background: radial-gradient(700px 360px at 50% 0%, rgba(244, 98, 58, .35), transparent 70%), linear-gradient(var(--night) 0 260px, var(--app-bg) 260px); }
.auth::before { content: ""; position: absolute; inset: 0 0 auto; height: 260px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88' fill='none' stroke='%23FFFFFF' stroke-opacity='.06' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M44.0 29.0L48.0 34.3L54.6 33.4L53.7 40.0L59.0 44.0L53.7 48.0L54.6 54.6L48.0 53.7L44.0 59.0L40.0 53.7L33.4 54.6L34.3 48.0L29.0 44.0L34.3 40.0L33.4 33.4L40.0 34.3Z'/%3E%3Cpath d='M0.0 -15.0L4.0 -9.7L10.6 -10.6L9.7 -4.0L15.0 0.0L9.7 4.0L10.6 10.6L4.0 9.7L0.0 15.0L-4.0 9.7L-10.6 10.6L-9.7 4.0L-15.0 0.0L-9.7 -4.0L-10.6 -10.6L-4.0 -9.7Z'/%3E%3Cpath d='M88.0 -15.0L92.0 -9.7L98.6 -10.6L97.7 -4.0L103.0 0.0L97.7 4.0L98.6 10.6L92.0 9.7L88.0 15.0L84.0 9.7L77.4 10.6L78.3 4.0L73.0 0.0L78.3 -4.0L77.4 -10.6L84.0 -9.7Z'/%3E%3Cpath d='M0.0 73.0L4.0 78.3L10.6 77.4L9.7 84.0L15.0 88.0L9.7 92.0L10.6 98.6L4.0 97.7L0.0 103.0L-4.0 97.7L-10.6 98.6L-9.7 92.0L-15.0 88.0L-9.7 84.0L-10.6 77.4L-4.0 78.3Z'/%3E%3Cpath d='M88.0 73.0L92.0 78.3L98.6 77.4L97.7 84.0L103.0 88.0L97.7 92.0L98.6 98.6L92.0 97.7L88.0 103.0L84.0 97.7L77.4 98.6L78.3 92.0L73.0 88.0L78.3 84.0L77.4 77.4L84.0 78.3Z'/%3E%3Ccircle cx='44' cy='0' r='2'/%3E%3Ccircle cx='0' cy='44' r='2'/%3E%3Ccircle cx='88' cy='44' r='2'/%3E%3Ccircle cx='44' cy='88' r='2'/%3E%3C/svg%3E"); background-size: 88px; pointer-events: none; }
.auth-card { position: relative; width: 100%; max-width: 440px; background: var(--panel); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; color: inherit; }
.brand h1 { margin: 0; font-size: 30px; font-weight: 700; color: var(--text); }
.brand img { border-radius: 16px; }
.brand-sub { text-align: center; color: var(--muted); margin: 12px 0 22px; line-height: 1.7; }
.tabs { display: flex; background: var(--chip); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.tab { flex: 1; height: 40px; border-radius: 11px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--panel); color: var(--text); box-shadow: var(--bubble-shadow); }
.auth-foot { position: relative; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 0; }
.auth-foot a { color: inherit; }
.auth .pane { display: none; }
#auth[data-mode="login"] [data-pane="login"],
#auth[data-mode="register"][data-step="phone"] [data-pane="phone"],
#auth[data-mode="register"][data-step="code"] [data-pane="code"],
#auth[data-mode="register"][data-step="account"] [data-pane="account"] { display: block; }
.steps-ind { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -4px 0 14px; }
.steps-ind span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--chip); color: var(--muted); }
.steps-ind span.on { background: var(--primary); color: #fff; }
.steps-ind i { width: 34px; height: 2px; background: var(--line); }
.steps-ind i.on { background: var(--primary); }
.pane-title { text-align: center; font-size: 19px; margin: 0 0 6px; font-weight: 700; }
.pane-sub { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 18px; }
.phone-input { display: flex; border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); direction: ltr; overflow: hidden; }
.phone-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.phone-input select { border: 0; outline: 0; background: var(--head); padding: 0 8px; max-width: 46%; direction: rtl; }
.field .phone-input input { border: 0; border-radius: 0; flex: 1; min-width: 0; font-size: 16px; letter-spacing: .5px; box-shadow: none; }
.otp { display: block; width: 100%; height: 58px; text-align: center; font-size: 28px; letter-spacing: 12px; font-family: ui-monospace, Consolas, monospace;
  border: 1px solid var(--line); border-radius: 14px; background: var(--input-bg); outline: none; margin-bottom: 10px; }
.otp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dev-code { background: var(--banner); color: var(--banner-text); font-size: 13px; padding: 8px 12px; border-radius: 10px; text-align: center; margin: 0 0 8px; }
.link { color: var(--primary); font-weight: 600; font-size: 14px; background: none; }
.link:disabled { color: var(--muted); font-weight: 400; cursor: default; }
.link.center { display: block; margin: 14px auto 0; }

/* ── التخطيط ── */
.app { display: grid; grid-template-columns: 72px minmax(340px, 30%) 1fr; height: 100dvh; max-width: 1600px; margin: 0 auto; background: var(--panel); position: relative; }
@media (min-width: 1440px) { .app { height: calc(100dvh - 40px); margin-top: 20px; box-shadow: var(--shadow); border-radius: 18px; overflow: hidden; } }
/* شريط التنقل الجانبي بلون الليل في الوضعين */
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 16px; }
.rail::before { content: ""; width: 40px; height: 40px; margin-bottom: 10px; background: url("/icon.svg") center / contain no-repeat; }
.rail-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: rgba(255,255,255,.6); position: relative; transition: background .15s, color .15s; }
.rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-btn.active { background: var(--ember-grad); color: #fff; box-shadow: 0 4px 14px rgba(232, 70, 31, .35); }
.rail-btn .badge { position: absolute; top: -4px; inset-inline-end: -6px; box-shadow: 0 0 0 2px var(--rail); }
.rail-me { margin-top: 6px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }

.sidebar { display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); min-height: 0; max-width: 100%; overflow-x: hidden; background: var(--panel); position: relative; }
.side-head { display: flex; align-items: center; gap: 4px; height: calc(68px + env(safe-area-inset-top)); padding: 0 16px 0 10px; padding-top: env(safe-area-inset-top); flex: none; }
.side-head h1 { flex: 1; margin: 0; font-size: 23px; font-weight: 700; }
.search { margin: 0 14px 10px; display: flex; align-items: center; gap: 10px; background: var(--chip); border-radius: 14px; padding: 0 14px; color: var(--icon); height: 40px; }
.search .ic { width: 17px; height: 17px; }
.search input { flex: 1; border: 0; outline: 0; background: none; height: 40px; min-width: 0; font-size: 14px; }
.filters { display: flex; gap: 8px; padding: 0 14px 10px; flex: none; }
.chip { height: 32px; padding: 0 14px; border-radius: 10px; background: var(--chip); color: var(--muted); font-size: 13.5px; font-weight: 500; }
.chip.active { background: var(--night); color: #fff; }
:root[data-theme="dark"] .chip.active { background: var(--primary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.active { background: var(--primary); } }
.conn-banner { margin: 0 14px 8px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; background: var(--banner); color: var(--banner-text); }
.list-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 0 8px; }
.archived-row { display: flex; align-items: center; gap: 14px; width: 100%; height: 52px; padding: 0 10px; text-align: start; font-weight: 600; border-radius: 14px; }
.archived-row:hover { background: var(--hover); }
.ar-ic { width: 50px; display: grid; place-items: center; color: var(--primary); }
.ar-count { color: var(--primary); font-size: 12px; font-weight: 700; }
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-item { display: flex; align-items: center; gap: 14px; padding: 0 10px; height: 74px; cursor: pointer; position: relative; border-radius: 16px; margin-bottom: 2px; }
.conv-item:hover { background: var(--hover); }
.conv-item.active { background: var(--active); }
.conv-item.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--primary); }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.conv-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-name { flex: 1; font-size: 15.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 12px; color: var(--muted); flex: none; }
.conv-item.unread .conv-time { color: var(--primary); font-weight: 700; }
.conv-prev { flex: 1; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 3px; min-width: 0; }
.conv-prev > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conv-item.unread .conv-prev { color: var(--text-2); }
.conv-prev .ic { width: 17px; height: 17px; }
.conv-prev .read { color: var(--read); }
.conv-prev .typing-txt { color: var(--primary); font-weight: 600; }
.conv-flags { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.conv-flags .ic { width: 15px; height: 15px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--badge); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.muted { background: var(--muted); }
.list-empty { text-align: center; color: var(--muted); padding: 40px 24px; line-height: 1.8; }
.list-empty .ic { width: 18px; height: 18px; vertical-align: middle; }
.list-foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 22px 12px 90px; margin: 0; }
.list-foot .ic { width: 12px; height: 12px; }
.list-foot b { color: var(--primary); font-weight: 600; }
.fab { display: none; position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); inset-inline-end: 18px; width: 58px; height: 58px; border-radius: 20px;
  background: var(--ember-grad); color: #fff; place-items: center; box-shadow: 0 8px 22px rgba(232, 70, 31, .4); z-index: 5; }
.fab .ic { width: 24px; height: 24px; }

/* ── الصورة الرمزية ── */
.avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none;
  position: relative; font-size: 18px; user-select: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar.xs { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 100px; height: 100px; font-size: 36px; }
.avatar.xl { width: 160px; height: 160px; font-size: 56px; }
.avatar .ic { width: 52%; height: 52%; }
.avatar.online::after { content: ""; position: absolute; bottom: 1px; inset-inline-end: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--online); border: 2px solid var(--panel); }
/* ألوان الأحرف الأولى: دافئة ومتناسقة مع الهوية */
.c0 { background: #E8572E; } .c1 { background: #4B44A3; } .c2 { background: #C2417A; } .c3 { background: #D98A1F; }
.c4 { background: #7A4FC9; } .c5 { background: #1F8A9E; } .c6 { background: #4E8A3A; } .c7 { background: #B5446E; }
.c8 { background: #C4452E; } .c9 { background: #3E5BB5; } .c10 { background: #2E8A72; } .c11 { background: #9C6B2E; }
.t0 { color: #D9461F; } .t1 { color: #5B54C0; } .t2 { color: #C2417A; } .t3 { color: #C0780F; } .t4 { color: #7A4FC9; } .t5 { color: #1A8496; }
.t6 { color: #4E8A3A; } .t7 { color: #B5446E; } .t8 { color: #C4452E; } .t9 { color: #3E5BB5; } .t10 { color: #23856C; } .t11 { color: #9C6B2E; }

/* ── المحادثة ── */
.chat { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--chat-bg); }
.empty { flex: 1; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 24px;
  background-color: var(--chat-bg); background-image: var(--pattern); background-size: 88px; }
.empty-logo { margin: 0 auto; border-radius: 28px; box-shadow: 0 16px 40px rgba(20, 17, 43, .25); }
.empty h2 { color: var(--text); font-weight: 700; font-size: 28px; margin: 26px 0 10px; }
.empty p { line-height: 1.8; max-width: 520px; margin: 0 auto; }
.e2e-note { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 36px !important; }
.e2e-note .ic { width: 13px; height: 13px; }
.e2e-note.light { color: rgba(255,255,255,.75); margin-top: 6px !important; }
.conv { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 2px; height: 68px; padding: 0 14px 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 3; flex: none;
  padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.chat-head .back { display: none; }
/* زر الرجوع كـ"فقاعة" دائمة الوضوح، لا تعتمد فقط على hover */
.chat-head .back, .side-head #side-back:not(.hidden) { background: var(--tint); border-radius: 50%; }
.peer { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: start; height: 100%; padding-inline-start: 4px; }
.peer-text { min-width: 0; }
.peer-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.peer-sub .ic { width: 13px; height: 13px; }
.peer-sub.typing { color: var(--primary); font-weight: 600; }
.chat-search { display: flex; align-items: center; gap: 4px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 2; color: var(--icon); }
.chat-search > .ic { width: 18px; height: 18px; margin-inline-start: 6px; }
.chat-search input { flex: 1; border: 0; outline: 0; background: none; height: 38px; min-width: 0; padding: 0 8px; }
.cs-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pinned-bar { display: flex; align-items: center; gap: 12px; padding: 6px 16px; min-height: 52px; background: var(--panel); border-bottom: 1px solid var(--line); text-align: start; z-index: 2; width: 100%; }
.pinned-bar .pb-line { width: 3px; align-self: stretch; border-radius: 2px; background: var(--ember-grad); }
.pinned-bar .pb-main { flex: 1; min-width: 0; }
.pinned-bar b { display: block; font-size: 12.5px; color: var(--primary); font-weight: 700; }
.pinned-bar span { display: block; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinned-bar .ic { color: var(--icon); width: 18px; height: 18px; }

.messages { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; outline: none; background-image: var(--pattern); background-size: 88px; }
.msg-inner { max-width: 1000px; margin: 0 auto; padding: 12px 6% 8px; display: flex; flex-direction: column; }
.load-more { align-self: center; margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.e2e-banner { align-self: center; max-width: 480px; text-align: center; background: var(--banner); color: var(--banner-text); font-size: 12.5px; line-height: 1.7;
  padding: 8px 14px; border-radius: 12px; margin: 4px 0 12px; }
.e2e-banner .ic { width: 12px; height: 12px; vertical-align: -1px; }
.day { align-self: center; margin: 12px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); padding: 4px 14px; border-radius: 999px;
  box-shadow: var(--bubble-shadow); position: sticky; top: 8px; z-index: 1; }
.sys { align-self: center; max-width: 80%; text-align: center; margin: 6px 0; font-size: 12.5px; color: var(--muted); background: var(--panel); padding: 5px 14px;
  border-radius: 999px; box-shadow: var(--bubble-shadow); }

/* الفقاعات المرسلة دائماً يمين الشاشة فعلياً، والمستلمة يسار (كواتساب/آيمسج)، بصرف النظر عن اتجاه النص */
.msg { display: flex; flex-direction: column; margin-top: 2px; position: relative; }
.msg.in { align-items: flex-end; }
.msg.out { align-items: flex-start; }
.msg.first { margin-top: 12px; }
/* فقاعات مستديرة بلا ذيل؛ الزاوية القريبة من المرسل أصغر في أول رسالة */
.bubble { position: relative; max-width: min(65%, 560px); padding: 7px 11px 8px; border-radius: 18px; background: var(--in); color: var(--bubble-text);
  box-shadow: var(--bubble-shadow); line-height: 1.55; overflow-wrap: anywhere; min-width: 70px; font-size: 14.5px; }
.msg.out .bubble { background: var(--out); }
.msg.first.in .bubble { border-start-end-radius: 6px; }
.msg.first.out .bubble { border-start-start-radius: 6px; }
.msg.hl .bubble { animation: hl 1.6s ease; }
.msg.found .bubble { box-shadow: 0 0 0 2px var(--gold); }
@keyframes hl { 0%, 60% { box-shadow: 0 0 0 3px var(--primary); } }
.msg.pending .bubble { opacity: .8; }
.sender { font-size: 12.8px; font-weight: 700; margin-bottom: 2px; }
.text { white-space: pre-wrap; }
.text.big { font-size: 42px; line-height: 1.2; }
.text a { word-break: break-all; }
.meta { float: inline-end; display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 10px; margin-top: 4px; font-size: 11px;
  color: var(--meta); position: relative; bottom: -5px; white-space: nowrap; }
.meta .ic { width: 16px; height: 16px; }
.meta .read { color: var(--read); }
.meta .timer, .meta .ic-pin { width: 12px; height: 12px; }
.bubble.media-only { padding: 4px; }
.bubble.media-only .meta { position: absolute; bottom: 10px; inset-inline-end: 10px; color: #fff; padding: 2px 8px; margin: 0; border-radius: 999px; background: rgba(20, 17, 43, .45); }
.bubble.media-only .meta .read { color: #D4CCFF; }
.deleted { font-style: italic; color: var(--meta); display: inline-flex; gap: 6px; align-items: center; }
.deleted .ic { width: 15px; height: 15px; }
.quote { display: block; width: 100%; text-align: start; border-inline-start: 3px solid var(--primary); background: var(--tint);
  padding: 6px 10px; border-radius: 10px; margin-bottom: 5px; font-size: 13.5px; cursor: pointer; }
.quote b { display: block; font-size: 12.8px; font-weight: 700; }
.quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--meta); }
.fwd { font-size: 12.5px; color: var(--meta); font-style: italic; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.fwd .ic { width: 14px; height: 14px; }
.media { position: relative; border-radius: 14px; overflow: hidden; background: var(--tint); cursor: pointer;
  max-width: 330px; min-width: 180px; display: grid; place-items: center; }
.media img, .media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.media img.blur { filter: blur(12px); transform: scale(1.08); }
.media .spin { position: absolute; }
.media .play { position: absolute; width: 54px; height: 54px; border-radius: 50%; background: rgba(20, 17, 43, .55); color: #fff; display: grid; place-items: center; }
.media .dur { position: absolute; bottom: 10px; inset-inline-start: 10px; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(20, 17, 43, .45); display: flex; align-items: center; gap: 4px; }
.media .dur .ic { width: 14px; height: 14px; }
.caption { margin-top: 4px; padding: 0 2px; }
.filecard { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--tint); min-width: 240px; cursor: pointer; }
.file-ic { width: 38px; height: 46px; border-radius: 8px; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.file-ic.pdf { background: #D9462E; } .file-ic.doc { background: #4B44A3; } .file-ic.xls { background: #2E8A5A; } .file-ic.zip { background: #9C6B2E; } .file-ic.other { background: #6E6880; }
.file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.file-size { font-size: 12px; color: var(--meta); }
.filecard > .ic { color: var(--primary); border: 1.5px solid currentColor; border-radius: 50%; padding: 6px; width: 34px; height: 34px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 250px; padding: 4px 2px 0; }
.voice .pbtn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary); color: #fff; }
.voice .pbtn .ic { width: 18px; height: 18px; }
.voice .bars { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; direction: ltr; }
.voice .bars i { flex: 1; background: var(--meta); opacity: .45; border-radius: 2px; min-height: 3px; }
.voice .bars i.on { background: var(--primary); opacity: 1; }
.voice .v-ava { position: relative; }
.voice .v-ava .mic { position: absolute; bottom: -3px; inset-inline-start: -5px; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--panel); color: var(--primary); }
.voice-meta { display: flex; justify-content: space-between; padding-inline-start: 50px; }
.vtime { font-size: 11px; color: var(--meta); padding-top: 4px; }
.call-log { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 4px 2px; }
.call-log .cl-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; color: var(--primary); }
.call-log .cl-ic.bad { color: var(--danger); }
.call-log small { display: block; color: var(--meta); font-size: 12px; }
.reacts { display: flex; gap: 3px; margin-top: -6px; z-index: 1; padding: 0 10px; }
.react-pill { background: var(--panel); border-radius: 999px; padding: 1px 8px; font-size: 14px; display: inline-flex; gap: 3px; align-items: center; box-shadow: var(--shadow); border: 1px solid var(--line); }
.react-pill.mine { background: var(--primary-soft); border-color: var(--primary); }
.react-pill small { font-size: 11px; color: var(--muted); }
.msg-actions { position: absolute; top: 4px; opacity: 0; transition: opacity .12s; display: flex; gap: 3px; }
.msg.in .msg-actions { left: calc(min(65%, 560px) + 8px); }
.msg.out .msg-actions { right: calc(min(65%, 560px) + 8px); }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button { width: 30px; height: 30px; border-radius: 10px; background: var(--panel); color: var(--icon); display: grid; place-items: center; box-shadow: var(--shadow); }
.msg-actions .ic { width: 16px; height: 16px; }
.no-key { color: var(--meta); font-style: italic; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.no-key .ic { width: 15px; height: 15px; }
.typing-bubble { align-self: flex-start; display: inline-flex; gap: 4px; background: var(--in); padding: 12px 14px; border-radius: 18px; margin-top: 8px; box-shadow: var(--bubble-shadow); }
.typing-bubble i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: blink 1.2s infinite; }
.typing-bubble i:nth-child(2) { animation-delay: .2s; } .typing-bubble i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.upload-bar { height: 4px; border-radius: 2px; background: var(--tint); overflow: hidden; margin-top: 6px; }
.upload-bar i { display: block; height: 100%; background: var(--ember-grad); transition: width .2s; }
.scroll-down { position: absolute; bottom: 84px; left: 18px; width: 44px; height: 44px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow);
  color: var(--icon); display: grid; place-items: center; z-index: 3; }
.scroll-down .badge { position: absolute; top: -8px; right: -6px; }
.drop { position: absolute; inset: 0; z-index: 20; background: rgba(20, 17, 43, .88); color: #fff; display: grid; place-items: center; text-align: center; font-size: 18px; font-weight: 600; }
.drop .ic { width: 60px; height: 60px; color: var(--ember); }

/* ── الكتابة ── */
.composer-wrap { position: relative; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); flex: none; }
.composer, .recorder { display: flex; align-items: flex-end; gap: 4px; padding: 8px 14px; min-height: 64px; }
.composer > .icon-btn { margin-bottom: 4px; }
.recorder { align-items: center; justify-content: flex-start; }
#input { flex: 1; resize: none; border: 1px solid var(--line); outline: 0; background: var(--chip); border-radius: 22px; padding: 11px 16px; max-height: 140px; line-height: 1.45; min-height: 44px; margin: 2px 6px; font-size: 15px; transition: border-color .15s, background .15s; }
#input:focus { border-color: var(--primary); background: var(--input-bg); }
.send-btn { width: 46px; height: 46px; border-radius: 16px; background: var(--ember-grad); color: #fff; display: grid; place-items: center; flex: none; transition: transform .1s; margin-bottom: 1px;
  box-shadow: 0 4px 14px rgba(232, 70, 31, .3); }
.send-btn:active { transform: scale(.92); }
.send-btn .send-ic, .send-btn.on .mic-ic { display: none; }
.send-btn.on .send-ic { display: block; }
.send-btn .ic { width: 21px; height: 21px; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px 0; }
.reply-bar .quote { margin: 0; cursor: default; }
.reply-bar .quote.editing { border-color: var(--gold); }
.blocked-bar { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.blocked-bar button { color: var(--primary); font-weight: 700; }
.emoji-panel { position: absolute; bottom: 100%; left: 0; right: 0; height: 320px; background: var(--panel); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; z-index: 10; box-shadow: var(--shadow); }
.emoji-tabs { display: flex; border-bottom: 1px solid var(--line); }
.emoji-tabs button { flex: 1; height: 44px; font-size: 20px; opacity: .55; }
.emoji-tabs button.active { opacity: 1; box-shadow: inset 0 -3px var(--primary); }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); padding: 8px 12px; align-content: start; }
.emoji-grid button { font-size: 26px; height: 44px; border-radius: 10px; }
.emoji-grid button:hover { background: var(--hover); }
.attach-menu { position: absolute; bottom: 100%; right: 58px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; z-index: 10; margin-bottom: 8px; min-width: 210px; border: 1px solid var(--line); }
.attach-menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px 12px; border-radius: 12px; font-size: 15px; }
.attach-menu button:hover { background: var(--hover); }
.am-ic { width: 38px; height: 38px; border-radius: 12px; color: #fff; display: grid; place-items: center; }
.am-ic .ic { width: 18px; height: 18px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; margin-inline-start: 6px; }
@keyframes pulse { 50% { opacity: .3; } }
.rec-time { font-variant-numeric: tabular-nums; min-width: 42px; font-size: 16px; font-weight: 600; }
.rec-wave { flex: 1; height: 36px; min-width: 0; max-width: 420px; }

/* ── القوائم والنوافذ ── */
.menu { position: fixed; z-index: 60; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; min-width: 210px; animation: pop .12s ease; border: 1px solid var(--line); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.menu .quick { display: flex; gap: 2px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .quick button { font-size: 26px; width: 40px; height: 40px; border-radius: 12px; transition: transform .1s; }
.menu .quick button:hover { background: var(--hover); transform: scale(1.15); }
.menu .item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px; text-align: start; font-size: 14.5px; color: var(--text-2); border-radius: 10px; }
.menu .item:hover { background: var(--hover); }
.menu .item .ic { width: 19px; height: 19px; color: var(--icon); }
.menu .item.danger, .menu .item.danger .ic { color: var(--danger); }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 17, 43, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; backdrop-filter: blur(3px); }
.backdrop.clear { background: transparent !important; backdrop-filter: none; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; max-height: min(90dvh, 780px); background: var(--panel); border-radius: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: pop .15s ease; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 20px; height: 62px; flex: none; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); }
.user-list { list-style: none; margin: 8px -12px 0; padding: 0; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 8px 12px; cursor: pointer; min-height: 64px; border-radius: 14px; }
.user-row:hover { background: var(--hover); }
.user-row .u-main { flex: 1; min-width: 0; }
.user-row .u-name { font-size: 15.5px; font-weight: 600; }
.user-row .u-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .role { font-size: 11.5px; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); padding: 2px 10px; border-radius: 999px; }
.user-row .ur-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
.user-row .ur-ic .ic { width: 20px; height: 20px; }
.list-label { font-size: 14px; font-weight: 700; color: var(--primary); padding: 16px 0 6px; margin: 0; }
.check { width: 22px; height: 22px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; }
.check .ic { width: 14px; height: 14px; stroke-width: 3; }
.user-row.sel .check { background: var(--primary); border-color: var(--primary); color: #fff; }
.selected-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.selected-chips span { background: var(--primary-soft); color: var(--primary-dark); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.profile-top { text-align: center; padding: 10px 0 18px; }
.profile-top h2 { margin: 14px 0 2px; font-weight: 700; font-size: 22px; }
.profile-top p { margin: 0; color: var(--muted); }
.profile-top .avatar { margin: 0 auto; }
.ava-edit { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.ava-edit::after { content: "تغيير الصورة"; position: absolute; inset: 0; border-radius: 50%; background: rgba(20, 17, 43, .55); color: #fff; display: grid; place-items: center;
  font-size: 13px; opacity: 0; transition: opacity .15s; }
.ava-edit:hover::after { opacity: 1; }
.ava-edit .cam { position: absolute; bottom: 4px; inset-inline-start: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--ember-grad); color: #fff; display: grid; place-items: center; z-index: 1; }
.ava-edit .cam .ic { width: 16px; height: 16px; }
.section { border-top: 1px solid var(--line); margin: 0 -20px; padding: 16px 20px; }
.section h4 { margin: 0 0 10px; font-size: 13px; color: var(--primary); font-weight: 700; }
.row-btn { display: flex; align-items: center; gap: 16px; width: 100%; padding: 11px 8px; text-align: start; font-size: 15px; border-radius: 12px; }
.row-btn:hover:not([disabled]) { background: var(--hover); }
.row-btn .ic { color: var(--icon); }
.row-btn .rb-main { flex: 1; min-width: 0; }
.row-btn small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.row-btn.danger, .row-btn.danger .ic { color: var(--danger); }
.row-btn[disabled] { opacity: .6; cursor: default; }
.switch { width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on { background: var(--primary); }
.switch.on::after { right: 20px; }
.safety { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; direction: ltr; font-family: ui-monospace, Consolas, monospace; font-size: 17px;
  text-align: center; background: var(--head); padding: 16px; border-radius: 14px; letter-spacing: 1px; }
.options { display: flex; flex-direction: column; }
.option { display: flex; align-items: center; gap: 14px; padding: 12px 8px; cursor: pointer; font-size: 15px; border-radius: 12px; }
.option:hover { background: var(--hover); }
.option .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); }
.option.sel .radio { border: 6px solid var(--primary); }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.media-grid .mg { aspect-ratio: 1; background: var(--head); border-radius: 12px; overflow: hidden; position: relative; cursor: pointer; }
.media-grid .mg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid .mg .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.link-box { display: flex; align-items: center; gap: 10px; background: var(--head); border-radius: 12px; padding: 10px 12px; direction: ltr; font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.link-box span { flex: 1; min-width: 0; }
.quick-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.quick-actions button { width: 96px; padding: 12px 0 10px; border-radius: 16px; border: 1px solid var(--line); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.quick-actions button:hover { background: var(--hover); }

/* ── المكالمة ── */
.call { position: fixed; inset: 0; z-index: 80; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: radial-gradient(600px 400px at 50% 30%, rgba(244, 98, 58, .28), transparent 70%), linear-gradient(180deg, #2A2560, #14112B); }
.call::before { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88' fill='none' stroke='%23FFFFFF' stroke-opacity='.06' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M44.0 29.0L48.0 34.3L54.6 33.4L53.7 40.0L59.0 44.0L53.7 48.0L54.6 54.6L48.0 53.7L44.0 59.0L40.0 53.7L33.4 54.6L34.3 48.0L29.0 44.0L34.3 40.0L33.4 33.4L40.0 34.3Z'/%3E%3Cpath d='M0.0 -15.0L4.0 -9.7L10.6 -10.6L9.7 -4.0L15.0 0.0L9.7 4.0L10.6 10.6L4.0 9.7L0.0 15.0L-4.0 9.7L-10.6 10.6L-9.7 4.0L-15.0 0.0L-9.7 -4.0L-10.6 -10.6L-4.0 -9.7Z'/%3E%3Cpath d='M88.0 -15.0L92.0 -9.7L98.6 -10.6L97.7 -4.0L103.0 0.0L97.7 4.0L98.6 10.6L92.0 9.7L88.0 15.0L84.0 9.7L77.4 10.6L78.3 4.0L73.0 0.0L78.3 -4.0L77.4 -10.6L84.0 -9.7Z'/%3E%3Cpath d='M0.0 73.0L4.0 78.3L10.6 77.4L9.7 84.0L15.0 88.0L9.7 92.0L10.6 98.6L4.0 97.7L0.0 103.0L-4.0 97.7L-10.6 98.6L-9.7 92.0L-15.0 88.0L-9.7 84.0L-10.6 77.4L-4.0 78.3Z'/%3E%3Cpath d='M88.0 73.0L92.0 78.3L98.6 77.4L97.7 84.0L103.0 88.0L97.7 92.0L98.6 98.6L92.0 97.7L88.0 103.0L84.0 97.7L77.4 98.6L78.3 92.0L73.0 88.0L78.3 84.0L77.4 77.4L84.0 78.3Z'/%3E%3Ccircle cx='44' cy='0' r='2'/%3E%3Ccircle cx='0' cy='44' r='2'/%3E%3Ccircle cx='88' cy='44' r='2'/%3E%3Ccircle cx='44' cy='88' r='2'/%3E%3C/svg%3E"); background-size: 88px; pointer-events: none; }
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.call.has-video .remote-video { display: block; }
.local-video { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; width: 26vw; max-width: 200px; aspect-ratio: 3/4; object-fit: cover;
  border-radius: 18px; box-shadow: 0 6px 24px rgba(0,0,0,.5); background: #111; z-index: 2; display: none; transform: scaleX(-1); }
.call.local-on .local-video { display: block; }
.call-info { position: relative; z-index: 1; text-align: center; margin-top: 10vh; }
.call.has-video .call-info { margin-top: max(20px, env(safe-area-inset-top)); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.call.has-video .call-info .avatar { display: none; }
.call-info .avatar { margin: 0 auto 22px; }
.call.ringing .call-info .avatar { animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(244, 98, 58, .55); } 100% { box-shadow: 0 0 0 44px rgba(244, 98, 58, 0); } }
.call-info h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.call-info p { margin: 0 0 6px; opacity: .8; }
.call-controls { position: relative; z-index: 3; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 22px 16px max(36px, env(safe-area-inset-bottom)); width: 100%; }
.call.has-video .call-controls { background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.cbtn { width: 60px; height: 60px; border-radius: 20px; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); }
.cbtn:hover { background: rgba(255,255,255,.22); }
.cbtn.off { background: #fff; color: var(--night); }
.cbtn.end { background: #E5384F; }
.cbtn.end .ic { transform: rotate(135deg); }
.cbtn.accept { background: var(--online); }
.cbtn .ic { width: 26px; height: 26px; }

/* ── العارض ── */
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(14, 12, 32, .96); display: flex; flex-direction: column; animation: fade .15s; }
.viewer header { display: flex; align-items: center; gap: 6px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); color: #fff; }
.viewer-meta { flex: 1; min-width: 0; font-size: 14px; }
.viewer-meta small { display: block; opacity: .65; }
.viewer-body { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 12px 16px; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.viewer-body .vplayer { max-width: 100%; max-height: 100%; display: flex; }
.viewer-body .vplayer video { border-radius: 10px; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translate(-50%, 20px); background: var(--night); color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── الموبايل ── */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .sidebar { border: 0; }
  .side-head h1 { font-size: 25px; background: var(--ember-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .fab { display: grid; }
  .chat { display: none; }
  .app.chat-open .sidebar { display: none; }
  .app.chat-open .chat { display: flex; }
  .chat-head { padding: 0 4px; padding-top: env(safe-area-inset-top); }
  .chat-head .back { display: inline-grid; }
  .chat-head .peer { gap: 10px; padding: 0; margin-inline-start: 8px; }
  .bubble { max-width: 85%; }
  .msg-actions { display: none; }
  .msg-inner { padding: 8px 12px 6px; }
  .modal { max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  /* نافذة بملء الشاشة: لا يغطي شريط الحالة/الشق عنوانها ولا يغطي شريط الإيماءة أزرارها */
  .modal-head { height: calc(62px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .backdrop { padding: 0; }
  .media { max-width: 260px; }
  .scroll-down { bottom: 78px; }
  .attach-menu { right: 8px; }
  .composer, .recorder { padding: 8px 8px; }
}
@media (hover: none) { .msg-actions { display: none; } }

/* العناوين الكبيرة بخط «تجارب» */
.brand h1, .side-head h1, .empty h2 { font-family: var(--display-font); font-weight: 900; }

/* ═════════════ مزايا الموبايل: الملصقات، لمرة واحدة، الموقع، جهة الاتصال ═════════════ */
.ep-switch { display: flex; gap: 6px; padding: 8px 10px 0; }
.ep-switch button { flex: 1; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--muted); }
.ep-switch button .ic { width: 18px; height: 18px; }
.ep-switch button.active { background: var(--primary-soft); color: var(--primary); }
.stk-tabs button img { width: 26px; height: 26px; object-fit: contain; }
.stk-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 10px 12px; align-content: start; }
.stk-item, .stk-add { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; transition: background .15s, transform .1s; }
.stk-item:hover, .stk-add:hover { background: var(--hover); }
.stk-item:active { transform: scale(.94); }
.stk-item img { width: 100%; height: 100%; object-fit: contain; }
.stk-add { border: 2px dashed var(--line); color: var(--muted); font-size: 13px; gap: 4px; align-content: center; }
.stk-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.7; }
.emoji-panel { height: 340px; }
.bubble.sticker { background: none !important; box-shadow: none !important; border: 0 !important; padding: 0; min-width: 0; }
.stk-msg { display: block; width: 150px; height: 150px; object-fit: contain; }
div.stk-msg { display: grid; place-items: center; }
div.stk-msg img { width: 100%; height: 100%; object-fit: contain; }
.bubble.sticker .meta { float: none; display: inline-flex; bottom: 0; margin: 2px 0 0; padding: 2px 8px; border-radius: 999px; background: var(--panel); box-shadow: var(--bubble-shadow); }
.once { display: flex; align-items: center; gap: 12px; padding: 6px 4px; min-width: 210px; text-align: start; }
button.once:hover .once-ic { transform: scale(1.06); }
.once-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none;
  border: 2.5px dashed var(--primary); color: var(--primary); transition: transform .15s; }
.once.done .once-ic, .once.mine .once-ic { border-style: solid; border-color: var(--muted); color: var(--muted); }
.once b { display: block; font-size: 14px; }
.once small { display: block; color: var(--meta); font-size: 12px; }
.viewer.once-view img, .viewer.once-view video { user-select: none; -webkit-user-drag: none; }
.loc { display: block; width: 260px; border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none; background: var(--tint); }
.loc-map { display: grid; place-items: center; height: 120px; position: relative;
  background: linear-gradient(90deg, transparent 47%, rgba(255,255,255,.7) 47% 53%, transparent 53%) 0 0 / 60px 60px,
    linear-gradient(0deg, transparent 47%, rgba(255,255,255,.7) 47% 53%, transparent 53%) 0 0 / 60px 60px,
    linear-gradient(135deg, transparent 48%, rgba(255,255,255,.55) 48% 52%, transparent 52%) 0 0 / 140px 140px, #DCE8D2; }
:root[data-theme="dark"] .loc-map { filter: brightness(.55) saturate(.8); }
.loc-pin { width: 44px; height: 44px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--primary); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.loc-pin .ic { transform: rotate(45deg); color: #fff; width: 20px; height: 20px; }
.loc-pin.live { animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(232, 70, 31, .55); } 100% { box-shadow: 0 0 0 22px rgba(232, 70, 31, 0); } }
.loc-info { display: block; padding: 8px 12px 10px; }
.loc-info b { display: block; font-size: 14px; }
.loc-info small { display: block; color: var(--meta); font-size: 12px; }
.loc-stop { margin-top: 6px; width: 100%; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.contact-card { display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 4px 2px 8px; }
.cc-main b { display: block; }
.cc-main small { color: var(--meta); }
.cc-btn { width: 100%; height: 34px; border-radius: 10px; background: var(--tint); color: var(--primary); font-weight: 700; border-top: 1px solid var(--line); }
.vspeed { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--tint); color: var(--meta); margin-inline-start: 6px; }
.msg.swipe-ready .bubble { box-shadow: 0 0 0 2px var(--primary); }
.msg { touch-action: pan-y; }
/* تطبيق الموبايل الأصلي: احترام حواف الشاشة */
.native .side-head, .native .chat-head { padding-top: max(env(safe-area-inset-top), 0px); }

/* الدخول: برقم الهاتف أو باسم المستخدم */
#login-form[data-by="phone"] [data-by-username], #login-form[data-by="username"] [data-by-phone] { display: none; }

/* iOS يكبّر الصفحة تلقائياً عند التركيز على حقل خطه أقل من 16px ويبقيها مكبّرة: نثبّت 16px على اللمس */
@media (pointer: coarse) {
  input, textarea, select { font-size: max(16px, 1em); }
  .search input { font-size: 16px; }
}

/* قائمة الرسالة بملء الشاشة على الموبايل: تغبيش الخلفية + الرسالة مرفوعة + تفاعلات فوقها وإجراءات تحتها */
.backdrop.focus-bd { background: rgba(20, 17, 43, .38); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15); }
.focus-stack { position: fixed; z-index: 61; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.focus-stack > * { pointer-events: auto; animation: pop .16s ease; }
.focus-stack .at-right { margin-left: auto; margin-right: 0; }
.focus-stack .at-left { margin-right: auto; margin-left: 0; }
.focus-stack .menu { position: static; width: min(270px, 100%); }
.focus-stack .quick-bar { display: flex; gap: 2px; padding: 6px 8px; background: var(--panel); border-radius: 999px; box-shadow: var(--shadow); border: 1px solid var(--line); max-width: 100%; }
.focus-stack .quick-bar button { font-size: 27px; width: 42px; height: 42px; border-radius: 50%; transition: transform .1s; }
.focus-stack .quick-bar button:active { transform: scale(1.25); }
.focus-msg { overflow: hidden; pointer-events: none !important; }
.focus-msg.clipped { -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }
.focus-msg .msg-actions, .focus-msg .reactions-hover { display: none !important; }

/* التطبيق الأصلي: نتحكم بارتفاع الصفحة بأنفسنا بدل تصغير body من الإضافة (يتضارب مع 100dvh).
   --kb يحمل ارتفاع الكيبورد الحالي (0 إن كان مغلقاً) فنطرحه من ارتفاع العناصر بملء الشاشة. */
:root { --kb: 0px; }
.native body { position: relative; overflow: hidden; }
.native .app, .native .auth { height: calc(100dvh - var(--kb)); }
.native .backdrop { position: absolute; inset: 0; height: calc(100dvh - var(--kb)); }
.native .modal { height: calc(100dvh - var(--kb)); }
@media (min-width: 761px) { .native .modal { height: auto; } }
/* الكيبورد ظاهر: لا حاجة لحشوة شريط الإيماءة تحت خانة الكتابة أو الصفحة (الكيبورد نفسه يحتلها) */
.kb-open .composer-wrap { padding-bottom: 0; }
.kb-open .modal-foot { padding-bottom: 12px; }
.kb-open .auth { padding-bottom: 16px; }

/* الإعدادات كقوائم: صفحة رئيسية بصفوف مجمّعة، وكل بند يفتح صفحته */
.spage { display: none; }
.spage.on { display: block; }
.list-group { margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.list-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: start; color: var(--text); font-size: 16px; text-decoration: none; background: none; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row:active, .list-row:hover { background: var(--hover); }
.list-row > .ic, .list-row > svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-main small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.list-row .chev { color: var(--muted); display: grid; transform: scaleX(-1); }
.list-row .chev .ic { width: 18px; height: 18px; }
.spage .section:first-child { margin-top: 0; }
/* خطوط فاصلة بين المحادثات */
.conv-item::after { content: ""; position: absolute; inset-inline-start: 82px; inset-inline-end: 8px; bottom: -1px; height: 1px; background: var(--line); }
.conv-item.active::after, .conv-item:last-child::after { display: none; }

/* واجهة التطبيق كلها بلا تحديد نص عند الضغط المطوّل (قائمة الدردشات، الصور، الأزرار، الرسائل...) —
   النسخ من الرسائل متاح عبر قائمة الضغط المطوّل المخصّصة بدل تحديد نص نظام الجهاز.
   الاستثناء: خانات الإدخال (بحث، كتابة رسالة، نماذج الإعدادات) تبقى قابلة للتحديد والتعديل عادةً. */
.app, .auth, #camera-view, #viewer, #menu-root, #modal-root {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.app input, .app textarea, .auth input, #modal-root input, #modal-root textarea {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
.profile-top[data-view-avatar] .avatar { cursor: pointer; }
.profile-top .avatar.lg img { object-fit: cover; }
/* اختيار الخط من الإعدادات: خط النظام بديل عن خطوط الغريب */
:root[data-font="system"] { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; --display-font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }

/* سجل المكالمات */
.call-arrow { font-size: 15px; line-height: 1; }
.call-arrow.bad { color: var(--danger); }
.callback-btn { color: var(--primary); }

/* مشغّل الفيديو الداخلي (معاينة الإرسال وعارض الوسائط) */
.vplayer { position: relative; width: 100%; background: #000; border-radius: 10px; overflow: hidden; line-height: 0; }
.vplayer video { width: 100%; max-height: 260px; display: block; }
.viewer-body .vplayer video { max-height: 70vh; width: auto; max-width: 100%; }
.vplayer.vp-preview video { max-height: 260px; }
.vp-big-play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  display: grid; place-items: center; transition: opacity .15s; }
.vp-big-play .ic { width: 26px; height: 26px; }
.vplayer.playing .vp-big-play { opacity: 0; pointer-events: none; }
.vp-bar { position: absolute; inset-inline: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent); }
.vp-btn { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center; flex: none; }
.vp-btn .ic { width: 18px; height: 18px; }
.vp-time { font-size: 11.5px; color: #fff; min-width: 32px; text-align: center; direction: ltr; flex: none; }
.vp-scrub { flex: 1; appearance: none; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); accent-color: var(--primary); }
.vp-scrub::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; }

/* الكاميرا الداخلية */
.camera-view { position: fixed; inset: 0; z-index: 75; background: #000; display: flex; flex-direction: column; animation: fade .15s; }
.camera-view #cam-preview { flex: 1; width: 100%; object-fit: cover; background: #000; }
.cam-top { position: absolute; inset-inline: 0; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 14px 14px; z-index: 1; }
.cam-timer { color: #fff; font-size: 14px; font-weight: 700; background: rgba(217,70,31,.9); padding: 4px 12px; border-radius: 999px; direction: ltr; }
.cam-timer::before { content: "● "; }
.cam-bottom { position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 16px 16px max(22px, env(safe-area-inset-bottom)); }
.cam-hint { color: rgba(255,255,255,.75); font-size: 13px; margin: 0; }
.camera-view.recording .cam-hint { opacity: 0; }
.cam-shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; background: transparent; }
.cam-ring { width: 56px; height: 56px; border-radius: 50%; background: #fff; transition: all .15s; }
.camera-view.recording .cam-shutter { border-color: #D9461F; }
.camera-view.recording .cam-ring { width: 28px; height: 28px; border-radius: 8px; background: #D9461F; }
