/* =========================================================
   smart Meet — هوية ذكي smart
   الألوان مأخوذة من الشعار: تركواز ذكي + كحلي ذكي
   ========================================================= */
:root {
  --brand: #1faec1;          /* تركواز ذكي */
  --brand-2: #4fd1e0;
  --brand-ink: #062a33;      /* النص فوق التركواز */
  --brand-soft: rgba(31, 174, 193, .14);
  --navy: #132e4d;           /* كحلي ذكي */
  --bg: #07111f;
  --bg-2: #0d1b2e;
  --surface: #12243b;
  --surface-2: #19304d;
  --glass: rgba(13, 27, 46, .82);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef4fb;
  --muted: #8ea3bd;
  --danger: #e5484d;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 20px;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 105% -10%, rgba(31, 174, 193, .16), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(19, 46, 77, .9), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; direction: ltr; }
.error { color: #fda4af; min-height: 1.2em; margin: .5rem 0 0; font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .3; } }

/* ----- Brand ----- */
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-logo { display: block; height: 56px; width: auto; }
.brand-mark { height: 34px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; direction: ltr; text-align: left; font-size: 1.1rem; }
.brand-text > span { font-weight: 600; white-space: nowrap; }
.brand-text b { color: var(--brand); font-weight: 700; }
.brand-text small { direction: rtl; text-align: right; font-size: .72rem; color: var(--muted); margin-top: .15rem; }

/* ----- Forms & buttons ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.field input, .field select {
  width: 100%; padding: .75rem .9rem; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent;
  border-radius: 14px; padding: .8rem 1.1rem; font-weight: 600; transition: transform .1s, filter .15s, background .15s; }
.btn:active { transform: scale(.98); }
a.btn { text-decoration: none; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--brand), #178a9a); color: #fff; box-shadow: 0 8px 24px rgba(31, 174, 193, .25); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn.primary { background: var(--brand); color: #fff; border-color: transparent; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff;
  font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.badge.soft { background: var(--surface-2); color: var(--muted); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .8rem; font-size: .9rem; line-height: 1.5; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--brand); flex: none; }
.check small { color: var(--muted); }

/* =========================================================
   الصفحة الرئيسية (فاتحة)
   ========================================================= */
body.light {
  --bg: #f4f8fb; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #eef4f8;
  --line: #e2eaf2; --line-2: #d3dde8; --text: #132e4d; --muted: #5d7089; color-scheme: light;
  background:
    radial-gradient(800px 460px at 105% -15%, rgba(31, 174, 193, .20), transparent 60%),
    radial-gradient(600px 400px at -15% 20%, rgba(19, 46, 77, .07), transparent 60%),
    var(--bg);
}
body.light .error { color: var(--danger); }
.site-nav { max-width: 1120px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.site-nav .brand-logo { height: 52px; }
.nav-tag { font-size: .8rem; font-weight: 600; color: var(--navy); background: var(--brand-soft); border-radius: 999px; padding: .35rem .8rem; direction: ltr; }
.home-main { max-width: 1120px; margin: 0 auto; padding: 1rem 20px 3rem; display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .home-main { grid-template-columns: 1.1fr 1fr; align-items: start; gap: 2.5rem; padding-top: 2.5rem; } }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.25; margin: 0 0 .75rem; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), var(--navy)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero > p { color: var(--muted); font-size: 1.05rem; line-height: 1.8; margin: 0 0 1.5rem; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
@media (min-width: 600px) and (max-width: 899px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { display: flex; gap: .85rem; align-items: flex-start; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 16px; padding: .85rem 1rem; }
.features .f-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: #127f8e; }
.features b { display: block; margin-bottom: .15rem; }
.features small { color: var(--muted); line-height: 1.6; }
.start-card { padding: 1.5rem; box-shadow: 0 30px 70px rgba(19, 46, 77, .10); border-radius: 24px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; margin-bottom: 1.25rem; }
.seg button { border: 0; background: transparent; padding: .65rem; border-radius: 11px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(19, 46, 77, .12); }
body.light .btn-primary { background: linear-gradient(135deg, var(--navy), #1d4471); box-shadow: 0 10px 26px rgba(19, 46, 77, .25); }
.recent { grid-column: 1 / -1; }
.recent h2 { font-size: 1.1rem; margin: .5rem 0 .75rem; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
@media (min-width: 700px) { .recent ul { grid-template-columns: repeat(3, 1fr); } }
.recent a { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1rem; transition: border-color .15s, transform .15s; }
.recent a:hover { border-color: var(--brand); transform: translateY(-2px); }
.recent .r-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: #127f8e; display: grid; place-items: center; flex: none; }
.recent .r-t { flex: 1; min-width: 0; }
.recent .r-t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .r-t small { color: var(--muted); }
.site-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 20px 2rem; }

/* =========================================================
   شاشة ما قبل الدخول
   ========================================================= */
.lobby { position: relative; isolation: isolate; min-height: 100dvh; max-width: 1080px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 1.1rem; }
.lb-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.lb-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.lb-blob.a { width: 460px; height: 460px; background: #1faec1; top: -160px; right: -120px; animation: lbDrift1 16s ease-in-out infinite alternate; }
.lb-blob.b { width: 420px; height: 420px; background: #1d4471; bottom: -150px; left: -120px; animation: lbDrift2 20s ease-in-out infinite alternate; }
.lb-blob.c { width: 300px; height: 300px; background: #7c5cff; top: 45%; left: 40%; opacity: .2; animation: lbDrift3 24s ease-in-out infinite alternate; }
@keyframes lbDrift1 { to { transform: translate(-110px, 130px) scale(1.15); } }
@keyframes lbDrift2 { to { transform: translate(150px, -110px) scale(1.1); } }
@keyframes lbDrift3 { to { transform: translate(-160px, 70px) scale(1.3); } }
.lb-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse at 50% 35%, #000 30%, transparent 75%); }
#lbStars { position: absolute; inset: 0; width: 100%; height: 100%; }
.lb-in { opacity: 0; transform: translateY(20px); animation: lbIn .7s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes lbIn { to { opacity: 1; transform: none; } }

.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.lobby-head .brand-logo { height: 46px; }
.lb-code { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid rgba(31, 174, 193, .3); background: rgba(31, 174, 193, .1); color: var(--brand-2);
  border-radius: 999px; padding: .4rem .85rem; font-size: .82rem; transition: transform .2s, background .2s; }
.lb-code:hover { background: rgba(31, 174, 193, .2); transform: translateY(-2px); }
.lb-code:active { transform: scale(.95); }

.lobby-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 880px) { .lobby-grid { grid-template-columns: 1.3fr 1fr; align-items: center; gap: 1.6rem; } }

/* --- المعاينة --- */
.lobby-grid > * { min-width: 0; }
.lb-stage { display: grid; gap: .7rem; min-width: 0; }
.lobby { overflow-x: clip; }
.lb-stage .preview { width: 100%; }
.preview { --lvl: 0; aspect-ratio: 4 / 3.4; border-radius: 28px; border: 0;
  background: radial-gradient(120% 90% at 50% 25%, #1a3558, #0b1729 70%); box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
@media (min-width: 880px) { .preview { aspect-ratio: 16 / 11; } }
.preview::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; z-index: 3; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), rgba(31, 174, 193, .9), rgba(124, 92, 255, .8), rgba(79, 209, 224, .2), rgba(31, 174, 193, .9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinBorder 6s linear infinite; opacity: calc(.45 + var(--lvl) * 1.2); }
.preview video { transform: scaleX(-1); }
.lb-avatar-wrap { position: absolute; inset: 0; display: grid; place-items: center; }
.preview.video-on .lb-avatar-wrap { display: none; }
.lobby .preview .avatar { position: relative; inset: auto; margin: 0; width: clamp(92px, 30%, 150px); font-size: clamp(2.2rem, 7vw, 3.6rem);
  transform: scale(calc(1 + var(--lvl) * .12)); transition: transform .08s linear, background .4s;
  box-shadow: 0 0 0 calc(6px + var(--lvl) * 22px) rgba(31, 174, 193, calc(.12 + var(--lvl) * .25)), 0 20px 40px rgba(0, 0, 0, .35); animation: avIn .8s cubic-bezier(.34, 1.56, .64, 1) .3s both; }
@keyframes avIn { from { transform: scale(.3); opacity: 0; } }
.lb-ring { position: absolute; width: clamp(92px, 30%, 150px); aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(79, 209, 224, .35); animation: ripple2 3s ease-out infinite; }
.lb-ring.r2 { animation-delay: 1s; } .lb-ring.r3 { animation-delay: 2s; }
@keyframes ripple2 { from { transform: scale(1); opacity: .8; } to { transform: scale(2.2); opacity: 0; } }
.lb-meter { position: absolute; z-index: 2; top: 14px; inset-inline-start: 14px; display: flex; align-items: center; gap: 3px; height: 26px; padding: 0 .55rem;
  border-radius: 999px; background: rgba(7, 17, 31, .55); backdrop-filter: blur(6px); }
.lb-meter i { width: 3px; height: 16px; border-radius: 2px; background: linear-gradient(var(--brand-2), var(--brand)); transform: scaleY(.15); transition: transform .08s linear; }
.lb-you { position: absolute; z-index: 2; top: 14px; inset-inline-end: 14px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; background: rgba(7, 17, 31, .65); }
.lb-you:empty { display: none; }
.preview-controls { position: absolute; bottom: 14px; inset-inline: 0; display: flex; justify-content: center; z-index: 4; gap: .6rem; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(7, 17, 31, .65); display: grid; place-items: center; backdrop-filter: blur(8px); }
.round.off { background: var(--danger); border-color: transparent; }
.preview-controls .round { width: 54px; height: 54px; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background .2s; }
.preview-controls .round:hover { transform: translateY(-3px) scale(1.05); }
.round.shake { animation: shake .45s ease; } .round.flip { animation: flip .5s ease; }
.lb-checks { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.lb-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .35rem .75rem; border-radius: 999px; background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); color: var(--muted); transition: all .3s; }
.lb-check i { width: 8px; height: 8px; border-radius: 50%; background: #64748b; transition: background .3s, box-shadow .3s; }
.lb-check.ok { color: #a7f3d0; border-color: rgba(52, 211, 153, .3); animation: pop .4s cubic-bezier(.34, 1.56, .64, 1); }
.lb-check.ok i { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.lb-check.off { color: #fda4af; }
.lb-check.off i { background: var(--danger); }
.lb-check.heard i { animation: live 1.4s infinite; }

/* --- كارت البيانات --- */
.lb-card { position: relative; border-radius: 28px; padding: 1.5rem 1.3rem 1.3rem; background: linear-gradient(180deg, rgba(25, 48, 77, .78), rgba(13, 27, 46, .9));
  border: 1px solid var(--line-2); backdrop-filter: blur(14px); box-shadow: 0 30px 70px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); display: grid; gap: .85rem; }
.lb-hello { margin: 0; font-size: .95rem; font-weight: 600; color: var(--brand-2); }
.lb-card h2 { margin: -.3rem 0 0; font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.25;
  background: linear-gradient(90deg, #fff, #c7f3f8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lb-people { display: flex; align-items: center; gap: .7rem; }
.lb-people p { margin: 0; font-size: .9rem; line-height: 1.6; }
.lb-people p b { color: var(--text); }
.lb-faces { display: flex; flex: none; }
.lb-faces:empty { display: none; }
.lb-face { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #fff; background: var(--avatar, #1faec1);
  border: 2px solid #12243b; margin-inline-start: -10px; animation: faceIn .5s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i) * 90ms + 400ms); }
.lb-face:first-child { margin-inline-start: 0; }
.lb-face.more { background: var(--surface-2); color: var(--muted); }
@keyframes faceIn { from { transform: scale(0) translateY(10px); opacity: 0; } }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-start: .2rem; vertical-align: middle; animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } }

.lb-field { display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(7, 17, 31, .55);
  transition: border-color .2s, box-shadow .2s; }
.lb-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31, 174, 193, .15); }
.lb-field > span { color: var(--muted); display: inline-grid; }
.lb-field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: .95rem 0; font-size: 1.05rem; }
.lb-card > * { min-width: 0; }
.lb-langs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: .4rem; }
.lb-sel { display: grid; gap: .3rem; min-width: 0; }
.lb-sel small { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-sel select { width: 100%; padding: .7rem .7rem; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(7, 17, 31, .55); outline: none; font-size: .9rem; }
.lb-sel select:focus { border-color: var(--brand); }
.lb-sel select:disabled { opacity: .5; }
.lb-swap { padding-bottom: .65rem; display: inline-block; color: var(--brand-2); font-size: 1.1rem; animation: swap 3s ease-in-out infinite; }
@keyframes swap { 50% { transform: scaleX(-1); } }
.lb-switch { display: flex; align-items: center; gap: .75rem; cursor: pointer; padding: .7rem .8rem; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.lb-switch input { position: absolute; opacity: 0; pointer-events: none; }
.lb-switch .sw { flex: none; width: 48px; height: 28px; border-radius: 999px; background: #3a4b63; position: relative; transition: background .25s; }
.lb-switch .sw i { position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: inset-inline-start .25s cubic-bezier(.34, 1.56, .64, 1); }
.lb-switch input:checked + .sw { background: var(--brand); }
.lb-switch input:checked + .sw i { inset-inline-start: 23px; }
.lb-switch input:focus-visible + .sw { box-shadow: 0 0 0 3px rgba(31, 174, 193, .4); }
.lb-switch .txt { display: grid; }
.lb-switch .txt b { font-size: .92rem; }
.lb-switch .txt small { color: var(--muted); font-size: .76rem; }
.lb-join { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; padding: 1rem; border: 0; border-radius: 18px;
  font-size: 1.08rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #1faec1, #127f8e 55%, #1d4471); background-size: 200% 100%;
  box-shadow: 0 14px 34px rgba(31, 174, 193, .38); transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s, background-position .5s; }
.lb-join::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 3s ease-in-out infinite 1.2s; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.lb-join:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 40px rgba(31, 174, 193, .5); }
.lb-join:active { transform: scale(.97); }
.lb-join:disabled { filter: grayscale(.6); opacity: .6; }
.lb-join:disabled::after { display: none; }
.lb-join [data-icon] { transform: scaleX(-1); transition: transform .3s; }
.lb-join:hover [data-icon] { transform: scaleX(-1) translateX(5px); }

/* --- انتقال الدخول --- */
.join-warp { position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: radial-gradient(circle at var(--x) var(--y), rgba(79, 209, 224, .95) 0, rgba(31, 174, 193, .7) 8%, rgba(19, 46, 77, .0) 22%);
  animation: warp 1s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes warp { 0% { opacity: 1; clip-path: circle(0 at var(--x) var(--y)); } 45% { opacity: 1; clip-path: circle(150% at var(--x) var(--y)); } 100% { opacity: 0; clip-path: circle(150% at var(--x) var(--y)); } }
.meeting:not([hidden]) .grid { animation: gridIn .7s cubic-bezier(.34, 1.3, .64, 1) .15s both; }
@keyframes gridIn { from { opacity: 0; transform: scale(.92); } }

/* =========================================================
   غرفة الاجتماع
   ========================================================= */
.meeting { isolation: isolate; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; position: relative; }

/* --- الشريط العلوي --- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px; min-height: 60px; }
.tb-start { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1; }
.tb-mark { height: 30px; width: auto; flex: none; }
.tb-title { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.tb-title h1 { margin: 0; font-size: 1.05rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-pill { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--muted); font-size: .78rem; letter-spacing: .03em; }
.code-pill:hover { color: var(--brand); }
.tb-center, .tb-end { display: flex; align-items: center; gap: .4rem; flex: none; }
.pill { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .7rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); font-size: .82rem; white-space: nowrap; }
.pill-btn:hover { border-color: var(--brand); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.status { color: var(--ok); }
.status.bad { color: var(--warn); }
.status.bad .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .2); }
.pill.rec { color: #fecdd3; background: rgba(229, 72, 77, .18); border-color: rgba(229, 72, 77, .35); font-weight: 700; letter-spacing: .05em; }
.pill.rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
@media (max-width: 560px) {
  .status span { display: none; }
  .status { padding: 0 .55rem; }
  .tb-end .pill-btn[data-panel="minutes"] { display: none; }
}
@media (max-width: 400px) { .tb-center .pill.mono { display: none; } }

/* --- المسرح + اللوحة الجانبية --- */
.meeting-body { min-height: 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .meeting.panel-open .meeting-body { grid-template-columns: 1fr 380px; } }
.stage { position: relative; min-height: 0; padding: 4px 16px 8px; }
.grid { height: 100%; display: grid; gap: 10px; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.grid[data-count="3"], .grid[data-count="4"], .grid[data-count="5"], .grid[data-count="6"], .grid[data-many] { grid-template-columns: 1fr 1fr; }
@media (min-width: 820px) {
  .grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
  .grid[data-count="5"], .grid[data-count="6"], .grid[data-many] { grid-template-columns: repeat(3, 1fr); }
}
.grid.has-spotlight { grid-template-columns: 1fr !important; grid-template-rows: 3fr; grid-auto-rows: 1fr; }
@media (min-width: 820px) {
  .grid.has-spotlight { grid-template-columns: 3fr 1fr !important; grid-template-rows: none; grid-auto-rows: minmax(0, 1fr); }
  .grid.has-spotlight .tile.spotlight { grid-row: 1 / span 4; }
}

/* --- البلاطات --- */
.tile { position: relative; overflow: hidden; border-radius: 22px; min-height: 0;
  background: radial-gradient(120% 90% at 50% 20%, #1a3558 0%, #0d1b2e 70%); border: 1px solid var(--line);
  transition: box-shadow .25s, border-color .25s; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.mirror video { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; }
.tile.spotlight { order: -1; }
.tile.speaking { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand), 0 0 28px rgba(31, 174, 193, .35); }
.tile .avatar, .preview .avatar { position: absolute; inset: 0; margin: auto; width: clamp(64px, 24%, 132px); aspect-ratio: 1;
  border-radius: 50%; display: grid; place-items: center; font-size: clamp(1.6rem, 5.5vw, 3.2rem); font-weight: 700;
  color: #fff; background: var(--avatar, #1faec1);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .05), 0 0 0 16px rgba(255, 255, 255, .025); }
.tile.speaking .avatar { box-shadow: 0 0 0 8px rgba(31, 174, 193, .25), 0 0 0 18px rgba(31, 174, 193, .1); }
.tile.video-on .avatar, .preview.video-on .avatar { display: none; }
.tile:not(.video-on) video, .preview:not(.video-on) video { visibility: hidden; }
.tile .label { position: absolute; bottom: 10px; inset-inline-start: 10px; display: flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem; border-radius: 999px; background: rgba(7, 17, 31, .72); backdrop-filter: blur(8px);
  font-weight: 600; font-size: .85rem; z-index: 2; max-width: calc(100% - 20px); }
.tile .label .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .badges { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; gap: 6px; z-index: 2; }
.tile .badges > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(7, 17, 31, .72); backdrop-filter: blur(8px); }
.tile .badges .mic-off { color: #fda4af; }
.tile .badges .hand { background: var(--warn); color: #3b2900; animation: wave 1s ease-in-out 2; }
.tile .badges .host { background: var(--brand-soft); color: var(--brand-2); font-size: .7rem; font-weight: 700; width: auto; padding: 0 .55rem; border-radius: 999px; }
@keyframes wave { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* --- النص المكتوب والتفاعلات --- */
.captions { position: absolute; bottom: 18px; inset-inline: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 5; }
.captions .cap { max-width: min(760px, 100%); background: rgba(7, 17, 31, .86); backdrop-filter: blur(6px); padding: .5rem .9rem; border-radius: 14px; font-size: 1rem; line-height: 1.55; border: 1px solid var(--line); }
.captions .cap b { color: var(--brand-2); margin-inline-end: .35rem; }
.captions .cap .tr { display: block; color: #a5f3fc; }
.captions .cap .orig { display: block; font-size: .8rem; color: #cbd5e1; opacity: .75; }
.captions .cap .fixed { font-size: .75rem; opacity: .8; }
.reactions-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }


/* --- أزرار التحكم (تحت) --- */
.controls { position: relative; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin: 4px 12px max(12px, env(safe-area-inset-bottom)); padding: 8px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(25, 48, 77, .75), rgba(13, 27, 46, .9)); border: 1px solid var(--line-2);
  backdrop-filter: blur(14px); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
@media (min-width: 900px) { .controls { width: 600px; justify-self: center; } }
.ctl { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px; border: 0; border-radius: 20px; background: transparent;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background .2s; }
.ctl:hover { background: rgba(255, 255, 255, .04); }
.ctl:active { transform: scale(.92); }
.ctl .lbl { font-size: .75rem; color: var(--muted); font-weight: 600; transition: color .2s; }
.ctl .orb { --c1: #2a4a72; --c2: #19304d; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--c1), var(--c2)); color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s, background .25s; }
.ctl:hover .orb { transform: translateY(-3px) rotate(-4deg); }
#micBtn .orb, #camBtn .orb { --c1: #1faec1; --c2: #127f8e; }
.ctl.off .orb { --c1: #3b2232; --c2: #2a1824; color: #fda4af; box-shadow: inset 0 0 0 1.5px rgba(229, 72, 77, .5); }
.ctl.off .lbl { color: #fda4af; }
.ctl.active .orb { --c1: #1faec1; --c2: #4fd1e0; box-shadow: 0 0 0 3px rgba(31, 174, 193, .25), 0 8px 22px rgba(31, 174, 193, .45); }
.ctl.active .lbl { color: var(--brand-2); }
.ctl.leave .orb { --c1: #f2545b; --c2: #c62f3a; box-shadow: 0 8px 22px rgba(229, 72, 77, .45); }
.ctl.leave .lbl { color: #fda4af; }
.ctl .badge { position: absolute; top: 6px; inset-inline-end: calc(50% - 34px); animation: pop .35s cubic-bezier(.34, 1.56, .64, 1); }
/* حلقات النبض حوالين المايك وإنت بتتكلم */
#micBtn.talking .orb { animation: talk 1.1s ease-out infinite; }
@keyframes talk { 0% { box-shadow: 0 0 0 0 rgba(79, 209, 224, .65), 0 6px 16px rgba(0, 0, 0, .3); } 100% { box-shadow: 0 0 0 14px rgba(79, 209, 224, 0), 0 6px 16px rgba(0, 0, 0, .3); } }
/* اهتزاز لما تقفل المايك/الكاميرا */
.ctl.shake .orb { animation: shake .45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-4px) rotate(-6deg); } 40%, 80% { transform: translateX(4px) rotate(6deg); } }
.ctl.flip .orb { animation: flip .5s ease; }
@keyframes flip { 50% { transform: rotateY(90deg) scale(.9); } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* =========== لوحة التفاعلات =========== */
.emoji-bar { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(400px, calc(100vw - 24px));
  padding: 12px; border-radius: 24px; background: linear-gradient(180deg, rgba(25, 48, 77, .97), rgba(13, 27, 46, .98));
  border: 1px solid var(--line-2); backdrop-filter: blur(16px); box-shadow: 0 -10px 50px rgba(0, 0, 0, .55); z-index: 26;
  animation: popUp .35s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes popUp { from { transform: translateX(-50%) translateY(18px) scale(.85); opacity: 0; } }
.fx-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.fx { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 25%, transparent), transparent); transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), border-color .2s; }
.fx span { font-size: 1.7rem; display: block; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.fx small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.fx:hover { transform: translateY(-4px); border-color: var(--c); }
.fx:hover span { transform: scale(1.2) rotate(-10deg); }
.emo-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(7, 17, 31, .5); margin-bottom: 8px; }
.emo-tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: .3rem; font-size: 1.05rem; filter: grayscale(.7); opacity: .7; transition: all .2s; }
.emo-tabs button.on { background: var(--surface-2); filter: none; opacity: 1; }
.emo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.emo-grid button { border: 0; background: transparent; font-size: 1.65rem; height: 46px; border-radius: 12px;
  opacity: 0; animation: emoIn .35s cubic-bezier(.34, 1.56, .64, 1) forwards; animation-delay: calc(var(--k) * 22ms); transition: transform .15s, background .15s; }
@keyframes emoIn { from { opacity: 0; transform: scale(.3) translateY(8px); } to { opacity: 1; transform: none; } }
.emo-grid button:hover { background: rgba(255, 255, 255, .07); transform: scale(1.25) translateY(-3px); }
.sent { animation: sent .45s ease !important; }
@keyframes sent { 30% { transform: scale(.75); } 60% { transform: scale(1.3) rotate(10deg); } }

/* --- طيران الإيموجي من مربع الشخص --- */
.float-emoji { position: absolute; z-index: 7; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  animation: emoFly 3s cubic-bezier(.2, .7, .3, 1) forwards; }
.float-emoji .fe { display: block; font-size: 2.8rem; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45)); animation: emoPop .5s cubic-bezier(.34, 1.8, .64, 1); }
.float-emoji small { display: inline-block; margin-top: 2px; font-size: .7rem; font-weight: 600; background: rgba(7, 17, 31, .8); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
@keyframes emoFly {
  0% { opacity: 0; }
  8% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% - 260px)) rotate(var(--rot)); }
}
@keyframes emoPop { 0% { transform: scale(0); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; }
.fx-banner { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 9; white-space: nowrap; font-weight: 700;
  padding: .55rem 1.1rem; border-radius: 999px; background: linear-gradient(135deg, rgba(124, 92, 255, .9), rgba(31, 174, 193, .9));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4); animation: banner 2.6s cubic-bezier(.34, 1.56, .64, 1) forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.8); } 12%, 82% { opacity: 1; transform: translateX(-50%); } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
.tile.reacted { animation: tileBump .8s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes tileBump { 30% { transform: scale(1.025); box-shadow: 0 0 0 3px rgba(167, 139, 250, .7), 0 0 40px rgba(167, 139, 250, .4); } }

/* =========== حركات غرفة الاجتماع =========== */
.meeting::before { content: ''; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 35% at 80% 10%, rgba(31, 174, 193, .16), transparent 70%), radial-gradient(35% 30% at 10% 90%, rgba(124, 92, 255, .12), transparent 70%);
  animation: aurora 20s ease-in-out infinite alternate; }
@keyframes aurora { to { transform: translate(-6%, 5%) rotate(6deg) scale(1.1); } }
.topbar { animation: slideDown .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } }
.controls { animation: slideUp .7s cubic-bezier(.34, 1.3, .64, 1); }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } }
.controls .ctl { opacity: 0; animation: ctlIn .5s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.controls .ctl:nth-child(1) { animation-delay: .25s; } .controls .ctl:nth-child(2) { animation-delay: .32s; } .controls .ctl:nth-child(3) { animation-delay: .39s; }
.controls .ctl:nth-child(4) { animation-delay: .46s; } .controls .ctl:nth-child(5) { animation-delay: .53s; }
@keyframes ctlIn { from { opacity: 0; transform: translateY(14px) scale(.8); } to { opacity: 1; transform: none; } }
/* الشخص اللي بيتكلم: حد منوّر بيلف */
.tile.speaking::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--ang, 0deg), #1faec1, #a78bfa, #4fd1e0, #1faec1);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinBorder 3s linear infinite; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spinBorder { to { --ang: 360deg; } }
/* رفع اليد */
.tile .badges .hand:not([hidden]) { animation: wave 1s ease-in-out 3, handGlow 1.6s ease-in-out infinite; }
@keyframes handGlow { 50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, .25); } }
/* النبض حوالين التسجيل */
.pill.rec { animation: recIn .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes recIn { from { transform: scale(.5); opacity: 0; } }
/* الرسائل والترجمة */
.messages li { animation: msgIn .35s cubic-bezier(.34, 1.4, .64, 1); }
.messages li.mine { transform-origin: 100% 100%; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.92); } }
.captions .cap { animation: capIn .3s ease-out; }
@keyframes capIn { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.panel:not([hidden]) .panel-body.show { animation: fadeUp .3s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.tabs button.active { animation: tabPop .3s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes tabPop { 50% { transform: scale(1.08); } }
.badge { animation: pop .35s cubic-bezier(.34, 1.56, .64, 1); }

/* --- لوحة الخدمات (مربعات الأيقونات) --- */
.tools { position: absolute; z-index: 25; inset-inline: 12px; bottom: calc(116px + max(12px, env(safe-area-inset-bottom)));
  margin-inline: auto; max-width: 760px; padding: 14px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(25, 48, 77, .96), rgba(13, 27, 46, .98)); border: 1px solid var(--line-2);
  box-shadow: 0 -10px 50px rgba(0, 0, 0, .55); backdrop-filter: blur(16px); transform-origin: 50% 100%;
  animation: sheetIn .32s cubic-bezier(.34, 1.36, .64, 1); }
@keyframes sheetIn { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .tools-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .tools-grid { grid-template-columns: repeat(6, 1fr); } }
.tile-btn { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  opacity: 0; animation: tileIn .45s cubic-bezier(.34, 1.56, .64, 1) forwards; animation-delay: calc(var(--i, 0) * 35ms);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .2s, border-color .2s; }
@keyframes tileIn { from { opacity: 0; transform: translateY(16px) scale(.85); } to { opacity: 1; transform: none; } }
.tile-btn:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .06); border-color: var(--line-2); }
.tile-btn:active { transform: scale(.94); }
.tile-btn .orb { width: 50px; height: 50px; border-radius: 17px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--c1), var(--c2)); position: relative; overflow: hidden;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--c1) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.tile-btn .orb::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, .35) 50%, transparent 60%);
  transform: translateX(-120%); transition: transform .7s ease; }
.tile-btn:hover .orb { transform: scale(1.08) rotate(-6deg); }
.tile-btn:hover .orb::after { transform: translateX(120%); }
.tile-btn .lbl { font-size: .8rem; font-weight: 600; text-align: center; line-height: 1.3; }
.tile-btn.active { border-color: color-mix(in srgb, var(--c1) 70%, transparent); background: color-mix(in srgb, var(--c1) 14%, transparent); }
.tile-btn.active .orb { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c1) 30%, transparent), 0 8px 26px color-mix(in srgb, var(--c1) 60%, transparent); } }
.tile-btn .badge { position: absolute; top: 8px; inset-inline-end: 8px; }

/* موجة الضغطة */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: rgba(255, 255, 255, .35); animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(30); opacity: 0; } }

/* دخول المشاركين والكلام */
.tile { animation: tileJoin .5s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes tileJoin { from { opacity: 0; transform: scale(.9); } }
.tile.speaking .avatar { animation: speak 1.2s ease-out infinite; }
@keyframes speak { 0% { box-shadow: 0 0 0 0 rgba(31, 174, 193, .5), 0 0 0 0 rgba(31, 174, 193, .25); } 100% { box-shadow: 0 0 0 16px rgba(31, 174, 193, 0), 0 0 0 30px rgba(31, 174, 193, 0); } }
.toast { animation: toastIn .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes toastIn { from { transform: translateY(-18px) scale(.9); opacity: 0; } }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tile-btn { opacity: 1; }
}

/* --- اللوحة الجانبية بتبويبات --- */
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); }
@media (min-width: 900px) { .panel { margin: 4px 16px 8px 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; } }
@media (max-width: 899px) {
  .panel { position: fixed; z-index: 30; inset-inline: 0; bottom: 0; height: 86dvh; border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--line-2); box-shadow: 0 -20px 60px rgba(0, 0, 0, .55); animation: rise .2s ease-out; }
}
.panel-head { display: flex; align-items: center; gap: .5rem; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0 .25rem; font-size: 1rem; flex: 1; }
.panel-head h2:not(.sr-only) ~ .icon-btn { margin-inline-start: auto; }
.tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; padding: .45rem .75rem; font-size: .85rem; font-weight: 600; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--brand-soft); color: var(--brand-2); }
.tabs button > span:not([data-icon]) { display: none; }
.tabs button.active > span:not([data-icon]) { display: inline; }
.tabs button { padding: .5rem .65rem; }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: none; }
.panel-body.show { display: flex; flex-direction: column; gap: .75rem; }
.panel-body[data-view="chat"].show, .panel-body[data-view="assistant"].show { padding: 0; }

.messages { list-style: none; margin: 0; padding: 16px; flex: 1; overflow: auto; display: flex; flex-direction: column; gap: .75rem; }
.messages li { max-width: 85%; align-self: flex-start; }
.messages li.mine { align-self: flex-end; }
.messages .who { font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.messages .bubble { background: var(--surface); padding: .55rem .85rem; border-radius: 16px 16px 16px 4px; white-space: pre-wrap; word-break: break-word; }
.messages li.mine .bubble { background: linear-gradient(135deg, rgba(31, 174, 193, .28), rgba(31, 174, 193, .14)); border-radius: 16px 16px 4px 16px; }
.messages .empty { color: var(--muted); align-self: center; margin-top: 2rem; }
.composer { display: flex; gap: .5rem; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; padding: .7rem .95rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); outline: none; }
.composer input:focus { border-color: var(--brand); }
.composer .icon-btn { border-radius: 50%; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.people li { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; border-radius: 14px; background: var(--surface); }
.people .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--avatar); flex: none; color: #fff; }
.people .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .ic { display: flex; gap: .35rem; color: var(--muted); align-items: center; }
.people .ic .off { color: #fda4af; }
.section-title { font-size: .8rem; color: var(--muted); font-weight: 600; margin: .25rem 0 0; }

.minutes { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; }
.minutes li { padding: .45rem .65rem; border-radius: 12px; background: var(--surface); }
.minutes time { color: var(--muted); font-size: .75rem; margin-inline-end: .4rem; direction: ltr; display: inline-block; }
.minutes .sys { background: transparent; color: var(--muted); padding: .2rem .6rem; }

/* --- المساعد --- */
.ai-off { background: rgba(251, 191, 36, .1); color: #fde68a; border: 1px solid rgba(251, 191, 36, .3); border-radius: 12px; padding: .75rem; margin: 16px 16px 0; font-size: .9rem; line-height: 1.6; }
.ai-off code { background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 6px; }
.ai-thread .bubble { line-height: 1.7; }
.ai-thread li.ai .bubble, .ai-thread li.ai-intro .bubble { background: var(--surface); border: 1px solid var(--line); }
.ai-thread li.ai .who { color: var(--brand-2); }
.ai-thread li.pending .bubble { color: var(--muted); }
.ai-thread .dots::after { content: '…'; animation: pulse 1s infinite; }
.ai-thread .share-ai { margin-top: .35rem; background: none; border: 0; color: var(--brand-2); font-size: .8rem; padding: 0; }
.quick { display: flex; gap: .4rem; overflow-x: auto; padding: 0 14px 10px; scrollbar-width: none; }
.quick button { flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: .4rem .85rem; font-size: .85rem; }
.quick button:hover { border-color: var(--brand); }

/* --- الترجمة --- */
.switch-row { display: flex; align-items: center; gap: 1rem; justify-content: space-between; background: var(--surface); border-radius: 16px; padding: .85rem; }
.switch-row p { margin: .25rem 0 0; }
.toggle { flex: none; width: 52px; height: 30px; border-radius: 999px; border: 0; background: #3a4b63; position: relative; transition: background .2s; }
.toggle i { position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.toggle[aria-checked="true"] { background: var(--brand); }
.toggle[aria-checked="true"] i { inset-inline-start: 25px; }
.cap-status { margin: 0; padding: .65rem .8rem; border-radius: 12px; font-size: .9rem; line-height: 1.6; background: var(--surface); }
.cap-status.ok { color: #a7f3d0; background: rgba(52, 211, 153, .1); }
.cap-status.warn { color: #fde68a; background: rgba(251, 191, 36, .1); }
.cap-status.err { color: #fecdd3; background: rgba(229, 72, 77, .12); }

/* --- رسائل عامة --- */
.toasts { position: fixed; top: max(14px, env(safe-area-inset-top)); inset-inline: 16px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: rgba(13, 27, 46, .95); border: 1px solid var(--line-2); padding: .6rem 1rem; border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  animation: rise .2s ease-out; max-width: 480px; backdrop-filter: blur(8px); }
.unmute-bar { position: fixed; z-index: 50; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 0; border-radius: 16px;
  background: var(--brand); color: #fff; font-weight: 700; padding: 1rem 1.4rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); font-size: 1rem; }

/* --- أدوات المنظّم --- */
.host-box { display: grid; gap: .5rem; padding: .75rem; border-radius: 18px; background: linear-gradient(135deg, rgba(31, 174, 193, .10), rgba(19, 46, 77, .35)); border: 1px solid rgba(31, 174, 193, .25); }
.host-box .section-title { margin: 0 0 .1rem; color: var(--brand-2); }
.switch-row.sm { padding: .55rem .7rem; background: rgba(7, 17, 31, .35); }
.switch-row.sm b { font-size: .9rem; }
.mini { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 999px; padding: .3rem .7rem; font-size: .8rem; font-weight: 600; }
.mini.icon { padding: .3rem; border-radius: 50%; }
.mini.ok { background: var(--brand); border-color: transparent; color: #fff; }
.mini.danger { color: #fda4af; border-color: rgba(229, 72, 77, .4); }
.people .row-menu { background: transparent; padding: 0 .5rem .3rem; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; margin-top: -.3rem; }
.host-tag { font-size: .68rem; font-weight: 700; color: var(--brand-2); background: var(--brand-soft); border-radius: 999px; padding: .1rem .45rem; margin-inline-start: .3rem; vertical-align: middle; }
.waiting-list li { background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .25); }
[data-panel="people"].attention { animation: ring 1.2s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 4px rgba(251, 191, 36, .45); } }

/* --- شاشة الانتظار --- */
.waiting { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(700px 400px at 50% 30%, rgba(31, 174, 193, .18), transparent 60%), rgba(7, 17, 31, .96); backdrop-filter: blur(6px); }
.waiting-card { text-align: center; max-width: 380px; display: grid; justify-items: center; gap: .6rem; }
.waiting-card h2 { margin: .4rem 0 0; font-size: 1.3rem; }
.waiting-card p { margin: 0 0 .6rem; line-height: 1.7; }
.waiting-mark { height: 46px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- نافذة الخروج للمنظّم --- */
.modal { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 20px; background: rgba(4, 10, 20, .7); backdrop-filter: blur(4px); }
.modal-card { width: min(380px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 22px; padding: 1.4rem; display: grid; gap: .6rem; animation: rise .2s ease-out; }
.modal-card h2 { margin: 0; font-size: 1.2rem; }
.modal-card p { margin: 0 0 .4rem; line-height: 1.7; }
.btn.link { background: none; color: var(--muted); }

/* --- شاشة نهاية الاجتماع --- */
.end-screen { position: fixed; inset: 0; z-index: 75; overflow: auto; padding: max(24px, env(safe-area-inset-top)) 16px 32px;
  background: radial-gradient(700px 420px at 50% 0%, rgba(31, 174, 193, .18), transparent 60%), var(--bg); }
.end-card { max-width: 680px; margin: 0 auto; display: grid; gap: .7rem; justify-items: center; text-align: center; }
.end-card h2 { margin: .3rem 0 0; font-size: 1.5rem; }
.end-card > p { margin: 0; }
.end-summary { width: 100%; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.2rem 1.3rem; display: grid; justify-items: center; gap: .6rem; }
.end-summary .summary { width: 100%; justify-self: stretch; line-height: 1.8; }
.end-summary h3 { margin: 1rem 0 .35rem; font-size: 1rem; color: var(--brand-2); border-inline-start: 4px solid var(--brand); padding-inline-start: .6rem; }
.end-summary h3:first-child { margin-top: 0; }
.end-summary ul { margin: 0; padding-inline-start: 1.2rem; }
.end-summary li { margin: .2rem 0; }
.end-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.btn-wa { background: #25d366; color: #fff; }

body.in-meeting { overflow: hidden; height: 100dvh; }
.meeting, .stage, .reactions-layer { overflow: clip; }


/* =========== مشاركة الشاشة: أخف =========== */
.tile.self-sharing { display: grid; place-items: center; background: linear-gradient(145deg, rgba(31, 174, 193, .16), rgba(19, 46, 77, .6)); }
.tile.self-sharing .avatar, .tile.self-sharing video { display: none; }
.share-note { display: grid; justify-items: center; gap: .3rem; text-align: center; padding: 1rem; z-index: 2; }
.share-note .sn-ic { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #14b8a6, #0f766e); margin-bottom: .3rem; }
.share-note small { color: var(--muted); }
.sn-stop { margin-top: .5rem; border: 0; border-radius: 999px; padding: .5rem 1rem; font-weight: 700; color: #fff; background: var(--danger); }
/* وقف الحركات التقيلة طول ما فيه شاشة متشاركة */
.meeting.screen-on::before { animation: none; }
.meeting.screen-on .tile.speaking::after { animation: none; }
.meeting.screen-on .tile.speaking .avatar { animation: none; }
.meeting.screen-on .tile .label, .meeting.screen-on .tile .badges > span { backdrop-filter: none; }
.meeting.screen-on .tile.screen { border-color: var(--line); box-shadow: none; }
.meeting.screen-on .tile.screen video { background: #000; }
