/* ========== Страница манги (Детали) ========== */
.md-hero {
    position: relative;
    overflow: hidden;
    padding: 34px 40px 30px;
    background: radial-gradient(900px 260px at 85% 0%, rgba(255, 40, 70, .30), transparent 70%),
        linear-gradient(180deg, #1a0509 0%, #12060a 60%, #111 100%);
    border-bottom: 1px solid rgba(255, 77, 109, .25);
}

.md-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.md-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    opacity: .38;
    filter: saturate(1.15);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .45) 55%, transparent 96%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .45) 55%, transparent 96%);
}

.md-hero-bg img.blurred {
    filter: blur(30px) saturate(1.3) brightness(.65);
    transform: scale(1.2);
    opacity: .32;
    -webkit-mask-image: none;
    mask-image: none;
}

.md-hero-inner {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.md-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(18, 18, 24, .55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #e8e8ec;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}

.md-back:hover {
    background: rgba(255, 59, 91, .18);
    border-color: rgba(255, 59, 91, .5);
    color: #fff;
}

.md-back svg {
    width: 16px;
    height: 16px;
}

.md-hero-top {
    display: flex;
    gap: 26px;
    margin-top: 16px;
}

.md-cover {
    width: 190px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(255, 77, 109, .4);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
    flex-shrink: 0;
}

.md-head h1 {
    margin: 0;
    font-size: 38px;
    color: #fff;
    font-weight: 800;
}

.md-author {
    margin: 6px 0 10px;
    color: #e2e5ec;
    font-size: 13.5px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px 10px;
    display: inline-block;
}


.md-genres {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.md-genres span {
    background: rgba(255, 77, 109, .10);
    border: 1px solid rgba(255, 77, 109, .45);
    backdrop-filter: blur(10px);
    color: #ff8fa3;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
}

.md-score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.md-score {
    color: #ff4d6d;
    font-size: 26px;
    font-weight: 800;
}

.md-votes {
    color: #8b8e98;
    font-size: 13px;
}

/* ========== Кнопки действий ========== */
.md-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0 22px;
}

.md-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'MyCustomFont';
    font-size: 14px;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all .22s;
    border: 1px solid transparent;
}

.md-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.md-btn.primary {
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    color: #fff;
    box-shadow: 0 8px 26px rgba(255, 77, 109, .4);
}

.md-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 77, 109, .5);
}

.md-btn.ghost {
    background: rgba(29, 30, 36, .7);
    border-color: #2c2e36;
    color: #c9ccd4;
    backdrop-filter: blur(6px);
}

.md-btn.ghost:hover {
    border-color: rgba(255, 77, 109, .5);
    color: #ff8fa3;
}

.md-btn.ghost.faved {
    border-color: rgba(255, 77, 109, .7);
    color: #ff8fa3;
    background: rgba(255, 77, 109, .12);
}

.md-btn.ghost.faved svg {
    fill: #ff4d6d;
    stroke: #ff4d6d;
}

.md-share {
    display: flex;
    gap: 6px;
}

.md-btn.icon {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    background: rgba(29, 30, 36, .7);
    border-color: #2c2e36;
    color: #8b8e98;
    font-size: 11px;
    font-weight: 800;
    backdrop-filter: blur(6px);
}

.md-btn.icon:hover {
    color: #fff;
    border-color: #3a3d46;
}

.md-btn.icon.copied {
    color: #6ee7a0;
    border-color: rgba(110, 231, 160, .5);
}

.md-btn.icon svg {
    width: 15px;
    height: 15px;
}

.md-ext {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #8b8e98;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(29, 30, 36, .5);
    border: 1px solid #2c2e36;
    transition: all .2s;
}

.md-ext:hover {
    color: #ff8fa3;
    border-color: rgba(255, 77, 109, .5);
    background: rgba(255, 77, 109, .08);
}

.md-stats {
    display: flex;
    gap: 34px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.md-stats div b {
    display: block;
    color: #fff;
    font-size: 17px;
}

.md-stats div span {
    color: #6f727c;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* ========== Табы / панели ========== */
.md-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 26px 40px 80px;
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 24px;
}

.md-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #23242b;
    margin-bottom: 18px;
    overflow-x: auto;
    overflow-y: hidden !important;
    touch-action: pan-x;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.md-tabs::-webkit-scrollbar {
    display: none;
}


.md-tab {
    background: none;
    border: none;
    color: #8b8e98;
    font-family: 'MyCustomFont';
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
}

.md-tab:hover {
    color: #fff;
}

.md-tab.active {
    color: #ff4d6d;
    border-bottom-color: #ff4d6d;
}

.md-pane {
    display: none;
}

.md-pane.active {
    display: block;
}

.md-h {
    color: #fff;
    font-size: 16px;
    margin: 0 0 10px;
}

.md-desc {
    color: #c9ccd4;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}

.md-soon {
    color: #6f727c;
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
}

/* ========== Кадры из манги ========== */
.md-frames {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.md-frames img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top center;
    border-radius: 10px;
    border: 1px solid #2c2e36;
    cursor: pointer;
    background: #0d0e11;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.md-frames img:hover {
    border-color: rgba(255, 77, 109, .85);
    box-shadow: 0 0 0 1px rgba(255, 77, 109, .55), 0 10px 28px rgba(255, 77, 109, .28);
    transform: translateY(-3px);
}

.md-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(5, 6, 8, .93);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.md-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 77, 109, .5);
    box-shadow: 0 0 46px rgba(255, 77, 109, .25);
}

/* ========== Главы: аккордеон ========== */
.md-chapters {
    margin: 18px 0 40px;
}

.md-ch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.md-ch-head span,
.md-ch-count {
    color: #8b8e98;
    font-size: 13px;
    font-weight: 700;
}

.md-ch-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.md-ch-batch-btn {
    background: rgba(255, 77, 109, 0.12);
    border: 1px solid rgba(255, 77, 109, 0.35);
    color: #ff8fa3;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.md-ch-batch-btn:hover {
    background: #ff4d6d;
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 77, 109, 0.4);
}

.md-ch-batch-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.md-ch-toggle {
    background: #17181c;
    border: 1px solid #2a2c33;
    color: #d7d8db;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.md-ch-toggle:hover {
    border-color: #ff4d6d;
    color: #ff4d6d;
}

#md-ch-jump {
    background: #17181d;
    border: 1px solid #2c2e36;
    color: #e8e8ec;
    font-family: 'MyCustomFont';
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 10px;
    outline: none;
    max-width: 260px;
}

.md-ch-acc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.md-ch-empty {
    color: #5c5f66;
    padding: 12px 4px;
    font-size: 13px;
}

.md-acc-item {
    border: 1px solid #23252b;
    border-radius: 10px;
    overflow: hidden;
    background: #101114;
}

.md-acc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: #15161a;
}

.md-acc-head:hover {
    background: #1b1d22;
}

.md-acc-head .chev {
    transition: transform .18s;
    color: #8b8e98;
    font-size: 11px;
}

.md-acc-item.open .chev {
    transform: rotate(90deg);
}

.md-acc-head .rng {
    font-weight: 600;
    color: #fff;
}

.md-acc-head .cnt {
    margin-left: auto;
    color: #8b8e98;
    font-size: 12px;
}

.md-acc-body {
    display: none;
    border-top: 1px solid #23252b;
}

.md-acc-item.open .md-acc-body {
    display: block;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #32353f transparent;
    -webkit-overflow-scrolling: touch;
}

.md-acc-body::-webkit-scrollbar {
    width: 6px;
}

.md-acc-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.md-acc-body::-webkit-scrollbar-thumb {
    background: #32353f;
    border-radius: 4px;
    transition: background .2s ease;
}

.md-acc-body::-webkit-scrollbar-thumb:hover {
    background: #ff4d6d;
}

.md-ch-row-wrap {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.md-ch-row {
    display: grid;
    grid-template-columns: 36px 1fr 68px 84px 76px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #1a1b1f;
    transition: background .15s;
    box-sizing: border-box;
    width: 100%;
    cursor: pointer;
}

.md-ch-row:last-child {
    border-bottom: none;
}

.md-ch-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.md-ch-num {
    color: #6f727c;
    font-weight: 700;
    font-size: 13.5px;
    text-align: center;
    flex-shrink: 0;
}

.md-ch-name {
    color: #d6d9e0;
    font-size: 13.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.15s;
    min-width: 0;
}

.md-ch-name:hover {
    color: #ff4d6d;
}

.md-ch-pages,
.md-ch-date {
    color: #6f727c;
    font-size: 12px;
    white-space: nowrap;
}

.md-ch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.md-ch-dl-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #8b8e98;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    outline: none;
}

.md-ch-dl-btn:hover {
    background: rgba(255, 77, 109, 0.18);
    border-color: rgba(255, 77, 109, 0.6);
    color: #ff8fa3;
}

.md-ch-dl-btn.downloaded {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.6);
    color: #4ade80;
}

.md-ch-dl-btn.loading {
    border-color: #ff4d6d;
    color: #ff4d6d;
}

.md-dl-svg {
    width: 14px;
    height: 14px;
}

.md-ch-dl-btn.downloaded .md-dl-svg {
    display: none;
}

.md-ch-dl-btn.downloaded::after {
    content: '✓';
    font-size: 13px;
    font-weight: 800;
    color: #4ade80;
}

.md-dl-pct:not(:empty) {
    margin-left: 2px;
}

.md-ch-read-btn {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 77, 109, .6);
    color: #ff8fa3;
    transition: all .2s;
    background: transparent;
    flex-shrink: 0;
    text-decoration: none;
}

.md-ch-read-btn:hover {
    background: #ff4d6d;
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 77, 109, .5);
}

.md-ch-read-btn svg {
    width: 13px;
    height: 13px;
}

/* ========== Сайдбар ========== */
.md-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.md-card {
    background: #17181d;
    border: 1px solid #23242b;
    border-radius: 14px;
    padding: 16px 18px;
}

.md-card h3 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 14px;
}

.md-info div,
.ad-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px dashed #23252c;
}

.md-info div:last-child,
.ad-info-row:last-child {
    border-bottom: none;
}

.md-info span,
.ad-info-row span {
    color: #6f727c;
    font-size: 12.5px;
    flex-shrink: 0;
}

.md-info b,
.ad-info-row b {
    color: #d6d9e0;
    font-weight: 600;
    text-align: right;
}

.md-rating .md-r-big {
    color: #ff4d6d;
    font-size: 34px;
    font-weight: 800;
}

.md-rating .md-r-bar {
    height: 6px;
    background: #23242b;
    border-radius: 3px;
    margin: 10px 0;
    overflow: hidden;
}

.md-rating .md-r-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #ff4d6d, #ff8fa3);
}

.md-rating .md-r-stars {
    color: #ff4d6d;
    font-size: 16px;
    letter-spacing: 2px;
}

.md-latest a {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: #c9ccd4;
    font-size: 12.5px;
    padding: 7px 0;
    border-bottom: 1px dashed #23242b;
}

.md-latest a:last-child {
    border-bottom: none;
}

.md-latest a:hover {
    color: #ff8fa3;
}

.md-latest .md-l-num {
    color: #ff4d6d;
    font-weight: 800;
    min-width: 52px;
}

.md-latest .md-l-date {
    margin-left: auto;
    color: #6f727c;
    font-size: 11px;
}

/* ========== Адаптив детали ========== */
@media (max-width: 1000px) {
    .md-page {
        grid-template-columns: 1fr;
        padding: 20px 16px 60px;
    }

    .md-hero {
        padding: 24px 16px;
    }

    .md-hero-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .md-genres,
    .md-actions,
    .md-stats {
        justify-content: center;
    }
}

/* ---------- Продолжить чтение ---------- */
.md-continue-note {
    margin: -10px 0 16px;
    font-size: 13px;
    color: #ff8fa3;
    font-weight: 600;
}

.md-continue-note a {
    color: #8b8e98;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 6px;
    transition: color 0.2s ease;
}

.md-continue-note a:hover {
    color: #fff;
}

.md-continue-note.hidden {
    display: none !important;
}

/* Shimmer animation on cover and hero bg */
.md-cover,
.md-hero-bg {
    background: linear-gradient(90deg, #18191f 0%, #252833 35%, #343847 50%, #252833 65%, #18191f 100%) !important;
    background-size: 250% 100% !important;
    animation: ahShimmer 2s infinite ease-in-out !important;
}

/* ==========================================
   МОБИЛЬНЫЙ АДАПТИВ СТРАНИЦЫ МАНГИ (screens <= 768px)
   ========================================== */
@media (max-width: 768px) {
    .md-hero {
        padding: 20px 14px 22px !important;
    }

    .md-hero-top {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 16px !important;
    }

    .md-cover {
        width: 160px !important;
        margin: 0 auto;
    }

    .md-head h1 {
        font-size: 24px !important;
        text-align: center;
    }

    .md-author {
        text-align: center;
    }

    .md-genres {
        justify-content: center;
    }

    .md-score-row {
        justify-content: center;
    }

    .md-actions {
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    .md-btn.primary {
        flex: 1 1 auto;
        justify-content: center;
        padding: 10px 16px;
    }

    .md-btn.ghost {
        padding: 10px 14px;
    }

    .md-stats {
        justify-content: center;
        gap: 16px;
    }

    .md-page {
        grid-template-columns: 1fr !important;
        padding: 16px 16px calc(120px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow-x: hidden;
    }

    body.ah-has-download .md-page {
        padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .md-main,
    .md-side {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .md-chapters,
    #md-chapters,
    #p-ch,
    .md-ch-acc,
    .md-acc-item,
    .md-acc-body {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .md-ch-row {
        grid-template-columns: 28px 1fr 74px !important;
        gap: 8px !important;
        padding: 9px 8px !important;
    }

    .md-ch-pages,
    .md-ch-date {
        display: none !important;
    }

    .md-ch-head {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 10px !important;
    }

    .md-ch-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 8px !important;
        justify-content: space-between !important;
    }

    .md-ch-batch-btn,
    .md-ch-toggle {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 120px !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 8px 12px !important;
    }

    #md-ch-jump {
        width: 100% !important;
        flex: 1 1 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 2px !important;
    }

    .md-card {
        padding: 14px 16px !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .md-info div {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 7px 0 !important;
        gap: 12px !important;
    }

    .md-info span {
        min-width: auto !important;
        flex-shrink: 0 !important;
    }

    .md-info b {
        text-align: right !important;
        word-break: break-word !important;
        max-width: 65% !important;
    }

    .md-frames {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==============================================================
   МОДАЛЬНОЕ ОКНО ВЫБОРА ГЛАВ ДЛЯ СКАЧИВАНИЯ (СТИЛЬ ОФЛАЙН-ХРАНИЛИЩА)
   ============================================================== */
.md-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 16px;
    box-sizing: border-box;
}

.md-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.md-download-modal {
    background: #141720;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.md-modal-overlay.open .md-download-modal {
    transform: scale(1);
}

.md-dl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.md-dl-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-dl-modal-close {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ced6e0 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 16px !important;
    line-height: 1 !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
}

.md-dl-modal-close:hover {
    background: rgba(255, 77, 109, 0.25) !important;
    border-color: #ff4d6d !important;
    color: #fff !important;
    transform: scale(1.05);
}

.md-dl-modal-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    color: #8b8e98;
}

.md-dl-modal-subbar-btns {
    display: flex;
    gap: 8px;
}

.md-dl-quick-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d6d9e0;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.md-dl-quick-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.md-dl-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.md-dl-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.md-dl-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.md-dl-item.selected {
    background: rgba(255, 77, 109, 0.12);
    border-color: rgba(255, 77, 109, 0.4);
}

.md-dl-item.already-downloaded {
    opacity: 0.55;
    background: rgba(46, 213, 115, 0.05);
    border-color: rgba(46, 213, 115, 0.2);
}

.md-dl-item-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.md-dl-item.selected .md-dl-item-check {
    background: #ff4d6d;
    border-color: #ff4d6d;
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.5);
}

.md-dl-item-check svg {
    width: 13px;
    height: 13px;
    stroke: #fff;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.15s ease;
}

.md-dl-item.selected .md-dl-item-check svg {
    opacity: 1;
    transform: scale(1);
}

.md-dl-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.md-dl-item-num {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-dl-tag-saved {
    font-size: 11px;
    font-weight: 600;
    color: #2ed573;
    background: rgba(46, 213, 115, 0.15);
    padding: 1px 6px;
    border-radius: 4px;
}

.md-dl-item-title {
    font-size: 12px;
    color: #8b8e98;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-dl-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.md-dl-modal-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #c9ccd4;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.md-dl-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.md-dl-modal-submit {
    background: linear-gradient(135deg, #ff4d6d, #d63a6a);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(255, 77, 109, 0.4);
    transition: all 0.2s ease;
}

.md-dl-modal-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 77, 109, 0.55);
}

.md-dl-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}