/* =========================================================
   Hadis Ahlul Bait — gaya aplikasi
   Palet: zamrud (hijau) + emas, dasar gading. Tema: terang, gelap, sepia.
   ========================================================= */

:root {
    --bg: #f6f3ea;
    --surface: #ffffff;
    --surface-2: #fbf9f3;
    --ink: #17211d;
    --ink-2: #44524b;
    --muted: #7a867f;
    --line: #e7e1d2;
    --brand: #0f5a46;
    --brand-strong: #0a3f31;
    --brand-soft: #e3f0ea;
    --on-brand: #ffffff;
    --gold: #b8913a;
    --gold-soft: #f4ecd8;
    --gold-ink: #7a5d1d;
    --mark: #f6e3a8;
    --danger: #b3261e;
    --hero-1: #0a3f31;
    --hero-2: #0f5a46;
    --hero-3: #157058;
    --shadow: 0 1px 2px rgba(20, 35, 28, .05), 0 6px 24px -8px rgba(20, 35, 28, .12);
    --shadow-lg: 0 18px 40px -16px rgba(10, 40, 30, .35);

    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-ar: "Amiri", "Scheherazade New", "Traditional Arabic", "Noto Naskh Arabic", serif;
    --font-fa: "Vazirmatn", "Tahoma", "Noto Naskh Arabic", sans-serif;
    --fs: 16px;          /* diatur dari Setelan */
    --fs-ar: 26px;       /* diatur dari Setelan */

    --radius: 18px;
    --radius-sm: 12px;
    --nav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0b1311;
    --surface: #121c19;
    --surface-2: #16231f;
    --ink: #ece8dc;
    --ink-2: #c3c9c1;
    --muted: #8a968f;
    --line: #22322c;
    --brand: #4cb08b;
    --brand-strong: #3a9574;
    --brand-soft: #183229;
    --on-brand: #06261c;
    --gold: #d9b76a;
    --gold-soft: #2a2619;
    --gold-ink: #e3c787;
    --mark: #5a4a1c;
    --danger: #f2b8b5;
    --hero-1: #08201a;
    --hero-2: #0d2f26;
    --hero-3: #123d31;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
    --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #0b1311;
        --surface: #121c19;
        --surface-2: #16231f;
        --ink: #ece8dc;
        --ink-2: #c3c9c1;
        --muted: #8a968f;
        --line: #22322c;
        --brand: #4cb08b;
        --brand-strong: #3a9574;
        --brand-soft: #183229;
        --on-brand: #06261c;
        --gold: #d9b76a;
        --gold-soft: #2a2619;
        --gold-ink: #e3c787;
        --mark: #5a4a1c;
        --danger: #f2b8b5;
        --hero-1: #08201a;
        --hero-2: #0d2f26;
        --hero-3: #123d31;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
        --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

:root[data-theme="sepia"] {
    --bg: #efe5cf;
    --surface: #fbf4e3;
    --surface-2: #f6edd8;
    --ink: #3a2e1d;
    --ink-2: #5a4a33;
    --muted: #8a785c;
    --line: #e0d1b1;
    --brand: #2f5d4b;
    --brand-strong: #234a3b;
    --brand-soft: #e3e3cc;
    --gold: #a07a2c;
    --gold-soft: #f0e2bf;
    --gold-ink: #6f5216;
    --mark: #f1d88f;
    --hero-1: #2a4a3c;
    --hero-2: #33594a;
    --hero-3: #3d6655;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--fs);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

.ic {
    width: 22px; height: 22px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.ic.sm { width: 18px; height: 18px; }
.ic.fill { fill: currentColor; }

.ar {
    font-family: var(--font-ar);
    font-size: var(--fs-ar);
    line-height: 1.95;
    direction: rtl;
    text-align: right;
    color: var(--ink);
    word-spacing: .05em;
}
.fa {
    font-family: var(--font-fa);
    direction: rtl;
    text-align: right;
    line-height: 2;
}
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pola geometri Islami (bintang delapan) */
.pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23e3c787' stroke-width='1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3Cpath d='M0 0l15 15M64 0 49 15M0 64l15-15M64 64 49 49M32 0v15M32 64V49M0 32h15M64 32H49'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 64px 64px;
}

/* ---------- Kerangka ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.shell { min-width: 0; }

.view {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 28px);
    outline: none;
}
.view.wide { max-width: 1040px; }

/* Tab bar bawah */
.nav {
    position: fixed; z-index: 30;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--nav-h) + var(--safe-b));
    padding: 6px 8px var(--safe-b);
    display: flex; justify-content: space-around; align-items: stretch;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .nav { background: var(--surface); } }
.nav-brand { display: none; }
.nav .nav-support { display: none; }
.nav-item {
    flex: 1; max-width: 96px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; font-weight: 600; color: var(--muted);
    border-radius: 14px;
    transition: color .2s;
}
.nav-item .ic { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: 99px; transition: background .2s; }
.nav-item.active { color: var(--brand); }
.nav-item.active .ic { background: var(--brand-soft); }

/* Bar atas (halaman dalam) */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 6px;
    min-height: 58px;
    padding: calc(var(--safe-t) + 6px) 10px 6px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title {
    flex: 1; min-width: 0; margin: 0;
    font-size: 17px; font-weight: 700; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: 2px; }
.icon-btn {
    width: 42px; height: 42px; flex: none;
    display: inline-grid; place-items: center;
    border: 0; border-radius: 50%; background: transparent; color: var(--ink);
    cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--brand-soft); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { color: var(--gold); }

.offline-bar {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    margin: 0 auto; padding: 8px 16px;
    font-size: 13px; font-weight: 500;
    background: var(--gold-soft); color: var(--gold-ink);
}

/* Layar lebar: rail navigasi di kiri */
@media (min-width: 960px) {
    :root { --nav-h: 0px; }
    .app { display: grid; grid-template-columns: 240px 1fr; }
    .nav {
        position: sticky; top: 0; bottom: auto; height: 100vh;
        flex-direction: column; justify-content: flex-start; gap: 4px;
        padding: 22px 14px;
        border-top: 0; border-right: 1px solid var(--line);
        background: var(--surface);
    }
    .nav-brand {
        display: flex; align-items: center; gap: 12px;
        padding: 4px 10px 22px; margin-bottom: 8px;
        border-bottom: 1px solid var(--line);
        font-size: 14px; line-height: 1.25; color: var(--muted);
    }
    .nav-brand b { color: var(--ink); font-size: 16px; }
    .nav-brand img { border-radius: 50%; }
    .nav-item {
        flex: none; max-width: none;
        flex-direction: row; justify-content: flex-start; gap: 12px;
        padding: 10px 12px; font-size: 14.5px;
    }
    .nav-item .ic { padding: 0; width: 22px; height: 22px; background: none !important; }
    .nav-item:hover { background: var(--surface-2); color: var(--ink); }
    .nav .nav-support { display: flex; margin-top: auto; color: var(--gold-ink); background: var(--gold-soft); }
    .nav-support:hover { background: var(--gold-soft); color: var(--gold-ink); filter: brightness(.97); }
    .nav-item.active { background: var(--brand-soft); }
    .view { padding-bottom: 48px; padding-left: 28px; padding-right: 28px; }
    .topbar { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Hero beranda ---------- */
.hero {
    position: relative;
    margin: 0 -16px;
    padding: calc(var(--safe-t) + 26px) 20px 76px;
    color: #f6efdc;
    background: linear-gradient(160deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
    overflow: hidden;
    border-radius: 0 0 28px 28px;
}
.hero .pattern-layer { position: absolute; inset: 0; opacity: .16; mask-image: linear-gradient(180deg, #000 10%, transparent 95%); -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 95%); }
.hero > * { position: relative; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-date { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; opacity: .85; }
.hero-date .hijri { color: #e3c787; }
.hero h1 { margin: 18px 0 2px; font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.hero .hero-ar { font-family: var(--font-ar); font-size: 24px; color: #e3c787; direction: rtl; line-height: 1.6; }
.hero p { margin: 6px 0 0; font-size: 14px; opacity: .8; max-width: 420px; }
.hero-logo { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(227, 199, 135, .5); }

.search-trigger {
    position: relative; z-index: 2;
    display: flex; align-items: center; gap: 10px;
    margin: -30px 4px 0;
    padding: 0 18px; height: 56px;
    background: var(--surface); color: var(--muted);
    border-radius: 16px; border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    font-size: 15px; cursor: text;
}
.search-trigger .ic { color: var(--brand); }

@media (min-width: 960px) {
    .hero { margin: 20px 0 0; border-radius: 28px; padding: 36px 36px 84px; }
    .hero h1 { font-size: 34px; }
    .search-trigger { margin: -32px 28px 0; }
    .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); overflow: visible; margin: 0; padding: 2px 0 0; }
    .rail-item { width: auto; }
}

/* ---------- Bagian & kartu ---------- */
.section { margin-top: 28px; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0 2px 12px;
}
.section-head h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.section-head .link { font-size: 13.5px; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; cursor: pointer; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--gold-ink);
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Kartu unggulan (hadis hari ini) */
.feature { padding: 22px 20px 16px; overflow: hidden; isolation: isolate; }
.feature > * { position: relative; z-index: 1; }
.feature::after {
    content: ""; position: absolute; top: -40px; right: -40px; width: 150px; height: 150px;
    background: radial-gradient(circle, var(--gold-soft), transparent 70%);
    pointer-events: none;
}
.feature .ar { margin: 14px 0 10px; }
.feature .tr { font-size: 1.06em; color: var(--ink); line-height: 1.7; }
.feature .tr.fa { color: var(--ink-2); }

.ornament {
    display: flex; align-items: center; gap: 10px; margin: 14px 0;
    color: var(--gold);
}
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.ornament .ic { width: 14px; height: 14px; }

.byline {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 13.5px;
}
.byline .who { font-weight: 700; color: var(--brand); }
.byline .ref { color: var(--muted); display: inline-flex; gap: 6px; align-items: flex-start; }

.actions {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.chip-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 38px; padding: 0 14px;
    border-radius: 99px; border: 1px solid var(--line);
    background: var(--surface-2); color: var(--ink-2);
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn:active { transform: scale(.97); }
.chip-btn .ic { width: 18px; height: 18px; }
.chip-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.chip-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip-btn.primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.chip-btn.grow { flex: 1; justify-content: center; }
.chip-btn.round { width: 38px; padding: 0; justify-content: center; }
.actions .spacer { flex: 1; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; padding: 0 22px;
    border-radius: 14px; border: 0;
    background: var(--brand); color: var(--on-brand);
    font-weight: 700; font-size: 15px; cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.block { width: 100%; }

/* ---------- Ma'shumin ---------- */
.star-badge {
    position: relative; flex: none;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    color: var(--gold-ink); font-weight: 800; font-size: 14px;
}
.star-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--gold-soft); stroke: var(--gold); stroke-width: 1; }
.star-badge span { position: relative; }

.rail {
    display: flex; gap: 10px; overflow-x: auto;
    margin: 0 -16px; padding: 2px 16px 10px;
    scroll-snap-type: x proximity; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-item {
    flex: none; width: 128px; scroll-snap-align: start;
    padding: 14px 12px 12px;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    transition: transform .15s, border-color .15s;
}
.rail-item:hover { border-color: var(--gold); transform: translateY(-2px); }
.rail-item .ar { font-size: 22px; line-height: 1.5; text-align: center; color: var(--brand); }
.rail-item .nm { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.rail-item .ct { font-size: 11.5px; color: var(--muted); }

.m-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
@media (min-width: 560px) { .m-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .m-grid { grid-template-columns: 1fr 1fr 1fr; } }
.m-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 14px 14px 12px;
    transition: border-color .15s, transform .15s;
}
.m-card:hover { border-color: var(--gold); }
.m-card:active { transform: scale(.99); }
.m-card .body { flex: 1; min-width: 0; }
.m-card .t1 { font-weight: 700; font-size: 15px; line-height: 1.3; }
.m-card .t2 { font-size: 13px; color: var(--muted); }
.m-card .ar { font-size: 24px; line-height: 1.4; color: var(--brand); flex: none; }
.m-card .chev { color: var(--muted); }

.page-head { padding: 18px 2px 4px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.m-hero {
    position: relative; overflow: hidden;
    margin-top: 8px; padding: 22px 20px;
    border-radius: var(--radius);
    background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
    color: #f6efdc;
}
.m-hero .pattern-layer { position: absolute; inset: 0; opacity: .13; }
.m-hero > * { position: relative; }
.m-hero .ar { color: #e3c787; font-size: 36px; line-height: 1.5; text-align: left; direction: rtl; display: inline-block; }
.m-hero h2 { margin: 2px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.m-hero .sub { font-size: 13.5px; opacity: .8; }
.m-hero .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.m-hero .chip-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #f6efdc; }
.m-hero .chip-btn:hover { background: rgba(255, 255, 255, .18); }

/* Segmen / filter */
.segment {
    display: inline-flex; padding: 4px; gap: 2px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
}
.segment button {
    border: 0; background: transparent; cursor: pointer;
    padding: 7px 14px; border-radius: 10px;
    font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.segment button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 2px 12px; }
.count { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Daftar hadis ---------- */
/* minmax(0, 1fr): rujukan panjang (nowrap) tidak boleh melebarkan kartu keluar layar */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.h-card { min-width: 0; padding: 16px 16px 12px; transition: border-color .15s; overflow-wrap: anywhere; }
.h-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.h-card .stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.h-card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; color: var(--brand);
    background: var(--brand-soft); border-radius: 99px; padding: 3px 10px 3px 8px;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag .ic { width: 13px; height: 13px; }
.h-card .ar { font-size: calc(var(--fs-ar) * .82); line-height: 1.85; }
.h-card .tr { color: var(--ink); }
.h-card .ar + .tr { margin-top: 6px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.h-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.h-card .ref { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.h-card .ref span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-card .icon-btn { position: relative; z-index: 1; width: 38px; height: 38px; margin: -6px -6px -6px 0; color: var(--muted); }
.h-card .icon-btn.on { color: var(--gold); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

.more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- Detail ---------- */
.detail { padding-top: 6px; }
.detail-who { display: flex; align-items: center; gap: 12px; margin: 10px 2px 16px; }
.detail-who .t1 { font-weight: 800; font-size: 17px; line-height: 1.3; }
.detail-who .t2 { font-size: 13px; color: var(--muted); }
.detail .card { padding: 22px 20px; }
.detail .ar { font-size: calc(var(--fs-ar) * 1.08); line-height: 2.05; }
.tr-block + .tr-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tr-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tr-block .tr { font-size: 1.08em; line-height: 1.8; white-space: pre-line; }
.ref-box {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    margin-top: 14px; padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--gold-soft); color: var(--gold-ink);
    font-size: 14px; font-weight: 500; text-align: center;
}
.ref-box [dir="auto"] { unicode-bidi: plaintext; text-align: center; }
.detail .actions { border-top: 0; padding-top: 0; margin-top: 16px; }
.tr-missing { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.tr-missing p { margin: 0; color: var(--danger); font-size: 14px; }
.tr-missing .chip-btn:disabled { opacity: .85; cursor: progress; }
.tr-hint { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: currentColor; }

/* ---------- Pencarian ---------- */
.search-bar {
    position: sticky; top: 0; z-index: 20;
    margin: 0 -16px; padding: calc(var(--safe-t) + 10px) 16px 10px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.search-field {
    display: flex; align-items: center; gap: 8px;
    height: 52px; padding: 0 6px 0 16px;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-field .ic { color: var(--muted); }
.search-field input {
    flex: 1; min-width: 0; height: 100%;
    border: 0; outline: 0; background: transparent; color: var(--ink);
    font: inherit; font-size: 16px;
}
.search-field input::-webkit-search-cancel-button { display: none; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 10px -16px 0; padding: 0 16px; }
.filters::-webkit-scrollbar { display: none; }
.filter {
    flex: none; height: 34px; padding: 0 14px;
    border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
    font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.filter.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.recent { display: grid; }
.recent button {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
    text-align: left; cursor: pointer; color: var(--ink-2); font-size: 15px;
}
.recent button .ic { color: var(--muted); width: 18px; height: 18px; }

/* ---------- Setelan ---------- */
.settings { display: grid; gap: 16px; margin-top: 8px; }
.settings .card { padding: 6px 18px; }
.setting { padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.setting-head .t1 { font-weight: 700; font-size: 15px; }
.setting-head .t2 { font-size: 13px; color: var(--muted); }
.setting .segment { margin-top: 12px; width: 100%; }
.setting .segment button { flex: 1; }
.range { width: 100%; margin-top: 14px; accent-color: var(--brand); }
.preview { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line); }
.preview .ar { font-size: var(--fs-ar); line-height: 1.8; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }

.about { text-align: center; padding: 26px 18px !important; }
.about img { width: 76px; height: 76px; border-radius: 50%; box-shadow: var(--shadow); }
.about h3 { margin: 12px 0 2px; font-size: 18px; }
.about p { margin: 6px auto 0; max-width: 460px; color: var(--ink-2); font-size: 14px; }
.stat-row { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.stat-row b { display: block; font-size: 20px; color: var(--brand); }
.stat-row span { font-size: 12px; color: var(--muted); }

/* ---------- Dukung Kami ---------- */
.support {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 18px; text-align: left;
    background: linear-gradient(135deg, var(--gold-soft), var(--surface) 70%);
    border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
}
.support-icon {
    width: 46px; height: 46px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface); color: var(--gold); border: 1px solid var(--line);
}
.support-icon .ic { fill: currentColor; }
.support-body { flex: 1; min-width: 180px; }
.support-body h3 { margin: 0; font-size: 16px; }
.support-body p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.support .btn { height: 42px; padding: 0 18px; background: var(--gold); color: var(--surface); }
.support .btn:hover { background: var(--gold-ink); color: var(--surface); }
.support .btn .ic { fill: currentColor; }
@media (max-width: 480px) { .support .btn { width: 100%; } }

/* ---------- Keadaan kosong, memuat, galat ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; color: var(--gold); stroke-width: 1.4; }
.empty h3 { margin: 12px 0 4px; color: var(--ink); font-size: 17px; }
.empty p { margin: 0 auto; max-width: 320px; font-size: 14px; }
.empty .btn { margin-top: 18px; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skeleton::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
    animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-card { padding: 18px; }
.sk-line { height: 13px; margin-top: 10px; }
.sk-line.w40 { width: 40%; } .sk-line.w70 { width: 70%; } .sk-line.w90 { width: 90%; }
.sk-line.ar { height: 22px; margin-left: auto; width: 85%; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.salawat { text-align: center; margin: 36px 0 8px; color: var(--muted); }
.salawat .ar { text-align: center; font-size: 22px; color: var(--gold-ink); line-height: 1.6; }
.salawat small { font-size: 12px; }

/* ---------- Toast ---------- */
.toast {
    position: fixed; z-index: 50; left: 50%;
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px; border-radius: 99px;
    background: var(--ink); color: var(--bg);
    font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
    transition: opacity .2s, transform .2s;
    max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { width: 18px; height: 18px; color: var(--gold); }

/* Animasi masuk halaman */
.view > * { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
