/* =========================================================
   حصن المسلم V15 — تصميم خفيف وسريع ومحصور داخل القسم
   ========================================================= */

.hisn-v17 {
    --hisn-bg: var(--eq-theme-bg, #f7faf7);
    --hisn-surface: var(--eq-theme-surface, #ffffff);
    --hisn-surface-soft: #f4f8f4;
    --hisn-text: var(--eq-theme-text, #21372f);
    --hisn-muted: var(--eq-theme-muted, #68776f);
    --hisn-green: #2f684f;
    --hisn-green-strong: #1f563f;
    --hisn-gold: #b78a3c;
    --hisn-gold-soft: #f4ead5;
    --hisn-border: rgba(39, 89, 67, .15);
    --hisn-shadow: 0 12px 34px rgba(31, 74, 55, .07);
    --hisn-radius: 18px;
    color: var(--hisn-text);
}

html.dark .hisn-v17,
html[data-theme="dark"] .hisn-v17,
body.dark.hisn-v17 {
    --hisn-bg: #101814;
    --hisn-surface: #17211c;
    --hisn-surface-soft: #1b2821;
    --hisn-text: #edf5ef;
    --hisn-muted: #a8b7ad;
    --hisn-green: #78a68a;
    --hisn-green-strong: #9dc3aa;
    --hisn-gold: #c9a65d;
    --hisn-gold-soft: rgba(201,166,93,.12);
    --hisn-border: rgba(210, 229, 216, .12);
    --hisn-shadow: none;
}

.hisn-v17 .hisn-main {
    width: min(1180px, calc(100% - 28px));
    margin-inline: auto;
    padding: 18px 0 52px;
}

.hisn-v17 .hisn-skip-link {
    position: fixed;
    inset-inline-start: 12px;
    top: -80px;
    z-index: 100000;
    padding: 10px 14px;
    background: var(--hisn-green-strong);
    color: #fff;
    border-radius: 10px;
}
.hisn-v17 .hisn-skip-link:focus { top: 10px; }

.hisn-v17 .hisn-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 4px 0 16px;
    font-size: .91rem;
    color: var(--hisn-muted);
}
.hisn-v17 .hisn-breadcrumb a { color: var(--hisn-green); text-decoration: none; }
.hisn-v17 .hisn-breadcrumb a:hover { text-decoration: underline; }

.hisn-v17 .hisn-eyebrow {
    margin: 0 0 7px;
    color: var(--hisn-gold);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .02em;
}

/* Hero */
.hisn-v17 .hisn-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: center;
    gap: 28px;
    overflow: hidden;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--hisn-border);
    border-radius: 26px;
    background:
        radial-gradient(circle at 88% 10%, rgba(183,138,60,.13), transparent 27%),
        linear-gradient(135deg, var(--hisn-surface) 0%, var(--hisn-surface-soft) 100%);
    box-shadow: var(--hisn-shadow);
}
.hisn-v17 .hisn-hero h1,
.hisn-v17 .hisn-detail-hero h1 {
    margin: 0;
    color: var(--hisn-green-strong);
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    line-height: 1.35;
}
.hisn-v17 .hisn-hero__copy > p:not(.hisn-eyebrow) {
    max-width: 760px;
    margin: 13px 0 0;
    color: var(--hisn-muted);
    font-size: 1.05rem;
    line-height: 2;
}
.hisn-v17 .hisn-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 20px;
}
.hisn-v17 .hisn-hero__stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border: 1px solid var(--hisn-border);
    border-radius: 999px;
    background: var(--hisn-surface);
    color: var(--hisn-muted);
    font-size: .9rem;
}
.hisn-v17 .hisn-hero__stats strong { color: var(--hisn-green-strong); }
.hisn-v17 .hisn-hero__book {
    display: grid;
    place-items: center;
    min-height: 218px;
    border: 1px solid rgba(183,138,60,.23);
    border-radius: 22px;
    background: var(--hisn-gold-soft);
}
.hisn-v17 .hisn-hero__book img {
    display: block;
    width: min(150px, 80%);
    height: auto;
    max-height: 205px;
    object-fit: contain;
}

/* Shared headings */
.hisn-v17 .hisn-section-head { margin-bottom: 16px; }
.hisn-v17 .hisn-section-head h2 {
    margin: 0;
    color: var(--hisn-green-strong);
    font-size: clamp(1.25rem, 2.5vw, 1.7rem);
}
.hisn-v17 .hisn-section-head > p:last-child {
    margin: 7px 0 0;
    color: var(--hisn-muted);
}

/* Last visited */
.hisn-v17 .hisn-last {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(183,138,60,.28);
    border-radius: 15px;
    background: var(--hisn-gold-soft);
}
.hisn-v17 .hisn-last a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--hisn-text);
    text-decoration: none;
    font-weight: 800;
}
.hisn-v17 .hisn-last small { display: block; color: var(--hisn-muted); font-weight: 500; }

/* Featured */
.hisn-v17 .hisn-featured,
.hisn-v17 .hisn-browser,
.hisn-v17 .hisn-related { margin-top: 34px; }
.hisn-v17 .hisn-featured__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.hisn-v17 .hisn-feature-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid var(--hisn-border);
    border-radius: 15px;
    background: var(--hisn-surface);
    color: var(--hisn-text);
    text-decoration: none;
    font-weight: 800;
}
.hisn-v17 .hisn-feature-card:hover { border-color: rgba(183,138,60,.5); }
.hisn-v17 .hisn-feature-card__num {
    color: var(--hisn-gold);
    font-variant-numeric: tabular-nums;
    font-size: .83rem;
}

/* Search + filters */
.hisn-v17 .hisn-browser {
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--hisn-border);
    border-radius: 22px;
    background: var(--hisn-surface);
}
.hisn-v17 .hisn-section-head--browser {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: end;
    gap: 22px;
}
.hisn-v17 .hisn-search-wrap { position: relative; }
.hisn-v17 #hisn-search {
    width: 100%;
    min-height: 48px;
    padding: 0 14px 0 64px;
    border: 1px solid var(--hisn-border);
    border-radius: 13px;
    outline: none;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    direction: rtl;
    text-align: right;
    font: inherit;
    font-size: 1rem;
}
.hisn-v17 #hisn-search:focus {
    border-color: var(--hisn-gold);
    box-shadow: 0 0 0 3px rgba(183,138,60,.12);
}
.hisn-v17 #hisn-search-clear {
    position: absolute;
    inset-inline-end: auto;
    inset-inline-start: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    padding: 7px 9px;
    background: var(--hisn-surface);
    color: var(--hisn-muted);
    cursor: pointer;
}
.hisn-v17 .hisn-filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 16px -2px 0;
    padding: 2px 2px 8px;
    scrollbar-width: thin;
}
.hisn-v17 .hisn-filters button {
    flex: 0 0 auto;
    border: 1px solid var(--hisn-border);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    font: inherit;
    cursor: pointer;
}
.hisn-v17 .hisn-filters button.is-active {
    border-color: var(--hisn-green-strong);
    background: var(--hisn-green-strong);
    color: #fff;
}
.hisn-v17 .hisn-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 13px;
    color: var(--hisn-muted);
    font-size: .9rem;
}
.hisn-v17 #hisn-reset {
    border: 0;
    background: none;
    color: var(--hisn-green);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

/* Index cards */
.hisn-v17 .hisn-index-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.hisn-v17 .hisn-index-item {
    min-width: 0;
    content-visibility: auto;
    contain-intrinsic-size: 70px;
}
.hisn-v17 .hisn-index-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 11px;
    min-height: 72px;
    padding: 11px 12px;
    border: 1px solid var(--hisn-border);
    border-radius: 14px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    text-decoration: none;
}
.hisn-v17 .hisn-index-card:hover,
.hisn-v17 .hisn-index-card:focus-visible {
    border-color: rgba(183,138,60,.55);
    background: var(--hisn-surface);
}
.hisn-v17 .hisn-index-card__number {
    display: grid;
    place-items: center;
    width: 44px;
    min-height: 38px;
    border: 1px solid rgba(183,138,60,.28);
    border-radius: 10px;
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
    font-size: .83rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.hisn-v17 .hisn-index-card__body { min-width: 0; }
.hisn-v17 .hisn-index-card__body strong {
    display: block;
    overflow: hidden;
    color: var(--hisn-text);
    font-size: 1rem;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hisn-v17 .hisn-index-card__body small {
    display: block;
    margin-top: 2px;
    color: var(--hisn-muted);
    font-size: .78rem;
}
.hisn-v17 .hisn-index-card__arrow { color: var(--hisn-gold); font-weight: 900; }
.hisn-v17 .hisn-empty {
    margin: 20px 0 0;
    padding: 20px;
    border-radius: 14px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-muted);
    text-align: center;
}

/* Related */
.hisn-v17 .hisn-related__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.hisn-v17 .hisn-related__grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--hisn-border);
    border-radius: 13px;
    background: var(--hisn-surface);
    color: var(--hisn-text);
    text-decoration: none;
    text-align: center;
    font-weight: 800;
}
.hisn-v17 .hisn-related__grid a.is-primary {
    border-color: var(--hisn-green-strong);
    background: var(--hisn-green-strong);
    color: #fff;
}

/* Detail hero */
.hisn-v17 .hisn-detail-hero {
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--hisn-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 90% 0%, rgba(183,138,60,.13), transparent 30%),
        var(--hisn-surface);
    box-shadow: var(--hisn-shadow);
}
.hisn-v17 .hisn-detail-hero > p:not(.hisn-eyebrow) {
    margin: 10px 0 0;
    color: var(--hisn-muted);
}
.hisn-v17 .hisn-detail-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.hisn-v17 .hisn-detail-hero__meta span {
    padding: 7px 10px;
    border: 1px solid var(--hisn-border);
    border-radius: 999px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-muted);
    font-size: .85rem;
}

/* Reading tools */
.hisn-v17 .hisn-reading-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 14px 0 18px;
    padding: 10px;
    border: 1px solid var(--hisn-border);
    border-radius: 14px;
    background: var(--hisn-surface);
}
.hisn-v17 .hisn-tool {
    min-height: 38px;
    border: 1px solid var(--hisn-border);
    border-radius: 10px;
    padding: 7px 11px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.hisn-v17 .hisn-tool--index {
    margin-inline-end: auto;
    border-color: rgba(183,138,60,.35);
    background: var(--hisn-gold-soft);
    color: var(--hisn-text);
    font-weight: 800;
}
.hisn-v17 .hisn-tool.is-saved {
    border-color: var(--hisn-gold);
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
    font-weight: 800;
}

/* Dhikr cards */
.hisn-v17 .hisn-content-list {
    --hisn-reading-size: 1.32rem;
    display: grid;
    gap: 13px;
    max-width: 980px;
    margin-inline: auto;
}
.hisn-v17 .hisn-dhikr-card {
    padding: clamp(17px, 3vw, 25px);
    border: 1px solid var(--hisn-border);
    border-radius: 18px;
    background: var(--hisn-surface);
    box-shadow: 0 7px 24px rgba(31,74,55,.045);
    content-visibility: auto;
    contain-intrinsic-size: 240px;
}
html.dark .hisn-v17 .hisn-dhikr-card,
html[data-theme="dark"] .hisn-v17 .hisn-dhikr-card { box-shadow: none; }
.hisn-v17 .hisn-dhikr-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}
.hisn-v17 .hisn-dhikr-card__number {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
    font-size: .82rem;
    font-weight: 900;
}
.hisn-v17 .hisn-dhikr-card__actions { display: flex; gap: 6px; }
.hisn-v17 .hisn-mini-btn,
.hisn-v17 .hisn-audio-link {
    border: 1px solid var(--hisn-border);
    border-radius: 9px;
    padding: 6px 9px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    font: inherit;
    font-size: .82rem;
    text-decoration: none;
    cursor: pointer;
}
.hisn-v17 .hisn-mini-btn--audio {
    border-color: var(--hisn-green-strong);
    background: var(--hisn-green-strong);
    color: #fff;
}
.hisn-v17 .hisn-dhikr-text {
    margin: 0;
    color: var(--hisn-text);
    font-family: var(--font3, 'Amiri', 'Traditional Arabic', serif);
    font-size: var(--hisn-reading-size);
    line-height: 2.05;
    text-align: right;
}
.hisn-v17 .hisn-dhikr-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--hisn-border);
    color: var(--hisn-muted);
    font-size: .9rem;
}
.hisn-v17 .hisn-dhikr-card__meta strong {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    min-height: 30px;
    margin-inline-start: 4px;
    border-radius: 9px;
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
}

/* Prev / next */
.hisn-v17 .hisn-prev-next {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 980px;
    margin: 20px auto 0;
}
.hisn-v17 .hisn-nav-card {
    display: block;
    min-height: 70px;
    padding: 12px 14px;
    border: 1px solid var(--hisn-border);
    border-radius: 14px;
    background: var(--hisn-surface);
    color: var(--hisn-text);
    text-decoration: none;
}
.hisn-v17 .hisn-nav-card small { display: block; color: var(--hisn-muted); margin-bottom: 4px; }
.hisn-v17 .hisn-nav-card strong { font-size: .95rem; line-height: 1.5; }
.hisn-v17 .hisn-nav-card.is-disabled { opacity: 0; pointer-events: none; }

/* Compact audio player */
.hisn-v17 .hisn-player {
    position: fixed;
    inset-inline: 12px;
    bottom: 12px;
    z-index: 999990;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto minmax(160px, 2fr) auto auto;
    align-items: center;
    gap: 9px;
    max-width: 980px;
    margin-inline: auto;
    padding: 10px 12px;
    border: 1px solid rgba(183,138,60,.35);
    border-radius: 15px;
    background: var(--hisn-surface);
    box-shadow: 0 12px 38px rgba(0,0,0,.18);
}
.hisn-v17 .hisn-player[hidden] { display: none !important; }
.hisn-v17 .hisn-player__info { min-width: 0; }
.hisn-v17 .hisn-player__info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .86rem;
}
.hisn-v17 .hisn-player__info span { color: var(--hisn-muted); font-size: .75rem; }
.hisn-v17 .hisn-player button,
.hisn-v17 .hisn-player select {
    min-height: 34px;
    border: 1px solid var(--hisn-border);
    border-radius: 9px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}
.hisn-v17 .hisn-player button { padding-inline: 10px; }
.hisn-v17 #hisn-player-toggle {
    border-color: var(--hisn-green-strong);
    background: var(--hisn-green-strong);
    color: #fff;
}
.hisn-v17 #hisn-player-progress { width: 100%; accent-color: var(--hisn-gold); }

.hisn-v17 .hisn-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .hisn-v17 .hisn-featured__grid,
    .hisn-v17 .hisn-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hisn-v17 .hisn-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hisn-v17 .hisn-player { grid-template-columns: minmax(0,1fr) auto auto; }
    .hisn-v17 #hisn-player-progress { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 680px) {
    .hisn-v17 .hisn-main { width: min(100% - 18px, 1180px); padding-top: 10px; }
    .hisn-v17 .hisn-hero { grid-template-columns: 1fr; padding: 22px 17px; }
    .hisn-v17 .hisn-hero__book { display: none; }
    .hisn-v17 .hisn-section-head--browser { grid-template-columns: 1fr; gap: 13px; }
    .hisn-v17 .hisn-index-grid { grid-template-columns: 1fr; }
    .hisn-v17 .hisn-featured__grid { grid-template-columns: 1fr; }
    .hisn-v17 .hisn-reading-tools { gap: 6px; }
    .hisn-v17 .hisn-tool--index { width: 100%; margin-inline-end: 0; text-align: center; }
    .hisn-v17 .hisn-dhikr-card { padding: 16px 13px; }
    .hisn-v17 .hisn-dhikr-card__head { align-items: flex-start; }
    .hisn-v17 .hisn-dhikr-text { line-height: 1.95; }
    .hisn-v17 .hisn-dhikr-card__meta { align-items: flex-start; flex-direction: column; }
    .hisn-v17 .hisn-prev-next { grid-template-columns: 1fr; }
    .hisn-v17 .hisn-related__grid { grid-template-columns: 1fr; }
    .hisn-v17 .hisn-player { inset-inline: 7px; bottom: 7px; grid-template-columns: minmax(0,1fr) auto; }
    .hisn-v17 .hisn-player__info { grid-column: 1 / -1; }
    .hisn-v17 #hisn-player-progress { grid-column: 1 / -1; }
    .hisn-v17 #hisn-player-speed { min-width: 72px; }
}

@media (max-width: 360px) {
    .hisn-v17 .hisn-index-card { grid-template-columns: 40px minmax(0,1fr) 18px; padding: 9px; gap: 8px; }
    .hisn-v17 .hisn-index-card__number { width: 38px; min-height: 36px; }
    .hisn-v17 .hisn-dhikr-card__actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    .hisn-v17 *, .hisn-v17 *::before, .hisn-v17 *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* =========================================================
   حصن المسلم V17 — واجهة نظيفة + بحث ثابت + مشغل عصري
   ========================================================= */

/* ---------- الرئيسية ---------- */
.hisn-v17.hisn-index-page .hisn-main {
    overflow: visible;
}

.hisn-v17 .hisn-hero--premium {
    position: relative;
    isolation: isolate;
    grid-template-columns: minmax(0, 1fr) 210px;
    min-height: 320px;
    padding: clamp(26px, 4.2vw, 48px);
    border-color: rgba(183, 138, 60, .24);
    background:
        radial-gradient(circle at 12% 12%, rgba(183, 138, 60, .11), transparent 26%),
        radial-gradient(circle at 92% 80%, rgba(47, 104, 79, .09), transparent 31%),
        linear-gradient(135deg, var(--hisn-surface) 0%, var(--hisn-surface-soft) 100%);
}

.hisn-v17 .hisn-hero--premium::after {
    content: "";
    position: absolute;
    inset-inline-end: -58px;
    top: -58px;
    width: 128px;
    height: 128px;
    border: 1px solid rgba(183, 138, 60, .13);
    border-radius: 34px;
    transform: rotate(45deg);
    pointer-events: none;
    z-index: -1;
}

.hisn-v17 .hisn-hero__copy,
.hisn-v17 .hisn-hero__visual,
.hisn-v17 .hisn-section-head--browser > * {
    min-width: 0;
}

.hisn-v17 .hisn-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.hisn-v17 .hisn-hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 15px;
    border: 1px solid var(--hisn-border);
    border-radius: 12px;
    background: var(--hisn-surface);
    color: var(--hisn-text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 900;
}

.hisn-v17 .hisn-hero__cta--primary {
    border-color: var(--hisn-green-strong);
    background: var(--hisn-green-strong);
    color: #fff;
}

.hisn-v17 .hisn-hero__visual {
    display: grid;
    gap: 9px;
    text-align: center;
}

.hisn-v17 .hisn-hero__seal {
    justify-self: center;
    padding: 5px 11px;
    border: 1px solid rgba(183, 138, 60, .28);
    border-radius: 999px;
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
    font-size: .76rem;
    font-weight: 900;
}

.hisn-v17 .hisn-hero__visual .hisn-hero__book {
    width: 100%;
    min-height: 230px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.hisn-v17 .hisn-hero__mini-stat {
    color: var(--hisn-muted);
    font-size: .76rem;
    font-weight: 800;
}

/* تابع القراءة — شريط صغير لا يزاحم الواجهة */
.hisn-v17 .hisn-last {
    width: fit-content;
    max-width: 100%;
    margin-top: 12px;
    padding: 0;
    border: 1px solid rgba(183, 138, 60, .24);
    border-radius: 12px;
    background: transparent;
    overflow: hidden;
}

.hisn-v17 .hisn-last a {
    min-height: 40px;
    padding: 6px 10px 6px 12px;
    background: linear-gradient(90deg, var(--hisn-gold-soft), var(--hisn-surface));
    font-size: .84rem;
}

.hisn-v17 .hisn-last small {
    display: inline;
    margin-inline-end: 6px;
    color: var(--hisn-gold);
    font-size: .7rem;
    font-weight: 900;
}

.hisn-v17 .hisn-last strong { font-size: .84rem; }
.hisn-v17 .hisn-last__action {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--hisn-green-strong);
    color: #fff;
    font-size: .72rem;
}

/* الوصول السريع — قائمة منسدلة مميزة وصغيرة */
.hisn-v17 .hisn-quick {
    margin-top: 14px;
    border: 1px solid rgba(183, 138, 60, .30);
    border-radius: 14px;
    background: var(--hisn-surface);
    overflow: hidden;
    box-shadow: 0 7px 22px rgba(31, 74, 55, .04);
}

.hisn-v17 .hisn-quick summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.hisn-v17 .hisn-quick summary::-webkit-details-marker { display: none; }
.hisn-v17 .hisn-quick__summary-copy { display: grid; gap: 0; }
.hisn-v17 .hisn-quick__summary-copy small {
    color: var(--hisn-gold);
    font-size: .68rem;
    font-weight: 900;
}
.hisn-v17 .hisn-quick__summary-copy strong { font-size: .85rem; }
.hisn-v17 .hisn-quick__summary-action {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
    font-size: .7rem;
    font-weight: 900;
}
.hisn-v17 .hisn-quick[open] .hisn-quick__summary-action { font-size: 0; }
.hisn-v17 .hisn-quick[open] .hisn-quick__summary-action::before {
    content: "إغلاق";
    font-size: .7rem;
}
.hisn-v17 .hisn-quick__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 9px;
    border-top: 1px solid var(--hisn-border);
}
.hisn-v17 .hisn-quick__grid a {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid var(--hisn-border);
    border-radius: 10px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    text-decoration: none;
}
.hisn-v17 .hisn-quick__grid a:hover,
.hisn-v17 .hisn-quick__grid a:focus-visible { border-color: rgba(183, 138, 60, .55); }
.hisn-v17 .hisn-quick__grid a span {
    display: grid;
    place-items: center;
    min-height: 28px;
    border-radius: 8px;
    background: var(--hisn-gold-soft);
    color: var(--hisn-gold);
    font-size: .7rem;
    font-weight: 900;
}
.hisn-v17 .hisn-quick__grid a strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8rem;
}

/* صندوق الفهرس — منع أي overflow أو تعارض مع CSS العام */
.hisn-v17.hisn-index-page .hisn-browser {
    overflow: hidden;
    margin-top: 22px;
}

.hisn-v17 .hisn-section-head--browser {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
    align-items: end;
}

/* البحث V17 — زر المسح خارج مساحة النص بصريًا */
.hisn-v17 .hisn-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.hisn-v17 .hisn-search-wrap::before {
    content: "⌕";
    position: absolute;
    inset-inline-start: 14px;
    z-index: 2;
    color: var(--hisn-green-strong);
    font-size: 1.15rem;
    line-height: 1;
    pointer-events: none;
}

.hisn-v17 #hisn-search {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding-inline-start: 44px;
    padding-inline-end: 50px;
    border: 1px solid var(--hisn-border);
    border-radius: 14px;
    outline: none;
    background: #fff !important;
    color: #20362e !important;
    -webkit-text-fill-color: #20362e !important;
    caret-color: var(--hisn-green-strong) !important;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: plaintext;
    opacity: 1 !important;
    font: inherit;
    font-size: 1rem !important;
    font-weight: 700;
    line-height: 1.4;
}

.hisn-v17 #hisn-search::-webkit-search-cancel-button,
.hisn-v17 #hisn-search::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.hisn-v17 #hisn-search::placeholder {
    color: #75837b !important;
    -webkit-text-fill-color: #75837b !important;
    opacity: 1 !important;
    font-weight: 500;
}

.hisn-v17 #hisn-search:focus {
    border-color: var(--hisn-gold);
    box-shadow: 0 0 0 3px rgba(183, 138, 60, .12);
}

.hisn-v17 #hisn-search-clear {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    min-height: 0;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid var(--hisn-border);
    border-radius: 10px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-muted);
    font: inherit;
    font-size: 0;
    cursor: pointer;
}

.hisn-v17 #hisn-search-clear::before {
    content: "×";
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
}

.hisn-v17 #hisn-search-clear:hover,
.hisn-v17 #hisn-search-clear:focus-visible {
    border-color: rgba(183, 138, 60, .45);
    color: var(--hisn-green-strong);
}

.hisn-v17 #hisn-search-clear[hidden] { display: none !important; }

html.dark .hisn-v17 #hisn-search,
html[data-theme="dark"] .hisn-v17 #hisn-search,
body.dark.hisn-v17 #hisn-search {
    background: #111b16 !important;
    color: #f0f6f2 !important;
    -webkit-text-fill-color: #f0f6f2 !important;
    caret-color: #d3b46f !important;
}

html.dark .hisn-v17 #hisn-search::placeholder,
html[data-theme="dark"] .hisn-v17 #hisn-search::placeholder,
body.dark.hisn-v17 #hisn-search::placeholder {
    color: #a8b7ad !important;
    -webkit-text-fill-color: #a8b7ad !important;
}

/* ---------- مشغل الصوت العصري V17 ---------- */
.hisn-v17 .hisn-player {
    --hisn-audio-progress: 0%;
    position: fixed;
    inset-inline: auto;
    left: 50%;
    bottom: 12px;
    z-index: 999990;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 78px 74px;
    grid-template-areas:
        "toggle info speed actions"
        "timeline timeline timeline timeline";
    align-items: center;
    gap: 8px 10px;
    width: min(780px, calc(100% - 24px));
    max-width: none;
    margin: 0;
    padding: 10px 11px 9px;
    transform: translateX(-50%);
    border: 1px solid rgba(183, 138, 60, .42);
    border-top: 2px solid var(--hisn-gold);
    border-radius: 18px;
    background: var(--hisn-surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.hisn-v17 .hisn-player[hidden] { display: none !important; }
.hisn-v17 .hisn-player.is-playing { border-top-color: var(--hisn-green-strong); }

.hisn-v17 #hisn-player-toggle {
    grid-area: toggle;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid var(--hisn-green-strong);
    border-radius: 50%;
    background: var(--hisn-green-strong);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(31, 86, 63, .18);
}

.hisn-v17 .hisn-player__info {
    grid-area: info;
    display: grid;
    min-width: 0;
    gap: 1px;
}

.hisn-v17 .hisn-player__label {
    color: var(--hisn-gold);
    font-size: .62rem;
    line-height: 1.2;
    font-weight: 900;
}

.hisn-v17 .hisn-player__info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hisn-text);
    font-size: .84rem;
    line-height: 1.35;
}

.hisn-v17 .hisn-player__info #hisn-player-time {
    color: var(--hisn-muted);
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: right;
}

.hisn-v17 #hisn-player-speed {
    grid-area: speed;
    width: 78px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid var(--hisn-border);
    border-radius: 999px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-text);
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.hisn-v17 .hisn-player__actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.hisn-v17 #hisn-player-minimize,
.hisn-v17 #hisn-player-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--hisn-border);
    border-radius: 10px;
    background: var(--hisn-surface-soft);
    color: var(--hisn-muted);
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.hisn-v17 #hisn-player-close:hover,
.hisn-v17 #hisn-player-close:focus-visible {
    border-color: rgba(166, 77, 77, .34);
    color: #a64d4d;
}

.hisn-v17 .hisn-player__timeline {
    grid-area: timeline;
    min-width: 0;
}

.hisn-v17 #hisn-player-progress {
    display: block;
    width: 100%;
    height: 18px;
    margin: 0;
    padding: 0;
    direction: ltr;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.hisn-v17 #hisn-player-progress::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        var(--hisn-gold) 0,
        var(--hisn-gold) var(--hisn-audio-progress),
        rgba(104, 119, 111, .22) var(--hisn-audio-progress),
        rgba(104, 119, 111, .22) 100%);
}

.hisn-v17 #hisn-player-progress::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border: 2px solid var(--hisn-surface);
    border-radius: 50%;
    -webkit-appearance: none;
    appearance: none;
    background: var(--hisn-gold);
    box-shadow: 0 2px 7px rgba(0, 0, 0, .18);
}

.hisn-v17 #hisn-player-progress::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(104, 119, 111, .22);
}
.hisn-v17 #hisn-player-progress::-moz-range-progress {
    height: 4px;
    border-radius: 999px;
    background: var(--hisn-gold);
}
.hisn-v17 #hisn-player-progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid var(--hisn-surface);
    border-radius: 50%;
    background: var(--hisn-gold);
}

.hisn-v17 #hisn-player-restore {
    position: fixed;
    inset-inline-start: 10px;
    bottom: 10px;
    z-index: 999991;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(250px, calc(100% - 20px));
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid rgba(183, 138, 60, .42);
    border-radius: 999px;
    background: var(--hisn-surface);
    color: var(--hisn-text);
    box-shadow: 0 9px 28px rgba(0, 0, 0, .16);
    font: inherit;
    font-size: .76rem;
    font-weight: 900;
    cursor: pointer;
}
.hisn-v17 #hisn-player-restore[hidden] { display: none !important; }

.hisn-v17.hisn-detail-page.hisn-player-open .hisn-main { padding-bottom: 150px; }

/* ---------- تجاوب الرئيسية والمشغل ---------- */
@media (max-width: 900px) {
    .hisn-v17 .hisn-hero--premium { grid-template-columns: minmax(0, 1fr) 180px; }
    .hisn-v17 .hisn-quick__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hisn-v17 .hisn-section-head--browser { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 680px) {
    .hisn-v17 .hisn-main { width: min(100% - 18px, 1180px); }
    .hisn-v17 .hisn-hero--premium {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 22px 16px;
        border-radius: 20px;
    }
    .hisn-v17 .hisn-hero__visual { display: none; }
    .hisn-v17 .hisn-hero__copy > p:not(.hisn-eyebrow) { font-size: .97rem; line-height: 1.85; }
    .hisn-v17 .hisn-hero__actions { margin-top: 15px; }
    .hisn-v17 .hisn-hero__cta { flex: 1 1 145px; }
    .hisn-v17 .hisn-hero__stats { margin-top: 14px; gap: 6px; }
    .hisn-v17 .hisn-hero__stats span { padding: 6px 9px; font-size: .79rem; }
    .hisn-v17 .hisn-last { width: 100%; }
    .hisn-v17 .hisn-last a { min-height: 39px; }
    .hisn-v17 .hisn-quick { margin-top: 11px; }
    .hisn-v17 .hisn-quick summary { min-height: 46px; padding: 7px 10px; }
    .hisn-v17 .hisn-quick__grid { grid-template-columns: 1fr; padding: 7px; }
    .hisn-v17.hisn-index-page .hisn-browser { padding: 15px 12px; }
    .hisn-v17 .hisn-filters { margin-top: 12px; }

    .hisn-v17 .hisn-player {
        bottom: 7px;
        width: calc(100% - 14px);
        grid-template-columns: 44px minmax(0, 1fr) auto;
        grid-template-areas:
            "toggle info actions"
            "timeline timeline timeline"
            "speed speed speed";
        gap: 6px 8px;
        padding: 8px;
        border-radius: 15px;
    }
    .hisn-v17 #hisn-player-toggle { width: 42px; height: 42px; min-height: 42px; }
    .hisn-v17 #hisn-player-speed { justify-self: end; width: 72px; min-height: 32px; }
    .hisn-v17 .hisn-player__info strong { font-size: .8rem; }
    .hisn-v17 #hisn-player-minimize,
    .hisn-v17 #hisn-player-close { width: 32px; height: 32px; min-height: 32px; }
    .hisn-v17.hisn-detail-page.hisn-player-open .hisn-main { padding-bottom: 180px; }
}

@media (max-width: 380px) {
    .hisn-v17 #hisn-search { font-size: .94rem !important; }
    .hisn-v17 .hisn-player__label { display: none; }
    .hisn-v17 .hisn-player__actions { gap: 4px; }
}
