/* «قبل ما تدخل» and the room (student/live.js), in the navy design canvas (student-prejoin, student-live). The room is a
   full-screen call on a deep navy ground: the sheikh's initial in gold rings, his picture when he turns it on; the
   colours of the dark room are named here once. */
:root { --lv-bg: #0B1534; --lv-tile: rgba(255, 255, 255, .07); --lv-raise: rgba(255, 255, 255, .12); --lv-line: rgba(255, 255, 255, .12);
  --lv-ink: #FFFFFF; --lv-ink-2: rgba(255, 255, 255, .76); --lv-gold: #E9D3A0; --lv-live: #5BD68C; --lv-warn: #E9C46A; --lv-bad: #F08C76; }

/* ---------- قبل ما تدخل ---------- */
/* the mic first: a navy card with its state, the level line and the button that opens it */
.lv-check { position: relative; overflow: hidden; gap: 16px; padding: 18px; border-radius: var(--radius-xl); color: var(--on-accent);
  background: radial-gradient(300px 180px at 10% 0%, rgba(233, 211, 160, .12), transparent 65%), var(--grad); box-shadow: var(--shadow-deep); }
.lv-check-top { display: flex; align-items: center; gap: 12px; }
.lv-check-ic { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 6px rgba(255, 255, 255, .06); }
.lv-check-t { flex: 1; min-width: 0; }
.lv-check-t small { display: block; font-size: 13.5px; color: rgba(255, 255, 255, .78); }
.lv-check-t h2 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.3; }
.lv-ok { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .14); font-size: var(--text-sm); font-weight: 700; }
.lv-ok i { width: 8px; height: 8px; border-radius: 50%; background: var(--lv-live); box-shadow: 0 0 0 3px rgba(91, 214, 140, .25); }
.lv-check-p { margin: 0; font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .86); }
.lv-check .btn.primary { background: var(--surface); color: var(--brand); box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .55); }
.lv-check .btn.primary:disabled { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .72); box-shadow: none; }
/* the level: a gold line that follows his voice (live.js draws its width) */
.lv-meter { display: flex; height: 12px; padding: 3px; border-radius: var(--radius-pill); background: rgba(5, 12, 36, .3); overflow: hidden; }
.lv-meter i { width: 0; border-radius: var(--radius-pill); background: #E9C77D; transition: width .08s linear; }
.lv-preview { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: rgba(5, 12, 36, .35); color: rgba(255, 255, 255, .72); display: grid; place-items: center; }
.lv-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }   /* a mirror, like a front camera */
.lv-off { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: var(--text-md); text-align: center; padding: 0 16px; }
.lv-initial { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: var(--lv-ink); display: grid; place-items: center; font-size: 28px; font-weight: 800; }
/* how he goes in: a navy pill switch, a note on data, one tip */
.lv-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow); }
.lv-seg button { flex: 1; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border-radius: var(--radius-pill); background: none; box-shadow: none; color: var(--ink-2); font-size: var(--text-md); font-weight: 500; }
.lv-seg button[aria-pressed="true"] { background: var(--grad); color: var(--on-accent); font-weight: 700; box-shadow: var(--shadow-deep); }
.lv-mode-note { margin: 0; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--fill); font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.lv-mode-note svg { flex: none; margin-top: 3px; color: var(--navy-2); }
.lv-tip { margin: 0; display: flex; align-items: flex-start; gap: 12px; }
.lv-tip .ico-circle { width: 38px; height: 38px; }
.lv-tip > span:last-child { display: flex; flex-direction: column; }
.lv-tip b { font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.lv-tip b + span { font-size: var(--text-md); line-height: 1.55; color: var(--ink-2); }
.lv-from { gap: 2px; }
.lv-from small { font-size: var(--text-sm); color: var(--ink-3); }
.lv-from span { font-size: var(--text-base); }
.lv-from-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.lv-from-row b { font-size: 15.5px; font-weight: 700; }
.lv-from-row .pos { height: 30px; padding: 0 12px; font-size: 15px; }
.lv-foot-hint { margin: 0; text-align: center; font-size: 13.5px; color: var(--ink-3); }

/* ---------- غرفة الإقراء ---------- */
/* fixed over the whole screen; the content keeps the phone width in the middle of a wide screen */
.lv { position: fixed; inset: 0; z-index: 30; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, calc((100% - 448px) / 2)) calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: radial-gradient(130% 68% at 50% 30%, #23408C 0%, var(--brand-hover) 44%, var(--lv-bg) 100%); color: var(--lv-ink); }
.lv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: 2px; }
.lv-what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lv-what small { font-size: 13.5px; color: var(--lv-ink-2); }
.lv-what h1 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.3; }
.lv-status { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 700; color: var(--lv-gold); }
.lv-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--lv-ink-2); }
.lv-status.on i, .lv-status.joined i { background: var(--lv-live); box-shadow: 0 0 0 3px rgba(91, 214, 140, .22); }
.lv[data-net="weak"] .lv-status.on i { background: var(--lv-warn); }
.lv[data-net="drop"] .lv-status.on i { background: var(--lv-bad); }
.lv-status.waiting { color: var(--lv-ink-2); }
.lv-status.waiting i { animation: lv-blink 1.2s ease-in-out infinite; }
/* the trial's connection switch: dashed like the other trial tools */
/* the sheikh's page records the session (RECORDINGS.md §6): calm, a small gold dot, never red or blinking */
.lv-rec { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border-radius: var(--radius-pill); background: rgba(255, 249, 236, .1); color: #F2D79B; font-size: var(--text-sm); font-weight: 700; }
.lv-rec i { width: 7px; height: 7px; border-radius: 50%; background: #E9C77D; }
.lv-rec[hidden] { display: none; }
.lv-net { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 13px; border-radius: var(--radius-pill); border: 1px dashed rgba(233, 211, 160, .6); background: rgba(255, 249, 236, .08); color: #F2D79B; font-size: var(--text-sm); font-weight: 700; }
.lv-net i { width: 8px; height: 8px; border-radius: 50%; background: var(--lv-live); }
.lv[data-net="weak"] .lv-net i { background: var(--lv-warn); }
.lv[data-net="drop"] .lv-net i { background: var(--lv-bad); }

/* the sheikh in the middle and the student's small tile */
.lv-stage { position: relative; flex: 1; min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
.lv-sheikh { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 0 8px; }
.lv-orb { position: relative; width: 196px; height: 196px; display: grid; place-items: center; margin-bottom: 10px; }
.lv-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(233, 211, 160, .28); }
.lv-ring.r2 { inset: 22px; border-color: rgba(233, 211, 160, .5); background: rgba(233, 211, 160, .05); }
.lv-avatar { position: relative; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #2E52AA, #132457); color: var(--lv-gold);
  font-size: 52px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 3px rgba(233, 211, 160, .75), 0 24px 48px -18px rgba(0, 0, 0, .6); transition: opacity .3s, filter .3s; overflow: hidden; }
.lv-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lv-name { font-size: 22px; font-weight: 800; line-height: 1.3; }
.lv-sheikh.waiting .lv-avatar { opacity: .45; animation: lv-blink 1.6s ease-in-out infinite; }
.lv-sheikh.waiting .lv-ring { opacity: .4; }
/* the rings breathe while the sheikh is there (in the real call: only while he speaks) */
.lv-sheikh.on .lv-ring { animation: lv-breathe 2.4s ease-in-out infinite; }
.lv-sheikh.on .lv-ring.r2 { animation-delay: -.6s; }
.lv-sheikh.real.on:not(.speaking) .lv-ring { animation: none; }
/* his picture, when he turns it on, fills a tile */
.lv-sheikh.cam { flex: 1; min-height: 260px; padding: 0; border-radius: 20px; background: #000; overflow: hidden; }
.lv-sheikh.cam .lv-name, .lv-sheikh.cam .lv-status { position: absolute; z-index: 1; inset-inline-start: 12px; padding: 2px 10px; border-radius: var(--radius-pill); background: rgba(11, 21, 52, .6); font-size: var(--text-md); }
.lv-sheikh.cam .lv-name { bottom: 44px; }
.lv-sheikh.cam .lv-status { bottom: 12px; }
.lv-feed { position: absolute; inset: 0; background: #000; }
.lv-feed video { width: 100%; height: 100%; object-fit: contain; }   /* the sheikh's whole picture, never cropped */
.lv[data-net="weak"] .lv-avatar { filter: blur(2px); }
.lv-drop { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 20px; background: rgba(11, 21, 52, .84); font-size: var(--text-base); }
.lv-self { position: absolute; top: 4px; inset-inline-end: 2px; width: 82px; aspect-ratio: 4 / 5; border-radius: 18px; background: var(--lv-tile); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.lv-self video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.lv-self .lv-initial { width: 40px; height: 40px; font-size: var(--text-lg); }
.lv-me { position: relative; font-size: var(--text-xs); font-weight: 700; color: rgba(255, 255, 255, .86); }
.lv-self video ~ .lv-me { position: absolute; bottom: 6px; inset-inline-end: 8px; }
.lv-muted { position: absolute; bottom: 6px; inset-inline-start: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: var(--on-accent); display: grid; place-items: center; }

/* the clock, the start position and the two reminders */
.lv-time { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lv-clock { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.lv-left { font-size: 14.5px; color: var(--lv-ink-2); }
.lv-time b { color: var(--lv-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; margin-top: 8px; }
.lv-card { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 7px; min-height: 78px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--lv-tile); box-shadow: inset 0 0 0 1px var(--lv-line); font-size: var(--text-md); line-height: 1.5; }
.lv-card small { font-size: 13.5px; color: var(--lv-ink-2); }
.lv-pos.pos { height: 28px; font-size: 14.5px; background: var(--gold); color: #7A5614; }
.lv-privacy { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; color: rgba(255, 255, 255, .72); text-align: center; }

/* controls: big round buttons, the name under each */
.lv-controls { display: flex; justify-content: space-between; gap: 8px; padding-top: 14px; }
.lv-ctl { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--lv-ink); font-size: 12.5px; font-weight: 700; line-height: 1.2; -webkit-tap-highlight-color: transparent; }
.lv-ctl-t { color: rgba(255, 255, 255, .86); }
.lv-ctl-i { position: relative; width: 62px; height: 62px; border-radius: 50%; background: var(--lv-raise); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); display: grid; place-items: center; }
.lv-ctl:focus-visible { outline: none; }
.lv-ctl:focus-visible .lv-ctl-i { outline: 2px solid var(--lv-gold); outline-offset: 3px; }
.lv-ctl[aria-pressed="true"] .lv-ctl-i, .lv-ctl.off .lv-ctl-i { background: var(--lv-ink); color: var(--brand); }
.lv-ctl.off .lv-ctl-i::after { content: ""; position: absolute; width: 2px; height: 30px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.lv-ctl.end .lv-ctl-i { background: #D64545; color: var(--on-accent); box-shadow: var(--shadow-deep); }
.lv-ctl.end svg { transform: rotate(135deg); }   /* the receiver laid down: hang up */
@media (hover: hover) and (pointer: fine) {
  .lv-ctl:not(.off):not([aria-pressed="true"]):not(.end):hover .lv-ctl-i { background: rgba(255, 255, 255, .2); }
  .lv-ctl.end:hover .lv-ctl-i { background: #E05252; }
}
.lv-error .err { color: #FFB4A8; }

/* the sheets keep the light look of the app */
.lv-sheet { color: var(--ink); }
.lv-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--fill); color: var(--ink-2); display: grid; place-items: center; }
.lv-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lv-msgs li { align-self: flex-start; max-width: 86%; padding: 8px 12px; border-radius: 16px; background: var(--fill); font-size: var(--text-base); line-height: 1.6; }
.lv-msgs li.me { align-self: flex-end; background: var(--brand-soft); }
.lv-msgs b { display: block; font-size: var(--text-xs); font-weight: 700; color: var(--ink-2); }
.lv-send { display: flex; gap: 8px; }
.lv-send input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0 16px; background: var(--fill); }
.lv-send input:focus { outline: none; border-color: var(--navy-2); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); }
.lv-send input[aria-invalid="true"] { border-color: var(--danger); }
.lv-send .btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; }
.lv-end-yes { background: var(--danger); border-color: var(--danger); color: var(--on-accent); box-shadow: none; }

@keyframes lv-blink { 50% { opacity: .35; } }
@keyframes lv-breathe { 50% { transform: scale(1.04); opacity: .6; } }

/* the mic refused: how to let it in, step by step */
.mic-help { flex-direction: column; gap: 6px; line-height: 1.6; }
.mic-help ol { margin: 0; padding-inline-start: 20px; }
.lv-error { display: flex; flex-direction: column; gap: 10px; }

/* «انسخ الرابط» inside the note (a link opened inside an app) */
.note .link-btn { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; padding: 0; cursor: pointer; }

/* a press shows on the round controls */
.lv-ctl .lv-ctl-i { transition: transform 150ms var(--ease), background-color 200ms ease; }
.lv-ctl:active .lv-ctl-i { transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) { .lv-ctl .lv-ctl-i { transition: none; } .lv-ctl:active .lv-ctl-i { transform: none; } }

/* no link from the sheikh: where the way in comes from */
.lv-link { gap: 8px; }
.lv-link p { margin: 0; font-size: var(--text-base); line-height: 1.7; }
