:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #5d5a53;
  --line: #ddd7cb;
  --brand: #0f6b4f;
  --brand-ink: #ffffff;
  --rec: #c2261d;
  --warn-bg: #fff3cd;
  --warn-ink: #6b4e00;
  --ok-bg: #e3f4ea;
  --ok-ink: #11593f;
  --radius: 16px;
  --f-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Geeza Pro", serif;
  --f-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131412; --surface: #1d1f1c; --ink: #ecebe6; --muted: #aaa69d; --line: #34362f;
    --brand: #3cb88a; --brand-ink: #0b1a14; --rec: #ff6a5f;
    --warn-bg: #3a3014; --warn-ink: #f3d98a; --ok-bg: #143327; --ok-ink: #8fe0bd;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--f-ui); font-size: 18px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
html[lang="ur"] body { font-family: var(--f-ur); line-height: 2; }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 16px; }
.topbar h1 { margin: 0; font-size: 22px; }
.langs { display: flex; gap: 4px; flex-wrap: wrap; }
.lang-btn { font: 14px var(--f-ui); padding: 6px 10px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.lang-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.session-title { margin: 0; font-size: 26px; font-weight: 700; }
label.big { font-size: 22px; font-weight: 700; }
input[type="text"], input[type="password"], input[type="tel"], input[type="datetime-local"], textarea {
  font: inherit; font-size: 22px; width: 100%; padding: 14px 16px; min-height: 60px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.btn { font: inherit; font-size: 24px; font-weight: 700; min-height: 72px; padding: 12px 20px; border-radius: 14px; border: 0; cursor: pointer; width: 100%;
  background: var(--brand); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn.rec { background: var(--rec); color: #fff; }
.btn.quiet { background: transparent; color: var(--brand); border: 2px solid var(--line); font-size: 18px; min-height: 52px; }
.btn.small { font-size: 16px; min-height: 44px; width: auto; padding: 8px 14px; }
.btn:disabled { opacity: .5; cursor: default; }

.hint { margin: 0; color: var(--muted); font-size: 17px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.check input { width: 26px; height: 26px; }

.note { border-radius: 12px; padding: 12px 14px; font-size: 18px; margin: 0; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.ok { background: var(--ok-bg); color: var(--ok-ink); font-size: 22px; font-weight: 700; }
.note.err { background: var(--rec); color: #fff; }

.preview { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #000; transform: scaleX(-1); }
.rec-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 22px; font-weight: 700; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: var(--rec); display: inline-block; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.timer { font-family: var(--f-ui); font-variant-numeric: tabular-nums; direction: ltr; }
.counts { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 17px; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }

/* admin */
.admin .wrap { max-width: 900px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input { flex: 1 1 220px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.item.link { cursor: pointer; }
.item h3 { margin: 0; font-size: 20px; }
.meta { color: var(--muted); font-size: 15px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; direction: ltr; text-align: left; word-break: break-all; }
.pill { font: 600 14px var(--f-ui); padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.complete { color: var(--brand); }
.pill.recording { color: var(--rec); }
.pill.waiting, .pill.not_started { color: var(--muted); }
.pill.uploading { color: #a26a00; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions a, .actions button { font: 600 15px var(--f-ui); min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.actions .danger { color: var(--rec); }
.confirm-box { border: 0; padding: 0; background: transparent; width: min(520px, calc(100vw - 32px)); }
.confirm-box::backdrop { background: rgb(0 0 0 / .55); }
.confirm-box .card { border-color: var(--rec); border-width: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 17px; }
.seg label:has(input:checked) { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.seg input { width: 20px; height: 20px; accent-color: var(--brand); }
input[type="color"] { width: 64px; height: 48px; padding: 2px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.poster-thumb { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.file-btn { cursor: pointer; }
.bg-preview { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.bar.small { height: 6px; }
section > h2 { font-size: 20px; margin: 18px 0 8px; }
.item video, .item audio { width: 100%; border-radius: 10px; background: #000; }

/* episodes */
textarea { min-height: 110px; resize: vertical; font-size: 18px; }
.ep-thumb { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.ep-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.ep-form label { font-size: 16px; font-weight: 600; }
.yt-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 17px; }
.yt-line a, .yt-line button { font: 600 15px var(--f-ui); min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.yt-line a.yt { background: #c4302b; color: #fff; border-color: #c4302b; }
.pill.ready, .pill.done { color: var(--brand); }
.pill.failed { color: var(--rec); }
.pill.queued, .pill.running, .pill.waiting_youtube { color: #a26a00; }

/* live call */
.call { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.call-line { margin: 0; font-size: 18px; font-weight: 700; }
.call-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.call-grid figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; background: #0d1b2a; aspect-ratio: 4 / 3; }
.call-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-grid figure.voice video { opacity: 0; }
.call-grid figure.voice::before { z-index: 1; content: '🎙'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; }
.call-grid figcaption { position: absolute; inset-inline: 6px; bottom: 6px; background: rgba(10, 20, 32, .8); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
