.mm-chapters-box {
    width: 100%;
    margin: 24px 0;
    direction: rtl;
    font-family: inherit;
    box-sizing: border-box;
}

.mm-chapters-box *,
.mm-chapters-box *::before,
.mm-chapters-box *::after {
    box-sizing: border-box;
}

.mm-chapters-front-header {
    margin-bottom: 16px;
}

.mm-chapters-front-header h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.7;
}

.mm-chapters-front-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mm-chapters-front-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mm-chapters-front-item:hover,
.mm-chapters-front-item:focus-within,
.mm-chapters-front-item.is-open {
    border-color: #E5B489 !important;
}

.mm-chapters-front-item.is-open {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
}

.mm-chapters-front-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    background: #ffffff !important;
    border: 0 !important;
    cursor: pointer;
    color: #111827 !important;
    text-align: right;
    font-family: inherit;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.mm-chapters-front-toggle:hover,
.mm-chapters-front-toggle:active,
.mm-chapters-front-toggle:focus,
.mm-chapters-front-toggle:focus-visible,
.mm-chapters-front-item:hover .mm-chapters-front-toggle,
.mm-chapters-front-item:focus-within .mm-chapters-front-toggle,
.mm-chapters-front-item.is-open .mm-chapters-front-toggle {
    background: #E5B489 !important;
    color: #000000 !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.mm-chapters-front-toggle:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.mm-chapters-front-toggle::-moz-focus-inner {
    border: 0 !important;
}

.mm-chapters-front-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mm-chapters-front-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #f3f4f6 !important;
    color: #374151 !important;
    font-size: 14px;
    font-weight: 800;
}

.mm-chapters-front-title {
    display: block;
    color: #111827 !important;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.mm-chapters-front-toggle:hover .mm-chapters-front-title,
.mm-chapters-front-toggle:active .mm-chapters-front-title,
.mm-chapters-front-toggle:focus .mm-chapters-front-title,
.mm-chapters-front-toggle:focus-visible .mm-chapters-front-title,
.mm-chapters-front-item:hover .mm-chapters-front-title,
.mm-chapters-front-item:focus-within .mm-chapters-front-title,
.mm-chapters-front-item.is-open .mm-chapters-front-title,
.mm-chapters-front-toggle:hover .mm-chapters-front-number,
.mm-chapters-front-toggle:active .mm-chapters-front-number,
.mm-chapters-front-toggle:focus .mm-chapters-front-number,
.mm-chapters-front-toggle:focus-visible .mm-chapters-front-number,
.mm-chapters-front-item:hover .mm-chapters-front-number,
.mm-chapters-front-item:focus-within .mm-chapters-front-number,
.mm-chapters-front-item.is-open .mm-chapters-front-number {
    color: #000000 !important;
}

.mm-chapters-front-toggle:hover .mm-chapters-front-number,
.mm-chapters-front-toggle:active .mm-chapters-front-number,
.mm-chapters-front-toggle:focus .mm-chapters-front-number,
.mm-chapters-front-toggle:focus-visible .mm-chapters-front-number,
.mm-chapters-front-item:hover .mm-chapters-front-number,
.mm-chapters-front-item:focus-within .mm-chapters-front-number,
.mm-chapters-front-item.is-open .mm-chapters-front-number {
    background: rgba(0, 0, 0, 0.08) !important;
}

.mm-chapters-front-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #111827 !important;
}

.mm-chapters-front-icon::before,
.mm-chapters-front-icon::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    border-radius: 99px;
    background: #ffffff !important;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.mm-chapters-front-icon::after {
    transform: rotate(90deg);
}

.mm-chapters-front-item.is-open .mm-chapters-front-icon::after {
    transform: rotate(0deg);
}

.mm-chapters-front-toggle:hover .mm-chapters-front-icon,
.mm-chapters-front-toggle:active .mm-chapters-front-icon,
.mm-chapters-front-toggle:focus .mm-chapters-front-icon,
.mm-chapters-front-toggle:focus-visible .mm-chapters-front-icon,
.mm-chapters-front-item:hover .mm-chapters-front-icon,
.mm-chapters-front-item:focus-within .mm-chapters-front-icon,
.mm-chapters-front-item.is-open .mm-chapters-front-icon {
    background: #000000 !important;
}

.mm-chapters-front-toggle:hover .mm-chapters-front-icon::before,
.mm-chapters-front-toggle:hover .mm-chapters-front-icon::after,
.mm-chapters-front-toggle:active .mm-chapters-front-icon::before,
.mm-chapters-front-toggle:active .mm-chapters-front-icon::after,
.mm-chapters-front-toggle:focus .mm-chapters-front-icon::before,
.mm-chapters-front-toggle:focus .mm-chapters-front-icon::after,
.mm-chapters-front-toggle:focus-visible .mm-chapters-front-icon::before,
.mm-chapters-front-toggle:focus-visible .mm-chapters-front-icon::after,
.mm-chapters-front-item:hover .mm-chapters-front-icon::before,
.mm-chapters-front-item:hover .mm-chapters-front-icon::after,
.mm-chapters-front-item:focus-within .mm-chapters-front-icon::before,
.mm-chapters-front-item:focus-within .mm-chapters-front-icon::after,
.mm-chapters-front-item.is-open .mm-chapters-front-icon::before,
.mm-chapters-front-item.is-open .mm-chapters-front-icon::after {
    background: #ffffff !important;
}

.mm-chapters-front-content {
    display: none;
    padding: 0 20px 20px;
}

.mm-chapters-front-item.is-open .mm-chapters-front-content {
    display: block;
}

.mm-chapters-front-content ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-chapters-front-content li {
    position: relative;
    margin: 0;
    padding: 12px 40px 12px 14px;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.9;
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 14px;
}

.mm-chapters-front-content li::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #111827;
    transform: translateY(-50%);
}

.mm-chapters-empty {
    margin: 0;
    padding: 14px 16px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 14px;
}

@media (max-width: 768px) {
    .mm-chapters-box {
        margin: 18px 0;
    }

    .mm-chapters-front-header h2 {
        font-size: 21px;
    }

    .mm-chapters-front-item {
        border-radius: 16px;
    }

    .mm-chapters-front-toggle {
        padding: 15px 14px;
        gap: 12px;
    }

    .mm-chapters-front-right {
        gap: 10px;
    }

    .mm-chapters-front-number {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        font-size: 13px;
    }

    .mm-chapters-front-title {
        font-size: 15px;
        line-height: 1.8;
    }

    .mm-chapters-front-icon {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }

    .mm-chapters-front-content {
        padding: 0 14px 14px;
    }

    .mm-chapters-front-content li {
        padding: 11px 34px 11px 12px;
        font-size: 14px;
        border-radius: 12px;
    }

    .mm-chapters-front-content li::before {
        right: 14px;
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 420px) {
    .mm-chapters-front-toggle {
        align-items: flex-start;
    }

    .mm-chapters-front-title {
        font-size: 14px;
    }
}
