:root{--bg:#f4f5f7;--card:#fff;--ink:#20242a;--muted:#6d737b;--line:#dfe3e7;--accent:#20242a;--danger:#a72727}
*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--ink)}a{color:inherit}header{background:#20242a;color:#fff;padding:22px 16px}.wrap{max-width:1100px;margin:auto}.topbar{display:flex;justify-content:space-between;gap:15px;align-items:center}.topbar h1{margin:0;font-size:26px}.subtitle{opacity:.8;margin-top:5px}.logout{font-size:14px;color:#fff}.content{padding:18px 14px 40px}.card{background:var(--card);border-radius:14px;padding:16px;margin-bottom:14px;box-shadow:0 1px 7px rgba(0,0,0,.08)}.grid{display:grid;gap:12px}.grid.cards{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.navcard{border:1px solid var(--line);border-radius:12px;padding:18px;cursor:pointer;background:#fff}.navcard:hover{box-shadow:0 2px 8px rgba(0,0,0,.08)}.navcard .icon{font-size:27px}.navcard h3{margin:8px 0 0}.toolbar{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.toolbar input,.toolbar select,input[type=text],input[type=password],select{padding:11px 12px;border:1px solid #cfd4da;border-radius:10px;font-size:15px;background:#fff}button,.button{border:0;border-radius:10px;background:#20242a;color:#fff;padding:10px 14px;cursor:pointer;font-size:15px}.button.secondary,button.secondary{background:#e7e9ec;color:#20242a}.button.danger,button.danger{background:var(--danger)}button:disabled{opacity:.5;cursor:not-allowed}.track{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid #eee}.track:last-child{border-bottom:0}.play{width:46px;height:46px;border-radius:50%;padding:0;font-size:19px;flex:none}.trackmeta{min-width:0;flex:1}.tracktitle{font-weight:700;word-break:break-word}.tags{font-size:13px;color:var(--muted);margin-top:3px}.download{text-decoration:none;font-size:22px;padding:8px}.player{position:sticky;top:8px;z-index:5}.player audio{width:100%}.now{font-weight:700;margin:5px 0 10px}.breadcrumbs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.breadcrumbs button{background:#e7e9ec;color:#20242a;padding:7px 10px}.hidden{display:none!important}.empty{color:var(--muted);padding:25px;text-align:center}.notice{padding:11px;border-radius:9px;background:#eef2f5;margin-bottom:12px}.error{background:#ffe3e3;color:#7d1717}.loginbox{max-width:420px;margin:10vh auto;background:#fff;padding:28px;border-radius:16px;box-shadow:0 3px 18px rgba(0,0,0,.12)}.loginbox h1{margin-top:0}.loginbox input{width:100%;margin:10px 0}.loginbox button{width:100%}.adminnav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.adminnav button.active{background:#20242a;color:#fff}.adminnav button{background:#e7e9ec;color:#20242a}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.grow{flex:1}.source{border:1px solid var(--line);border-radius:10px;padding:12px;margin:9px 0}.path{font-family:monospace;font-size:13px;color:#555;word-break:break-all}.folder{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:8px;border-bottom:1px solid #eee;cursor:pointer}.folder:hover{background:#f6f7f8}.treeitem{padding:8px 10px;border-radius:8px;cursor:pointer;margin:3px 0}.treeitem:hover,.treeitem.selected{background:#eceff2}.indent{margin-left:18px}.split{display:grid;grid-template-columns:minmax(260px,340px) 1fr;gap:14px}.trackpick{max-height:55vh;overflow:auto;border:1px solid var(--line);border-radius:10px;padding:8px}.trackpick label{display:flex;gap:9px;align-items:flex-start;padding:8px;border-bottom:1px solid #eee}.trackpick input{margin-top:3px}.small{font-size:13px;color:var(--muted)}@media(max-width:760px){.split{grid-template-columns:1fr}.topbar{align-items:flex-start}.track{align-items:flex-start}.toolbar>*{width:100%}.toolbar button,.toolbar .button{width:auto}}
.sep{border:0;border-top:1px solid var(--line);margin:18px 0}.mini{font-size:11px;margin-top:4px}.result-heading{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.result-heading h2{margin-right:2px}.result-count{display:inline-flex;align-items:center;background:#e7e9ec;border-radius:999px;padding:6px 10px;font-size:13px;font-weight:700;color:#4f555c}.trackpick label>span{min-width:0;flex:1}

/* MMK CAST UI */
.castbar{display:flex;align-items:center;gap:10px;min-height:38px;margin:3px 0 10px;color:var(--muted);font-size:13px}
google-cast-launcher{width:34px;height:34px;--disconnected-color:#20242a;--connected-color:#1a8f42;flex:none}
.castcontrols{display:flex;gap:6px;margin-left:auto}.castcontrols button{padding:6px 9px;min-width:38px;background:#e7e9ec;color:#20242a;font-size:17px}

/* MMK SPECTRUM UI */
.mmk-spectrum-wrap{position:relative;margin-top:10px;height:72px;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:linear-gradient(180deg,rgba(32,36,42,.035),rgba(32,36,42,.01))}
#mmkSpectrum{display:block;width:100%;height:100%;padding:8px 9px 7px}
.mmk-spectrum-mode{position:absolute;right:8px;top:5px;font-size:9px;font-weight:700;letter-spacing:.12em;color:var(--muted);opacity:.65;pointer-events:none}
@media(max-width:760px){.mmk-spectrum-wrap{height:60px}}

/* MMK CAST VOLUME */
.castbar{
    flex-wrap:wrap;
}

.castvolume{
    display:flex;
    align-items:center;
    gap:9px;
    flex-basis:100%;
    padding-left:43px;
    padding-right:4px;
    margin-top:2px;
}

.castvolume.hidden{
    display:none;
}

.castvolume-icon{
    font-size:17px;
}

#mmkCastVolumeSlider{
    flex:1;
    min-width:100px;
    accent-color:currentColor;
}

#mmkCastVolumeValue{
    min-width:42px;
    text-align:right;
    font-size:12px;
    font-weight:600;
}


/* MMK AIRPLAY UI */
.mmk-airplay-bar{
    margin:8px 0 3px;
}

.mmk-airplay-button{
    display:inline-flex;
    align-items:center;
    gap:9px;
    border:1px solid var(--line);
    border-radius:9px;
    padding:7px 12px;
    background:#e7e9ec;
    color:#20242a;
    font-weight:600;
    cursor:pointer;
}

.mmk-airplay-button.active{
    font-weight:700;
}

.mmk-airplay-symbol{
    position:relative;
    display:inline-block;
    width:24px;
    height:20px;
}

.mmk-airplay-screen{
    position:absolute;
    left:2px;
    top:0;
    width:20px;
    height:13px;
    border:2px solid currentColor;
    border-radius:2px;
}

.mmk-airplay-triangle{
    position:absolute;
    left:7px;
    bottom:0;
    width:0;
    height:0;
    border-left:5px solid transparent;
    border-right:5px solid transparent;
    border-bottom:7px solid currentColor;
}



/* MMK STATS UI */
.stats-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:12px;margin-bottom:12px}
.statbox{margin:0}.statnumber{font-size:25px;font-weight:750;margin-top:4px}
.statsrow{display:flex;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.statsrow:last-child{border-bottom:0}.statsright{text-align:right;white-space:nowrap}



/* MMK SHARE 7J */
.mmk-now-row{display:flex;align-items:center;gap:8px}
.mmk-now-row .now{flex:1;min-width:0}
.mmk-share-track{
    flex:0 0 auto;border:0;background:transparent;color:inherit;
    font-size:24px;line-height:1;padding:6px 8px;cursor:pointer;border-radius:8px
}
.mmk-share-track:hover{background:rgba(127,127,127,.12)}
.mmk-share-track[hidden]{display:none!important}

/* Icône partage MMK */
.mmk-share-icon{
    width:27px;
    height:27px;
    display:block;
    overflow:visible;
}

.mmk-share-icon circle{
    fill:currentColor;
    stroke:none;
}

.mmk-share-icon path{
    fill:none;
    stroke:currentColor;
    stroke-width:2.6;
    stroke-linecap:round;
}


/* MMK PLAYER CONTROLS */
.mmk-player-buttons{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:18px;
    margin-top:10px;
}

.mmk-player-buttons button{
    border:0;
    border-radius:50%;
    width:44px;
    height:44px;
    font-size:20px;
    cursor:pointer;
}

#mmkVisiblePlayPause{
    width:52px;
    height:52px;
    font-size:23px;
}


/* MMK PLAYER BUTTONS V2 */
.mmk-player-buttons{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:18px;
    margin-top:10px;
}

.mmk-player-buttons button{
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    border:0;
    border-radius:50%;
    font-size:20px;
    cursor:pointer;
}

#mmkVisiblePlayPause{
    width:52px;
    height:52px;
    font-size:23px;
}

/* PLAY / PAUSE MMK sans emoji */
.mmk-pp-icon{
    display:block;
    position:relative;
    width:22px;
    height:24px;
}

.mmk-pp-icon.play{
    width:0;
    height:0;
    border-top:12px solid transparent;
    border-bottom:12px solid transparent;
    border-left:18px solid currentColor;
    margin-left:4px;
}

.mmk-pp-icon.pause::before,
.mmk-pp-icon.pause::after{
    content:"";
    position:absolute;
    top:1px;
    width:7px;
    height:22px;
    border-radius:2px;
    background:currentColor;
}

.mmk-pp-icon.pause::before{
    left:2px;
}

.mmk-pp-icon.pause::after{
    right:2px;
}


/* Correction Play : vrai triangle, zéro camembert */
.mmk-pp-icon.play{
    width:0 !important;
    height:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    border-top:12px solid transparent !important;
    border-bottom:12px solid transparent !important;
    border-left:20px solid currentColor !important;
    border-right:0 !important;
    margin-left:5px;
}

.mmk-pp-icon.play::before,
.mmk-pp-icon.play::after{
    display:none !important;
}

/* MMK : une seule rangée de commandes */
#mmkCastControls{
    display:none !important;
}

/* Si l'ancien patch de masquage en Cast a été appliqué,
   on garde au contraire les commandes générales visibles */
.mmk-player-buttons.mmk-hidden-during-cast{
    display:flex !important;
}


/* MMK CAST VOLUME +/- */
#mmkCastVolume.castvolume{
    display:flex;
    flex-basis:auto;
    align-items:center;
    justify-content:flex-end;
    gap:9px;

    margin:0 0 0 auto;
    padding:0;
}

#mmkCastVolume.hidden{
    display:none;
}

.mmk-cast-volume-button{
    display:flex;
    align-items:center;
    justify-content:center;

    width:44px;
    height:44px;

    border:0;
    border-radius:50%;

    background:#20242a;
    color:#fff;

    font-size:27px;
    font-weight:500;
    line-height:1;

    padding:0;
    margin:0;

    cursor:pointer;

    -webkit-user-select:none;
    user-select:none;
    touch-action:none;
}

.mmk-cast-volume-button:active{
    transform:scale(.94);
}

.mmk-cast-volume-value{
    display:inline-block;
    min-width:58px;

    text-align:center;

    font-size:17px;
    font-weight:700;
}

/* Les anciennes commandes Cast restent cachées */
#mmkCastControls{
    display:none !important;
}


/* =========================================================
   MMK - MA PLAYLIST PERSONNELLE
   ========================================================= */

.mmk-personal-main{
    white-space:nowrap;
}

#mmkPersonalCount{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:24px;
    height:24px;
    padding:0 7px;
    margin-left:4px;
    border-radius:12px;
    background:rgba(255,255,255,.12);
    font-size:13px;
}

.mmk-personal-add{
    width:38px;
    height:38px;
    min-width:38px;
    padding:0 !important;
    border-radius:50% !important;
    font-size:24px !important;
    line-height:1 !important;
    display:flex;
    align-items:center;
    justify-content:center;
}

.mmk-personal-overlay{
    position:fixed;
    inset:0;
    z-index:9999;
    background:rgba(0,0,0,.72);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:18px;
}

.mmk-personal-overlay.hidden{
    display:none !important;
}

.mmk-personal-popup{
    width:min(760px,100%);
    max-height:88vh;
    display:flex;
    flex-direction:column;
    background:#151a20;
    border:1px solid rgba(255,255,255,.12);
    border-radius:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.45);
    overflow:hidden;
}

.mmk-personal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:18px 20px;
    border-bottom:1px solid rgba(255,255,255,.10);
}

.mmk-personal-head h2{
    margin:0 0 3px 0;
}

.mmk-personal-close{
    width:42px;
    height:42px;
    min-width:42px;
    padding:0 !important;
    border-radius:50% !important;
    font-size:28px !important;
    line-height:1 !important;
}

.mmk-personal-list{
    overflow:auto;
    padding:8px 14px;
}

.mmk-personal-row{
    display:flex;
    align-items:center;
    gap:10px;
    padding:11px 4px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.mmk-personal-num{
    width:28px;
    flex:0 0 28px;
    text-align:center;
    opacity:.55;
}

.mmk-personal-meta{
    flex:1;
    min-width:0;
}

.mmk-personal-title{
    font-weight:700;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.mmk-personal-tags{
    margin-top:3px;
    font-size:12px;
    opacity:.65;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.mmk-personal-actions{
    display:flex;
    gap:5px;
}

.mmk-personal-actions button{
    width:36px;
    height:36px;
    min-width:36px;
    padding:0 !important;
    border-radius:50% !important;
}

.mmk-personal-empty{
    padding:42px 20px;
    text-align:center;
    opacity:.75;
}

.mmk-personal-empty span{
    font-size:13px;
}

.mmk-personal-empty.hidden{
    display:none;
}

.mmk-personal-footer{
    display:flex;
    gap:10px;
    padding:14px;
    border-top:1px solid rgba(255,255,255,.10);
}

.mmk-personal-footer button:first-child{
    flex:1;
}

body.mmk-popup-open{
    overflow:hidden;
}

@media(max-width:600px){

    .mmk-personal-overlay{
        padding:0;
        align-items:stretch;
    }

    .mmk-personal-popup{
        width:100%;
        max-height:none;
        height:100%;
        border-radius:0;
        border:0;
    }

    .mmk-personal-head{
        padding-top:max(18px,env(safe-area-inset-top));
    }

    .mmk-personal-footer{
        padding-bottom:max(14px,env(safe-area-inset-bottom));
    }
}


/* =========================================================
   MMK - CORRECTION CONTRASTE MA PLAYLIST
   ========================================================= */

.mmk-personal-popup{
    color:#f4f5f7 !important;
}

.mmk-personal-head h2{
    color:#ffffff !important;
}

.mmk-personal-head .small{
    color:#aeb5bf !important;
    opacity:1 !important;
}

.mmk-personal-num{
    color:#8f98a5 !important;
    opacity:1 !important;
}

.mmk-personal-title{
    color:#ffffff !important;
}

.mmk-personal-tags{
    color:#aeb5bf !important;
    opacity:1 !important;
}

.mmk-personal-empty{
    color:#e5e7eb !important;
    opacity:1 !important;
}

.mmk-personal-empty span{
    color:#9ca3af !important;
}

.mmk-personal-actions button,
.mmk-personal-close{
    background:#20242a !important;
    color:#ffffff !important;
    border:0 !important;
}

.mmk-personal-actions button:active,
.mmk-personal-close:active{
    background:#303640 !important;
}

#mmkPersonalPlay{
    background:#20242a !important;
    color:#ffffff !important;
}

#mmkPersonalClear{
    background:#e7e9ed !important;
    color:#20242a !important;
}


/* =========================================================
   MMK - ALIGNEMENT BOUTONS RECHERCHE / PLAYLISTS / MA PLAYLIST
   ========================================================= */

@media (max-width:700px){

    .toolbar{
        display:grid !important;
        grid-template-columns:repeat(3, minmax(0,1fr)) !important;
        gap:12px !important;
    }

    .toolbar #q,
    .toolbar #genre,
    .toolbar #composer,
    .toolbar #year{
        grid-column:1 / -1 !important;
        width:100% !important;
    }

    #searchBtn,
    #homeBtn,
    #mmkPersonalButton{
        width:100% !important;
        min-width:0 !important;
        height:68px !important;
        min-height:68px !important;
        padding:10px 8px !important;
        margin:0 !important;
        font-size:18px !important;
        line-height:1.1 !important;
        white-space:nowrap !important;
    }

    #mmkPersonalButton{
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        gap:5px !important;
    }

    #mmkPersonalCount{
        margin-left:2px !important;
    }
}


/* =========================================================
   MMK - TOOLBAR MOBILE PROPRE
   ========================================================= */

@media (max-width:700px){

    .toolbar{
        display:grid !important;
        grid-template-columns:1fr 1fr !important;
        gap:10px !important;
    }

    .toolbar #q,
    .toolbar #genre,
    .toolbar #composer,
    .toolbar #year{
        grid-column:1 / -1 !important;
        width:100% !important;
    }

    /* Rechercher seul sur toute la largeur */
    #searchBtn{
        grid-column:1 / -1 !important;
        width:100% !important;
        height:56px !important;
        min-height:56px !important;
        margin:0 !important;
        padding:0 16px !important;
        font-size:18px !important;
        border-radius:14px !important;
    }

    /* Les deux playlists côte à côte */
    #homeBtn,
    #mmkPersonalButton{
        grid-column:auto !important;
        width:100% !important;
        min-width:0 !important;
        height:56px !important;
        min-height:56px !important;
        margin:0 !important;
        padding:0 12px !important;
        border-radius:14px !important;

        display:flex !important;
        align-items:center !important;
        justify-content:center !important;

        font-size:17px !important;
        line-height:1 !important;
        white-space:nowrap !important;
    }

    #mmkPersonalButton{
        gap:7px !important;
    }

    #mmkPersonalCount{
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;

        min-width:24px !important;
        height:24px !important;
        padding:0 7px !important;
        margin:0 !important;

        border-radius:999px !important;
        font-size:13px !important;
        font-weight:700 !important;
        line-height:1 !important;

        background:rgba(0,0,0,.08) !important;
    }
}

