@font-face {
    font-family: 'LPMQ Isep Misbah';
    src: url('/fonts/quran/LPMQIsepMisbah.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Amiri Quran';
    src: url('/fonts/quran/AmiriQuran-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --thf-teal: #0d9488;
    --thf-teal-dark: #0f766e;
    --thf-teal-deep: #115e59;
    --thf-ink: #1f2937;
    --thf-muted: #6b7280;
    --thf-line: #e5e7eb;
    --thf-soft: #f3f4f6;
    --thf-cream: #f5f0e6;
    --thf-ayah-mark: #b8956c;
    /* Amiri Quran = harakat jelas di web; LPMQ = glyph MSI / gaya NU */
    --thf-arab: 'Amiri Quran', 'LPMQ Isep Misbah', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
    --thf-ui: 'Nunito', system-ui, sans-serif;
}

.thf-app {
    font-family: var(--thf-ui);
    background: #fff;
    min-height: 100vh;
    color: var(--thf-ink);
    width: 100%;
    max-width: 100%;
}

.thf-app * { box-sizing: border-box; }

html {
    max-width: 100%;
    /* Jangan overflow-x di html — bersama body sering mematahkan scroll sentuh di mobile */
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}
body {
    margin: 0;
    max-width: 100%;
    /* Satu tempat saja: clip horizontal tanpa nested scroll container */
    overflow-x: clip;
}

.thf-shell {
    width: 100%;
    max-width: min(1120px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    position: relative;
}

@media (max-width: 640px) {
    .thf-shell {
        max-width: 100%;
    }
}

.thf-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--thf-teal);
    color: #fff;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
}

.thf-topbar a, .thf-topbar button {
    color: #fff;
    background: transparent;
    border: 0;
    padding: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thf-topbar-title {
    flex: 1;
    min-width: 0;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.thf-topbar-sub {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.05rem;
}

.thf-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.thf-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.18) !important;
    border-radius: 999px;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.8rem;
    font-weight: 800;
}

.thf-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    background: var(--thf-soft);
    margin: 0.75rem 1rem 0;
    padding: 0.3rem;
    border-radius: 999px;
}

.thf-tab {
    text-align: center;
    padding: 0.55rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--thf-muted);
    text-decoration: none;
}

.thf-tab.is-active {
    background: #fff;
    color: var(--thf-teal-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.thf-search {
    margin: 0.85rem 1rem 0.5rem;
    position: relative;
}

.thf-search input {
    width: 100%;
    border: 0;
    background: var(--thf-soft);
    border-radius: 999px;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--thf-ink);
    outline: none;
}

.thf-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.thf-list {
    background: #fff;
    padding-bottom: 6.5rem;
}

@media (min-width: 768px) {
    .thf-list.thf-surah-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        border-top: 1px solid var(--thf-line);
    }
    .thf-list.thf-surah-grid .thf-row {
        border-right: 1px solid var(--thf-line);
    }
    .thf-list.thf-surah-grid .thf-row:nth-child(3n) {
        border-right: 0;
    }
}

.thf-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--thf-line);
    text-decoration: none;
    color: inherit;
}

.thf-row:active { background: #f9fafb; }

.thf-badge {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--thf-teal-dark);
    background:
        radial-gradient(circle at center, transparent 55%, #d1d5db 56%, #d1d5db 62%, transparent 63%),
        linear-gradient(135deg, #f3f4f6, #e5e7eb);
    clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 100% 65%, 80% 90%, 50% 100%, 20% 90%, 0% 65%, 0% 35%, 20% 10%);
}

.thf-row-body { flex: 1; min-width: 0; }

.thf-row-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--thf-ink);
    line-height: 1.2;
}

.thf-row-meta {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b7355;
}

.thf-row-ar {
    font-family: var(--thf-arab);
    font-size: 1.55rem;
    line-height: 1.35;
    color: var(--thf-ink);
    direction: rtl;
    font-feature-settings: 'liga' 1, 'calt' 1;
}

.thf-continue {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(3.55rem + env(safe-area-inset-bottom));
    width: 100%;
    max-width: 1120px;
    background: var(--thf-cream);
    border-top: 1px solid #e8dfd0;
    border-radius: 1rem 1rem 0 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    z-index: 45;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}

.thf-continue-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    background: #ebe3d4;
    color: #8b5e34;
    display: grid;
    place-items: center;
}

.thf-continue strong { display: block; font-size: 0.92rem; color: #5b4630; }
.thf-continue span { font-size: 0.75rem; color: #8b7355; font-weight: 600; }

/* Reader mushaf continuous */
.thf-reader-body {
    padding: 1.25rem 1rem calc(11.5rem + env(safe-area-inset-bottom));
    background: #fff;
}

.thf-mushaf-head {
    text-align: center;
    margin-bottom: 1.25rem;
}

.thf-surah-title {
    font-size: 1.85rem !important;
    line-height: 1.5 !important;
}

.thf-basmalah {
    font-size: 1.55rem !important;
    margin-top: 0.85rem;
    text-align: center !important;
}

.thf-mushaf-page {
    font-family: var(--thf-arab);
    font-size: clamp(1.75rem, 5.8vw, 2.2rem);
    line-height: 2.65;
    color: #111827;
    text-align: justify;
    text-align-last: center;
    direction: rtl;
    unicode-bidi: plaintext;
    font-feature-settings: 'liga' 1, 'calt' 1;
    letter-spacing: 0.01em;
    word-spacing: 0.06em;
}

.thf-ayah-inline {
    cursor: pointer;
    border-radius: 0.35rem;
    transition: background .15s;
    scroll-margin-top: 5rem;
}

.thf-ayah-inline:hover,
.thf-ayah-inline:focus {
    background: #f0fdfa;
    outline: none;
}

.thf-ayah-inline.is-active {
    background: #ccfbf1;
}

.thf-ayah-words {
    font-family: inherit;
}

.thf-ayah-text {
    font-family: var(--thf-arab);
    font-size: clamp(1.7rem, 5.6vw, 2.15rem);
    line-height: 2.55;
    color: #111827;
    text-align: justify;
    text-align-last: center;
    direction: rtl;
    unicode-bidi: embed;
    font-feature-settings: 'liga' 1, 'calt' 1;
    letter-spacing: 0.01em;
    word-spacing: 0.08em;
}

.thf-ayah-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    margin: 0 0.2rem;
    border: 1.5px solid var(--thf-ayah-mark);
    border-radius: 999px;
    color: var(--thf-ayah-mark);
    font-size: 0.62rem;
    font-weight: 800;
    font-family: var(--thf-ui);
    vertical-align: middle;
    transform: translateY(-0.1rem);
    direction: ltr;
}

.thf-ayah-id {
    margin-top: 0.55rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #4b5563;
    font-weight: 600;
    direction: ltr;
    text-align: left;
}

.thf-translation-panel {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-radius: 0.85rem;
    border: 1px solid var(--thf-line);
}

.thf-ayah.is-active {
    background: #ecfdf5;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding: 0.65rem 0.5rem;
    border-radius: 0.85rem;
}

.thf-topbar-picker {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: rgba(255,255,255,0.14);
    border: 0;
    border-radius: 0.65rem;
    color: #fff;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-family: inherit;
}
.thf-topbar-picker span { display: block; font-weight: 800; font-size: 0.98rem; }
.thf-topbar-picker .thf-topbar-sub { font-size: 0.7rem; font-weight: 600; opacity: .9; margin-bottom: 0.05rem; }

.thf-player {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(3.55rem + env(safe-area-inset-bottom));
    width: 100%;
    max-width: 1120px;
    background: #fff;
    border-radius: 1.1rem 1.1rem 0 0;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
    padding: 0.85rem 1rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    z-index: 48;
    box-sizing: border-box;
}

.thf-reader-dock {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 1120px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.15rem;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
    background: #0f766e;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.18);
    box-sizing: border-box;
    pointer-events: auto;
}
.thf-reader-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #ecfdf5;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.35rem 0.2rem;
    cursor: pointer;
    border-radius: 0.65rem;
}
.thf-reader-dock-item i {
    font-size: 1.05rem;
    line-height: 1;
}
.thf-reader-dock-item:hover,
.thf-reader-dock-item:focus {
    background: rgba(255,255,255,0.12);
    outline: none;
}
.thf-reader-dock-item.is-active {
    background: rgba(255,255,255,0.18);
}
html.thf-dark .thf-reader-dock {
    background: #0f172a;
    border-top-color: #334155;
}

.thf-mushaf-meta-list {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #e2e8f0;
    display: grid;
    gap: 0.75rem;
    direction: ltr;
    text-align: left;
}
.thf-mushaf-meta {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}
.thf-mushaf-meta-num {
    flex: 0 0 auto;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    border: 1.5px solid #0d9488;
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    margin-top: 0.1rem;
}
.thf-mushaf-meta-body {
    flex: 1;
    min-width: 0;
}
.thf-mushaf-meta-body .thf-ayah-latin {
    margin: 0 0 0.2rem;
}
.thf-mushaf-meta-body .thf-ayah-id {
    margin: 0;
}
html.thf-dark .thf-mushaf-meta-list {
    border-top-color: #334155;
}
html.thf-dark .thf-mushaf-meta-num {
    border-color: #2dd4bf;
    color: #99f6e4;
}

.thf-player-progress {
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.thf-player-progress > div {
    height: 100%;
    width: 0;
    background: var(--thf-teal);
    transition: width .15s linear;
}

.thf-player-meta { flex: 1; min-width: 0; }
.thf-player-meta small { display: block; color: var(--thf-muted); font-size: 0.72rem; font-weight: 700; }
.thf-player-meta strong { display: block; font-size: 0.98rem; font-weight: 800; color: var(--thf-ink); }

.thf-btn-play {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--thf-teal);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
}

.thf-btn-round {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 0;
    background: var(--thf-soft);
    color: var(--thf-teal-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.thf-btn-round.is-danger { color: #6b7280; }

/* Settings / forms list */
.thf-section {
    margin-top: 0.85rem;
    background: #fff;
}
.thf-section:last-of-type {
    padding-bottom: 2.5rem;
}
.thf-settings-page {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
    position: relative;
    z-index: 1;
}
.thf-settings-page .thf-section {
    position: relative;
    z-index: 2;
}

.thf-section-head {
    padding: 0.85rem 1rem 0.35rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--thf-ink);
}

.thf-setting-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--thf-line);
    border-left: 0;
    border-right: 0;
    border-top: 0;
    background: #fff;
    text-decoration: none;
    color: inherit;
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}
button.thf-setting-row {
    appearance: none;
    -webkit-appearance: none;
}

.thf-setting-row:last-child { border-bottom: 0; }

.thf-setting-label { flex: 1; font-weight: 600; font-size: 0.95rem; }
.thf-setting-value { color: #9ca3af; font-size: 0.88rem; font-weight: 600; }
.thf-setting-chevron { color: #d1d5db; }

.thf-switch {
    width: 2.6rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    flex-shrink: 0;
    transition: background .2s;
}
.thf-switch::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.thf-switch.is-on { background: var(--thf-teal); }
.thf-switch.is-on::after { transform: translateX(1.15rem); }

.thf-form-card {
    margin: 0.85rem 1rem;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid var(--thf-line);
    overflow: hidden;
}

.thf-field {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--thf-line);
}
.thf-field:last-child { border-bottom: 0; }
.thf-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--thf-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.thf-field input, .thf-field select, .thf-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: #fff;
    color: var(--thf-ink);
}
.thf-field input:focus, .thf-field select:focus, .thf-field textarea:focus {
    outline: none;
    border-color: var(--thf-teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}

.thf-kind-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.thf-kind-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    border: 1.5px solid #e5e7eb;
    background: #f8fafc;
    color: var(--thf-ink);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.thf-kind-btn i {
    color: var(--thf-teal);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}
.thf-kind-title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
}
.thf-kind-desc {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--thf-muted);
    line-height: 1.35;
}
.thf-kind-btn:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}
.thf-kind-btn.is-active {
    border-color: var(--thf-teal);
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.thf-kind-btn.is-active i { color: #0f766e; }
.thf-kind-hint {
    margin: 0.55rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    line-height: 1.4;
}
@media (max-width: 380px) {
    .thf-kind-toggle { grid-template-columns: 1fr; }
}

.thf-search-select {
    position: relative;
}
.thf-field:has(.thf-search-select[data-open="1"]) {
    position: relative;
    z-index: 6;
    overflow: visible;
}
.thf-search-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: #fff;
    color: var(--thf-ink);
    text-align: left;
    cursor: pointer;
}
.thf-search-select-trigger:focus {
    outline: none;
    border-color: var(--thf-teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.thf-search-select-trigger i {
    color: var(--thf-muted);
    font-size: 0.75rem;
}
.thf-search-select[data-open="1"] .thf-search-select-trigger {
    border-color: var(--thf-teal);
}
.thf-search-select-panel {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    background: #fff;
    border: 1px solid var(--thf-line);
    border-radius: 0.85rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
.thf-search-select-panel input[type="search"] {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--thf-line);
    border-radius: 0;
    padding: 0.75rem 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
    background: #f8fafc;
}
.thf-search-select-panel input[type="search"]:focus {
    outline: none;
    box-shadow: none;
}
.thf-search-select-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    max-height: 14rem;
    overflow-y: auto;
}
.thf-search-select-option {
    padding: 0.6rem 0.75rem;
    border-radius: 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--thf-ink);
    cursor: pointer;
}
.thf-search-select-option[hidden] {
    display: none !important;
}
.thf-search-select-option:hover,
.thf-search-select-option:focus {
    background: rgba(13, 148, 136, 0.1);
    outline: none;
}
.thf-search-select-option.is-selected {
    background: var(--thf-teal);
    color: #fff;
}
.thf-search-select-empty {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--thf-muted);
}

.thf-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--thf-line);
    font-weight: 600;
}
.thf-check input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--thf-teal);
}

.thf-submit {
    margin: 1rem;
    width: calc(100% - 2rem);
    background: var(--thf-teal);
    color: #fff;
    border: 0;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    font-weight: 800;
    font-size: 0.95rem;
}

.thf-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding: 0.85rem 1rem;
}
.thf-kpi {
    background: #fff;
    border: 1px solid var(--thf-line);
    border-radius: 0.9rem;
    padding: 0.85rem;
}
.thf-kpi small { display: block; color: var(--thf-muted); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.thf-kpi strong { display: block; margin-top: 0.25rem; font-size: 1.35rem; color: var(--thf-teal-dark); }

.thf-attr {
    padding: 0.75rem 1rem 1.25rem;
    font-size: 0.72rem;
    color: var(--thf-muted);
    font-weight: 600;
    line-height: 1.45;
}

.thf-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--thf-muted);
    font-weight: 600;
}

/* Alur Tahfidz khusus */
.thf-flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin: 0.85rem 1rem 0.35rem;
    padding: 0.65rem;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid var(--thf-line);
}
.thf-flow-step {
    text-align: center;
    text-decoration: none;
    color: var(--thf-muted);
    padding: 0.45rem 0.2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.68rem;
    line-height: 1.25;
    cursor: pointer;
    display: block;
    transition: background .15s, color .15s, transform .12s;
}
.thf-flow-step:hover,
.thf-flow-step:focus-visible {
    background: #f0fdfa;
    color: var(--thf-teal-dark);
    outline: none;
}
.thf-flow-step:active {
    transform: scale(0.97);
}
.thf-flow-step i {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--thf-teal);
}
.thf-flow-step.is-active {
    background: #ecfdf5;
    color: var(--thf-teal-dark);
    box-shadow: inset 0 0 0 1px #99f6e4;
}
.thf-flow-step.is-done {
    color: var(--thf-teal-dark);
}

#pilih, #rekam, #riwayat {
    scroll-margin-top: 4.5rem;
}

.thf-hero-cta {
    margin: 0.75rem 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}
.thf-hero-cta strong { display: block; font-size: 1rem; font-weight: 800; }
.thf-hero-cta span { display: block; font-size: 0.78rem; opacity: 0.9; font-weight: 600; margin-top: 0.15rem; }
.thf-hero-cta .thf-btn-round {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    color: #fff;
}

@media (min-width: 768px) {
    .thf-shell { min-height: calc(100vh - 0px); }
}

/* Bottom sheets */
.thf-sheet {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(110%);
    bottom: 0;
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 1.15rem 1.15rem 0 0;
    padding: 0.65rem 1rem calc(1rem + env(safe-area-inset-bottom));
    z-index: 120;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    max-height: 85vh;
    overflow-y: auto;
    display: none;
    pointer-events: none;
    transition: transform .22s ease;
    box-sizing: border-box;
}
.thf-sheet.is-open {
    display: block;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.thf-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 110;
    opacity: 0;
    display: none;
    pointer-events: none;
    transition: opacity .2s;
}
.thf-sheet-backdrop.is-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.thf-sheet-handle {
    width: 2.5rem;
    height: 0.28rem;
    border-radius: 999px;
    background: #d1d5db;
    margin: 0.15rem auto 0.85rem;
}
.thf-sheet h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 800;
}
.thf-sheet-ar {
    font-family: var(--thf-arab);
    font-size: 1.45rem;
    line-height: 2.2;
    direction: rtl;
    text-align: right;
    margin: 0.35rem 0;
}
.thf-sheet-latin {
    font-size: 0.82rem;
    color: #047857;
    font-weight: 600;
    font-style: italic;
    line-height: 1.45;
    margin: 0 0 0.35rem;
}
.thf-sheet-id {
    font-size: 0.82rem;
    color: var(--thf-muted);
    font-weight: 600;
    line-height: 1.45;
    margin: 0 0 0.75rem;
}
.thf-sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.thf-sheet-btn {
    border: 1px solid var(--thf-line);
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    font-weight: 800;
    font-size: 0.78rem;
    color: var(--thf-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.thf-sheet-btn i { color: var(--thf-teal); }
.thf-sheet-btn.is-primary {
    grid-column: 1 / -1;
    background: var(--thf-teal);
    border-color: var(--thf-teal);
    color: #fff;
}
.thf-sheet-btn.is-primary i { color: #fff; }
.thf-sheet-btn[data-action="tilawah"] {
    grid-column: 1 / -1;
}
.thf-sheet-cancel {
    width: 100%;
    margin-top: 0.75rem;
    border: 0;
    background: transparent;
    color: var(--thf-muted);
    font-weight: 800;
    padding: 0.65rem;
    cursor: pointer;
}

.thf-toast {
    position: fixed;
    left: 50%;
    bottom: 9.5rem;
    transform: translateX(-50%) translateY(12px);
    background: #0f766e;
    color: #fff;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    z-index: 80;
    opacity: 0;
    transition: .2s;
    max-width: 90%;
    text-align: center;
}
.thf-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

html.thf-dark .thf-shell,
html.thf-dark .thf-app,
html.thf-dark .thf-reader-body,
html.thf-dark .thf-player,
html.thf-dark .thf-sheet,
html.thf-dark .thf-section {
    background: #0f172a;
    color: #e2e8f0;
}
html.thf-dark body.thf-app {
    background: #0f172a;
}
html.thf-dark .thf-mushaf-page,
html.thf-dark .thf-ayah-text,
html.thf-dark .thf-row-ar,
html.thf-dark .thf-sheet-ar { color: #f8fafc; }
html.thf-dark .thf-ayah-inline.is-active { background: #134e4a; }
html.thf-dark .thf-translation-panel { background: #1e293b; border-color: #334155; }
html.thf-dark .thf-player { box-shadow: 0 -8px 28px rgba(0,0,0,.45); }
html.thf-dark .thf-player-meta strong { color: #f8fafc; }
html.thf-dark .thf-btn-round { background: #1e293b; }
html.thf-dark .thf-sheet-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }

/* Ukuran teks */
html.thf-size-sm .thf-mushaf-page { font-size: clamp(1.2rem, 4vw, 1.5rem); line-height: 2.2; }
html.thf-size-md .thf-mushaf-page { font-size: clamp(1.75rem, 5.8vw, 2.2rem); line-height: 2.65; }
html.thf-size-lg .thf-mushaf-page { font-size: clamp(2.15rem, 7vw, 2.75rem); line-height: 2.9; }
html.thf-size-sm .thf-bacaan-ar { font-size: clamp(1.05rem, 3.6vw, 1.25rem); line-height: 1.8; }
html.thf-size-md .thf-bacaan-ar { font-size: clamp(1.25rem, 4.2vw, 1.55rem); line-height: 1.95; }
html.thf-size-lg .thf-bacaan-ar { font-size: clamp(1.5rem, 5vw, 1.85rem); line-height: 2.1; }
html.thf-size-sm .thf-ayah-text,
html.thf-size-sm .thf-basmalah { font-size: clamp(1.2rem, 4vw, 1.5rem) !important; }
html.thf-size-lg .thf-ayah-text,
html.thf-size-lg .thf-basmalah { font-size: clamp(2rem, 6.5vw, 2.5rem) !important; }

/* Overlay cari — default TERSSEMBUNYI (jangan override [hidden] dengan display:flex) */
.thf-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: #fff;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: none;
    flex-direction: column;
}
.thf-search-overlay.is-open {
    display: flex;
}
.thf-search-overlay-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: var(--thf-teal);
    color: #fff;
}
.thf-search-overlay-bar button {
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0.35rem;
    font-size: 1.1rem;
    cursor: pointer;
}
.thf-search-overlay-bar input {
    flex: 1;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(255,255,255,0.95);
    color: var(--thf-ink);
}
.thf-search-hint {
    padding: 0.65rem 1.25rem 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}
.thf-search-hint strong { color: var(--thf-teal-dark); }
.thf-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem 1.5rem !important;
    margin: 0 !important;
    align-content: start;
}
.thf-search-overlay .thf-list {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    padding-bottom: 1rem;
}
html.thf-dark .thf-search-overlay,
html.thf-dark .thf-search-overlay .thf-list { background: #0f172a; }
html.thf-dark .thf-list,
html.thf-dark .thf-row,
html.thf-dark .thf-section,
html.thf-dark .thf-setting-row,
html.thf-dark .thf-search,
html.thf-dark .thf-tabs {
    background: #0f172a;
    color: #e2e8f0;
}
html.thf-dark .thf-row-title { color: #f8fafc; }
html.thf-dark .thf-row { border-bottom-color: #334155; }
html.thf-dark .thf-setting-label { color: #e2e8f0; }
html.thf-dark .thf-section-head { background: #1e293b; color: #f8fafc; }

.thf-toggle-row {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 0;
    cursor: pointer;
    font: inherit;
}

/* Reader lebar nyaman di desktop */
@media (min-width: 768px) {
    .thf-reader-body {
        max-width: 720px;
        margin: 0 auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .thf-mushaf-page {
        font-size: 2.05rem;
        line-height: 2.7;
    }
}

/* ===== Reader topbar (mobile-first, rapi) ===== */
.thf-reader-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e8eef5;
    padding: 0.55rem 1rem 0.65rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}
.thf-reader-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.thf-reader-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--thf-teal-dark);
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
}
.thf-reader-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.thf-reader-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: var(--thf-teal-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}
.thf-reader-bar-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.55rem;
}
.thf-reader-nav-btn {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: var(--thf-teal-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}
.thf-reader-nav-btn.is-disabled { opacity: 0.35; pointer-events: none; }
.thf-reader-title {
    flex: 1;
    min-width: 0;
    border: 0;
    background: #f0fdfa;
    border-radius: 0.85rem;
    padding: 0.4rem 0.75rem;
    text-align: center;
    cursor: pointer;
    color: var(--thf-ink);
}
.thf-reader-title small {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--thf-teal-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.thf-reader-title strong {
    display: block;
    font-size: 0.98rem;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thf-ayah-card.is-playing {
    background: #ecfdf5;
    box-shadow: inset 3px 0 0 var(--thf-teal);
}
.thf-w {
    display: inline;
    padding: 0 0.06em;
    border-radius: 0.2em;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.thf-word-live {
    background: rgba(13, 148, 136, 0.22);
    border-radius: 0.25rem;
    padding: 0 0.1rem;
}
.thf-word-done {
    color: #0f766e;
}
html.thf-dark .thf-reader-bar {
    background: rgba(15, 23, 42, 0.96);
    border-bottom-color: #334155;
}
html.thf-dark .thf-reader-back,
html.thf-dark .thf-reader-icon,
html.thf-dark .thf-reader-nav-btn,
html.thf-dark .thf-reader-title { color: #e2e8f0; border-color: #334155; }
html.thf-dark .thf-reader-icon,
html.thf-dark .thf-reader-nav-btn { background: #1e293b; }
html.thf-dark .thf-reader-title { background: #134e4a; }
html.thf-dark .thf-ayah-card.is-playing { background: #134e4a; }

/* ===== NU Online reader (per ayat) — legacy keep ===== */
.thf-topbar-nu {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    background: #fff;
    color: var(--thf-teal-dark);
    border-bottom: 1px solid var(--thf-line);
    box-shadow: 0 1px 0 rgba(15,23,42,0.04);
}
.thf-topbar-nu a, .thf-topbar-nu button {
    color: var(--thf-teal-dark);
}
.thf-topbar-nu .thf-chip-btn {
    background: #ecfdf5 !important;
    color: var(--thf-teal-dark) !important;
}
.thf-back-link {
    font-weight: 800;
    font-size: 0.9rem;
    gap: 0.4rem !important;
    text-decoration: none;
}
.thf-nav-mid {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    justify-content: center;
    min-width: 0;
}
.thf-topbar-nu .thf-topbar-picker {
    background: #f3f4f6;
    color: var(--thf-ink);
    max-width: 220px;
}
.thf-nav-disabled { opacity: 0.35; padding: 0.35rem; }

.thf-reader-nu {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 8rem;
}
.thf-surah-latin {
    margin: 0.35rem 0 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--thf-ink);
}
.thf-surah-meta {
    margin: 0.25rem 0 1rem;
    color: var(--thf-muted);
    font-weight: 600;
    font-size: 0.88rem;
}

.thf-ayah-list { display: flex; flex-direction: column; }
.thf-ayah-card {
    padding: 1.15rem 0;
    border-bottom: 1px solid #eef2f7;
    scroll-margin-top: 5.5rem;
}
.thf-ayah-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 800;
}

/* Mode layout: halaman (mushaf) vs per ayat */
html.thf-layout-page .thf-ayah-list { display: none !important; }
html.thf-layout-ayah .thf-mushaf-book,
html.thf-layout-ayah .thf-mushaf-pager,
html.thf-layout-ayah .thf-mushaf-aside { display: none !important; }
html.thf-layout-ayah .thf-ayah-list { display: flex !important; }
html.thf-layout-ayah .thf-reader-body {
    padding-bottom: calc(9.5rem + env(safe-area-inset-bottom));
}
.thf-ayah-card.is-active {
    background: #f0fdfa;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 0.85rem;
}
.thf-ayah-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}
.thf-ayah-menu-btn, .thf-ayah-act {
    border: 0;
    background: transparent;
    color: var(--thf-teal);
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.thf-ayah-act:hover, .thf-ayah-menu-btn:hover { background: #ecfdf5; }
.thf-ayah-quick { display: flex; gap: 0.15rem; }

.thf-ayah-ar {
    font-family: var(--thf-arab);
    font-size: clamp(1.65rem, 4.5vw, 2.05rem);
    line-height: 2.55;
    text-align: right;
    direction: rtl;
    color: #111;
    margin: 0 0 0.65rem;
}
.thf-ayah-latin {
    color: var(--thf-teal-dark);
    font-style: italic;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 0.35rem;
}
.thf-ayah-card .thf-ayah-id {
    margin: 0;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 600;
}

html.thf-hide-terjemah .thf-terjemah,
html.thf-hide-terjemah .thf-bacaan-id,
html.thf-hide-terjemah .thf-ayah-id,
html.thf-hide-terjemah .thf-sheet-id { display: none !important; }
html.thf-hide-latin .thf-translit,
html.thf-hide-latin .thf-bacaan-latin,
html.thf-hide-latin .thf-ayah-latin,
html.thf-hide-latin .thf-sheet-latin { display: none !important; }

/* Saat latin + terjemah dimatikan, sembunyikan seluruh blok meta mushaf */
html.thf-hide-terjemah.thf-hide-latin .thf-mushaf-meta-list { display: none !important; }

/* Tajwid colors */
.tj-mad { color: #dc2626; }
.tj-ikhfa { color: #16a34a; }
.tj-ghunnah { color: #ea580c; }
.tj-qalqalah { color: #2563eb; }
html.thf-tajwid-on .thf-ayah-ar { /* marker when on */ }

.thf-tajwid-legend {
    display: grid;
    gap: 0.55rem;
    margin: 0.5rem 0 1rem;
}
.thf-tajwid-legend-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 0.88rem;
}
.thf-tajwid-swatch {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.3rem;
}
.thf-tajwid-swatch.mad { background: #dc2626; }
.thf-tajwid-swatch.ikhfa { background: #16a34a; }
.thf-tajwid-swatch.ghunnah { background: #ea580c; }
.thf-tajwid-swatch.qalqalah { background: #2563eb; }

.thf-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.85rem 1rem 0.25rem;
}
.thf-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: var(--thf-teal-dark);
    font-weight: 800;
    font-size: 0.82rem;
    text-decoration: none;
}
.thf-chip:hover { background: #ccfbf1; }

html.thf-dark .thf-topbar-nu {
    background: #0f172a;
    color: #e2e8f0;
    border-bottom-color: #334155;
}
html.thf-dark .thf-topbar-nu a,
html.thf-dark .thf-topbar-nu button { color: #e2e8f0; }
html.thf-dark .thf-topbar-nu .thf-topbar-picker { background: #1e293b; color: #e2e8f0; }
html.thf-dark .thf-ayah-card { border-bottom-color: #334155; }
html.thf-dark .thf-ayah-card.is-active { background: #134e4a; }
html.thf-dark .thf-ayah-ar { color: #f8fafc; }
html.thf-dark .thf-ayah-card .thf-ayah-id { color: #cbd5e1; }
html.thf-dark .thf-surah-latin { color: #f8fafc; }

/* ===== Halaman awal Tahfidz ala NU Online ===== */
.thf-home {
    background: #f8fafc;
    min-height: 100vh;
    padding: 0 max(1.25rem, env(safe-area-inset-right)) calc(4.5rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    max-width: 100%;
    box-sizing: border-box;
}
.thf-home.has-continue {
    padding-bottom: calc(8.75rem + env(safe-area-inset-bottom));
}
.thf-home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 1rem 0 0.85rem;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #f1f5f9;
    margin: 0 -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
    min-width: 0;
    box-sizing: border-box;
}
.thf-home-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1 1 auto;
}
.thf-home-brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1rem;
    background: #047857;
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--thf-ui);
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
    text-transform: lowercase;
    box-shadow: 0 8px 18px rgba(4, 120, 87, 0.22);
}
.thf-home-brand-text {
    font-weight: 900;
    font-size: clamp(0.98rem, 3.6vw, 1.15rem);
    letter-spacing: -0.02em;
    color: #0f172a;
    white-space: nowrap;
}
.thf-home-brand-text span { color: #047857; font-weight: 700; }
.thf-home-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.thf-home-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.thf-home-icon-btn:hover {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.thf-home-hero {
    position: relative;
    margin: 1rem 0 0;
    padding: 1.35rem 1.25rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 45%, #d1fae5 100%);
    border: 1px solid rgba(167, 243, 208, 0.65);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    overflow: hidden;
}
.thf-home-hero-glow {
    position: absolute;
    right: -1.5rem;
    bottom: -1.5rem;
    width: 8rem;
    height: 8rem;
    border-radius: 999px;
    background: rgba(167, 243, 208, 0.45);
    filter: blur(28px);
    pointer-events: none;
}
.thf-home-hero-copy { flex: 1; min-width: 0; position: relative; z-index: 1; }
.thf-home-hero-kicker {
    margin: 0 0 0.65rem;
    display: inline-block;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #065f46;
    background: rgba(167, 243, 208, 0.65);
}
.thf-home-hero h1 {
    margin: 0;
    font-size: clamp(1.05rem, 3.8vw, 1.2rem);
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.35;
}
.thf-home-hero p {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.5;
}
.thf-home-hero-art {
    position: relative;
    z-index: 1;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: #fff;
    color: #047857;
    display: grid;
    place-items: center;
    font-size: 1.65rem;
    flex-shrink: 0;
    border: 1px solid #d1fae5;
    box-shadow: 0 10px 22px rgba(6, 95, 70, 0.1);
}

/* ===== Prayer card (mockup style) ===== */
.thf-prayer {
    position: relative;
    margin: 1.15rem 0 0;
    padding: 1.25rem;
    border-radius: 2rem;
    background: linear-gradient(180deg, #065f46 0%, #134e4a 100%);
    color: #ecfdf5;
    box-shadow: 0 16px 36px rgba(6, 78, 59, 0.28);
    overflow: hidden;
}
.thf-prayer-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}
.thf-prayer-top,
.thf-prayer-locbar,
.thf-prayer-times {
    position: relative;
    z-index: 1;
}
.thf-prayer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}
.thf-prayer-kicker {
    margin: 0 0 0.35rem;
    display: inline-block;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6ee7b7;
    background: rgba(2, 44, 34, 0.4);
}
.thf-prayer-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.thf-prayer-title-row h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}
.thf-prayer-pulse {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
    animation: thf-pulse 1.6s ease-out infinite;
}
@keyframes thf-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.thf-prayer-clock {
    font-size: 0.75rem;
    font-weight: 700;
    color: #a7f3d0;
    white-space: nowrap;
}
.thf-prayer-locbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    background: rgba(2, 44, 34, 0.4);
    border: 1px solid rgba(4, 120, 87, 0.35);
    backdrop-filter: blur(8px);
}
.thf-prayer-loc {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #d1fae5;
    line-height: 1.35;
}
.thf-prayer-loc i {
    margin-top: 0.1rem;
    color: #34d399;
    flex-shrink: 0;
}
.thf-prayer-loc span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.thf-prayer-btn {
    flex-shrink: 0;
    border: 0;
    border-radius: 0.75rem;
    background: #fff;
    color: #064e3b;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.thf-prayer-btn:disabled { opacity: 0.7; cursor: wait; }
.thf-prayer-times {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
}
.thf-prayer-times.is-empty strong { opacity: 0.45; }
.thf-prayer-times li {
    background: rgba(6, 78, 59, 0.5);
    border: 1px solid rgba(4, 120, 87, 0.35);
    border-radius: 1rem;
    padding: 0.55rem 0.2rem;
    text-align: center;
}
.thf-prayer-times li span {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    color: #6ee7b7;
}
.thf-prayer-times li strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 380px) {
    .thf-prayer-locbar { flex-direction: column; align-items: stretch; }
    .thf-prayer-btn { align-self: flex-start; }
    .thf-prayer-times li { padding: 0.45rem 0.1rem; }
    .thf-prayer-times li strong { font-size: 0.7rem; }
}

.thf-home-features {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    margin: 1.35rem 0 0;
    padding: 0 0 0.15rem;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.thf-home-features::-webkit-scrollbar { display: none; }
.thf-home-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex: 0 0 auto;
    min-width: 4.4rem;
    width: 4.6rem;
    text-decoration: none;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.25;
}
.thf-home-feature-label {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 auto;
    color: #334155;
    white-space: nowrap;
}
.thf-home-feature-icon {
    width: 3.65rem;
    height: 3.65rem;
    border-radius: 1.2rem;
    background: #f8fafc;
    color: #047857;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    transition: transform .15s, background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.thf-home-feature.is-active .thf-home-feature-icon,
.thf-home-feature:hover .thf-home-feature-icon {
    background: #047857;
    color: #fff;
    border-color: #047857;
    box-shadow: 0 12px 24px rgba(4, 120, 87, 0.28);
    transform: scale(1.04);
}
.thf-home-feature.is-active .thf-home-feature-label {
    color: #0f172a;
}
@media (min-width: 640px) {
    .thf-home-features {
        overflow: visible;
        justify-content: space-between;
        max-width: 42rem;
        margin-left: auto;
        margin-right: auto;
        gap: 0.65rem;
    }
    .thf-home-feature {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: 6.5rem;
    }
    .thf-home-feature-label {
        white-space: normal;
    }
    .thf-home-feature-icon {
        width: 4rem;
        height: 4rem;
        border-radius: 1.35rem;
        font-size: 1.25rem;
    }
}

.thf-home-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 1.35rem 0 0.85rem;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.thf-home-pills::-webkit-scrollbar { display: none; }
.thf-home-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.thf-home-pill.is-active {
    background: #047857;
    border-color: #047857;
    color: #fff;
    box-shadow: 0 6px 14px rgba(4, 120, 87, 0.22);
}
.thf-home-pill.is-soft {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.thf-home-search {
    margin: 0 1.25rem 0.85rem;
    position: relative;
}
.thf-home-search i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.thf-home-search input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 999px;
    padding: 0.75rem 1rem 0.75rem 2.4rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--thf-ink);
}
.thf-home-search input:focus {
    outline: none;
    border-color: #047857;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.thf-surah-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0 0 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
@media (min-width: 640px) {
    .thf-home {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }
    .thf-surah-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    .thf-surah-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.85rem;
    }
}
.thf-surah-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid #f1f5f9;
    border-radius: 1.35rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
    transition: border-color .15s, box-shadow .15s, transform .15s;
    content-visibility: auto;
    contain-intrinsic-size: auto 72px;
}
.thf-surah-card[hidden] {
    display: none !important;
}
.thf-surah-card:hover {
    border-color: #a7f3d0;
    box-shadow: 0 10px 24px rgba(4, 120, 87, 0.1);
    transform: translateY(-1px);
}
.thf-surah-num {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    flex-shrink: 0;
    border-radius: 1rem;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #047857;
    font-weight: 900;
    font-size: 0.72rem;
    display: grid;
    place-items: center;
    text-align: center;
}
.thf-surah-card:hover .thf-surah-num {
    background: #047857;
    border-color: #047857;
    color: #fff;
}
.thf-surah-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.thf-surah-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thf-surah-sub {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thf-surah-ar {
    font-family: var(--thf-arab);
    font-size: clamp(1.15rem, 4.2vw, 1.45rem);
    line-height: 1.2;
    color: #0f172a;
    direction: rtl;
    flex: 0 1 auto;
    max-width: 42%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.thf-juz-cards { grid-template-columns: 1fr; }
@media (min-width: 768px) {
    .thf-juz-cards { grid-template-columns: repeat(2, 1fr); }
}

html.thf-dark .thf-home,
html.thf-dark .thf-home-header,
html.thf-dark .thf-surah-card,
html.thf-dark .thf-home-icon-btn,
html.thf-dark .thf-home-pill {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
html.thf-dark .thf-home-brand-text { color: #f8fafc; }
html.thf-dark .thf-home-hero {
    background: linear-gradient(135deg, #134e4a, #115e59);
    border-color: #115e59;
}
html.thf-dark .thf-home-hero h1 { color: #f8fafc; }
html.thf-dark .thf-home-hero p { color: #a7f3d0; }
html.thf-dark .thf-home-hero-kicker {
    color: #ecfdf5;
    background: rgba(6, 78, 59, 0.55);
}
html.thf-dark .thf-home-hero-art {
    background: #0f172a;
    border-color: #115e59;
    color: #6ee7b7;
}
html.thf-dark .thf-home-feature { color: #cbd5e1; }
html.thf-dark .thf-home-feature-icon { background: #134e4a; border-color: #115e59; color: #99f6e4; }
html.thf-dark .thf-home-pill.is-soft { background: #134e4a; border-color: #115e59; color: #99f6e4; }
html.thf-dark .thf-home-pill.is-active { background: #047857; color: #fff; }
html.thf-dark .thf-home-search input { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html.thf-dark .thf-surah-name,
html.thf-dark .thf-surah-ar { color: #f8fafc; }
html.thf-dark .thf-surah-num {
    background: #134e4a;
    border-color: #115e59;
    color: #6ee7b7;
}
html.thf-dark .thf-surah-sub { color: #94a3b8; }

/* ===== Dashboard siswa — ringkas, tidak menumpuk form ===== */
.thf-dash {
    background: #fff;
    min-height: 100vh;
    padding: 0 max(2rem, env(safe-area-inset-right)) 2.5rem max(2rem, env(safe-area-inset-left));
    box-sizing: border-box;
    max-width: 100%;
}
.thf-dash-alert {
    margin: 0.75rem 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.88rem;
}
.thf-dash-alert.is-ok { background: #ecfdf5; color: #0f766e; }
.thf-dash-alert.is-err { background: #fff1f2; color: #be123c; }
.thf-dash-hero { margin-top: 0.85rem; }
.thf-dash-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.85rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--thf-teal);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
}
.thf-dash-kpi { padding-top: 0.35rem; }
.thf-dash-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.35rem 1rem 0.75rem;
    max-width: 28rem;
    margin: 0 auto;
}
.thf-dash-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    text-decoration: none;
    color: #334155;
    font-size: clamp(0.68rem, 2.8vw, 0.78rem);
    font-weight: 800;
    text-align: center;
}
.thf-dash-action-icon {
    width: clamp(2.75rem, 12vw, 3.25rem);
    height: clamp(2.75rem, 12vw, 3.25rem);
    border-radius: 999px;
    background: #ecfdf5;
    color: var(--thf-teal-dark);
    display: grid;
    place-items: center;
    border: 1px solid #ccfbf1;
    font-size: 1.05rem;
}
.thf-dash-hint {
    margin: 0 1rem 1rem;
    padding: 0.75rem 0.95rem;
    border-radius: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
}
.thf-dash-panel {
    margin: 0 1rem 1rem;
}
.thf-dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}
.thf-dash-panel-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 900;
    color: #0f172a;
}
.thf-dash-panel-head a,
.thf-dash-toggle {
    border: 0;
    background: transparent;
    color: var(--thf-teal-dark);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}
.thf-dash-panel .thf-surah-card,
.thf-dash-panel .thf-dash-row {
    margin-bottom: 0.5rem;
}
.thf-dash-del {
    border: 0;
    background: transparent;
    color: #e11d48;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}
.thf-dash-form {
    margin-top: 0.65rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.95rem;
    background: #fff;
}
.thf-dash-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.thf-dash-form .thf-field {
    border: 0;
    padding: 0;
    margin: 0 0 0.65rem;
}
.thf-dash-form .thf-submit {
    margin: 0.5rem 0 0;
    width: 100%;
}
@media (min-width: 768px) {
    .thf-dash-kpi {
        grid-template-columns: repeat(4, 1fr);
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .thf-dash-panel,
    .thf-dash-hint {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
}
html.thf-dark .thf-dash,
html.thf-dark .thf-dash-form,
html.thf-dark .thf-dash-hint { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.thf-dark .thf-dash-panel-head h2 { color: #f8fafc; }
html.thf-dark .thf-dash-action { color: #cbd5e1; }


.thf-bacaan-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.85rem 0 0;
}
.thf-bacaan-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.4rem;
    border-radius: 1.15rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.thf-bacaan-nav-item i { font-size: 1.05rem; color: #047857; }
.thf-bacaan-nav-item.is-active {
    background: #047857;
    border-color: #047857;
    color: #fff;
    box-shadow: 0 10px 22px rgba(4, 120, 87, 0.22);
}
.thf-bacaan-nav-item.is-active i { color: #fff; }
.thf-bacaan-hero { margin-top: 1rem; }
.thf-bacaan-list {
    display: grid;
    gap: 0.75rem;
    padding: 0 0 1rem;
}
.thf-bacaan-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 1rem 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.thf-bacaan-actions::-webkit-scrollbar { display: none; }
.thf-bacaan-source {
    margin: 0.55rem 0 0 !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #047857 !important;
    opacity: 1 !important;
}
.thf-bacaan-source a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.thf-bacaan-meta {
    margin: 1rem 0 0.55rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
}
.thf-bacaan-group {
    margin: 1rem 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #047857;
}
.thf-bacaan-card {
    padding: 1.05rem 1.05rem 1.1rem;
    border: 1px solid #f1f5f9;
    border-radius: 1.35rem;
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.thf-bacaan-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}
.thf-bacaan-num {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.85rem;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #047857;
    font-size: 0.72rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.thf-bacaan-card-titles { min-width: 0; flex: 1; }
.thf-bacaan-card-head h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.thf-bacaan-ar {
    margin: 0;
    font-family: var(--thf-arab);
    font-size: clamp(1.25rem, 4.2vw, 1.55rem);
    line-height: 1.95;
    color: #0f172a;
    text-align: right;
    white-space: pre-line;
}
.thf-bacaan-latin {
    margin: 0.65rem 0 0;
    font-size: 0.82rem;
    font-style: italic;
    color: #047857;
    font-weight: 600;
    line-height: 1.5;
}
.thf-bacaan-id {
    margin: 0.4rem 0 0;
    font-size: 0.84rem;
    color: #475569;
    font-weight: 500;
    line-height: 1.55;
}
.thf-bacaan-notes {
    margin: 0.5rem 0 2rem;
    padding: 1.05rem 1.15rem;
    border-radius: 1.25rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.thf-bacaan-notes h2 {
    margin: 0 0 0.45rem;
    font-size: 0.88rem;
    font-weight: 900;
    color: #065f46;
}
.thf-bacaan-notes ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
}
.thf-bacaan-notes li + li { margin-top: 0.3rem; }
html.thf-dark .thf-bacaan-nav-item {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
html.thf-dark .thf-bacaan-nav-item.is-active {
    background: #047857;
    border-color: #047857;
    color: #fff;
}
html.thf-dark .thf-bacaan-notes,
html.thf-dark .thf-bacaan-card {
    background: #0f172a;
    border-color: #334155;
}
html.thf-dark .thf-bacaan-card-head h3,
html.thf-dark .thf-bacaan-ar { color: #f8fafc; }
html.thf-dark .thf-bacaan-num {
    background: #134e4a;
    border-color: #115e59;
    color: #6ee7b7;
}
html.thf-dark .thf-bacaan-id { color: #94a3b8; }
html.thf-dark .thf-bacaan-notes h2 { color: #6ee7b7; }
html.thf-dark .thf-bacaan-notes ul { color: #cbd5e1; }

.thf-bacaan-nav--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.thf-bacaan-titlebar {
    margin: 1rem 0 0.85rem;
}
.thf-bacaan-titlebar h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.thf-bacaan-titlebar p {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}
.thf-bacaan-catalog {
    display: grid;
    gap: 0.65rem;
    padding: 0 0 1.5rem;
}
.thf-bacaan-catalog-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1.25rem;
    border: 1px solid #f1f5f9;
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.thf-bacaan-catalog-card:hover {
    border-color: #a7f3d0;
    box-shadow: 0 10px 24px rgba(4, 120, 87, 0.1);
    transform: translateY(-1px);
}
.thf-bacaan-catalog-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #047857;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.thf-bacaan-catalog-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.thf-bacaan-catalog-copy strong {
    font-size: 0.95rem;
    font-weight: 900;
    color: #0f172a;
}
.thf-bacaan-catalog-copy span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}
.thf-bacaan-catalog-chevron {
    color: #94a3b8;
    font-size: 0.8rem;
    flex-shrink: 0;
}
html.thf-dark .thf-bacaan-titlebar h1 { color: #f8fafc; }
html.thf-dark .thf-bacaan-catalog-card {
    background: #0f172a;
    border-color: #334155;
}
html.thf-dark .thf-bacaan-catalog-copy strong { color: #f8fafc; }
html.thf-dark .thf-bacaan-catalog-icon {
    background: #134e4a;
    border-color: #115e59;
    color: #6ee7b7;
}
.thf-bacaan-back {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.95rem;
    min-width: 0;
}
.thf-bacaan-back i {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    display: grid;
    place-items: center;
    color: #047857;
    flex-shrink: 0;
}
html.thf-dark .thf-bacaan-back { color: #f8fafc; }
html.thf-dark .thf-bacaan-back i {
    background: #0f172a;
    border-color: #334155;
    color: #6ee7b7;
}

/* ===== Mushaf per halaman ===== */
.thf-mushaf-book {
    margin: 0 auto 0.85rem;
    max-width: 42rem;
}
.thf-mushaf-paper {
    background: linear-gradient(180deg, #fffef9 0%, #fff 55%, #f8fafc 100%);
    border: 1px solid #e7e5e4;
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    padding: 1.35rem 1.15rem 1.5rem;
    min-height: 18rem;
}
.thf-mushaf-page {
    font-family: var(--thf-arab);
    font-size: clamp(1.55rem, 5.2vw, 2rem);
    line-height: 2.55;
    color: #111827;
    text-align: justify;
    text-align-last: center;
    direction: rtl;
    unicode-bidi: plaintext;
}
.thf-ayah-inline {
    cursor: pointer;
    border-radius: 0.35rem;
    transition: background .15s;
    padding: 0.05rem 0.05rem;
}
.thf-ayah-inline:hover,
.thf-ayah-inline:focus {
    background: #ecfdf5;
    outline: none;
}
.thf-ayah-inline.is-active,
.thf-ayah-inline.is-playing {
    background: #ccfbf1;
}
.thf-mushaf-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 42rem;
    margin: 0 auto 1rem;
    padding: 0.35rem 0.15rem;
}
.thf-mushaf-pager-btn {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid #d1fae5;
    background: #ecfdf5;
    color: #047857;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.thf-mushaf-pager-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.thf-mushaf-pager-meta {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 700;
}
.thf-mushaf-pager-meta strong {
    display: block;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 900;
}
.thf-mushaf-aside {
    max-width: 42rem;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.05rem;
    border-radius: 1.15rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.thf-mushaf-aside-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #334155;
}
.thf-mushaf-aside-actions {
    display: flex;
    gap: 0.2rem;
}
.thf-mushaf-hint {
    margin: 0.55rem 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}
.thf-reader-title {
    cursor: pointer;
}
.thf-reader-title strong i {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.75;
}
.thf-surah-card.is-current {
    border-color: #047857;
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.15);
}
html.thf-dark .thf-mushaf-paper {
    background: #0f172a;
    border-color: #334155;
}
html.thf-dark .thf-mushaf-page { color: #f8fafc; }
html.thf-dark .thf-ayah-inline.is-active,
html.thf-dark .thf-ayah-inline.is-playing { background: #134e4a; }
html.thf-dark .thf-mushaf-pager-meta strong { color: #f8fafc; }
html.thf-dark .thf-mushaf-aside {
    background: #0f172a;
    border-color: #334155;
}
html.thf-dark .thf-mushaf-pager-btn {
    background: #134e4a;
    border-color: #115e59;
    color: #99f6e4;
}
