/* Tilawa — maroon + champagne-gold liquid glass */
:root {
  --maroon-950: #1f040b;
  --maroon-900: #2d0711;
  --maroon-800: #3a0915;
  --maroon-700: #561022;
  --maroon-600: #74182f;
  --maroon-500: #94233f;
  --gold-100: #fbf0d6;
  --gold-200: #f3dfb0;
  --gold-300: #e7c98a;
  --gold-400: #d6ae67;
  --gold-500: #b98d46;
  --cream: #f8efe2;
  --muted: rgba(248, 239, 226, .66);
  --faint: rgba(248, 239, 226, .42);
  --glass: rgba(255, 236, 214, .065);
  --glass-2: rgba(255, 236, 214, .10);
  --glass-line: rgba(255, 226, 186, .17);
  --glass-hi: rgba(255, 245, 228, .30);
  --ok: #7fe3a4;
  --close: #f3c46b;
  --wrong: #ff8a7a;
  --missed: #f0b35c;
  --added: #b9a7ff;
  --radius: 22px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --quran: 'Amiri Quran', 'Amiri', 'Traditional Arabic', serif;
  --ar-size: 34px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* colour themes - the gold accents stay the same in every theme */
:root, [data-theme="emerald"] {
  --t-base: #02140f; --t-top: #031a14; --t-bottom: #010b08; --t-glow: #0a3a2c; --t-glow2: #072a20;
  --t-blob1: #0b3f2f; --t-blob3: #082f23; --t-panel: #04211a; --t-ink: #03170f; --t-deep: 1, 10, 7; --t-sheet: 4, 30, 23;
  --t-blob-op: .35; --ok: #a8f5c6;
}
[data-theme="navy"] {
  --t-base: #040b1c; --t-top: #061026; --t-bottom: #020611; --t-glow: #11244d; --t-glow2: #0c1a3a;
  --t-blob1: #142c5e; --t-blob3: #0e2048; --t-panel: #08142e; --t-ink: #060f24; --t-deep: 2, 5, 14; --t-sheet: 8, 18, 42;
  --t-blob-op: .35; --ok: #8ff0b4;
}
[data-theme="maroon"] {
  --t-base: #2d0711; --t-top: #33081a; --t-bottom: #22050d; --t-glow: #6d1529; --t-glow2: #4c0d1c;
  --t-blob1: #7c1b33; --t-blob3: #5d1226; --t-panel: #3a0915; --t-ink: #2d0711; --t-deep: 20, 3, 8; --t-sheet: 52, 10, 22;
  --ok: #7fe3a4;
}
.themes { display: flex; gap: 8px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.swatch.on { border-color: var(--gold-300); box-shadow: 0 0 0 3px rgba(231,201,138,.25); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--cream); font: 15px/1.55 var(--sans);
  background: var(--t-base);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(90px + var(--safe-b));
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; border-radius: 10px; }
[hidden] { display: none !important; }

/* living background */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(1200px 700px at 15% -10%, var(--t-glow) 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 20%, var(--t-glow2) 0%, transparent 60%),
              linear-gradient(180deg, var(--t-top) 0%, var(--t-bottom) 100%); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--t-blob-op, .55); animation: drift 26s ease-in-out infinite alternate; }
.b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: 30vh; background: var(--t-blob1); }
.b2 { width: 34vmax; height: 34vmax; right: -10vmax; top: -8vmax; background: #a0753a; opacity: .12; animation-duration: 32s; }
.b3 { width: 30vmax; height: 30vmax; right: 10vw; bottom: -14vmax; background: var(--t-blob3); animation-duration: 38s; }
@keyframes drift { to { transform: translate(6vmax, -4vmax) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* liquid glass */
.glass {
  background: linear-gradient(150deg, rgba(255, 240, 220, .075), rgba(255, 240, 220, .025) 55%, rgba(255, 240, 220, .045));
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(0,0,0,.25), 0 18px 50px -18px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
}
.card { border-radius: var(--radius); padding: 20px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 22px; padding-top: max(10px, env(safe-area-inset-top)); border-radius: 0 0 22px 22px; border-top: 0; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 26px/1 var(--serif); letter-spacing: .5px; color: var(--gold-200); }
.moon { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(241, 214, 160, .45)); }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 9px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; transition: .2s; }
.tabs a:hover { color: var(--cream); background: var(--glass); }
.tabs a.on { color: var(--t-ink); background: linear-gradient(180deg, var(--gold-200), var(--gold-400)); box-shadow: 0 6px 18px -6px rgba(214,174,103,.6); }
.bottomnav { display: none; }

main { max-width: 1040px; margin: 0 auto; padding: 22px 18px 40px; outline: none; }

/* headings */
.eyebrow { font: 600 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-300); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .2px; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; }
h2 { font-size: 28px; }
h3 { font-size: 21px; }
.gold { color: var(--gold-200); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 34px 30px; margin-bottom: 22px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; }
.hero p { color: var(--muted); max-width: 46ch; margin: 12px 0 20px; }
.hero .ar-hero { font: 46px/1.6 var(--quran); text-align: center; color: var(--gold-200); text-shadow: 0 0 30px rgba(241,214,160,.25); direction: rtl; }
.hero .ar-hero small { display: block; margin-top: 18px; font: italic 15px/1.4 var(--serif); color: var(--muted); direction: ltr; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--glass-line);
  background: var(--glass); font-weight: 600; font-size: 14px; transition: transform .15s, background .2s; white-space: nowrap; }
.btn:hover { background: var(--glass-2); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { color: var(--t-ink); border-color: transparent; background: linear-gradient(180deg, var(--gold-100), var(--gold-400));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 26px -10px rgba(214,174,103,.7); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.icon { padding: 9px; width: 40px; height: 40px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.on { border-color: var(--gold-400); color: var(--gold-100); background: rgba(214,174,103,.14); }

/* continue strip */
.continue { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }

/* search + segmented */
.toolbar { display: flex; gap: 10px; align-items: center; margin: 6px 0 16px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; position: relative; }
.search input, .field input, .field select, select.field {
  width: 100%; padding: 12px 16px 12px 42px; border-radius: 999px; border: 1px solid var(--glass-line); background: rgba(var(--t-deep), .35);
  color: var(--cream); font: 15px var(--sans); outline: none; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; stroke: var(--faint); fill: none; stroke-width: 2; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg button.on { background: rgba(255, 236, 214, .14); color: var(--gold-100); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }

/* surah grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.sura { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; transition: transform .18s, border-color .2s; }
.sura:hover { transform: translateY(-2px); border-color: rgba(231, 201, 138, .4); }
.num { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; font: 600 14px var(--sans); color: var(--gold-200);
  background: radial-gradient(circle at 30% 25%, rgba(255,240,210,.22), rgba(255,240,210,.04)); border: 1px solid rgba(231,201,138,.35); }
.sura .t { font: 600 19px/1.15 var(--serif); }
.sura .m { font-size: 12px; color: var(--faint); margin-top: 2px; }
.sura .ar { font: 24px/1 var(--quran); color: var(--gold-200); direction: rtl; }
.sura .prog { height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 7px; overflow: hidden; }
.sura .prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-400), var(--gold-200)); }

/* reader */
.reader-head { text-align: center; padding: 28px 20px 22px; border-radius: 28px; margin-bottom: 16px; position: relative; }
.reader-head .ar { font: 44px/1.4 var(--quran); color: var(--gold-200); direction: rtl; }
.reader-head .sub { color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.reader-tools { position: sticky; top: 64px; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px; border-radius: 999px; margin-bottom: 16px; flex-wrap: wrap; }
.basmala { text-align: center; font: 34px/2 var(--quran); color: var(--gold-200); direction: rtl; margin: 8px 0 14px; }
.ayah { position: relative; padding: 18px 20px 14px; border-radius: 20px; margin-bottom: 10px; transition: border-color .3s, background .3s; scroll-margin-top: 140px; }
.ayah.playing { border-color: rgba(231,201,138,.7); background: linear-gradient(150deg, rgba(231,201,138,.16), rgba(255,240,220,.04)); }
.ayah .ar { font: var(--ar-size)/2.15 var(--quran); direction: rtl; text-align: right; word-spacing: 2px; }
.ayah .en { color: var(--muted); font-size: 15px; margin-top: 6px; line-height: 1.6; }
.ayah .actions { display: flex; gap: 4px; justify-content: flex-start; margin-top: 8px; opacity: .8; }
.ayah:hover .actions { opacity: 1; }
.mark { display: inline-grid; place-items: center; min-width: 1.35em; height: 1.35em; margin: 0 .2em; padding: 0 .2em; border-radius: 50%;
  font: 600 .5em/1 var(--sans); color: var(--gold-200); border: 1.5px solid rgba(231,201,138,.7); vertical-align: middle;
  box-shadow: inset 0 0 0 3px rgba(231,201,138,.12); }
.notrans .en { display: none; }

/* word states */
.w { border-radius: 8px; padding: 0 .06em; transition: color .3s, background .3s, filter .4s; }
.w.ok { color: var(--ok); }
.w.close { color: var(--close); text-decoration: underline dotted 2px; text-underline-offset: 10px; }
.w.wrong { color: var(--wrong); background: rgba(255,138,122,.12); text-decoration: underline wavy 1.5px; text-underline-offset: 10px; }
.w.missed, .w.skipped { color: var(--missed); outline: 1.5px dashed rgba(240,179,92,.7); outline-offset: -2px; }
.w.unheard { color: var(--close); }
.w.now { background: rgba(231,201,138,.18); }
.hifz .w.hide { color: transparent; background: linear-gradient(180deg, rgba(255,236,214,.13), rgba(255,236,214,.06)); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); user-select: none; }
.hifz .en { display: none; }
.extra { display: inline-block; font: 600 .5em/1.2 var(--sans); color: var(--added); border: 1px solid rgba(185,167,255,.5); background: rgba(185,167,255,.12);
  padding: .25em .55em; border-radius: 999px; vertical-align: middle; margin: 0 .2em; direction: rtl; }
.extra.rep { color: var(--gold-200); border-color: rgba(231,201,138,.5); background: rgba(231,201,138,.1); }

/* recite */
.recite-grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.recite-grid.rc { grid-template-areas: "ctrl main" "honest main"; grid-template-rows: auto 1fr; }
.rc-ctrl { grid-area: ctrl; } .rc-main { grid-area: main; min-width: 0; } .rc-honest { grid-area: honest; margin-top: 0 !important; }
.nb { white-space: nowrap; }
.panel { border-radius: 24px; padding: 20px; }
.panel + .panel { margin-top: 14px; }
#resultPanel { scroll-margin-top: 96px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.field select, .field input { padding: 11px 14px; border-radius: 14px; appearance: none; -webkit-appearance: none;
  background: rgba(var(--t-deep),.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e7c98a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.field input { background-image: none; }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mic-wrap { display: grid; place-items: center; padding: 18px 0 6px; }
.mic { position: relative; width: 112px; height: 112px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, #fff4dc, var(--gold-300) 45%, var(--gold-500)); color: var(--t-ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 18px 40px -12px rgba(214,174,103,.75), 0 0 0 10px rgba(231,201,138,.08); transition: transform .2s; }
.mic svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mic:active { transform: scale(.96); }
.mic.rec { background: radial-gradient(circle at 35% 28%, #ffb3a6, #d9475a 50%, #8e1830); color: #fff; }
.mic .ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(255,160,150,.6); transform: scale(var(--lv, 1)); opacity: .8; transition: transform .08s; pointer-events: none; }
.mic:disabled { filter: grayscale(.6) brightness(.7); cursor: progress; }
.status { text-align: center; color: var(--muted); font-size: 13px; min-height: 40px; margin-top: 10px; }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin: 8px auto 0; max-width: 220px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-400), var(--gold-100)); transition: width .3s; }
.heard { font: 20px/1.9 var(--quran); direction: rtl; color: var(--faint); min-height: 1em; }
.recite-text .ayah { margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: currentColor; }
.lg-ok { color: var(--ok); } .lg-close { color: var(--close); } .lg-wrong { color: var(--wrong); } .lg-missed { color: var(--missed); } .lg-added { color: var(--added); }

/* results */
.result-top { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.score { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold-300) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); position: relative; }
.score::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--t-panel); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.score b { font-variant-numeric: lining-nums; position: relative; font: 600 34px var(--serif); color: var(--gold-100); }
.score b small { font-size: 16px; }
.mistakes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.mistakes li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(var(--t-deep),.28); border: 1px solid var(--glass-line); }
.mistakes .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--sans); }
.mistakes .arw { font: 22px/1.6 var(--quran); direction: rtl; }
.t-wrong .ic { background: rgba(255,138,122,.18); color: var(--wrong); }
.t-missed .ic, .t-skipped-ayah .ic { background: rgba(240,179,92,.18); color: var(--missed); }
.t-added .ic { background: rgba(185,167,255,.18); color: var(--added); }
.t-repeated .ic, .t-repeated-ayah .ic, .t-check .ic, .t-check-basmala .ic { background: rgba(231,201,138,.15); color: var(--gold-200); }
.correct { color: var(--ok); }
.said { color: var(--wrong); text-decoration: line-through; text-decoration-thickness: 1px; }

.honest { border-radius: 20px; padding: 16px 18px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.honest b { color: var(--gold-200); }

/* progress */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { border-radius: 20px; padding: 16px; }
.stat b { font-variant-numeric: lining-nums; display: block; font: 600 32px/1.1 var(--serif); color: var(--gold-100); }
.stat span { font-size: 12px; color: var(--muted); }
table.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
table.hist th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; padding: 8px 10px; }
table.hist td { padding: 11px 10px; border-top: 1px solid var(--glass-line); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); }
.pill.good { color: var(--ok); background: rgba(143,220,174,.12); } .pill.mid { color: var(--close); background: rgba(243,196,107,.12); } .pill.bad { color: var(--wrong); background: rgba(255,138,122,.12); }
.weak { display: grid; gap: 8px; }
.weak a { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(var(--t-deep),.25); border: 1px solid var(--glass-line); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* settings */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--glass-line); }
.set-row:first-of-type { border-top: 0; }
.switch { width: 50px; height: 30px; border-radius: 999px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.08); position: relative; flex: none; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); transition: .2s; }
.switch.on { background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); }
.switch.on::after { left: 23px; }

/* player */
.player { position: fixed; left: 50%; translate: -50% 0; bottom: calc(16px + var(--safe-b)); z-index: 30; width: min(760px, calc(100% - 24px));
  border-radius: 24px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.player .ttl { font: 600 15px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .pbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--t-ink);
  background: linear-gradient(180deg, var(--gold-100), var(--gold-400)); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.player svg { width: 20px; height: 20px; fill: currentColor; }
.player .ctr { display: flex; gap: 4px; align-items: center; }
.player .ctr .btn { padding: 7px 10px; font-size: 12px; }
.player .pbar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: -2px; }
.player .pbar i { display: block; height: 100%; width: 0; background: var(--gold-300); }

/* sheets / dialogs */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(var(--t-deep), .55); display: grid; place-items: end center; animation: fade .2s; }
.sheet { width: min(620px, 100%); max-height: 86vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 18px 20px calc(24px + var(--safe-b)); background: rgba(var(--t-sheet), .88); }
@media (min-width: 761px) { .sheet-back { place-items: center; } .sheet { border-radius: 26px; } }
.sheet h3 { margin-bottom: 10px; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.list { display: grid; gap: 4px; max-height: 46vh; overflow: auto; margin-top: 8px; }
.list button { text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid transparent; background: rgba(255,255,255,.04); }
.list button:hover { background: rgba(255,255,255,.08); }
.list button.on { border-color: var(--gold-400); color: var(--gold-100); }
.list button small { display: block; color: var(--faint); font-size: 11.5px; }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; top: 80px; translate: -50% 0; z-index: 60; padding: 10px 18px; border-radius: 999px; background: rgba(var(--t-sheet), .95);
  border: 1px solid var(--glass-line); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.toast.show { opacity: 1; }

.foot { text-align: center; font-size: 12px; color: var(--faint); margin-top: 34px; }
.foot a { text-decoration: underline; }

/* phone */
@media (max-width: 760px) {
  body { padding-bottom: calc(150px + var(--safe-b)); }
  .tabs { display: none; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .bottomnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 25; border-radius: 24px; padding: 6px; }
  .bottomnav a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 18px; font-size: 11px; color: var(--muted); }
  .bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottomnav a.on { color: var(--gold-100); background: rgba(255,236,214,.10); }
  .player { bottom: calc(84px + var(--safe-b)); grid-template-columns: auto 1fr auto; padding: 8px 10px; }
  .player .ctr .hide-sm { display: none; }
  main { padding: 14px 12px 30px; }
  .hero { grid-template-columns: 1fr; padding: 26px 20px; }
  .hero .ar-hero { font-size: 34px; order: -1; }
  .recite-grid, .recite-grid[style] { grid-template-columns: 1fr !important; }
  .recite-grid.rc { grid-template-areas: "ctrl" "main" "honest"; grid-template-rows: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .reader-tools { top: 58px; border-radius: 20px; }
  :root { --ar-size: 28px; }
  .ayah { padding: 14px 14px 10px; }
  .result-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .mistakes li { grid-template-columns: 30px 1fr; }
  .mistakes li > .row { grid-column: 1 / -1; justify-content: flex-end; }
}
h1, h2, h3, .hero small, .continue, .sura .t { font-variant-numeric: lining-nums; }

/* voice teacher */
.teach-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }
.teach-row .seg button { padding: 6px 12px; }
.teachbar { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 12px 16px; margin-bottom: 12px; border-radius: 18px;
  background: linear-gradient(150deg, rgba(255,138,122,.16), rgba(255,138,122,.05)); border: 1px solid rgba(255,138,122,.45);
  position: fixed; top: 84px; left: 50%; translate: -50% 0; width: min(640px, calc(100% - 24px)); z-index: 40;
  background-color: rgba(var(--t-sheet), .92); box-shadow: 0 24px 60px -20px rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fade .25s; }
.teachbar .stop { font: 700 15px/1 var(--sans); letter-spacing: .14em; color: #fff; background: #c8423f; padding: 10px 12px; border-radius: 12px; box-shadow: 0 6px 18px -6px rgba(200,66,63,.8); }
.teachbar .small-stop { background: rgba(231,201,138,.2); color: var(--gold-100); box-shadow: none; }
.teachbar .teach-ar { font-size: 26px; margin-top: 2px; }
.w.teach { color: var(--gold-100) !important; background: rgba(255,138,122,.22); outline: 2px solid rgba(255,138,122,.8); animation: pulse 1s ease-in-out infinite alternate; }
.ayah .ar.teach { outline: 2px solid rgba(255,138,122,.7); border-radius: 12px; }
@keyframes pulse { to { background: rgba(231,201,138,.25); } }
@media (max-width: 760px) { .teachbar { top: 70px; } }

/* install guide */
.inst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.inst.mine { border-color: rgba(231,201,138,.6); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px rgba(231,201,138,.25), 0 18px 50px -18px rgba(0,0,0,.55); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; line-height: 1.5; }
.steps li::before { content: counter(st); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--sans);
  color: var(--t-ink); background: linear-gradient(180deg, var(--gold-100), var(--gold-400)); }
