
@font-face {
  font-family: 'Digital Khatt IndoPak';
  src: url('digitalkhatt.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IndoPak Nastaleeq';
  src: url('indopak_nastaleeq.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IndoPak Quran';
  src: url('indopak_v56.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Accessibility & SEO utility classes */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

:root {
    --bg-color: #2c2925;
    --text-color: #000000;
    --primary-color: #8b5a2b;
    --sidebar-bg: #f4e9d8;
    --sidebar-text: #333333;
    --page-bg: #fffbf0;
    --highlight-bg: #e6f2ff;
    
    --frame-outer: #8b6b4a;
    --frame-inner: #d2b48c;
    --frame-bg: #faf0e6;
    
    --line-height: 94px; 
    --column-width: 960px;
    --column-gap: 60px; 
}

[data-theme="dark"] {
    --bg-color: #000000; --text-color: #e8e8e8; --primary-color: #d4a373;
    --sidebar-bg: #1e1e1e; --sidebar-text: #e0e0e0; --page-bg: #121212;
    --highlight-bg: #2d3748; --frame-outer: #3a2e22; --frame-inner: #5c4d3c; --frame-bg: #1a1a1a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif; background-color: var(--bg-color); color: var(--text-color);
    overflow: hidden; display: flex; flex-direction: column;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    width: 100%; max-width: 100vw; min-width: 0;
}

#app {
    display: flex; width: 100%; max-width: 100vw; height: 100%; position: relative;
    min-width: 0; overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px; background-color: var(--sidebar-bg); color: var(--sidebar-text);
    position: fixed; top: 0; right: -300px; height: 100%; z-index: 1000;
    transition: right 0.3s ease; box-shadow: -2px 0 5px rgba(0,0,0,0.5); display: flex; flex-direction: column;
}
.sidebar.open { right: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; background-color: var(--primary-color); color: white; }
.sidebar-content { padding: 15px; overflow-y: auto; flex: 1; }
.nav-section { margin-bottom: 25px; }
.nav-section h3 { margin-bottom: 10px; border-bottom: 1px solid #ccc; padding-bottom: 5px; }
.jump-controls select { width: 100%; padding: 8px; margin-bottom: 10px; border-radius: 4px; }
.settings-controls label { display: block; margin-bottom: 10px; cursor: pointer; }
.btn { background-color: var(--primary-color); color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 1rem; }

/* Main Content */
#main-content {
    flex: 1; display: flex; flex-direction: column;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    width: 100%; max-width: 100vw; min-width: 0; overflow-x: hidden;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%232c2925"/><path d="M0 0h100v100H0z" fill="none" stroke="%233a3631" stroke-width="1"/></svg>'); 
}

/* Fullscreen & Backdrop resets to prevent browser black box glitches */
:fullscreen {
    width: 100% !important;
    height: 100% !important;
    background-color: var(--bg-color) !important;
}
:-webkit-full-screen {
    width: 100% !important;
    height: 100% !important;
    background-color: var(--bg-color) !important;
}
::backdrop {
    background-color: var(--bg-color) !important;
}

header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background-color: var(--frame-outer);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 100;
    flex-shrink: 0;
    gap: 4px;
    direction: ltr;
}

/* Hide upper bar (header) in full screen mode */
:fullscreen header,
:-webkit-full-screen header,
body.fullscreen-mode header {
    display: none !important;
}

/* Page-Attached Navigation Controls (Locked to side of page structure) */
.page-nav-left-anchor {
    position: fixed;
    bottom: 25px;
    z-index: 9998;
    pointer-events: auto;
    transition: left 0.15s ease-out;
}

.page-nav-right-anchor {
    position: fixed;
    bottom: 25px;
    z-index: 9998;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 16px; /* Distance between right arrow button and full screen button */
    direction: ltr;
    white-space: nowrap;
    transition: left 0.15s ease-out;
}

/* Option to hide/show page nav and full screen buttons */
body.hide-page-nav .page-nav-left-anchor,
body.hide-page-nav .page-nav-right-anchor {
    display: none !important;
}

.floating-nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
}

.floating-nav-btn:hover {
    transform: scale(1.1);
    opacity: 1;
    background-color: var(--frame-outer);
}

.floating-nav-btn:active {
    transform: scale(0.95);
}

.fs-toggle-btn {
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 15px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.fs-toggle-btn:hover {
    background-color: var(--frame-outer);
    transform: scale(1.05);
}
.header-left-section {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    gap: 1px;
    align-items: center;
    flex-shrink: 0;
}

.header-tools-group {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.header-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    margin: 0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 1.15rem;
    font-weight: bold;
    color: #fff8e7;
    white-space: nowrap;
    user-select: none;
    pointer-events: auto;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.header-title .title-en {
    font-family: 'Segoe UI', system-ui, sans-serif;
    letter-spacing: 0.5px;
    font-size: 1.05rem;
}

.header-title .title-sep {
    color: rgba(212, 175, 55, 0.85);
    font-size: 1.05rem;
    margin: 0 3px;
    font-weight: 300;
}

.header-title .title-ar {
    font-family: 'Digital Khatt IndoPak', 'Amiri Quran', serif;
    font-size: 1.35rem;
    color: #ffe6a3;
    line-height: 1;
}

.header-right {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Top Bar Metadata Bar */
.header-meta-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-wrap: nowrap;
    user-select: none;
    direction: ltr;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    padding: 1px 3px;
    font-size: 9.5px;
    line-height: 1.1;
    color: #eae5d9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
    height: 20px;
    box-sizing: border-box;
}

.meta-badge:hover {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.35);
}

.meta-badge.badge-surah {
    background: rgba(139, 90, 43, 0.45);
    border-color: rgba(212, 175, 55, 0.65);
    color: #fff9ed;
}

.meta-badge .meta-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.meta-badge .meta-val {
    font-weight: 700;
    color: #ffffff;
    font-size: 9.5px;
}

.meta-badge.badge-surah .meta-val {
    font-size: 10px;
    color: #ffe6a3;
}

/* Info Badge for Total Verses (distinct informational appearance) */
.meta-badge.meta-info-badge {
    background: rgba(35, 85, 135, 0.5);
    border-color: rgba(100, 190, 255, 0.6);
    color: #e1f2ff;
    border-radius: 10px;
    padding: 1px 4px;
    font-size: 9.5px;
    gap: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 0 5px rgba(100, 190, 255, 0.15);
}

.meta-badge.meta-info-badge:hover {
    background: rgba(45, 105, 160, 0.65);
    border-color: rgba(140, 215, 255, 0.85);
}

.meta-info-badge .meta-info-icon {
    font-size: 9px;
    color: #7ecef4;
}

.meta-info-badge .meta-val {
    color: #ffffff;
    font-weight: 700;
    font-size: 9.5px;
}

.meta-info-badge .meta-unit {
    color: #b8e2fb;
    font-size: 8.5px;
    font-weight: 500;
}

/* Multi-Surah Header Selector & Pills */
.surah-multi-selector {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.surah-pill-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0d9cb;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.2;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.surah-pill-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.surah-pill-btn.active {
    background: rgba(212, 175, 55, 0.35);
    border-color: rgba(255, 230, 163, 0.85);
    color: #ffe6a3;
    font-weight: 700;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

.surah-more-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffe6a3;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 10px;
    cursor: pointer;
    line-height: 1.2;
    font-family: inherit;
}

.surah-more-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: rgba(255, 230, 163, 0.6);
}

.surah-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #2c2925;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    min-width: 175px;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}

.surah-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    font-size: 11.5px;
    color: #e0d9cb;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.15s;
    font-family: inherit;
}

.surah-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.surah-dropdown-item.active {
    background: rgba(212, 175, 55, 0.25);
    color: #ffe6a3;
    font-weight: bold;
}

.meta-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 2px;
    flex-shrink: 0;
}

.header-jump-group {
    display: flex;
    gap: 1px;
    align-items: center;
}

.header-select {
    padding: 1px 2px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.3);
    background-color: rgba(0,0,0,0.25);
    color: white;
    font-size: 10px;
    cursor: pointer;
    outline: none;
    height: 23px;
    box-sizing: border-box;
}

.header-select option {
    background-color: #2c2925;
    color: white;
}

#surah-select {
    width: 84px;
    max-width: 84px;
}

#ayah-select {
    width: 40px;
    max-width: 40px;
    text-align: center;
}

.header-btn {
    background-color: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 1px 3px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    min-width: 20px;
    height: 23px;
    box-sizing: border-box;
}

.header-tools-group .header-btn {
    min-width: 19px;
    width: 20px;
    height: 23px;
    padding: 1px 2px;
    font-size: 9.5px;
}

.header-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

.header-btn.active {
    background-color: var(--primary-color);
    border-color: white;
}

.header-btn .btn-text {
    display: none;
}

/* Header Zoom Controls */
.header-zoom-group {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    padding: 0 1px;
    gap: 1px;
    height: 23px;
    box-sizing: border-box;
}

.header-zoom-group .zoom-btn {
    background: transparent;
    border: none;
    padding: 0 1px;
    font-size: 8.5px;
    min-width: 15px;
    min-height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    color: white;
    transition: background-color 0.15s;
}

.header-zoom-group .zoom-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.zoom-val-badge {
    font-size: 8.5px;
    color: #f0e6d6;
    padding: 0 1px;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.zoom-val-badge:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .header-btn span.btn-text {
        display: none;
    }
}

/* Viewport and Layout */
.reader-container {
    flex: 1; 
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
}

.book-scale-wrapper {
    position: relative;
    margin: 0 auto;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible;
}

.book-wrapper {
    position: relative; 
    display: flex; 
    justify-content: center; 
    margin: 0 auto;
    transform-origin: top center;
    transition: transform 0.15s ease-out;
}

.frames-container { display: flex; gap: var(--column-gap); }

.page-frame {
    background-color: var(--frame-outer); padding: 10px; border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    width: calc(var(--column-width) + 40px);
    display: flex; flex-direction: column;
}

.page-inner-frame { background-color: var(--frame-inner); padding: 4px; border: 2px solid #5a4027; }
.page-content-bg { background-color: var(--frame-bg); height: calc(16 * var(--line-height)); border: 2px solid #5a4027; }

.page-footer { text-align: center; color: white; font-weight: bold; margin-top: 5px; font-size: 16px; }

.viewport {
    position: absolute;
    top: 16px;
    height: calc(16 * var(--line-height));
    width: var(--column-width);
    overflow: hidden; scroll-behavior: smooth; transition: width 0.3s;
}

.book-wrapper.split-screen .viewport {
    width: calc(2 * var(--column-width) + var(--column-gap) + 40px); 
}

.quran-text {
    height: calc(16 * var(--line-height));
    column-width: var(--column-width);
    column-gap: calc(var(--column-gap) + 40px); 
    column-fill: auto;
    
    font-family: 'Digital Khatt IndoPak', 'IndoPak Nastaleeq', 'IndoPak Quran', serif;
    font-size: 32px; 
    line-height: var(--line-height);
    text-align: justify;
    text-align-last: center;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-ligatures: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
    direction: rtl; color: var(--text-color);
}

.surah-intro-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: var(--line-height);
    box-sizing: border-box;
    padding: 2px 0;
    break-inside: avoid;
    page-break-inside: avoid;
}

.surah-intro-block.no-bismillah {
    justify-content: center;
}

.surah-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid var(--primary-color);
    outline: 1px solid rgba(139, 90, 43, 0.45);
    outline-offset: -4px;
    background: linear-gradient(180deg, rgba(210, 180, 140, 0.22) 0%, rgba(245, 235, 220, 0.5) 50%, rgba(210, 180, 140, 0.22) 100%);
    box-shadow: inset 0 0 10px rgba(139, 90, 43, 0.12), 0 2px 4px rgba(0,0,0,0.06);
    border-radius: 4px;
    width: calc(100% - 24px);
    max-width: 100%;
    margin: 0 auto;
    height: 46px;
    line-height: 42px;
    padding: 0 15px 2px 15px;
    box-sizing: border-box;
    color: var(--text-color);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
}

.surah-header .surah-ornament {
    color: var(--primary-color);
    font-size: 20px;
    opacity: 0.85;
}

.surah-intro-block.no-bismillah .surah-header {
    height: 62px;
    line-height: 58px;
    font-size: 27px;
}

[data-theme='dark'] .surah-header {
    background: linear-gradient(180deg, rgba(60, 45, 30, 0.4) 0%, rgba(40, 30, 20, 0.6) 50%, rgba(60, 45, 30, 0.4) 100%);
    outline-color: rgba(212, 163, 115, 0.4);
    box-shadow: inset 0 0 10px rgba(212, 163, 115, 0.15), 0 2px 4px rgba(0,0,0,0.4);
}

.bismillah {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    font-size: 22px;
    width: 100%;
    height: 42px;
    line-height: 42px;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
}

.bismillah::before, .bismillah::after {
    content: '';
    display: inline-block;
    width: 75px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    vertical-align: middle;
}

.rub-el-hizb {
    color: var(--primary-color);
    margin: 0 6px 0 2px;
    font-family: inherit;
    display: inline-block;
    vertical-align: baseline;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
}

.ayah-marker { color: var(--primary-color); margin: 0 5px; font-family: inherit; }

.ayah-marker-badge {
    display: inline-block;
    position: relative;
    vertical-align: baseline;
    text-align: center;
    margin: 0 3px;
    white-space: nowrap;
}

.ayah-stop-above {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.82em;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-color) !important;
    pointer-events: none;
    font-family: inherit;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
}

.ayah-number-box {
    display: inline-block;
    line-height: inherit;
    white-space: nowrap;
    color: var(--primary-color);
}

.sub-ayah-badge {
    display: inline-block;
    position: relative;
    vertical-align: baseline;
    text-align: center;
    margin: 0 2px;
    white-space: nowrap;
}

.sub-ayah-stop-above {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.82em;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-color) !important;
    pointer-events: none;
    font-family: inherit;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
}

.sub-ayah-symbol {
    display: inline-block;
    line-height: inherit;
    white-space: nowrap;
    color: var(--primary-color);
}

.highlight { background-color: var(--highlight-bg); }

.search-results-container { position: absolute; top: 60px; left: 20px; right: 20px; bottom: 20px; background: var(--page-bg); border: 1px solid var(--primary-color); border-radius: 8px; z-index: 500; display: flex; flex-direction: column; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.search-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #ccc; background: var(--sidebar-bg); }
.search-box { display: flex; gap: 5px; flex: 1; max-width: 400px; margin-right: 15px; }
.search-box input { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
#search-results { flex: 1; overflow-y: auto; padding: 20px; }
.search-result-item { padding: 15px; border-bottom: 1px solid #ccc; cursor: pointer; }
.search-result-item:hover { background-color: var(--highlight-bg); }
.search-result-ayah { font-family: 'Digital Khatt IndoPak', 'IndoPak Nastaleeq', serif; font-size: 1.2em; direction: rtl; margin-bottom: 5px; }

/* Responsive & Mobile Optimization */
@media (max-width: 1050px) { 
    #frame-left { display: none !important; } 
    .book-wrapper.split-screen .viewport { width: var(--column-width); } 
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        padding: 6px 8px;
        gap: 6px;
        direction: ltr !important;
    }

    .header-left-section {
        display: contents;
    }

    /* Row 1 in Mobile Header: Title on left, tool icons on right */
    .header-center {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-start;
        margin: 0;
        position: static;
        transform: none;
        pointer-events: auto;
    }
    .header-title {
        font-size: 0.95rem;
        gap: 3px;
        white-space: nowrap;
    }
    .header-title .title-en {
        font-size: 0.9rem;
    }
    .header-title .title-ar {
        font-size: 1.1rem;
    }

    .header-tools-group {
        order: 2;
        display: inline-flex;
        gap: 3px;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }
    .header-tools-group #split-screen-btn {
        display: none !important;
    }
    .header-tools-group .header-btn {
        min-width: 30px;
        height: 30px;
        padding: 4px 6px;
        font-size: 11px;
    }
    .header-zoom-group {
        padding: 1px 3px;
        gap: 2px;
    }
    .zoom-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .zoom-val-badge {
        font-size: 10px;
        min-width: 32px;
    }

    /* Row 2 in Mobile Header: Full-width Metadata Bar */
    .header-right {
        order: 3;
        width: 100%;
        flex: 1 1 100%;
        justify-content: flex-start;
        overflow: hidden;
        padding: 2px 0;
    }
    .header-meta-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
        gap: 4px;
    }
    .header-meta-bar::-webkit-scrollbar {
        display: none;
    }
    .meta-badge {
        padding: 2px 6px;
        font-size: 11px;
        gap: 3px;
        flex-shrink: 0;
    }
    .meta-badge .meta-label {
        font-size: 8.5px;
    }
    .meta-badge .meta-val {
        font-size: 11px;
    }
    .meta-badge.badge-surah .meta-val {
        font-size: 11.5px;
    }

    /* Row 3 in Mobile Header: Surah / Ayah jump & Audio controls */
    .header-left {
        order: 4;
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        gap: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 5px;
        direction: ltr !important;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    .header-left::-webkit-scrollbar {
        display: none;
    }
    .header-jump-group {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    .header-jump-group #surah-select {
        min-width: 95px;
        max-width: 125px;
        padding: 5px 6px;
        font-size: 11.5px;
        direction: ltr;
    }
    .header-jump-group #ayah-select {
        min-width: 55px;
        max-width: 65px;
        padding: 5px 4px;
        font-size: 11.5px;
        direction: ltr;
    }
    .header-jump-group #jump-btn {
        padding: 5px 8px;
        font-size: 11px;
        min-height: 30px;
        min-width: 30px;
    }
    .header-left .header-btn {
        min-height: 30px;
        min-width: 30px;
        height: 30px;
        padding: 0 8px;
        font-size: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .header-left .header-btn span.btn-text {
        display: none !important;
    }
    .header-audio-sep {
        display: none;
    }

    /* Mobile Reader Container */
    .reader-container {
        padding: 8px 4px 65px 4px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    :fullscreen,
    :-webkit-full-screen,
    body.fullscreen-mode {
        background-color: var(--frame-bg) !important;
    }
    :fullscreen #main-content,
    :-webkit-full-screen #main-content,
    body.fullscreen-mode #main-content,
    :fullscreen .reader-container,
    :-webkit-full-screen .reader-container,
    body.fullscreen-mode .reader-container {
        background: var(--frame-bg) !important;
        background-image: none !important;
    }
    :fullscreen .reader-container,
    :-webkit-full-screen .reader-container,
    body.fullscreen-mode .reader-container {
        padding: 12px 4px 35px 4px !important;
        justify-content: center !important;
        align-items: center !important;
    }
    [data-theme="dark"]:fullscreen,
    [data-theme="dark"]:-webkit-full-screen,
    [data-theme="dark"] body.fullscreen-mode,
    [data-theme="dark"] body.fullscreen-mode #main-content,
    [data-theme="dark"] body.fullscreen-mode .reader-container {
        background: #121212 !important;
        background-image: none !important;
    }
    .book-scale-wrapper {
        margin: auto !important;
        flex-shrink: 0 !important;
    }
    .book-wrapper {
        flex-shrink: 0;
    }

    /* Mobile Page Nav Anchors (Bottom edges of screen) */
    .page-nav-left-anchor {
        bottom: 12px;
        left: 10px !important;
    }
    .page-nav-right-anchor {
        bottom: 12px;
        left: auto !important;
        right: 10px !important;
        gap: 8px;
    }
    .floating-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    .fs-toggle-btn {
        padding: 10px 14px;
        font-size: 12px;
    }

    /* Mobile Search Results */
    .search-results-container {
        top: 10px;
        left: 8px;
        right: 8px;
        bottom: 10px;
    }
    .search-header {
        padding: 8px 12px;
    }
}

/* ========================================================
   Interactive Ayah Study & Recitation Styles
   ======================================================== */

/* Light shade highlight in Mushaf text when verse is reciting */
.ayah.audio-playing-verse {
    background: rgba(212, 175, 55, 0.28) !important;
    border-radius: 5px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.42);
    transition: background 0.35s ease, box-shadow 0.35s ease;
    animation: naturalVerseBreathe 3.5s infinite ease-in-out;
}

@keyframes naturalVerseBreathe {
    0%, 100% { background: rgba(212, 175, 55, 0.26); box-shadow: 0 0 10px rgba(212, 175, 55, 0.38); }
    50% { background: rgba(212, 175, 55, 0.34); box-shadow: 0 0 16px rgba(212, 175, 55, 0.52); }
}

[data-theme="dark"] .ayah.audio-playing-verse {
    background: rgba(255, 230, 163, 0.22) !important;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
    animation: naturalVerseBreatheDark 3.5s infinite ease-in-out;
}

@keyframes naturalVerseBreatheDark {
    0%, 100% { background: rgba(255, 230, 163, 0.20); box-shadow: 0 0 10px rgba(255, 215, 0, 0.28); }
    50% { background: rgba(255, 230, 163, 0.28); box-shadow: 0 0 16px rgba(255, 215, 0, 0.45); }
}

/* Header Study Mode Button */
.header-btn#study-mode-btn {
    transition: all 0.2s ease;
}

.header-btn#study-mode-btn.active {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(255, 230, 163, 0.85);
    color: #ffe6a3;
    font-weight: 600;
}

/* Ayah Study Modal Overlay */
.ayah-study-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 10005;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    animation: fadeInStudy 0.2s ease-out;
}

@keyframes fadeInStudy {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Sheet Container */
.ayah-study-sheet {
    background: var(--page-bg, #fffbf0);
    color: #1a1815;
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
    border-top: 3px solid #d4af37;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpStudy 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpStudy {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

[data-theme="dark"] .ayah-study-sheet {
    background: #181614;
    color: #f0ebe1;
    border-top: 3px solid #d4af37;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.85);
}

/* Header */
.ayah-study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f5efe3;
    border-bottom: 1px solid #e3d7c3;
}

[data-theme="dark"] .ayah-study-header {
    background: #23201c;
    border-bottom: 1px solid #38332c;
}

.ayah-study-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    direction: ltr;
}

.ayah-study-surah-badge {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: #8b5a2b;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Amiri Quran", sans-serif;
}

[data-theme="dark"] .ayah-study-surah-badge {
    background: rgba(212, 175, 55, 0.25);
    color: #ffe6a3;
    border-color: rgba(255, 230, 163, 0.6);
}

.ayah-study-verse-badge {
    font-size: 13.5px;
    font-weight: 700;
    color: #594f46;
    line-height: 1.4;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Amiri Quran", sans-serif;
}

[data-theme="dark"] .ayah-study-verse-badge {
    color: #cfc6b8;
}

.ayah-study-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.study-pill-btn {
    background: #eadecb;
    border: 1px solid #d0c2aa;
    color: #2b2520;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.study-pill-btn.active {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #1b5e20;
}

[data-theme="dark"] .study-pill-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f0ebe1;
}

[data-theme="dark"] .study-pill-btn.active {
    background: rgba(76, 175, 80, 0.25);
    border-color: #81c784;
    color: #a5d6a7;
}

.study-close-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    color: #4a3e35;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.study-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .study-close-btn {
    color: #cfc6b8;
}

[data-theme="dark"] .study-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Body */
.ayah-study-body {
    padding: 14px 18px 24px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Audio Toolbar */
.ayah-audio-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f3e8;
    border: 1px solid #dcd1be;
    border-radius: 10px;
    padding: 8px 12px;
}

[data-theme="dark"] .ayah-audio-bar {
    background: #23201c;
    border-color: #38332c;
}

.study-play-main-btn {
    background: #8b5a2b;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.study-play-main-btn:hover {
    background: #a46d37;
}

.study-play-main-btn.playing {
    background: #c62828;
}

.study-stop-main-btn {
    background: #6e5e4e;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    opacity: 0.88;
}

.study-stop-main-btn:hover {
    background: #c62828;
    color: #ffffff;
    opacity: 1;
    transform: scale(1.02);
}

.study-stop-main-btn.active-stop {
    background: #c62828;
    opacity: 1;
}

[data-theme="dark"] .study-stop-main-btn {
    background: #473e34;
    color: #f0e6d6;
}

[data-theme="dark"] .study-stop-main-btn:hover {
    background: #d32f2f;
    color: #ffffff;
}

.ayah-audio-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

#study-audio-status {
    font-size: 11.5px;
    color: #5a4e42;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#study-audio-status:empty {
    display: none;
}

[data-theme="dark"] #study-audio-status {
    color: #cfc6b8;
}

.audio-progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

[data-theme="dark"] .audio-progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

.audio-progress-fill {
    height: 100%;
    width: 0%;
    background: #d4af37;
    transition: width 0.15s linear;
}

/* Arabic Text Box */
.ayah-arabic-box {
    font-family: 'Digital Khatt IndoPak', 'IndoPak Nastaleeq', 'IndoPak Quran', serif;
    font-size: 32px;
    line-height: 2.2;
    text-align: right;
    color: var(--text-color, #000000);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-ligatures: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
    direction: rtl;
    padding: 8px 12px;
    word-spacing: 2px;
}

[data-theme="dark"] .ayah-arabic-box {
    color: #ffe6a3;
}

.study-verse-word {
    display: inline-block;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.study-verse-word:hover {
    background-color: rgba(212, 175, 55, 0.22);
}

.study-verse-word.playing {
    background-color: rgba(212, 175, 55, 0.4) !important;
    color: #8b5a2b !important;
    border-radius: 4px;
}

[data-theme="dark"] .study-verse-word.playing {
    background-color: rgba(212, 175, 55, 0.35) !important;
    color: #ffe6a3 !important;
}

/* English Translation Box */
.ayah-translation-box {
    background: #f5eedf;
    border-left: 4px solid #b8861b;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
}

[data-theme="dark"] .ayah-translation-box {
    background: #23201c;
    border-left-color: #d4af37;
}

.ayah-trans-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.ayah-trans-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b5a2b;
}

[data-theme="dark"] .ayah-trans-tag {
    color: #ffd875;
}

.ayah-trans-text {
    font-size: 15px;
    line-height: 1.6;
    color: #241e19;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] .ayah-trans-text {
    color: #f5f2eb;
}

/* Word-by-Word Section */
.ayah-wbw-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ayah-wbw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ayah-wbw-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b5a2b;
}

[data-theme="dark"] .ayah-wbw-tag {
    color: #ffd875;
}

.ayah-wbw-hint {
    font-size: 11.5px;
    color: #6b5c4f;
}

[data-theme="dark"] .ayah-wbw-hint {
    color: #b3a898;
}

/* Active Word Callout */
.study-word-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7eed7;
    border: 1.5px solid #d4af37;
    border-radius: 8px;
    padding: 8px 12px;
    animation: fadeInCallout 0.2s ease;
}

@keyframes fadeInCallout {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .study-word-callout {
    background: #26221b;
    border-color: #8c7330;
}

.callout-word-arabic {
    font-family: 'Digital Khatt IndoPak', 'IndoPak Nastaleeq', 'IndoPak Quran', serif;
    font-size: 32px;
    line-height: 1.5;
    color: var(--text-color, #000000);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-ligatures: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
    direction: rtl;
    padding: 0 8px;
}

[data-theme="dark"] .callout-word-arabic {
    color: #ffe6a3;
}

.callout-word-details {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.callout-word-tl {
    font-size: 12px;
    font-weight: 600;
    color: #594f46;
}

[data-theme="dark"] .callout-word-tl {
    color: #dcd4c7;
}

.callout-word-tr {
    font-size: 13.5px;
    font-weight: 700;
    color: #8b5a2b;
}

[data-theme="dark"] .callout-word-tr {
    color: #ffe6a3;
}

.callout-audio-btn {
    background: #8b5a2b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.callout-audio-btn:hover {
    transform: scale(1.08);
}

/* Word Chips Flow */
.ayah-wbw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    direction: rtl;
    padding: 4px 0;
}

.wbw-word-chip {
    background: #ffffff;
    border: 1px solid #dcd1be;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 75px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .wbw-word-chip {
    background: #221f1c;
    border-color: #3d362c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.wbw-word-chip:hover {
    background: #fff8e7;
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .wbw-word-chip:hover {
    background: #2e2922;
    border-color: #997c36;
}

/* Light shade highlight when playing word */
.wbw-word-chip.playing {
    background: #fff0c7 !important;
    border-color: #d4af37 !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    transform: translateY(-2px) scale(1.03);
}

[data-theme="dark"] .wbw-word-chip.playing {
    background: #3d331c !important;
    border-color: #e6be58 !important;
    box-shadow: 0 0 12px rgba(230, 190, 88, 0.4);
}

.wbw-ar {
    font-family: 'Digital Khatt IndoPak', 'IndoPak Nastaleeq', 'IndoPak Quran', serif;
    font-size: 28px;
    line-height: 1.5;
    color: var(--text-color, #000000);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-ligatures: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ccmp" 1, "mark" 1, "mkmk" 1;
    direction: rtl;
    text-align: center;
}

[data-theme="dark"] .wbw-ar {
    color: #ffe6a3;
}

.wbw-tl {
    font-size: 11px;
    color: #594f46;
    direction: ltr;
    margin-top: 2px;
}

[data-theme="dark"] .wbw-tl {
    color: #b5aba0;
}

.wbw-tr {
    font-size: 11.5px;
    font-weight: 700;
    color: #8b5a2b;
    direction: ltr;
    text-align: center;
    margin-top: 2px;
}

[data-theme="dark"] .wbw-tr {
    color: #ffd875;
}

.wbw-audio-icon {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 9px;
    color: #9c8a77;
}

[data-theme="dark"] .wbw-audio-icon {
    color: #7d7265;
}

.wbw-word-chip:hover .wbw-audio-icon {
    color: #b8861b;
}

/* Responsive adjust for Desktop */
@media (min-width: 769px) {
    .ayah-study-modal-overlay {
        align-items: center;
    }
    .ayah-study-sheet {
        border-radius: 16px;
        max-height: 80vh;
        border: 1px solid rgba(212, 175, 55, 0.6);
    }
}

/* ========================================================
   Header Play & Recitation Range Controls
   ======================================================== */
#header-play-btn {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

#header-play-btn.playing {
    background-color: #2e7d32 !important;
    border-color: #a5d6a7 !important;
    color: #ffffff !important;
    animation: pulseHeaderPlay 1.8s infinite;
}

@keyframes pulseHeaderPlay {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#header-stop-btn {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
    opacity: 0.85;
}

#header-stop-btn:hover {
    background-color: rgba(198, 40, 40, 0.5) !important;
    border-color: #ef5350 !important;
    color: #ffffff !important;
    opacity: 1;
}

#header-stop-btn.active-stop {
    background-color: #c62828 !important;
    border-color: #ef5350 !important;
    color: #ffffff !important;
    opacity: 1;
}

#open-range-play-btn {
    background-color: rgba(63, 81, 181, 0.22);
    border: 1px solid rgba(159, 168, 218, 0.45);
    color: #e8eaf6;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

#open-range-play-btn:hover {
    background-color: rgba(63, 81, 181, 0.45);
    border-color: #c5cae9;
    color: #ffffff;
}

#open-range-play-btn.active-range {
    background-color: #3949ab !important;
    border-color: #e8eaf6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(63, 81, 181, 0.6);
}

/* Full Surah Audio Button (Quran.com Live Stream) */
#open-qari-audio-btn {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(184, 134, 11, 0.42));
    border: 1px solid rgba(255, 215, 0, 0.65);
    color: #fff9e6;
    font-weight: 600;
    transition: all 0.2s ease;
}

#open-qari-audio-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.52), rgba(184, 134, 11, 0.68));
    border-color: #ffd700;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

#open-qari-audio-btn.playing {
    background: linear-gradient(135deg, #d4af37, #b8860b) !important;
    border-color: #fff8e1 !important;
    color: #1a1815 !important;
    font-weight: 700 !important;
    animation: pulseQariBtn 1.8s infinite;
}

@keyframes pulseQariBtn {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.8); }
    70% { box-shadow: 0 0 0 7px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.header-audio-sep {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 1px;
    flex-shrink: 0;
}

@media (min-width: 1140px) {
    #header-play-btn .btn-text,
    #header-stop-btn .btn-text,
    #open-range-play-btn .btn-text,
    #open-qari-audio-btn .btn-text {
        display: inline;
        font-size: 9px;
        margin-left: 1px;
    }
}

@media (max-width: 1340px) {
    .header-center {
        position: static;
        transform: none;
        margin: 0 auto;
        padding: 0 4px;
    }
}

/* ========================================================
   Recitation Range & Repeat Modal
   ======================================================== */
.range-modal-sheet {
    direction: ltr;
    max-width: 740px;
    width: 95%;
    max-height: 88vh;
    border-radius: 16px;
    background: #fffbf0;
    color: #1a1815;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.65);
    border-top: 4px solid #d4af37;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[data-theme="dark"] .range-modal-sheet {
    background: #181614;
    color: #f2ede4;
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-top: 4px solid #d4af37;
}

.range-modal-badge {
    background: rgba(212, 175, 55, 0.18);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #8b5a2b;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .range-modal-badge {
    color: #ffd875;
    background: rgba(212, 175, 55, 0.22);
}

.range-modal-sub {
    font-size: 13px;
    font-weight: 600;
    color: #63584e;
}

[data-theme="dark"] .range-modal-sub {
    color: #c7beaf;
}

.range-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* Presets */
.range-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.range-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a6e60;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

[data-theme="dark"] .range-section-label {
    color: #a89d8f;
}

.range-presets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.range-preset-chip {
    background: #f0e6d2;
    border: 1px solid #dcd0bc;
    color: #4a3e33;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.range-preset-chip:hover {
    background: #e8dbbf;
    border-color: #c2b093;
}

.range-preset-chip.active {
    background: #8b5a2b;
    border-color: #6e431c;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(139, 90, 43, 0.3);
}

[data-theme="dark"] .range-preset-chip {
    background: #2a2621;
    border-color: #423b32;
    color: #e0d8cb;
}

[data-theme="dark"] .range-preset-chip:hover {
    background: #36312a;
    border-color: #574e43;
}

[data-theme="dark"] .range-preset-chip.active {
    background: #d4af37;
    border-color: #e6c86e;
    color: #1a160d;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* Range Selectors Grid */
.range-selectors-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    background: #f7f1e4;
    border: 1px solid #e2d6c1;
    border-radius: 12px;
    padding: 12px 14px;
}

[data-theme="dark"] .range-selectors-grid {
    background: #221f1a;
    border-color: #38332a;
}

.range-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.range-col-title {
    font-size: 12px;
    font-weight: 700;
    color: #6e5e4e;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .range-col-title {
    color: #d1c4b2;
}

.range-arrow-divider {
    color: #bfa15f;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.range-field-row {
    display: flex;
    gap: 8px;
}

.range-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.field-label {
    font-size: 11px;
    font-weight: 600;
    color: #8c7e6e;
}

[data-theme="dark"] .field-label {
    color: #9e9180;
}

.range-select {
    width: 100%;
    padding: 7px 8px;
    border-radius: 6px;
    border: 1px solid #c9bca9;
    background-color: #ffffff;
    color: #24201a;
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
}

[data-theme="dark"] .range-select {
    background-color: #2d2923;
    border-color: #4f473c;
    color: #f7f3ec;
}

/* Options Grid */
.range-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.range-option-card {
    background: #fbf7ee;
    border: 1px solid #e8decb;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

[data-theme="dark"] .range-option-card {
    background: #201d19;
    border-color: #38332a;
}

.option-title {
    font-size: 12px;
    font-weight: 700;
    color: #5c4e3f;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .option-title {
    color: #decbb5;
}

.option-hint {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: normal;
    color: #8c7c6c;
}

[data-theme="dark"] .option-hint {
    color: #9e8e7c;
}

.repeat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.repeat-pill {
    flex: 1;
    min-width: 38px;
    background: #eee4ce;
    border: 1px solid #d4c6a9;
    color: #4a3e33;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.repeat-pill:hover {
    background: #e3d6bc;
}

.repeat-pill.active {
    background: #8b5a2b;
    border-color: #6e431c;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(139, 90, 43, 0.25);
}

[data-theme="dark"] .repeat-pill {
    background: #2b2721;
    border-color: #453e34;
    color: #ded6c8;
}

[data-theme="dark"] .repeat-pill:hover {
    background: #37322a;
}

[data-theme="dark"] .repeat-pill.active {
    background: #d4af37;
    border-color: #e6c86e;
    color: #1a160d;
}

/* Trim Mode Selector & Status Badges */
.trim-mode-wrapper {
    width: 100%;
}

.trim-mode-select {
    width: 100%;
    font-size: 11.5px;
    font-weight: 600;
}

.range-status-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-trim-indicator {
    font-size: 11px;
    font-weight: 700;
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.12);
    border: 1px solid rgba(46, 125, 50, 0.35);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

[data-theme="dark"] .range-trim-indicator {
    color: #81c784;
    background: rgba(46, 125, 50, 0.22);
    border-color: rgba(129, 199, 132, 0.4);
}

/* Status Box */
.range-status-box {
    background: #f5efe3;
    border: 1px solid #dfd3bc;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

[data-theme="dark"] .range-status-box {
    background: #24201a;
    border-color: #3d362b;
}

.range-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.range-summary-badge {
    font-size: 12px;
    font-weight: 700;
    color: #8b5a2b;
}

[data-theme="dark"] .range-summary-badge {
    color: #ffd875;
}

.range-live-counter {
    font-size: 11.5px;
    font-weight: 600;
    color: #615547;
}

[data-theme="dark"] .range-live-counter {
    color: #b8ac9c;
}

.range-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2d6c1;
    border-radius: 3px;
    overflow: hidden;
}

[data-theme="dark"] .range-progress-bar {
    background: #363026;
}

.range-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #2e7d32);
    border-radius: 3px;
    transition: width 0.15s linear;
}

.range-active-verse-status {
    font-size: 12px;
    color: #4a3e33;
    font-style: italic;
    min-height: 16px;
}

[data-theme="dark"] .range-active-verse-status {
    color: #c7bea9;
}

/* Footer Buttons */
.range-modal-footer {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f5efe3;
    border-top: 1px solid #e3d7c3;
    justify-content: flex-end;
}

[data-theme="dark"] .range-modal-footer {
    background: #23201c;
    border-top: 1px solid #38332c;
}

.range-footer-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    border: none;
    box-sizing: border-box;
}

.range-footer-btn.primary {
    background: #2e7d32;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.35);
    flex: 1.5;
    justify-content: center;
}

.range-footer-btn.primary:hover {
    background: #256628;
}

.range-footer-btn.primary.playing {
    background: #e65100;
    box-shadow: 0 2px 6px rgba(230, 81, 0, 0.4);
}

.range-footer-btn.secondary {
    background: #e6dcc6;
    color: #4a3e33;
    border: 1px solid #cfc2a5;
}

.range-footer-btn.secondary:hover {
    background: #ded1b8;
}

[data-theme="dark"] .range-footer-btn.secondary {
    background: #332e26;
    color: #e3d9cb;
    border-color: #4c4438;
}

[data-theme="dark"] .range-footer-btn.secondary:hover {
    background: #403a30;
}

.range-footer-btn.danger {
    background: #c62828;
    color: #ffffff;
}

.range-footer-btn.danger:hover {
    background: #b71c1c;
}

@media (max-width: 600px) {
    .range-selectors-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .range-arrow-divider {
        transform: rotate(90deg);
        padding: 4px 0;
    }
    .range-options-grid {
        grid-template-columns: 1fr;
    }
    .range-modal-footer {
        flex-wrap: wrap;
    }
    .range-footer-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
    }
    .range-footer-btn.primary {
        flex-basis: 100%;
        order: -1;
    }
}

/* ========================================================
   Full Surah Audio Modal (Quran.com Live Stream)
   ======================================================== */
.modal-overlay,
.qari-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    z-index: 10005 !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    box-sizing: border-box;
}

@keyframes qariFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.qari-modal-sheet {
    direction: ltr;
    max-width: 840px;
    width: 95%;
    max-height: 88vh;
    border-radius: 16px;
    background: #fffdf5;
    color: #1a1815;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.7);
    border-top: 5px solid #d4af37;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    animation: qariFadeIn 0.22s ease-out;
}

[data-theme="dark"] .qari-modal-sheet {
    background: #191714;
    color: #f5f0e6;
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-top: 5px solid #d4af37;
}

.qari-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 20px 12px;
    border-bottom: 1px solid #e9dfcc;
    background: #fbf6ec;
}

[data-theme="dark"] .qari-modal-header {
    background: #23201b;
    border-bottom: 1px solid #3d362c;
}

.qari-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qari-badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.qari-modal-badge {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: #8b5a2b;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .qari-modal-badge {
    color: #ffd875;
    background: rgba(212, 175, 55, 0.22);
}

.qari-distinct-pill {
    background: rgba(21, 101, 192, 0.12);
    border: 1px solid rgba(21, 101, 192, 0.4);
    color: #1565c0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

[data-theme="dark"] .qari-distinct-pill {
    background: rgba(33, 150, 243, 0.18);
    border-color: rgba(33, 150, 243, 0.5);
    color: #90caf9;
}

.qari-modal-title {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 800;
    color: #3e2723;
    letter-spacing: -0.2px;
}

[data-theme="dark"] .qari-modal-title {
    color: #ffecb3;
}

.qari-modal-subtitle {
    font-size: 12px;
    color: #6d5b4b;
}

[data-theme="dark"] .qari-modal-subtitle {
    color: #b5a796;
}

/* Modal Body */
.qari-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Controls Row */
.qari-controls-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 14px;
    align-items: end;
}

.qari-input-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #5d4037;
}

[data-theme="dark"] .qari-input-label {
    color: #e0d5c3;
}

.qari-select {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #d5c8b2;
    background: #ffffff;
    color: #2b2520;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
}

[data-theme="dark"] .qari-select {
    background: #2b2621;
    border-color: #4a4135;
    color: #f7f1e6;
}

.qari-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.qari-search-icon {
    position: absolute;
    left: 12px;
    color: #8b5a2b;
    font-size: 13px;
    pointer-events: none;
}

[data-theme="dark"] .qari-search-icon {
    color: #d4af37;
}

#qari-search-input {
    width: 100%;
    height: 38px;
    padding: 6px 36px 6px 34px;
    border-radius: 8px;
    border: 1px solid #d5c8b2;
    background: #ffffff;
    color: #2b2520;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#qari-search-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

[data-theme="dark"] #qari-search-input {
    background: #2b2621;
    border-color: #4a4135;
    color: #f7f1e6;
}

[data-theme="dark"] #qari-search-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35);
}

.qari-search-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #8b7d6b;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.qari-search-clear:hover {
    color: #c62828;
}

/* Reciter Section Header */
.qari-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ebdcc7;
}

[data-theme="dark"] .qari-list-header {
    border-bottom-color: #3b3429;
}

.qari-section-heading {
    font-size: 13px;
    font-weight: 700;
    color: #4e342e;
}

[data-theme="dark"] .qari-section-heading {
    color: #ffd875;
}

.qari-count-chip {
    font-size: 11.5px;
    font-weight: 600;
    color: #795548;
    background: rgba(121, 85, 72, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
}

[data-theme="dark"] .qari-count-chip {
    color: #d7ccc8;
    background: rgba(215, 204, 200, 0.15);
}

.qari-quick-tags {
    display: flex;
    gap: 4px;
}

.qari-style-tag {
    background: #f1e7d4;
    border: 1px solid #d9cbaf;
    color: #4a3e33;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qari-style-tag:hover {
    background: #e5dac3;
}

.qari-style-tag.active {
    background: #8b5a2b;
    border-color: #8b5a2b;
    color: #ffffff;
}

[data-theme="dark"] .qari-style-tag {
    background: #2b2621;
    border-color: #483f33;
    color: #d1c5b4;
}

[data-theme="dark"] .qari-style-tag:hover {
    background: #39322b;
}

[data-theme="dark"] .qari-style-tag.active {
    background: #d4af37;
    border-color: #ffd875;
    color: #1a1815;
}

/* Qari Grid */
.qari-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
}

.qari-card {
    background: #ffffff;
    border: 1px solid #e5d8c3;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    user-select: none;
}

.qari-card:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.22);
    transform: translateY(-1px);
}

.qari-card.selected {
    border-color: #8b5a2b;
    background: #fff9ea;
    box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.25);
}

.qari-card.playing {
    border-color: #2e7d32 !important;
    background: #f1f8e9 !important;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.35);
}

[data-theme="dark"] .qari-card {
    background: #24201a;
    border-color: #3e362b;
}

[data-theme="dark"] .qari-card:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

[data-theme="dark"] .qari-card.selected {
    border-color: #d4af37;
    background: #2f291f;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35);
}

[data-theme="dark"] .qari-card.playing {
    border-color: #81c784 !important;
    background: #1c2b1e !important;
    box-shadow: 0 0 0 2px rgba(129, 199, 132, 0.4);
}

.qari-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0e6d2, #dcc8a4);
    color: #6d4c2d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.qari-card.playing .qari-card-avatar {
    background: linear-gradient(135deg, #a5d6a7, #2e7d32);
    color: #ffffff;
}

[data-theme="dark"] .qari-card-avatar {
    background: linear-gradient(135deg, #3d3428, #2a241b);
    color: #ffd875;
}

.qari-card-info {
    flex: 1;
    min-width: 0;
}

.qari-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #2b2520;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .qari-card-name {
    color: #f7f1e6;
}

.qari-card-ar {
    font-family: 'Amiri Quran', 'Scheherazade New', serif;
    font-size: 12.5px;
    color: #795548;
    direction: rtl;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .qari-card-ar {
    color: #d7ccc8;
}

.qari-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.qari-card-style {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: #eee4d1;
    color: #6d4c2d;
    text-transform: uppercase;
}

[data-theme="dark"] .qari-card-style {
    background: #3c3429;
    color: #e0d2bd;
}

.qari-playing-bars {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.qari-card.playing .qari-playing-bars {
    display: flex;
}

.qari-bar {
    width: 3px;
    background: #2e7d32;
    border-radius: 1px;
    animation: barBounce 0.8s ease infinite alternate;
}

[data-theme="dark"] .qari-bar {
    background: #81c784;
}

.qari-bar:nth-child(2) { animation-delay: 0.2s; }
.qari-bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes barBounce {
    0% { height: 4px; }
    100% { height: 14px; }
}

/* Bottom Player Bar */
.qari-player-bar {
    background: #f7efe1;
    border-top: 1px solid #e5d8c3;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 240px 1fr 140px;
    gap: 16px;
    align-items: center;
}

[data-theme="dark"] .qari-player-bar {
    background: #1f1b16;
    border-top-color: #3b3327;
}

.qari-now-playing {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.qari-np-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #8b5a2b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.qari-player-bar.is-playing .qari-np-avatar {
    background: #2e7d32;
    animation: pulseAvatar 1.6s infinite;
}

@keyframes pulseAvatar {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

[data-theme="dark"] .qari-np-avatar {
    background: #d4af37;
    color: #1a1815;
}

[data-theme="dark"] .qari-player-bar.is-playing .qari-np-avatar {
    background: #81c784;
    color: #0d1f11;
}

.qari-np-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.qari-np-surah {
    font-size: 13px;
    font-weight: 800;
    color: #2b2520;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .qari-np-surah {
    color: #f7f1e6;
}

.qari-np-reciter {
    font-size: 11.5px;
    font-weight: 600;
    color: #6d4c2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .qari-np-reciter {
    color: #ffd875;
}

.qari-np-style {
    font-size: 9.5px;
    background: rgba(139, 90, 43, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

.qari-np-status {
    font-size: 10.5px;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

[data-theme="dark"] .qari-np-status {
    color: #81c784;
}

.live-dot {
    font-size: 8px;
    color: #2e7d32;
    animation: liveBlink 1.2s infinite;
}

[data-theme="dark"] .live-dot {
    color: #81c784;
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Center Controls */
.qari-player-controls-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.qari-transport-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qari-transport-btn {
    background: #e6d8c0;
    border: 1px solid #d4c3a5;
    color: #4a3e33;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qari-transport-btn:hover {
    background: #dbc9ae;
    transform: scale(1.05);
}

.qari-transport-btn.primary {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: #2e7d32;
    border-color: #2e7d32;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    padding: 0 14px;
    width: auto;
    box-shadow: 0 3px 8px rgba(46, 125, 50, 0.35);
}

.qari-transport-btn.primary:hover {
    background: #256628;
}

.qari-transport-btn.danger {
    background: #c62828;
    border-color: #c62828;
    color: #ffffff;
}

.qari-transport-btn.danger:hover {
    background: #b71c1c;
}

[data-theme="dark"] .qari-transport-btn {
    background: #332d24;
    border-color: #4c4233;
    color: #e5dac9;
}

[data-theme="dark"] .qari-transport-btn:hover {
    background: #443c30;
}

/* Scrubber Row */
.qari-scrubber-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qari-time-display {
    font-size: 11px;
    font-weight: 700;
    color: #6d5b4b;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: center;
}

[data-theme="dark"] .qari-time-display {
    color: #bfaea0;
}

.qari-slider-track {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.qari-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dfd1bb;
    outline: none;
    cursor: pointer;
    z-index: 2;
}

[data-theme="dark"] .qari-slider {
    background: #3f362b;
}

.qari-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5a2b;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.qari-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

[data-theme="dark"] .qari-slider::-webkit-slider-thumb {
    background: #d4af37;
    border-color: #1a1815;
}

.qari-slider-progress {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #d4af37, #2e7d32);
    pointer-events: none;
    z-index: 1;
}

/* Volume Section */
.qari-volume-section {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.qari-vol-icon-btn {
    background: transparent;
    border: none;
    color: #6d4c2d;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

[data-theme="dark"] .qari-vol-icon-btn {
    color: #d4af37;
}

.qari-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 5px;
    border-radius: 3px;
    background: #dfd1bb;
    outline: none;
    cursor: pointer;
}

[data-theme="dark"] .qari-vol-slider {
    background: #3f362b;
}

.qari-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8b5a2b;
    cursor: pointer;
}

[data-theme="dark"] .qari-vol-slider::-webkit-slider-thumb {
    background: #d4af37;
}

/* Mobile Responsiveness for Qari Modal */
@media (max-width: 768px) {
    .qari-modal-sheet {
        max-height: 94vh;
        width: 98%;
    }
    .qari-controls-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .qari-player-bar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 14px;
    }
    .qari-now-playing {
        justify-content: center;
        text-align: center;
    }
    .qari-volume-section {
        display: none; /* Hide volume on mobile - use device volume buttons */
    }
    .qari-grid-container {
        grid-template-columns: 1fr;
        max-height: 280px;
    }
}

