:root {
  color-scheme: light;
  --ink: #25362d;
  --muted: #65736a;
  --paper: #f3f2ec;
  --surface: #fbfaf6;
  --page: #f5efdf;
  --line: #e1dfd4;
  --green: #286a4b;
  --pale: #e9eee4;
  --accent: #a27636;
  --shadow: 0 18px 48px rgba(49, 55, 42, .08);
  --arabic-size: 34px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 "DM Sans", system-ui, sans-serif; transition: background-color .2s, color .2s; }
button, input, select { font: inherit; }
button, select { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #c28c41; outline-offset: 3px; }

body[data-theme="paper"] { --paper: #f5f6f4; --surface: #fff; --page: #fff; --ink: #262d29; --muted: #67716c; --line: #e1e7e3; --green: #27664b; --pale: #eaf1ec; --accent: #947342; color-scheme: light; }
body[data-theme="cream"] { --paper: #f3f2ec; --surface: #fbfaf6; --page: #f5efdf; --ink: #25362d; --muted: #65736a; --line: #e1dfd4; --green: #286a4b; --pale: #e9eee4; --accent: #a27636; color-scheme: light; }
body[data-theme="sepia"] { --paper: #eee5d7; --surface: #f7f0e4; --page: #f3e8d5; --ink: #493c2d; --muted: #796b58; --line: #ddd0bc; --green: #6a6340; --pale: #e9dfcb; --accent: #a36f32; color-scheme: light; }
body[data-theme="sage"] { --paper: #eaf0e9; --surface: #f5f8f3; --page: #edf4e9; --ink: #2b3d32; --muted: #68796d; --line: #d7e3d7; --green: #3e7050; --pale: #e0ebdf; --accent: #9b7c43; color-scheme: light; }
body[data-theme="dark"] { --paper: #18211e; --surface: #222e29; --page: #1c2823; --ink: #e2e9e4; --muted: #a9b6ad; --line: #394840; --green: #90c8a2; --pale: #2b3c32; --accent: #e2c17b; color-scheme: dark; }
body[data-theme="night"] { --paper: #211f1c; --surface: #2b2823; --page: #25221e; --ink: #e7dfd0; --muted: #b6aa98; --line: #484137; --green: #c6ad7a; --pale: #3a342a; --accent: #d6bd87; color-scheme: dark; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem clamp(1rem, 5vw, 5rem); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--pale); color: var(--green); font-size: 1.6rem; }
.brand strong, .brand small { display: block; }
.brand strong { font: 800 1rem Manrope, sans-serif; }
.brand small { color: var(--muted); font-size: .65rem; letter-spacing: .12em; }
.topbar nav { display: flex; align-items: center; gap: 1.3rem; }
.topbar nav a, .home-link { font-size: .88rem; font-weight: 700; text-decoration: none; }
.topbar nav a:hover, .home-link:hover, footer a:hover { color: var(--green); }

main { overflow: hidden; }
.hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2rem; min-height: 420px; padding: clamp(3rem, 7vw, 5rem) max(calc((100vw - 1160px) / 2), 6vw); background: radial-gradient(ellipse at 80% 30%, color-mix(in srgb, var(--pale) 75%, transparent), transparent 48%), var(--paper); }
.hero-copy { max-width: 640px; }
.eyebrow { margin: 0; color: var(--green); font-size: .74rem; font-weight: 800; letter-spacing: .14em; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: #4d9d65; }
.hero h1 { margin: .7rem 0 1rem; font: 800 clamp(2.7rem, 6vw, 5rem)/1.08 Manrope, sans-serif; letter-spacing: -.055em; }
.hero h1 em { display: block; color: var(--green); font-style: normal; }
.hero-copy > p:not(.eyebrow) { max-width: 570px; color: var(--muted); font-size: 1.08rem; }
.primary-link { display: inline-flex; align-items: center; gap: 1.3rem; margin-top: 1rem; padding: .9rem 1.2rem; border-radius: 14px; background: var(--green); color: var(--surface); font-weight: 800; text-decoration: none; }
.hero-art { position: relative; display: grid; min-height: 285px; place-items: center; }
.glow { position: absolute; width: min(85%, 320px); aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); border-radius: 50%; box-shadow: 0 0 0 32px color-mix(in srgb, var(--pale) 65%, transparent), 0 0 0 68px color-mix(in srgb, var(--pale) 40%, transparent); }
.arabic-ornament { position: relative; display: grid; width: 205px; height: 205px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--green); font: 46px/1.5 "Noto Naskh Arabic", serif; }
.star { position: absolute; color: var(--accent); }
.star-a { top: 12%; right: 22%; font-size: 2rem; }
.star-b { bottom: 13%; left: 20%; font-size: 2.5rem; }
.art-caption { position: absolute; bottom: 0; color: var(--muted); font-weight: 700; }

.reader-section { width: min(1160px, 100%); margin: auto; padding: 3.6rem 1.25rem 4.5rem; }
.reader-intro { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.reader-intro h2 { margin: .25rem 0 0; font: 800 clamp(1.65rem, 4vw, 2.3rem)/1.2 Manrope, sans-serif; }
.button { min-height: 44px; padding: .65rem .95rem; border: 1px solid transparent; border-radius: 12px; font-weight: 750; cursor: pointer; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button-quiet { border-color: var(--line); background: var(--surface); color: var(--green); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.reader-toolbar, .reading-options { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.control-field, .option-field { display: grid; min-width: 0; gap: .35rem; color: var(--muted); font-size: .78rem; font-weight: 750; }
.control-field select, .control-field input, .option-field select { width: 100%; min-width: 0; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); font-size: .88rem; }
.search-control { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .4rem; }
.search-control .control-field { min-width: 0; }
.voice-button { min-width: 46px; padding: .45rem; font-size: 1.1rem; }
.reading-options { grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; margin-top: .75rem; }
.reading-summary { color: var(--muted); font-size: .82rem; font-weight: 750; }
.stepper { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: .5rem; padding: .2rem; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); }
.stepper button { min-width: 38px; min-height: 36px; border: 0; border-radius: 8px; background: var(--surface); color: var(--green); font-weight: 800; cursor: pointer; }
.stepper output { font-variant-numeric: tabular-nums; }
.reading-options > .button { white-space: nowrap; }
.search-results { display: grid; max-height: 310px; gap: .4rem; overflow: auto; margin-top: .6rem; padding: .7rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-privacy-note { margin: .35rem .2rem; color: var(--muted); font-size: .73rem; }
.search-result, .bookmark-item { display: flex; width: 100%; flex-wrap: wrap; justify-content: space-between; gap: .35rem .8rem; padding: .7rem; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink); text-align: start; cursor: pointer; }
.search-result:hover, .bookmark-item:hover { outline: 1px solid var(--green); }
.search-result strong { color: var(--green); font-size: .82rem; }
.search-result span { width: 100%; font: 1.3rem/1.8 "Noto Naskh Arabic", serif; text-align: right; }
.search-empty, .bookmark-empty { margin: .3rem; color: var(--muted); }
.reader-status { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; min-height: 1.4rem; margin: .8rem 0; color: var(--green); font-weight: 700; }
.bookmark-panel { margin: .9rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.bookmark-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.bookmark-heading h3 { margin: 0; font: 800 1.1rem Manrope, sans-serif; }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 800; cursor: pointer; }
#bookmark-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; }
.bookmark-item { justify-content: flex-start; font-weight: 700; }
.settings-dialog { width: min(820px, calc(100% - 1.2rem)); max-width: 820px; max-height: min(92dvh, 900px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.settings-dialog::backdrop { background: rgba(15,24,19,.58); backdrop-filter: blur(4px); }
.settings-shell { display: flex; max-height: min(92dvh, 900px); flex-direction: column; }
.settings-header, .settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; }
.settings-header { border-bottom: 1px solid var(--line); }
.settings-header h3 { margin: .2rem 0 0; font: 800 1.3rem Manrope, sans-serif; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.settings-body { display: grid; gap: 1rem; overflow: auto; padding: 1.2rem 1.3rem; }
.settings-hint { margin: -.15rem 0 .8rem; color: var(--muted); font-size: .8rem; }
.tajweed-fieldset, .size-fieldset { min-width: 0; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: 16px; }
.tajweed-fieldset legend, .size-fieldset legend { padding: 0 .35rem; color: var(--ink); font-weight: 800; }
.tajweed-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.tajweed-preset { display: flex; min-width: 0; min-height: 132px; flex-direction: column; align-items: stretch; gap: .3rem; padding: .65rem; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tajweed-preset:hover { transform: translateY(-2px); }
.tajweed-preset[aria-pressed="true"] { border: 2px solid var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent); }
.tajweed-preset strong { margin-top: auto; font-size: .8rem; }
.tajweed-preset small { color: var(--muted); font-size: .68rem; line-height: 1.35; }
.preset-preview { display: block; min-height: 59px; padding: .35rem; border-radius: 9px; background: var(--page); color: var(--ink); font: 1.22rem/1.8 "Noto Naskh Arabic", serif; text-align: center; }
.tajweed-mark { border-radius: .16em; }
.tajweed-legend { margin: 1rem clamp(.8rem, 3vw, 1.6rem); padding: clamp(.9rem, 2.4vw, 1.35rem); border: 1px solid var(--line); border-radius: 18px; background: var(--page); }
.tajweed-legend-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .8rem; }
.tajweed-legend-heading .eyebrow { margin-bottom: .2rem; }
.tajweed-legend-heading h4 { margin: 0; color: var(--ink); font-size: 1rem; }
.tajweed-legend-heading > span, .tajweed-legend-note { color: var(--muted); font-size: .75rem; }
.tajweed-rule-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: 0; padding: 0; list-style: none; }
.tajweed-rule-list li { display: flex; min-width: 0; align-items: flex-start; gap: .55rem; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rule-swatch { width: .8rem; height: .8rem; flex: 0 0 auto; margin-top: .18rem; border-radius: 50%; background: var(--rule-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rule-color) 15%, transparent); }
.tajweed-rule-list li > span:last-child { display: grid; gap: .18rem; }
.tajweed-rule-list strong { color: var(--ink); font-size: .76rem; }
.tajweed-rule-list small { color: var(--muted); font-size: .69rem; line-height: 1.4; }
.tajweed-legend-note { margin: .8rem 0 0; }
.reader-audio { display: grid; grid-template-columns: minmax(190px, .8fr) auto minmax(250px, 1.4fr) auto; align-items: end; gap: .7rem; margin: 1rem 0 .3rem; padding: .85rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.reader-audio > div { display: grid; gap: .3rem; }
.reader-audio label { color: var(--muted); font-size: .72rem; font-weight: 750; }
.reader-audio select { min-width: 0; min-height: 42px; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--page); color: var(--ink); }
.reader-audio audio { width: 100%; min-width: 0; height: 42px; }
.audio-library-link { align-self: center; color: var(--green); font-size: .75rem; font-weight: 800; text-decoration: none; }
.audio-source-note { min-height: 1em; margin: .25rem .3rem .8rem; color: var(--muted); font-size: .73rem; }
.tajweed-ham_wasl, .tajweed-slnt, .tajweed-laam_shamsiyah { color: #AAAAAA; }
.tajweed-madda_normal { color: #537FFF; }
.tajweed-madda_permissible { color: #4050FF; }
.tajweed-madda_necessary { color: #000EBC; }
.tajweed-madda_obligatory { color: #2144C1; }
.tajweed-qalaqah { color: #DD0008; }
.tajweed-ikhafa_shafawi { color: #D500B7; }
.tajweed-ikhafa { color: #9400A8; }
.tajweed-iqlab { color: #26BFFD; }
.tajweed-idgham_shafawi { color: #58B800; }
.tajweed-idgham_ghunnah, .tajweed-idgham_wo_ghunnah { color: #169200; }
.tajweed-idgham_mutajanisayn, .tajweed-idgham_mutaqaribayn { color: #A1A1A1; }
.tajweed-ghunnah { color: #FF7E1E; }
.radio-choice { display: flex; align-items: flex-start; gap: .65rem; margin: .35rem 0; padding: .65rem; border-radius: 12px; background: var(--paper); cursor: pointer; }
.radio-choice input { margin-top: .3rem; accent-color: var(--green); }
.radio-choice span { display: grid; gap: .15rem; }
.radio-choice strong { color: var(--ink); font-size: .83rem; }
.radio-choice small { color: var(--muted); font-size: .76rem; line-height: 1.45; }
.font-controls { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .7rem; }
.font-controls output { min-width: 70px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 800; text-align: center; }
.spacing-field { max-width: 320px; }
.settings-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.button-primary { background: var(--green); color: var(--surface); }

.reader-card { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.reader-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem clamp(1rem, 4vw, 2rem); border-bottom: 1px solid var(--line); }
.reader-card-header h3 { margin: .22rem 0 0; font: 800 clamp(1.3rem, 3vw, 1.85rem)/1.25 Manrope, sans-serif; }
.reading-meta { display: flex; flex-wrap: wrap; justify-content: end; gap: .45rem; }
.reading-meta span { padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.orientation-toggle-button { flex: 0 0 auto; font-size: .78rem; }
.horizontal-hint { margin: .65rem .2rem; color: var(--muted); font-size: .75rem; font-weight: 700; }
.progress-row { display: flex; align-items: center; gap: .75rem; padding: .6rem clamp(1rem, 4vw, 2rem); color: var(--muted); font-size: .76rem; font-weight: 700; }
.progress-row progress { width: min(100%, 220px); height: 7px; accent-color: var(--green); }
.reader-content { min-height: 360px; overflow-x: auto; padding: clamp(1rem, 4vw, 2.4rem); background: var(--page); color: var(--ink); scrollbar-color: var(--green) var(--pale); }
.reader-page { width: 100%; margin: 0 auto; }
.surah-group + .surah-group { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.surah-heading { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem .8rem; margin: 0 auto 1.25rem; padding: .75rem 1rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px; text-align: center; }
.surah-name-ar { color: var(--green); font: 700 1.5rem/1.4 "Noto Naskh Arabic", serif; }
.surah-name-latin { color: var(--muted); font-size: .76rem; font-weight: 750; }
.basmala { margin: 0 auto 1rem; color: var(--ink); font: 700 calc(var(--arabic-size) * .83)/1.8 "Noto Naskh Arabic", serif; text-align: center; }
.ayah-list { direction: rtl; }
.ayah { position: relative; color: var(--ink); }
.ayah-text { font: 500 var(--arabic-size)/1.95 "Noto Naskh Arabic", "Times New Roman", serif; }
.ayah-number { display: inline-grid; width: 1.8em; height: 1.8em; margin: 0 .25em; padding: 0; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 50%; background: transparent; color: var(--accent); font: 700 .55em/1 "DM Sans", sans-serif; vertical-align: middle; cursor: pointer; }
.ayah-number[aria-pressed="true"] { border-width: 2px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.bookmark-button { width: 30px; height: 30px; margin: 0 .2rem; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--accent); font-size: 1.05rem; vertical-align: middle; cursor: pointer; }
.bookmark-button:hover, .bookmark-button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ayah-list[data-mode="scroll"] { display: grid; gap: .75rem; }
.ayah-list[data-mode="scroll"] .ayah { padding: .65rem .5rem; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.ayah-list[data-mode="focus"] { display: grid; gap: 1rem; }
.ayah-list[data-mode="focus"] .ayah { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: center; }
.ayah-list[data-mode="focus"] .bookmark-button { display: block; margin: .45rem auto 0; }
.reader-content[data-spacing="normal"] .ayah-text { line-height: 1.65; }
.reader-content[data-spacing="relaxed"] .ayah-text { line-height: 1.95; }
.reader-content[data-spacing="wide"] .ayah-text { line-height: 2.35; }
.reader-content[data-mode="mushaf"] { width: min(100%, 850px); min-height: 650px; margin: 1rem auto; padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 10%, transparent); }
.reader-content[data-mode="mushaf"][data-size-mode="page"] { overflow-x: auto; }
.reader-content[data-mode="mushaf"] .reader-page { width: min(100%, 760px); min-width: min(100%, 340px); margin: 0 auto; }
.reader-content[data-mode="mushaf"] .surah-heading { margin-bottom: .7rem; }
.reader-content[data-mode="mushaf"] .ayah-list { text-align: justify; text-align-last: justify; text-justify: inter-word; line-height: 2.35; }
.reader-content[data-mode="mushaf"] .ayah-list::after { display: inline-block; width: 100%; content: ""; }
.reader-content[data-mode="mushaf"] .ayah { display: inline; }
.reader-content[data-mode="mushaf"] .ayah-text { font-size: calc(var(--arabic-size) * .78); }
.reader-content[data-mode="mushaf"] .ayah-number { width: 1.65em; height: 1.65em; }
.reader-content[data-mode="mushaf"] .bookmark-button { display: none; }
.reader-content[data-size-mode="page"] .reader-page { transform-origin: top right; }
.reader-content[data-size-mode="text"] .reader-page { zoom: 100% !important; }
.page-controls { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: 1rem clamp(1rem, 4vw, 2rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; font-weight: 750; }
.source-note { margin: 1rem .2rem 0; color: var(--muted); font-size: .78rem; }
.source-note a { color: var(--green); font-weight: 700; }
.reader-card:fullscreen { display: flex; width: 100vw; height: 100dvh; flex-direction: column; overflow: auto; border: 0; border-radius: 0; background: var(--surface); }
.reader-card:fullscreen .reader-card-header { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.reader-card:fullscreen .reader-content { flex: 1 1 auto; width: min(100%, 1000px); max-height: none; }
.reader-card:fullscreen .reader-content[data-mode="mushaf"] { min-height: 0; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem clamp(1rem, 6vw, 5rem); border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; }
footer a { font-weight: 800; text-decoration: none; }
@media (max-width: 820px) {
  .topbar nav { display: none; }
  .hero { grid-template-columns: 1fr; padding: 3rem 1.4rem 2rem; }
  .hero-art { min-height: 225px; }
  .reader-toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: span 2; }
  .reading-options { grid-template-columns: 1fr auto auto; }
  .reading-summary { grid-column: 1 / -1; }
  .tajweed-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  :root { --arabic-size: 29px; }
  .topbar { min-height: 60px; padding: .55rem .8rem; }
  .home-link { font-size: .75rem; }
  .brand strong { font-size: .9rem; }
  .brand-mark { width: 36px; height: 36px; }
  .hero h1 { font-size: 2.8rem; }
  .reader-section { padding: 2.6rem .75rem 3.2rem; }
  .reader-intro { align-items: flex-start; flex-direction: column; }
  .reader-toolbar, .reading-options { gap: .55rem; padding: .7rem; }
  .reader-toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .reading-options { grid-template-columns: 1fr 1fr; }
  .reading-options > .button { grid-column: auto; padding: .55rem; font-size: .75rem; white-space: normal; }
  .reading-summary { grid-column: span 2; }
  .control-field select, .control-field input, .option-field select { font-size: .82rem; }
  .reader-card-header { align-items: flex-start; flex-wrap: wrap; }
  .reader-card-header > div:first-child { flex: 1 1 100%; }
  .reading-meta { justify-content: flex-start; }
  .orientation-toggle-button { min-height: 38px; }
  .tajweed-rule-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-audio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .reader-audio audio { grid-column: 1 / -1; }
  .audio-library-link { justify-self: end; }
  .reader-content { padding: .8rem; }
  .reader-content[data-mode="mushaf"] { min-height: 520px; }
  .reader-content[data-mode="mushaf"] .reader-page { width: 640px; max-width: none; min-width: 640px; margin-right: 0; }
  .reader-content[data-mode="mushaf"][data-size-mode="page"] .reader-page { width: 640px; min-width: 640px; }
  .reader-content[data-mode="mushaf"][data-size-mode="text"] .reader-page { width: 100%; min-width: 0; }
  .page-controls { flex-wrap: wrap; justify-content: center; }
  .page-controls span { order: -1; width: 100%; text-align: center; }
  footer { flex-wrap: wrap; }
  .settings-header, .settings-footer { padding: .85rem; }
  .settings-header h3 { font-size: 1.05rem; }
  .settings-body { padding: .85rem; }
  .tajweed-preset { min-height: 124px; padding: .5rem; }
  .tajweed-preset small { font-size: .64rem; }
  .tajweed-rule-list { grid-template-columns: 1fr; }
  .reader-audio { grid-template-columns: 1fr; }
  .reader-audio audio { grid-column: auto; }
  .audio-library-link { justify-self: start; }
  .settings-footer { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
