.pshtoc-box {
    --pshtoc-radius: 18px;
    --pshtoc-border: rgba(148, 163, 184, .28);
    --pshtoc-text: #172033;
    --pshtoc-muted: #64748b;
    --pshtoc-bg: #ffffff;
    --pshtoc-soft: #f8fafc;
    --pshtoc-accent: #475569;
    --pshtoc-accent-2: #64748b;
    --pshtoc-glow: rgba(71, 85, 105, .10);
    --pshtoc-shadow: rgba(15, 23, 42, .08);
    --pshtoc-focus: rgba(71, 85, 105, .25);
    --pshtoc-hover: rgba(71, 85, 105, .075);
    --pshtoc-badge-shadow: rgba(71, 85, 105, .24);
    direction: rtl;
    margin: 28px 0 30px;
    color: var(--pshtoc-text);
    background:
        radial-gradient(circle at top right, var(--pshtoc-glow), transparent 36%),
        linear-gradient(145deg, #fff, var(--pshtoc-soft));
    border: 1px solid var(--pshtoc-border);
    border-radius: var(--pshtoc-radius);
    box-shadow: 0 18px 45px var(--pshtoc-shadow);
    overflow: hidden;
    font-family: inherit;
}

.pshtoc-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 19px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: start;
    font: inherit;
    line-height: 1.6;
}

.pshtoc-toggle:focus-visible {
    outline: 3px solid var(--pshtoc-focus);
    outline-offset: -3px;
}

.pshtoc-badge {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0 11px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--pshtoc-accent), var(--pshtoc-accent-2));
    box-shadow: 0 10px 22px var(--pshtoc-badge-shadow);
}

.pshtoc-badge span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    opacity: .95;
}

.pshtoc-title {
    flex: 1 1 auto;
    font-weight: 800;
    font-size: 1.03em;
    letter-spacing: -.01em;
}

.pshtoc-count {
    flex: 0 0 auto;
    color: var(--pshtoc-muted);
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .86em;
    white-space: nowrap;
}

.pshtoc-chevron {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-inline-end: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .7;
    transition: transform .25s ease;
}

.pshtoc-is-open .pshtoc-chevron {
    transform: rotate(225deg);
}

.pshtoc-panel {
    overflow: hidden;
    transition: max-height .28s ease;
    border-top: 1px solid var(--pshtoc-border);
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(8px);
}

.pshtoc-panel[hidden] {
    display: none;
}

.pshtoc-list {
    list-style: none;
    margin: 0;
    padding: 12px 18px 18px;
    counter-reset: pshtoc;
}

.pshtoc-item {
    margin: 0;
    padding: 0;
}

.pshtoc-link {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 13px;
    color: #25324a;
    text-decoration: none;
    line-height: 1.75;
    transition: background-color .18s ease, transform .18s ease, color .18s ease;
}

.pshtoc-link:hover,
.pshtoc-link:focus-visible {
    color: var(--pshtoc-accent);
    background: var(--pshtoc-hover);
    transform: translateX(-2px);
    text-decoration: none;
    outline: none;
}

.pshtoc-has-numbers .pshtoc-link::before {
    counter-increment: pshtoc;
    content: counter(pshtoc, decimal-leading-zero);
    flex: 0 0 auto;
    min-width: 30px;
    color: var(--pshtoc-accent);
    font-weight: 800;
    font-size: .82em;
    opacity: .86;
}

.pshtoc-link-text {
    flex: 1 1 auto;
}

.pshtoc-level-3 .pshtoc-link {
    padding-inline-start: 30px;
    font-size: .96em;
}

.pshtoc-level-4 .pshtoc-link {
    padding-inline-start: 48px;
    font-size: .93em;
}

.pshtoc-level-5 .pshtoc-link,
.pshtoc-level-6 .pshtoc-link {
    padding-inline-start: 64px;
    font-size: .9em;
}

@media (max-width: 640px) {
    .pshtoc-box {
        border-radius: 15px;
        margin: 22px 0 24px;
    }

    .pshtoc-toggle {
        padding: 14px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .pshtoc-badge {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .pshtoc-count {
        order: 4;
        margin-inline-start: 50px;
    }

    .pshtoc-list {
        padding: 10px 10px 14px;
    }
}


/* -------------------------------------------------------------
   v1.0.3 - Dark mode contrast fix
   Keeps the TOC readable in Someh/Jannah dark mode and common
   dark-mode plugins that force content text to white.
-------------------------------------------------------------- */

html.dark-skin .pshtoc-box,
body.dark-skin .pshtoc-box,
html[data-skin="dark"] .pshtoc-box,
body[data-skin="dark"] .pshtoc-box,
html[data-theme="dark"] .pshtoc-box,
body[data-theme="dark"] .pshtoc-box,
html.dark-mode .pshtoc-box,
body.dark-mode .pshtoc-box,
html.night-mode .pshtoc-box,
body.night-mode .pshtoc-box,
html.wp-dark-mode-active .pshtoc-box,
body.wp-dark-mode-active .pshtoc-box,
html.someh-dark-mode .pshtoc-box,
body.someh-dark-mode .pshtoc-box,
html.ahan-darkmode-active .pshtoc-box,
body.ahan-darkmode-active .pshtoc-box,
html[class*="dark"] body .pshtoc-box,
body[class*="dark"] .pshtoc-box {
    --pshtoc-text: #e5e7eb;
    --pshtoc-muted: #a7b0bf;
    --pshtoc-bg: #111827;
    --pshtoc-soft: #1f2937;
    --pshtoc-accent: #60a5fa;
    --pshtoc-accent-2: #38bdf8;
    --pshtoc-border: rgba(148, 163, 184, .26);
    --pshtoc-glow: rgba(96, 165, 250, .13);
    --pshtoc-shadow: rgba(0, 0, 0, .32);
    --pshtoc-focus: rgba(96, 165, 250, .35);
    --pshtoc-hover: rgba(96, 165, 250, .12);
    --pshtoc-badge-shadow: rgba(56, 189, 248, .18);
    color: var(--pshtoc-text) !important;
    background:
        radial-gradient(circle at top right, var(--pshtoc-glow), transparent 38%),
        linear-gradient(145deg, #111827, #182235) !important;
    border-color: var(--pshtoc-border) !important;
}

html.dark-skin .pshtoc-panel,
body.dark-skin .pshtoc-panel,
html[data-skin="dark"] .pshtoc-panel,
body[data-skin="dark"] .pshtoc-panel,
html[data-theme="dark"] .pshtoc-panel,
body[data-theme="dark"] .pshtoc-panel,
html.dark-mode .pshtoc-panel,
body.dark-mode .pshtoc-panel,
html.night-mode .pshtoc-panel,
body.night-mode .pshtoc-panel,
html.wp-dark-mode-active .pshtoc-panel,
body.wp-dark-mode-active .pshtoc-panel,
html.someh-dark-mode .pshtoc-panel,
body.someh-dark-mode .pshtoc-panel,
html.ahan-darkmode-active .pshtoc-panel,
body.ahan-darkmode-active .pshtoc-panel,
html[class*="dark"] body .pshtoc-panel,
body[class*="dark"] .pshtoc-panel {
    background: rgba(15, 23, 42, .82) !important;
    border-top-color: var(--pshtoc-border) !important;
}

html.dark-skin .pshtoc-title,
body.dark-skin .pshtoc-title,
html.dark-skin .pshtoc-link,
body.dark-skin .pshtoc-link,
html.dark-skin .pshtoc-link-text,
body.dark-skin .pshtoc-link-text,
html[data-skin="dark"] .pshtoc-title,
body[data-skin="dark"] .pshtoc-title,
html[data-skin="dark"] .pshtoc-link,
body[data-skin="dark"] .pshtoc-link,
html[data-skin="dark"] .pshtoc-link-text,
body[data-skin="dark"] .pshtoc-link-text,
html[data-theme="dark"] .pshtoc-title,
body[data-theme="dark"] .pshtoc-title,
html[data-theme="dark"] .pshtoc-link,
body[data-theme="dark"] .pshtoc-link,
html[data-theme="dark"] .pshtoc-link-text,
body[data-theme="dark"] .pshtoc-link-text,
html.dark-mode .pshtoc-title,
body.dark-mode .pshtoc-title,
html.dark-mode .pshtoc-link,
body.dark-mode .pshtoc-link,
html.dark-mode .pshtoc-link-text,
body.dark-mode .pshtoc-link-text,
html.night-mode .pshtoc-title,
body.night-mode .pshtoc-title,
html.night-mode .pshtoc-link,
body.night-mode .pshtoc-link,
html.night-mode .pshtoc-link-text,
body.night-mode .pshtoc-link-text,
html.wp-dark-mode-active .pshtoc-title,
body.wp-dark-mode-active .pshtoc-title,
html.wp-dark-mode-active .pshtoc-link,
body.wp-dark-mode-active .pshtoc-link,
html.wp-dark-mode-active .pshtoc-link-text,
body.wp-dark-mode-active .pshtoc-link-text,
html.someh-dark-mode .pshtoc-title,
body.someh-dark-mode .pshtoc-title,
html.someh-dark-mode .pshtoc-link,
body.someh-dark-mode .pshtoc-link,
html.someh-dark-mode .pshtoc-link-text,
body.someh-dark-mode .pshtoc-link-text,
html.ahan-darkmode-active .pshtoc-title,
body.ahan-darkmode-active .pshtoc-title,
html.ahan-darkmode-active .pshtoc-link,
body.ahan-darkmode-active .pshtoc-link,
html.ahan-darkmode-active .pshtoc-link-text,
body.ahan-darkmode-active .pshtoc-link-text,
html[class*="dark"] body .pshtoc-title,
html[class*="dark"] body .pshtoc-link,
html[class*="dark"] body .pshtoc-link-text,
body[class*="dark"] .pshtoc-title,
body[class*="dark"] .pshtoc-link,
body[class*="dark"] .pshtoc-link-text {
    color: #e5e7eb !important;
}

html.dark-skin .pshtoc-count,
body.dark-skin .pshtoc-count,
html[data-skin="dark"] .pshtoc-count,
body[data-skin="dark"] .pshtoc-count,
html[data-theme="dark"] .pshtoc-count,
body[data-theme="dark"] .pshtoc-count,
html.dark-mode .pshtoc-count,
body.dark-mode .pshtoc-count,
html.night-mode .pshtoc-count,
body.night-mode .pshtoc-count,
html.wp-dark-mode-active .pshtoc-count,
body.wp-dark-mode-active .pshtoc-count,
html.someh-dark-mode .pshtoc-count,
body.someh-dark-mode .pshtoc-count,
html.ahan-darkmode-active .pshtoc-count,
body.ahan-darkmode-active .pshtoc-count,
html[class*="dark"] body .pshtoc-count,
body[class*="dark"] .pshtoc-count {
    color: #cbd5e1 !important;
    background: rgba(30, 41, 59, .88) !important;
    border-color: rgba(148, 163, 184, .24) !important;
}

html.dark-skin .pshtoc-has-numbers .pshtoc-link::before,
body.dark-skin .pshtoc-has-numbers .pshtoc-link::before,
html[data-skin="dark"] .pshtoc-has-numbers .pshtoc-link::before,
body[data-skin="dark"] .pshtoc-has-numbers .pshtoc-link::before,
html[data-theme="dark"] .pshtoc-has-numbers .pshtoc-link::before,
body[data-theme="dark"] .pshtoc-has-numbers .pshtoc-link::before,
html.dark-mode .pshtoc-has-numbers .pshtoc-link::before,
body.dark-mode .pshtoc-has-numbers .pshtoc-link::before,
html.night-mode .pshtoc-has-numbers .pshtoc-link::before,
body.night-mode .pshtoc-has-numbers .pshtoc-link::before,
html.wp-dark-mode-active .pshtoc-has-numbers .pshtoc-link::before,
body.wp-dark-mode-active .pshtoc-has-numbers .pshtoc-link::before,
html.someh-dark-mode .pshtoc-has-numbers .pshtoc-link::before,
body.someh-dark-mode .pshtoc-has-numbers .pshtoc-link::before,
html.ahan-darkmode-active .pshtoc-has-numbers .pshtoc-link::before,
body.ahan-darkmode-active .pshtoc-has-numbers .pshtoc-link::before,
html[class*="dark"] body .pshtoc-has-numbers .pshtoc-link::before,
body[class*="dark"] .pshtoc-has-numbers .pshtoc-link::before {
    color: #7dd3fc !important;
    opacity: 1 !important;
}

html.dark-skin .pshtoc-link:hover,
body.dark-skin .pshtoc-link:hover,
html.dark-skin .pshtoc-link:focus-visible,
body.dark-skin .pshtoc-link:focus-visible,
html[data-skin="dark"] .pshtoc-link:hover,
body[data-skin="dark"] .pshtoc-link:hover,
html[data-skin="dark"] .pshtoc-link:focus-visible,
body[data-skin="dark"] .pshtoc-link:focus-visible,
html[data-theme="dark"] .pshtoc-link:hover,
body[data-theme="dark"] .pshtoc-link:hover,
html[data-theme="dark"] .pshtoc-link:focus-visible,
body[data-theme="dark"] .pshtoc-link:focus-visible,
html.dark-mode .pshtoc-link:hover,
body.dark-mode .pshtoc-link:hover,
html.dark-mode .pshtoc-link:focus-visible,
body.dark-mode .pshtoc-link:focus-visible,
html.night-mode .pshtoc-link:hover,
body.night-mode .pshtoc-link:hover,
html.night-mode .pshtoc-link:focus-visible,
body.night-mode .pshtoc-link:focus-visible,
html.wp-dark-mode-active .pshtoc-link:hover,
body.wp-dark-mode-active .pshtoc-link:hover,
html.wp-dark-mode-active .pshtoc-link:focus-visible,
body.wp-dark-mode-active .pshtoc-link:focus-visible,
html.someh-dark-mode .pshtoc-link:hover,
body.someh-dark-mode .pshtoc-link:hover,
html.someh-dark-mode .pshtoc-link:focus-visible,
body.someh-dark-mode .pshtoc-link:focus-visible,
html.ahan-darkmode-active .pshtoc-link:hover,
body.ahan-darkmode-active .pshtoc-link:hover,
html.ahan-darkmode-active .pshtoc-link:focus-visible,
body.ahan-darkmode-active .pshtoc-link:focus-visible,
html[class*="dark"] body .pshtoc-link:hover,
html[class*="dark"] body .pshtoc-link:focus-visible,
body[class*="dark"] .pshtoc-link:hover,
body[class*="dark"] .pshtoc-link:focus-visible {
    color: #ffffff !important;
    background: rgba(96, 165, 250, .13) !important;
}

.pshtoc-box,
.pshtoc-box *,
.pshtoc-box *::before,
.pshtoc-box *::after {
    text-shadow: none !important;
}

