.iranrebate-toc {
    direction: rtl;
    font-family: YekanBakh, "Yekan Bakh", "Yekan Bakh FaNum", Tahoma, sans-serif;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.iranrebate-toc .iranrebate-toc-inner {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.iranrebate-toc .toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    /*padding: 16px 20px;*/
}
.iranrebate-toc .toc-header-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.iranrebate-toc .toc-icon {
    display: flex;
}
/* Inline SVG uses currentColor; the header icon is dark, the FAB icon inherits
   the button's white color (set on .toc-fab). */
.iranrebate-toc .toc-header .toc-icon {
    color: #09090B;
}
.iranrebate-toc .toc-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2a52;
    letter-spacing: .32px;
    line-height: 1.5;
}

/* Chevron (shown for the dropdown + the mobile sheet). */
.iranrebate-toc .toc-chevron {
    display: none;
    position: relative;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    cursor: pointer;
}
.iranrebate-toc .toc-chevron::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 7px;
    width: 9px;
    height: 9px;
    border-left: 2px solid #7684a7;
    border-bottom: 2px solid #7684a7;
    border-radius: 1px;
    transform: rotate(-45deg);
    transition: transform .3s ease;
}
.iranrebate-toc.toc-open .toc-chevron::before {
    top: 11px;
    transform: rotate(135deg);
}

/* ── Nav / track / list ────────────────────────────────────────────────────── */
.iranrebate-toc .toc-nav {
    position: relative;
    padding: 0;
    border-right: 1px solid #D1DEFF;
    overflow-y: auto;
}
.iranrebate-toc .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.iranrebate-toc .toc-item {
    margin: 0;
    padding: 0;
}
.iranrebate-toc .toc-link {
    display: block;
    position: relative;
    font-size: 12px;
    line-height: 24px;
    color: #A1ABC3;
    text-align: right;
    text-decoration: none;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.iranrebate-toc .toc-link:hover {
    color: #3e74fe;
    text-decoration: none;
    background: #ECF1FF;
}

/* h3 — smaller, lighter, slightly indented. */
.iranrebate-toc .toc-level-3 .toc-link {
    font-size: 12px;
    padding-right: 16px;
}
.iranrebate-toc .toc-level-3 .toc-link::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .55;
    margin-left: 8px;
    vertical-align: middle;
}

/* Active item — light-blue bar + blue text + blue track segment. */
.iranrebate-toc .toc-item.active > .toc-link {
    color: #3e74fe;
    background: #d1deff;
    border-radius: 4px 0 0 4px;
    border-right: 1px solid;
}
.iranrebate-toc .toc-item.active > .toc-link::before {
    opacity: 1;
}

/* The floating button is markup-only on desktop; revealed in the mobile block. */
.iranrebate-toc .toc-fab {
    display: none;
}

/* ── "what you learn" dropdown ──────────────────────────────────────────────── */
.iranrebate-toc--learn .toc-link {
    color: #7684A7;
    font-size: 14px;
}
.iranrebate-toc--learn .iranrebate-toc-inner {
    background: #f1f2f6;
    border-color: transparent;
    border-radius: 24px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 24px;
}
.iranrebate-toc--learn .toc-header {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.iranrebate-toc--learn .toc-chevron {
    display: block;
}
.iranrebate-toc--learn .toc-nav {
    display: none;
}
.iranrebate-toc--learn .toc-item.active > .toc-link {
    border-radius: 8px 0 0 8px;
}
.iranrebate-toc--learn .toc-nav {
    max-height: 216px;
}

.iranrebate-toc--sidebar .toc-chevron {
    display: none;
}
.iranrebate-toc--sidebar .toc-nav {
    max-height: 528px;
}

/* ── Breakpoint switches ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .iranrebate-toc .iranrebate-toc-inner {
        padding: 16px;
    }
    .iranrebate-toc .toc-link {
        padding: 2px 8px;
    }
    .iranrebate-toc .toc-item.active > .toc-link {
        border-radius: 6px 0 0 6px;
    }

    .iranrebate-toc--sidebar .toc-chevron {
        display: block;
    }

    .iranrebate-toc--learn .iranrebate-toc-inner {
        border-radius: 12px;
    }
    .iranrebate-toc--learn .toc-title {
        font-size: 14px;
    }
    .iranrebate-toc--learn .toc-link {
        font-size: 12px;
    }

    .iranrebate-toc--sidebar .toc-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 16px;
        bottom: 16px;
        padding: 8px;
        border: 0;
        border-radius: 50%;
        background: #4c5e8c;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 6px 20px rgb(0 0 0 / .25);
        z-index: 1999;
    }
    .iranrebate-toc--sidebar .toc-fab svg {
        width: 26px;
        height: 26px;
    }
    .iranrebate-toc--sidebar.toc-open .toc-fab {
        display: none;
    }

    .iranrebate-toc--sidebar .iranrebate-toc-inner {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        display: flex;
        flex-direction: column;
        max-height: 70vh;
        border: 0;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 30px rgb(0 0 0 / .2);
        transform: translateY(100%);
        transition: transform .3s ease;
    }
    .iranrebate-toc--sidebar.toc-open .iranrebate-toc-inner {
        transform: translateY(0);
    }

    .iranrebate-toc--sidebar .toc-nav {
        max-height: 100%;
    }
}

/* Dim overlay behind the open mobile sheet. */
.iranrebate-toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / .48);
    z-index: 9999;
}