/* Khotba — interface v3.
   Warm ivory and bronze, a classical Naskh display face (Amiri) with Ruqʿah accents (Aref Ruqaa)
   and a clean Arabic interface face (IBM Plex Sans Arabic). Photographs sit in arch-shaped frames. */

@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url("/assets/fonts/amiri-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri"; font-weight: 700; font-display: swap; src: url("/assets/fonts/amiri-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url("/assets/fonts/amiri-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Amiri"; font-weight: 700; font-display: swap; src: url("/assets/fonts/amiri-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Aref Ruqaa"; font-weight: 400; font-display: swap; src: url("/assets/fonts/aref-ruqaa-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Aref Ruqaa"; font-weight: 700; font-display: swap; src: url("/assets/fonts/aref-ruqaa-arabic-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 400; font-display: swap; src: url("/assets/fonts/noto-nastaliq-urdu-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Devanagari"; font-weight: 400; font-display: swap; src: url("/assets/fonts/noto-sans-devanagari-devanagari-400-normal.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF; }

:root {
  --page: #faf7f1;
  --sand: #f2ece0;
  --card: #ffffff;
  --line: #e8dfcd;
  --bronze: #7a6838;
  --bronze-deep: #5e5029;
  --gold: #c2a96b;
  --ink: #24201a;
  --muted: #6f685a;
  --ok: #3d6b4e;
  --live: #b23a2b;
  --ui: "Plex Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Amiri", "Plex Arabic", Georgia, serif;
  --ruqaa: "Aref Ruqaa", "Amiri", serif;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(36, 32, 26, .04), 0 12px 32px -18px rgba(36, 32, 26, .22);
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23c2a96b' stroke-opacity='.45' stroke-width='1'%3E%3Cpath d='M40 6 49.8 30.2 74 40 49.8 49.8 40 74 30.2 49.8 6 40 30.2 30.2Z'/%3E%3Cpath d='M16 16 40 25.9 64 16 54.1 40 64 64 40 54.1 16 64 25.9 40Z'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--ui); font-size: 1rem; line-height: 1.7; color: var(--ink); background: var(--page); }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--bronze); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
.ruqaa { font-family: var(--ruqaa); color: var(--bronze); }
.muted { color: var(--muted); }
.small { font-size: .9rem; line-height: 1.6; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.lang-en, .lang-fr, .lang-es, .lang-tl { direction: ltr; font-family: var(--display); }
.lang-ur { direction: rtl; font-family: "Noto Nastaliq Urdu", var(--display); line-height: 2.4; }
.lang-hi { direction: ltr; font-family: "Noto Sans Devanagari", var(--ui); line-height: 1.9; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.between { justify-content: space-between; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 48px; padding: .55em 1.3em;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font-family: var(--ui); font-weight: 600; font-size: .98rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--bronze); border-color: var(--bronze); color: #fff; }
.btn.primary:hover { background: var(--bronze-deep); border-color: var(--bronze-deep); }
.btn.big { min-height: 64px; font-size: 1.15rem; padding-inline: 1.6em; border-radius: 18px; }
.btn.danger { color: var(--live); border-color: rgba(178, 58, 43, .35); }
.btn.danger:hover { background: rgba(178, 58, 43, .06); }
.btn.ghost { border-color: transparent; background: transparent; padding-inline: .7em; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn .arrow { display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--sand); color: var(--live); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }

.pill { display: inline-flex; align-items: center; gap: .45em; padding: .2em .8em; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--sand); color: var(--muted); white-space: nowrap; }
.pill.ok { background: rgba(61, 107, 78, .12); color: var(--ok); }
.pill.work { background: rgba(194, 169, 107, .22); color: var(--bronze-deep); }
.pill.live { background: var(--live); color: #fff; }
.pill.bad { background: rgba(178, 58, 43, .1); color: var(--live); }
.dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; flex: none; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.spin { width: 1.1em; height: 1.1em; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.1rem, 3vw, 1.8rem); }
.field { width: 100%; min-height: 52px; padding: .6em 1em; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; }
.field:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(194, 169, 107, .2); }
label.lbl { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35em; }
.notice { padding: .8em 1.1em; border-radius: 14px; background: rgba(194, 169, 107, .16); color: var(--bronze-deep); font-size: .94rem; }
.notice.bad { background: rgba(178, 58, 43, .08); color: #7d2a1f; }
.toast { position: fixed; inset-inline: 1rem; bottom: 1.2rem; z-index: 40; margin-inline: auto; max-width: 32rem; padding: .85em 1.2em; border-radius: 14px; background: var(--ink); color: #fff; text-align: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--live); }
.stale { position: sticky; top: 0; z-index: 50; padding: .8rem 1.2rem; background: var(--live); color: #fff; text-align: center; font-weight: 600; }
.overlay { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(250, 247, 241, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.overlay .card { display: grid; justify-items: center; gap: .8rem; text-align: center; max-width: 24rem; }
.overlay .spin { width: 2.4rem; height: 2.4rem; border-width: 3px; color: var(--bronze); }

/* Arch-framed photographs. The frame has its own pattern, so it still looks finished without the photo. */
.arch { position: relative; overflow: hidden; border-radius: 999px 999px 28px 28px; background: var(--bronze) var(--lattice); background-size: 80px; aspect-ratio: 4 / 5; box-shadow: var(--shadow); }
.arch img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.arch.wide { aspect-ratio: 16 / 10; border-radius: 160px 160px 24px 24px; }

/* ---------- Imam portal ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 2.4rem); background: rgba(250, 247, 241, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; margin-inline-end: auto; }
.brand .mark { font-family: var(--ruqaa); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--bronze); }
.brand .sub { display: grid; line-height: 1.25; border-inline-start: 1px solid var(--line); padding-inline-start: .7rem; }
.brand .sub b { font-size: .78rem; letter-spacing: .12em; color: var(--bronze); font-family: var(--ui); direction: ltr; }
.brand .sub span { font-size: .78rem; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .4rem .25rem .9rem; border-radius: 999px; background: var(--sand); font-weight: 600; font-size: .9rem; }
.who .avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bronze); color: #fff; font-family: var(--ruqaa); }
.wrap { max-width: 76rem; margin: 0 auto; padding: clamp(1.4rem, 4vw, 3rem) clamp(1rem, 4vw, 2.4rem) 5rem; display: grid; gap: clamp(2rem, 5vw, 3.5rem); }

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 5vw, 5rem); padding: clamp(1rem, 5vw, 4rem); background: var(--page); }
.auth .panel { display: grid; gap: 1.4rem; width: min(100%, 26rem); justify-self: center; }
.auth h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.auth .arch { max-height: 82dvh; width: min(100%, 30rem); justify-self: center; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; } .auth .arch { order: -1; width: 11rem; aspect-ratio: 4 / 4.6; } }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; border-radius: 32px; }
.hero .text { display: grid; gap: 1.3rem; align-content: center; }
.hero .ruqaa { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.35; }
.hero h1 .tone { color: var(--bronze); display: block; }
.hero .lead { color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.18rem); max-width: 34rem; }
.hero .art { position: relative; }
.hero .art .arch { width: min(100%, 27rem); margin-inline: auto; }
.hero .tag { position: absolute; inset-inline-start: -.6rem; bottom: 12%; display: grid; gap: .1rem; padding: .8rem 1.1rem; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero .tag b { font-size: .8rem; color: var(--muted); font-weight: 500; }
.hero .tag span { display: flex; gap: .8rem; font-size: 1.05rem; }
.hero.drag { outline: 2px dashed var(--gold); outline-offset: 12px; }
.hint { font-size: .88rem; color: var(--muted); }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero .art { order: -1; }
  .hero .art .arch { width: min(70%, 15rem); }
  .hero .tag { inset-inline-start: 0; bottom: 6%; }
}

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-head h2 { font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.sermons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.sermon { position: relative; display: grid; gap: .7rem; align-content: start; padding: 1.3rem 1.3rem 1.1rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; text-align: start; transition: border-color .15s, transform .15s; }
.sermon:hover { border-color: var(--gold); transform: translateY(-2px); }
.sermon .badge { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--sand); color: var(--bronze); }
.sermon .badge svg { width: 1.3rem; height: 1.3rem; }
.sermon h3 { font-family: var(--display); font-size: 1.35rem; overflow-wrap: anywhere; padding-inline-end: 2.4rem; }
.sermon .del { position: absolute; top: .8rem; inset-inline-end: .8rem; }
.sermon .foot { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.empty { padding: 2rem; border-radius: var(--radius); border: 1.5px dashed var(--line); text-align: center; color: var(--muted); }

/* sermon confirmation */
.success { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem 1.5rem; align-items: center; }
.success .check { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(61, 107, 78, .12); color: var(--ok); }
.success .check svg { width: 2.2rem; height: 2.2rem; }
.success .ruqaa { font-size: 1.35rem; }
.success h1 { font-family: var(--display); font-size: clamp(1.7rem, 3.4vw, 2.5rem); overflow-wrap: anywhere; }
@media (max-width: 640px) { .success { grid-template-columns: auto 1fr; } .success > :last-child { grid-column: 1 / -1; } }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.card h2 { font-family: var(--display); font-size: 1.6rem; }
.langrow { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.langrow:last-of-type { border-bottom: 0; }
.glyph { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--sand); color: var(--bronze); font-weight: 700; grid-row: span 2; }
.langrow.ready .glyph { background: rgba(61, 107, 78, .12); color: var(--ok); }
.langrow .name { font-weight: 600; }
.langrow .name small { font-weight: 400; color: var(--muted); margin: 0 .55rem; }
.glyph svg { width: 1.35rem; height: 1.35rem; }
.bar { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--gold); transition: width .5s ease; }
.langrow.ready .bar i { background: var(--ok); }
.engine { display: flex; gap: .6rem; align-items: center; margin-top: .6rem; font-size: .88rem; color: var(--muted); }
.startcard { display: grid; gap: 1rem; background: linear-gradient(135deg, #fffdf8, #f6efe1); }
.startcard .btn.big { width: 100%; }
.qrbox { display: grid; gap: 1rem; justify-items: center; text-align: center; }
.qrbox .frame { width: min(100%, 15rem); padding: 1rem; border-radius: 120px 120px 20px 20px; background: #fff; border: 1.5px solid var(--gold); }
.qrbox img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qrbox .actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; }
.qrbox .actions .wide { grid-column: 1 / -1; }
.linkbox { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; direction: ltr; text-align: center; padding: .6rem .8rem; border-radius: 12px; background: var(--sand); overflow-wrap: anywhere; user-select: all; }
details.preview summary { cursor: pointer; font-weight: 600; color: var(--bronze); padding: .4rem 0; }
details.preview ol { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: .7rem; counter-reset: p; }
details.preview li { counter-increment: p; font-family: var(--display); font-size: 1.15rem; line-height: 2; padding: .6rem 1rem; border-radius: 14px; background: var(--page); }
details.preview li::before { content: counter(p, arabic-indic) "."; color: var(--bronze); margin-inline-end: .6rem; font-family: var(--ui); font-size: .85rem; }

/* live control room */
.livehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.livehead h1 { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.3rem); }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); direction: ltr; }
.now .ar { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 2; }
.now .tr { color: var(--muted); font-size: 1.05rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.now .next { font-size: .95rem; color: var(--muted); }
.now .next b { color: var(--bronze); margin-inline-end: .4rem; }
.meter { height: 10px; border-radius: 5px; background: var(--sand); overflow: hidden; direction: ltr; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--gold)); transition: width .08s linear; }
.bignum { font-family: var(--display); font-size: 3rem; font-weight: 700; line-height: 1; color: var(--bronze); }
details.tools summary { cursor: pointer; font-weight: 600; color: var(--bronze); }

/* ---------- listener ---------- */
.listener { --zoom: 1; --read: calc(var(--zoom) * clamp(1.25rem, .95rem + 1.5vw, 1.8rem)); min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--page); }
.listener header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top)); background: rgba(250, 247, 241, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.listener header .brand .mark { font-size: 1.6rem; }
@media (max-width: 420px) { .listener header .brand .sub { display: none; } }
.conn { display: inline-flex; align-items: center; gap: .4em; font-size: .82rem; font-weight: 600; color: var(--ok); }
.conn.bad { color: var(--live); }
.conn.wait { color: var(--muted); }
.listener main { width: min(100%, 46rem); margin: 0 auto; padding: 1.2rem 1rem 1.6rem; display: grid; gap: 1.1rem; align-content: start; }
.welcome { display: grid; gap: 1.2rem; text-align: center; }
.welcome .arch { width: min(78%, 20rem); aspect-ratio: 4 / 3.4; margin: .4rem auto 0; }
.welcome .ruqaa { font-size: clamp(1.8rem, 6vw, 2.4rem); line-height: 1.4; }
.welcome h1 { font-family: var(--display); font-size: clamp(1.4rem, 4.5vw, 1.9rem); overflow-wrap: anywhere; }
.choices { display: grid; gap: .7rem; }
@media (min-width: 640px) { .choices { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); } }
.choice { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 72px; padding: .7rem 1rem; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; text-align: start; box-shadow: var(--shadow); }
.choice:hover { border-color: var(--gold); }
.choice[aria-pressed="true"] { border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(122, 104, 56, .18); }
.choice .glyph { grid-row: auto; }
.choice[aria-pressed="true"] .glyph { background: var(--bronze); color: #fff; }
.choice strong { display: block; font-size: 1.2rem; font-weight: 600; line-height: 1.4; }
.choice small { color: var(--muted); font-size: .82rem; }
.statusbox { display: grid; justify-items: center; gap: .6rem; padding: 1.4rem 1rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.dots { display: inline-flex; gap: .35rem; }
.dots i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--gold); animation: pulse 1.4s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
.progress { height: 4px; border-radius: 2px; background: var(--sand); overflow: hidden; direction: ltr; }
.progress i { display: block; height: 100%; background: var(--gold); transition: width .6s ease; }
.where { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-weight: 600; }
.history { display: grid; gap: .8rem; }
.history p { font-size: calc(var(--read) * .8); line-height: 1.75; color: var(--muted); opacity: .75; overflow-wrap: anywhere; }
.current { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(1.1rem, 4vw, 1.8rem); position: relative; }
.current::before { content: ""; position: absolute; inset-block: 1.2rem; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.current .text { font-size: var(--read); line-height: 1.75; overflow-wrap: anywhere; }
.current .text.lang-ur { line-height: 2.5; }
.current .text.swap { animation: arrive .45s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } }
.current .original { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); font-family: var(--display); font-size: calc(var(--read) * .82); line-height: 2; color: var(--muted); direction: rtl; text-align: right; }
.banner { justify-self: center; padding: .45em 1.1em; border-radius: 999px; background: rgba(194, 169, 107, .22); color: var(--bronze-deep); font-size: .88rem; font-weight: 600; text-align: center; }
.listener footer { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem; padding: .6rem 1rem; padding-bottom: max(.6rem, env(safe-area-inset-bottom)); background: rgba(250, 247, 241, .96); border-top: 1px solid var(--line); }
.listener footer .btn { min-height: 44px; min-width: 48px; padding: .2em .9em; font-size: .9rem; border-radius: 12px; }
.listener footer .btn[aria-pressed="true"] { border-color: var(--bronze); color: var(--bronze); }
.listener footer .note { flex-basis: 100%; text-align: center; font-size: .75rem; color: var(--muted); }
@media (max-height: 640px) { .welcome .arch { width: 9rem; } .listener main { padding-top: .6rem; gap: .7rem; } }

/* Phones set to dark mode get a dim listener screen: kinder in a mosque. */
@media (prefers-color-scheme: dark) {
  .listener { --page: #17150f; --card: #211e17; --sand: #2b271e; --line: #3a3427; --ink: #f1ead9; --muted: #b3a88f; color: var(--ink); }
  .listener header, .listener footer { background: rgba(23, 21, 15, .94); }
  .listener .btn { background: var(--card); color: var(--ink); }
  .listener .btn.primary { background: var(--gold); border-color: var(--gold); color: #17150f; }
  .listener .choice[aria-pressed="true"] .glyph { background: var(--gold); color: #17150f; }
  .listener .banner { color: var(--gold); }
}

/* ---------- poster ---------- */
.poster-page { min-height: 100dvh; background: var(--sand); padding: 1.2rem; display: grid; gap: 1rem; justify-items: center; }
.poster { width: min(100%, 148mm); background: var(--page); color: var(--ink); padding: 10mm; border-radius: 4mm; box-shadow: var(--shadow); text-align: center; display: grid; gap: 4mm; position: relative; overflow: hidden; }
.poster::before { content: ""; position: absolute; inset: 0; background: var(--lattice); background-size: 64px; opacity: .35; pointer-events: none; }
.poster > * { position: relative; }
.poster .mark { font-family: var(--ruqaa); font-weight: 700; font-size: 40pt; line-height: 1.1; color: var(--bronze); }
.poster h1 { font-family: var(--display); font-size: 17pt; }
.poster h1 small { display: block; font-family: var(--ui); font-weight: 500; font-size: 10.5pt; color: var(--muted); }
.poster .title { font-family: var(--display); font-size: 13pt; color: var(--bronze-deep); overflow-wrap: anywhere; }
.poster .frame { width: 64%; margin: 0 auto; padding: 5mm; background: #fff; border: 1.5px solid var(--gold); border-radius: 40mm 40mm 4mm 4mm; }
.poster .frame img { display: block; width: 100%; image-rendering: pixelated; }
.poster ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2mm; font-size: 11pt; line-height: 1.45; }
.poster .langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 1mm 6mm; font-size: 13pt; }
.poster .free { font-size: 9.5pt; color: var(--bronze-deep); font-weight: 600; }
.poster .url { font-family: ui-monospace, Menlo, monospace; font-size: 8pt; direction: ltr; overflow-wrap: anywhere; color: var(--muted); }
@media print {
  @page { size: A5; margin: 0; }
  body, .poster-page { background: #fff; padding: 0; }
  .poster { width: 148mm; height: 209mm; align-content: center; border-radius: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* add a language (v5) */
.addlang { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.addlang .muted { margin: 0 0 .7rem; }
.chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip { display: inline-flex; align-items: baseline; gap: .45rem; min-height: 44px; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--page); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--gold); background: var(--sand); }
.chip:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.chip:disabled { opacity: .5; cursor: progress; }
.chip .plus { color: var(--bronze); font-weight: 700; }
.chip small { color: var(--muted); font-weight: 400; }
.langrow .icon-btn { width: 36px; height: 36px; }
.cmd { unicode-bidi: isolate; font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--sand); padding: .05em .4em; border-radius: 6px; white-space: nowrap; }
