/* Quran.tv Mutoon — book-style text (no PDF viewer) */
:root, .qtv-mutoon[data-theme="light"] {
  --mt-ink: #1a1a1a;
  --mt-muted: #6b6b6b;
  --mt-paper: #fffdf8;
  --mt-card: #ffffff;
  --mt-line: #e5dcc8;
  --mt-green: #0b6b56;
  --mt-green-deep: #075043;
  --mt-rose: #c2185b;
  --mt-rose-soft: #e91e63;
  --mt-match: #fce4ec;
  --mt-current: #fff3c4;
  --mt-err: #b42318;
  --mt-err-bg: #fdecec;
  --mt-surface: #fffefb;
  --mt-surface-2: #f7f2e7;
  --mt-btn-bg: #ffffff;
  --mt-input-bg: #ffffff;
  --mt-nav-bg: #ffffff;
  --mt-nav-arrow: #f7f4ec;
  --mt-progress-track: #ebe4d4;
  --mt-score-bg: linear-gradient(180deg, #fffefb, #f5f1e6);
  --mt-score-pill: #ffffff;
  --mt-score-hit-bg: #eef8f3;
  --mt-score-hit-line: #b7e0cb;
  --mt-score-miss-bg: #fdecec;
  --mt-score-miss-line: #f3c1c1;
  --mt-score-perfect-bg: #e5f5ee;
  --mt-score-perfect-line: #9fd0bb;
  --mt-flash-ok-bg: #e8f6ef;
  --mt-flash-ok-line: #b7e0cb;
  --mt-flash-err-line: #f3c1c1;
  --mt-badge-bg: #e8d9a8;
  --mt-badge-ink: #6a5300;
  --mt-stub-bg: #f7f3ea;
  --mt-stub-line: #d4c7a8;
  --mt-stub-hover: #eef6f2;
  --mt-done-bg: rgba(255,244,214,.55);
  --mt-done-line: rgba(180,140,40,.35);
  --mt-live-bg: #f0f7f4;
  --mt-chip-bg: #e8f4ef;
  --mt-hide-bg: rgba(0,0,0,.07);
  --mt-hover: rgba(11,107,86,.08);
  --mt-active-soft: rgba(11,107,86,.12);
  --mt-active-line: rgba(11,107,86,.28);
  --mt-hadith-active: rgba(194,24,91,.04);
  --mt-hadith-active-line: rgba(194,24,91,.18);
  --mt-perfect-bg: rgba(11,107,86,.07);
  --mt-perfect-line: rgba(11,107,86,.45);
  --mt-shadow: 0 10px 32px rgba(40,30,10,.1);
  --mt-radius: 16px;
  --mt-ui: "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --mt-text: "Amiri", "Traditional Arabic", "Scheherazade New", serif;
}

.qtv-mutoon[data-theme="dark"] {
  --mt-ink: #e7eeea;
  --mt-muted: #9aaca3;
  --mt-paper: #151c1a;
  --mt-card: #1b2421;
  --mt-line: #31403a;
  --mt-green: #2f9b7d;
  --mt-green-deep: #7dceb4;
  --mt-rose: #e85a8a;
  --mt-rose-soft: #f0719b;
  --mt-match: #3a2430;
  --mt-current: #3d3520;
  --mt-err: #ff8a80;
  --mt-err-bg: #3a2222;
  --mt-surface: #222c28;
  --mt-surface-2: #1a221f;
  --mt-btn-bg: #24302c;
  --mt-input-bg: #1a221f;
  --mt-nav-bg: #1f2925;
  --mt-nav-arrow: #24302c;
  --mt-progress-track: #2a3531;
  --mt-score-bg: linear-gradient(180deg, #222c28, #1a221f);
  --mt-score-pill: #24302c;
  --mt-score-hit-bg: #1e332c;
  --mt-score-hit-line: #3a6b58;
  --mt-score-miss-bg: #3a2222;
  --mt-score-miss-line: #6b3a3a;
  --mt-score-perfect-bg: #1e332c;
  --mt-score-perfect-line: #3a6b58;
  --mt-flash-ok-bg: #1e332c;
  --mt-flash-ok-line: #3a6b58;
  --mt-flash-err-line: #6b3a3a;
  --mt-badge-bg: #3d3520;
  --mt-badge-ink: #e8d9a8;
  --mt-stub-bg: #222c28;
  --mt-stub-line: #4a564f;
  --mt-stub-hover: #2a3531;
  --mt-done-bg: rgba(61,53,32,.65);
  --mt-done-line: rgba(180,140,40,.45);
  --mt-live-bg: #1e2925;
  --mt-chip-bg: #24302c;
  --mt-hide-bg: rgba(255,255,255,.1);
  --mt-hover: rgba(47,155,125,.14);
  --mt-active-soft: rgba(47,155,125,.2);
  --mt-active-line: rgba(47,155,125,.4);
  --mt-hadith-active: rgba(232,90,138,.1);
  --mt-hadith-active-line: rgba(232,90,138,.3);
  --mt-perfect-bg: rgba(47,155,125,.14);
  --mt-perfect-line: rgba(47,155,125,.45);
  --mt-shadow: 0 12px 36px rgba(0,0,0,.45);
}

/* صفحة المتون: أخفِ عنوان القالب الضخم وقلّل الحشو */
body.qtv-mutoon-page .entry-header,
body.qtv-mutoon-page header.entry-header,
body.qtv-mutoon-page .page-header,
body.qtv-mutoon-page .ast-page-title,
body.qtv-mutoon-page .page-title,
body.qtv-mutoon-page h1.entry-title,
body.qtv-mutoon-page .entry-title,
body.qtv-mutoon-page .elementor-page-title,
body.qtv-mutoon-page .elementor-heading-title.elementor-size-default:first-child,
body.qtv-mutoon-page .wp-block-post-title {
  display: none !important;
}
body.qtv-mutoon-page .site-main,
body.qtv-mutoon-page .entry-content,
body.qtv-mutoon-page .post-content,
body.qtv-mutoon-page article.page,
body.qtv-mutoon-page .content-area,
body.qtv-mutoon-page #content,
body.qtv-mutoon-page .ast-container,
body.qtv-mutoon-page .e-con,
body.qtv-mutoon-page .elementor-widget-theme-post-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
body.qtv-mutoon-page .entry-content > :first-child,
body.qtv-mutoon-page .post-content > :first-child {
  margin-top: 0 !important;
}
body.qtv-mutoon-page.qtv-mutoon-dark,
body.qtv-mutoon-page.qtv-mutoon-dark .site-content,
body.qtv-mutoon-page.qtv-mutoon-dark .content-area,
body.qtv-mutoon-page.qtv-mutoon-dark .entry-content {
  background: #101614 !important;
  color: #e7eeea;
}

.qtv-mutoon {
  font-family: var(--mt-ui); color: var(--mt-ink);
  max-width: 980px; margin: .35rem auto .75rem; padding: 0 .5rem;
  direction: rtl; box-sizing: border-box;
  color-scheme: light;
}
.qtv-mutoon[data-theme="dark"] { color-scheme: dark; }
.mt-stage {
  background: var(--mt-card);
  border: 1px solid var(--mt-line);
  border-radius: 14px;
  box-shadow: var(--mt-shadow);
  overflow: hidden;
  min-height: 0;
  display: flex; flex-direction: column;
}
.mt-head {
  background: linear-gradient(120deg, var(--mt-green), var(--mt-green-deep)); color: #fff;
  padding: .4rem .7rem; display: flex; align-items: center; justify-content: space-between; gap: .45rem;
  min-height: 2.35rem;
}
.mt-head-main {
  display: flex; align-items: center; gap: .45rem; min-width: 0; flex: 1;
}
.mt-head-actions {
  display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto;
}
.mt-head h1 { margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: .01em; flex: 0 0 auto; }
.mt-level-head {
  max-width: 4.6rem; min-width: 3.6rem;
  padding: .2rem .3rem; font-size: .75rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.16); color: #fff;
  border-radius: 8px; height: 2rem;
  cursor: pointer;
}
.mt-level-head option { color: #1a1a1a; background: #fff; }
.mt-theme {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff;
  border-radius: 8px; width: 2rem; height: 2rem; padding: 0;
  cursor: pointer; font: inherit; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.mt-theme:hover { background: rgba(255,255,255,.25); }
#mt-mic.mt-mic-head {
  min-width: 2.15rem; width: 2.15rem; height: 2.15rem;
  background: rgba(255,255,255,.95); border-color: rgba(255,255,255,.95); color: var(--mt-green-deep);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
#mt-mic.mt-mic-head:hover {
  background: #fff; color: var(--mt-green); border-color: #fff;
}
#mt-mic.mt-mic-head.is-on {
  background: var(--mt-err); border-color: var(--mt-err); color: #fff;
}
#mt-mic.mt-mic-head .mt-mic-icon { width: 1.2rem; height: 1.2rem; }
.mt-back {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff;
  border-radius: 8px; padding: .28rem .55rem; cursor: pointer; font: inherit; font-size: .8rem;
  flex: 0 0 auto;
}
.mt-head-title {
  margin: 0; min-width: 0; font-size: .82rem; font-weight: 700; line-height: 1.3;
  color: rgba(255,255,255,.95);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-head-title .mt-chip {
  background: rgba(255,255,255,.22); color: #fff; vertical-align: middle;
  margin-inline-start: .25rem;
}
.mt-body { padding: .45rem; flex: 1; overflow: auto; }

.mt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.mt-item {
  display: grid; grid-template-columns: 1fr auto; gap: .55rem; align-items: center;
  padding: .75rem .85rem; border: 1px solid var(--mt-line); border-radius: 12px;
  background: linear-gradient(180deg,var(--mt-surface),var(--mt-surface-2));
}
.mt-item-title { font-weight: 800; font-size: .98rem; }
.mt-item-meta { color: var(--mt-muted); font-size: .78rem; margin-top: .2rem; }
.mt-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.mt-btn {
  border: 1px solid var(--mt-line); background: var(--mt-btn-bg); color: var(--mt-ink); border-radius: 9px;
  padding: .4rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; gap: .35rem;
}
.mt-btn:hover { border-color: var(--mt-green); color: var(--mt-green-deep); }
.mt-btn-primary { background: var(--mt-green); border-color: var(--mt-green); color: #fff; }
.mt-btn-primary:hover { background: var(--mt-green-deep); color: #fff; }
.mt-btn.is-on { background: var(--mt-err); border-color: var(--mt-err); color: #fff; }

#mt-mic.mt-mic-btn {
  min-width: 2.35rem; width: 2.35rem; height: 2.35rem; padding: 0;
  justify-content: center; border-radius: 50%;
  background: var(--mt-green); border-color: var(--mt-green); color: #fff;
  flex: 0 0 auto;
}
#mt-mic.mt-mic-btn:hover { background: var(--mt-green-deep); color: #fff; }
#mt-mic .mt-mic-icon { width: 1.35rem; height: 1.35rem; display: block; }
#mt-mic.is-on {
  background: var(--mt-err); border-color: var(--mt-err); color: #fff;
  animation: mtMicPulse 1.2s ease infinite;
}
@keyframes mtMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,35,24,.35); }
  50% { box-shadow: 0 0 0 8px rgba(180,35,24,0); }
}

.mt-nav-block {
  margin: 0 0 .35rem;
  position: relative;
  z-index: 20;
}
.mt-nav-row {
  display: flex; align-items: stretch; gap: 0;
  margin: 0; border: 1px solid var(--mt-line); border-radius: 10px;
  overflow: visible;
  background: var(--mt-nav-bg);
}
.mt-nav-block.is-open .mt-nav-row {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}
.mt-nav-row .mt-toc-drop { flex: 1; min-width: 0; margin: 0; border-inline: 1px solid var(--mt-line); border-radius: 0; }
.mt-nav-arrow {
  flex: 0 0 2.4rem; width: 2.4rem;
  border: 0; background: var(--mt-nav-arrow); color: var(--mt-green-deep);
  border-radius: 0; font-size: 1.45rem; line-height: 1; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.mt-nav-row .mt-nav-arrow:first-child { border-radius: 0 9px 9px 0; }
.mt-nav-row .mt-nav-arrow:last-child { border-radius: 9px 0 0 9px; }
.mt-nav-block.is-open .mt-nav-row .mt-nav-arrow:first-child { border-radius: 0 9px 0 0; }
.mt-nav-block.is-open .mt-nav-row .mt-nav-arrow:last-child { border-radius: 9px 0 0 0; }
.mt-nav-arrow:hover:not(:disabled) { background: var(--mt-hover); }
.mt-nav-arrow:active:not(:disabled) { transform: none; }
.mt-nav-arrow:disabled { opacity: .35; cursor: default; }

.mt-workspace {
  min-height: 12rem;
  overflow-anchor: none;
}
.mt-matn {
  overflow-anchor: none;
}
.mt-body { overflow-anchor: none; scroll-behavior: auto; }

.mt-practice-bar {
  display: flex; flex-direction: column; gap: 0;
  margin: 0; padding: .35rem .4rem;
  border: 1px solid var(--mt-line); border-bottom: 0; border-radius: 10px 10px 0 0;
  background: var(--mt-surface);
}
.mt-btn-row { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.mt-btn-row-main {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: .22rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mt-mic-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .22rem;
  flex: 0 0 auto;
}
.mt-part-nav {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .12rem;
  flex: 0 0 auto;
  margin-inline: .1rem;
  padding: .1rem;
  border: 1px solid var(--mt-line);
  border-radius: 9px;
  background: var(--mt-nav-bg);
}
.mt-part-nav .mt-icon-btn {
  min-width: 1.85rem; width: 1.85rem; height: 1.85rem;
  border-color: transparent; background: transparent;
}
.mt-part-nav .mt-icon-btn:hover:not(:disabled) {
  background: var(--mt-hover); border-color: transparent; color: var(--mt-green-deep);
}
.mt-part-nav .mt-icon-btn:disabled {
  opacity: .35; cursor: default;
}
.mt-part-label {
  min-width: 2.4rem; text-align: center;
  font-size: .72rem; font-weight: 800; color: var(--mt-green-deep);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.mt-btn-row-main .mt-select {
  max-width: 4.8rem; padding: .28rem .3rem; font-size: .72rem; flex: 0 0 auto;
}
.mt-btn-row-main #mt-level { max-width: 4.2rem; }
.mt-btn-row-main .mt-btn:not(.mt-mic-btn):not(.mt-icon-btn) {
  padding: .28rem .42rem; font-size: .72rem; flex: 0 0 auto; white-space: nowrap;
}
.mt-icon-btn {
  min-width: 2.05rem; width: 2.05rem; height: 2.05rem; padding: 0 !important;
  justify-content: center; border-radius: 8px; flex: 0 0 auto;
}
.mt-icon-btn .mt-ui-icon {
  width: 1.15rem; height: 1.15rem; display: block;
}
.mt-audio-btn.is-playing {
  background: var(--mt-green); border-color: var(--mt-green); color: #fff;
}
.mt-audio-btn.is-playing .mt-audio-play { display: none; }
.mt-audio-btn.is-playing .mt-audio-pause { display: block !important; }
.mt-word.is-audio-current {
  background: var(--mt-current) !important;
  box-shadow: inset 0 -2px 0 var(--mt-rose);
  color: var(--mt-ink) !important;
}
.mt-book[data-blank="1"] .mt-word.is-audio-current {
  color: var(--mt-ink) !important;
  background: var(--mt-current) !important;
}

.mt-book-icon-btn {
  width: 2.2rem; min-width: 2.2rem; height: 2.2rem; padding: 0 !important;
  justify-content: center; border-radius: 8px;
  background: var(--mt-green); border-color: var(--mt-green); color: #fff;
}
.mt-book-icon-btn:hover { background: var(--mt-green-deep); color: #fff; border-color: var(--mt-green-deep); }
.mt-book-icon-btn.is-open { background: var(--mt-green-deep); }
.mt-book-icon-btn .mt-book-icon { width: 1.15rem; height: 1.15rem; display: block; }

.mt-book-box {
  border: 1px solid var(--mt-line); border-top: 0; border-radius: 0 0 10px 10px;
  background: #fff; margin: 0 0 .35rem; overflow: hidden;
}
.mt-book-box[hidden] { display: none !important; }

.mt-book-panel {
  background: #fff; padding: 0; display: flex; flex-direction: column;
}
.mt-book-panel[hidden] { display: none !important; }
.mt-book-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .3rem;
  padding: .3rem .4rem; border-bottom: 1px solid var(--mt-line);
  background: #faf7f0; font-weight: 800; color: var(--mt-green-deep); font-size: .85rem;
}
.mt-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mt-book-frame-wrap {
  width: 100%; height: min(82vh, 820px); min-height: 460px;
  border: 0; border-radius: 0; overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: #f4f0e6; touch-action: pan-y;
  position: relative;
}
.mt-book-frame-wrap.is-native {
  display: flex; flex-direction: column; overflow: hidden; background: #fff;
}
.mt-book-loading {
  margin: 0; padding: 1.25rem; text-align: center;
  color: var(--mt-green-deep); font-weight: 800; font-size: .92rem;
}
.mt-book-fallback {
  flex: 0 0 auto; padding: .65rem .75rem; background: #fff8e8;
  border-bottom: 1px solid var(--mt-line); text-align: center;
}
.mt-book-fallback p { margin: 0 0 .45rem; font-size: .82rem; color: var(--mt-muted); font-weight: 700; }
.mt-book-native {
  flex: 1 1 auto; width: 100%; min-height: 0; height: 100%; border: 0; display: block; background: #fff;
}
.mt-book-page {
  width: 100%; margin: 0; padding: 0; background: #fff;
  min-height: 40vw; border-bottom: 1px solid #ddd;
}
.mt-book-page-canvas {
  width: 100% !important; height: auto !important; display: block; vertical-align: top;
}
.mt-book-frame {
  width: 100%; height: min(82vh, 820px); min-height: 460px; border: 0; display: block;
  background: #f4f0e6;
}

.mt-search {
  flex: 1 1 140px; min-width: 120px; border: 1px solid var(--mt-line); border-radius: 8px;
  padding: .42rem .55rem; font: inherit; background: var(--mt-input-bg); color: var(--mt-ink);
}
.mt-select, .mt-input {
  border: 1px solid var(--mt-line); border-radius: 8px; padding: .4rem .5rem; font: inherit; background: var(--mt-input-bg); color: var(--mt-ink);
}
.mt-status { min-height: 1.15rem; font-size: .82rem; color: var(--mt-muted); margin: .2rem 0 .45rem; }
.mt-status.is-ok { color: var(--mt-green-deep); font-weight: 700; }
.mt-status.is-err { color: var(--mt-err); font-weight: 800; }
.mt-progress {
  height: 6px; background: var(--mt-progress-track); border-radius: 999px; overflow: hidden; margin: 0 0 .55rem;
}
.mt-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,var(--mt-green),var(--mt-rose)); transition: width .2s; }

.mt-flash {
  background: var(--mt-err-bg); color: var(--mt-err); border: 1px solid var(--mt-flash-err-line);
  border-radius: 10px; padding: .55rem .75rem; font-weight: 800; margin: 0 0 .55rem;
}

/* فهرس الأقسام — لوحة تحت شريط التنقل (لا تُقص) */
.mt-toc-drop {
  position: relative; margin: 0; z-index: 1;
}
.mt-toc-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  border: 0; background: linear-gradient(180deg, var(--mt-surface), var(--mt-surface-2));
  border-radius: 0; padding: .55rem .7rem; cursor: pointer; font: inherit; text-align: right;
  box-shadow: none; min-height: 2.6rem;
}
.mt-toc-toggle:hover { background: var(--mt-hover); }
.mt-nav-block.is-open .mt-toc-toggle {
  background: var(--mt-card);
}
.mt-toc-toggle-label { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.mt-toc-kicker {
  font-size: .72rem; font-weight: 800; color: var(--mt-green-deep); letter-spacing: .02em;
}
.mt-toc-current {
  font-size: .95rem; font-weight: 800; color: var(--mt-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.mt-toc-chevron {
  flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mt-hover); color: var(--mt-green-deep); font-size: .95rem;
  transition: transform .18s ease;
}
.mt-nav-block.is-open .mt-toc-chevron { transform: rotate(180deg); }

.mt-toc-panel {
  display: none;
  border: 1px solid var(--mt-green);
  border-top: 1px solid var(--mt-line);
  border-radius: 0 0 12px 12px;
  background: var(--mt-card);
  box-shadow: var(--mt-shadow);
  padding: .65rem;
  margin: 0;
  position: relative;
  z-index: 25;
}
.mt-toc-panel:not([hidden]) { display: block; }
.mt-nav-block.is-open .mt-toc-panel { display: block; }
.mt-toc-search {
  width: 100%; margin: 0 0 .55rem; flex: none;
  box-sizing: border-box;
  border: 1px solid var(--mt-line); border-radius: 8px;
  padding: .45rem .55rem; font: inherit; background: var(--mt-input-bg); color: var(--mt-ink);
}
.mt-toc-meta {
  font-size: .75rem; color: var(--mt-muted); font-weight: 700;
  padding: 0 .25rem .45rem; border-bottom: 1px dashed var(--mt-line); margin-bottom: .35rem;
}
.mt-toc-list {
  max-height: min(52vh, 420px); overflow: auto; display: grid; gap: .35rem; padding: .15rem;
  -webkit-overflow-scrolling: touch;
}
.mt-toc-item {
  display: grid; grid-template-columns: auto 1fr; gap: .55rem; align-items: center;
  width: 100%; text-align: right; border: 1px solid var(--mt-line); background: var(--mt-surface);
  padding: .6rem .65rem; border-radius: 10px; cursor: pointer; font: inherit; color: var(--mt-ink);
  box-sizing: border-box; min-height: 2.75rem;
}
.mt-toc-item:hover { background: var(--mt-hover); border-color: var(--mt-active-line); }
.mt-toc-item.is-active {
  background: var(--mt-active-soft); border-color: var(--mt-green); color: var(--mt-green-deep);
  box-shadow: inset 0 0 0 1px var(--mt-green);
}
.mt-toc-idx {
  min-width: 1.85rem; height: 1.85rem; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mt-green); color: #fff; font-size: .75rem; font-weight: 800;
  flex: 0 0 auto;
}
.mt-toc-item.is-active .mt-toc-idx { background: var(--mt-green-deep); }
.mt-toc-text { min-width: 0; }
.mt-toc-name { display: block; font-size: .92rem; font-weight: 800; line-height: 1.35; white-space: normal; }
.mt-toc-item small { display: block; color: var(--mt-muted); font-size: .72rem; margin-top: .12rem; font-weight: 600; }
.mt-toc-empty { margin: .4rem; color: var(--mt-muted); font-size: .85rem; text-align: center; }

.mt-workspace {
  display: block; border: 1px solid var(--mt-line); border-radius: 12px; overflow: hidden; background: var(--mt-paper);
  min-height: 420px; max-height: min(78vh, 860px);
}
.mt-matn {
  overflow: auto; padding: 1.1rem 1.25rem 1.6rem; background: var(--mt-card); max-height: inherit; min-height: 420px;
}

/* Book page look like the PDF screenshot */
.mt-book { max-width: 38rem; margin: 0 auto; text-align: center; }
.mt-book-num {
  font-family: var(--mt-ui); font-size: 1rem; color: var(--mt-ink); margin-bottom: .35rem; font-weight: 700;
}
.mt-book-title {
  font-family: var(--mt-text); font-size: 1.55rem; font-weight: 800; color: var(--mt-rose);
  margin: 0 0 1.1rem; line-height: 1.7;
}
.mt-hadith {
  text-align: right; font-family: var(--mt-text); font-size: 1.28rem; line-height: 2.35;
  margin: 0 0 1.15rem; padding: .55rem .55rem .45rem; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mt-hadith:hover { background: var(--mt-hover); border-color: var(--mt-active-line); }
.mt-hadith.is-active { background: var(--mt-hadith-active); border-color: var(--mt-hadith-active-line); }
.mt-hadith.is-perfect {
  border-color: var(--mt-perfect-line); background: var(--mt-perfect-bg);
}
.mt-hadith.is-done:not(.is-perfect) {
  border-color: var(--mt-done-line); background: var(--mt-done-bg);
}
.mt-hadith-badge {
  position: absolute; top: .35rem; left: .4rem;
  min-width: 1.55rem; height: 1.55rem; padding: 0 .35rem;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mt-ui); font-size: .72rem; font-weight: 800;
  background: var(--mt-badge-bg); color: var(--mt-badge-ink);
}
.mt-hadith-badge.is-perfect {
  background: var(--mt-green); color: #fff; font-size: .95rem;
}
.mt-hadith-stub {
  display: block; width: 100%; margin: 0 0 .55rem; padding: .45rem .65rem;
  border: 1px dashed var(--mt-stub-line); border-radius: 10px; background: var(--mt-stub-bg);
  color: var(--mt-green-deep); font: inherit; font-size: .85rem; font-weight: 800;
  cursor: pointer; text-align: right;
}
.mt-hadith-stub:hover { border-color: var(--mt-green); background: var(--mt-stub-hover); }

.mt-flash.is-ok {
  background: var(--mt-flash-ok-bg); color: var(--mt-green-deep); border-color: var(--mt-flash-ok-line);
}

.mt-score {
  margin-top: .85rem; padding: .65rem .7rem .7rem;
  border: 1px solid var(--mt-line); border-radius: 12px;
  background: var(--mt-score-bg);
}
.mt-score-head {
  font-size: .78rem; font-weight: 800; color: var(--mt-green-deep);
  margin: 0 0 .45rem; letter-spacing: .02em;
}
.mt-score-row {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.mt-score-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  border-radius: 999px; padding: .28rem .55rem;
  font-size: .78rem; font-weight: 700; color: var(--mt-ink);
  background: var(--mt-score-pill); border: 1px solid var(--mt-line);
}
.mt-score-pill b { font-size: .92rem; font-weight: 800; }
.mt-score-hit { border-color: var(--mt-score-hit-line); background: var(--mt-score-hit-bg); color: var(--mt-green-deep); }
.mt-score-miss { border-color: var(--mt-score-miss-line); background: var(--mt-score-miss-bg); color: var(--mt-err); }
.mt-score-perfect { border-color: var(--mt-score-perfect-line); background: var(--mt-score-perfect-bg); color: var(--mt-green-deep); }
.mt-score-acc { color: var(--mt-muted); }
.mt-score-note {
  margin: .45rem 0 0; font-size: .75rem; color: var(--mt-muted); font-weight: 600;
}

.mt-word { display: inline; margin-inline: .06rem; border-radius: 4px; transition: .12s; }
.mt-word.role-ink,
.mt-word.role-num,
.mt-word.role-salaah,
.mt-word.role-mark,
.mt-word.role-punct { color: var(--mt-ink); }
.mt-word.role-quote { color: var(--mt-rose-soft); font-weight: 600; }
.mt-word.role-salaah { font-size: 1.05em; }
.mt-word.is-decor { background: transparent !important; }

.mt-book[data-blank="1"] .mt-word.is-hidden {
  color: transparent !important; background: var(--mt-hide-bg); border-radius: 4px; user-select: none;
}
.mt-book[data-blank="1"] .mt-word.is-decor,
.mt-book[data-blank="1"] .mt-word.role-salaah,
.mt-book[data-blank="1"] .mt-word.role-num,
.mt-book[data-blank="1"] .mt-word.role-punct,
.mt-book[data-blank="1"] .mt-word.role-mark {
  color: var(--mt-ink) !important; background: transparent !important;
  user-select: text;
  box-shadow: none !important;
  min-width: 0 !important;
  display: inline !important;
}
.mt-book[data-blank="1"] .mt-word.is-current.is-decor,
.mt-book[data-blank="1"] .mt-word.is-current.role-num,
.mt-book[data-blank="1"] .mt-word.is-current.role-punct,
.mt-book[data-blank="1"] .mt-word.is-current.role-mark,
.mt-book[data-blank="1"] .mt-word.is-current.role-salaah {
  color: var(--mt-ink) !important; background: transparent !important;
  box-shadow: none !important;
}
.mt-book[data-blank="1"] .mt-word.role-salaah { color: var(--mt-ink) !important; }
.mt-book[data-blank="1"] .mt-word.is-matched { background: transparent; }
.mt-book[data-blank="1"] .mt-word.is-matched.role-quote { color: var(--mt-rose-soft); }
.mt-book[data-blank="1"] .mt-word.is-matched.role-ink,
.mt-book[data-blank="1"] .mt-word.is-matched.role-num,
.mt-book[data-blank="1"] .mt-word.is-matched.role-salaah,
.mt-book[data-blank="1"] .mt-word.is-matched.role-mark { color: var(--mt-ink); }
.mt-book[data-blank="1"] .mt-word.is-current {
  color: transparent !important; background: var(--mt-current); box-shadow: inset 0 -2px 0 var(--mt-rose);
  display: inline-block; min-width: 1.1em;
}
.mt-book[data-blank="0"] .mt-word.is-hidden { color: inherit; background: transparent; }
.mt-word.is-miss { outline: 2px solid var(--mt-err); background: var(--mt-err-bg) !important; color: var(--mt-err) !important; }

.mt-live {
  margin-top: .6rem; padding: .55rem .7rem; border-radius: 10px; background: var(--mt-live-bg);
  border: 1px dashed var(--mt-green); min-height: 2.3rem; font-size: 1.05rem; font-family: var(--mt-text);
}
.mt-live b { color: var(--mt-green-deep); }
.mt-note { font-size: .8rem; color: var(--mt-muted); margin-top: .45rem; }
.mt-chip {
  display: inline-flex; border-radius: 999px; padding: .2rem .55rem;
  background: var(--mt-chip-bg); color: var(--mt-green-deep); font-size: .75rem; font-weight: 700;
}

@media (max-width: 820px) {
  .mt-workspace { max-height: none; }
  .mt-matn { min-height: 320px; }
  .mt-toc-list { max-height: min(55vh, 420px); }
  .mt-book-title { font-size: 1.3rem; }
  .mt-hadith { font-size: 1.12rem; }
  .mt-item { grid-template-columns: 1fr; }
  .mt-book-frame-wrap, .mt-book-frame { height: min(85vh, 700px); min-height: 400px; }
  .mt-head-title { font-size: .75rem; max-width: 55vw; }
  .mt-head { padding: .35rem .55rem; }
  .mt-body { padding: .3rem; }
  .mt-btn-row-main { flex-wrap: nowrap; }
  .mt-btn-row-main .mt-btn:not(.mt-mic-btn):not(.mt-icon-btn) { padding: .26rem .36rem; font-size: .7rem; }
  .mt-btn-row-main .mt-select { max-width: 4.4rem; font-size: .68rem; }
  #mt-mic.mt-mic-btn { width: 2.2rem; height: 2.2rem; min-width: 2.2rem; }
}
