*{box-sizing:border-box}
:root{
    --bg:#f2f2f7;
    --surface:#ffffff;
    --surface-alt:#f7f7fa;
    --line:rgba(60,60,67,.12);
    --text:#111113;
    --muted:#6e6e73;
    --muted-2:#8e8e93;
    --accent:#1f6fff;
    --blue:#0a84ff;
    --orange:#ff9f0a;
    --green:#30d158;
    --red:#ff453a;
    --gray:#8e8e93;
    --shadow:0 10px 24px rgba(0,0,0,.08);
    --nav-bg:rgba(255,255,255,.76);
}
@media (prefers-color-scheme:dark){
    :root{
        --bg:#000000;
        --surface:#1c1c1e;
        --surface-alt:#2c2c2e;
        --line:rgba(84,84,88,.36);
        --text:#f5f5f7;
        --muted:#b1b1b6;
        --muted-2:#8e8e93;
        --accent:#0a84ff;
        --blue:#0a84ff;
        --orange:#ff9f0a;
        --green:#30d158;
        --red:#ff453a;
        --gray:#8e8e93;
        --shadow:none;
        --nav-bg:rgba(28,28,30,.72);
    }
}
html,body{margin:0;padding:0;max-width:100%;overflow-x:hidden}
body{
    background:var(--bg);
    color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}
button,input,select{font:inherit}
button,.nav-button,.yamtrack-step,.yamtrack-count,.chip{touch-action:manipulation}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.58}
img{display:block}
.hidden{display:none!important}
.app-shell{
    width:min(100%,860px);
    margin:0 auto;
    padding:18px 16px calc(92px + env(safe-area-inset-bottom));
}
.view{min-height:calc(100vh - 126px)}
.hero{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
    margin-bottom:18px;
}
.hero.compact{margin-bottom:14px}
.eyebrow{
    margin:0 0 6px;
    font-size:13px;
    font-weight:700;
    color:var(--muted-2);
    letter-spacing:.02em;
    text-transform:uppercase;
}
.hero h1,.sheet-header h2{
    margin:0;
    font-size:34px;
    line-height:1.02;
    font-weight:780;
}
.hero .subtext,.section-head p,.meta-line,.detail-subtext,.small-text{
    margin:6px 0 0;
    font-size:14px;
    color:var(--muted);
    line-height:1.35;
}
.ghost-button{
    border:1px solid var(--line);
    background:var(--surface);
    color:var(--text);
    border-radius:14px;
    padding:11px 14px;
    font-weight:650;
    box-shadow:var(--shadow);
}
.ghost-button.small{padding:9px 12px;border-radius:12px;font-size:14px}
.chip-scroll{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding:2px 0 14px;
    scrollbar-width:none;
}
.chip-scroll::-webkit-scrollbar{display:none}
.chip{
    flex-shrink:0;
    border:none;
    background:var(--surface-alt);
    color:var(--text);
    padding:9px 14px;
    border-radius:999px;
    font-weight:650;
}
.chip.active{background:var(--text);color:var(--bg)}
.home-block{margin-top:8px}
.home-block+.home-block{margin-top:26px}
.section-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:12px;
    margin-bottom:12px;
}
.section-head h2{
    margin:0;
    font-size:23px;
    line-height:1.08;
    font-weight:760;
}
.poster-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(175px,1fr));
    gap:16px;
}
.poster-card{
    --state-color:var(--blue);
    position:relative;
    display:flex;
    flex-direction:column;
    background:var(--surface);
    border-radius:10px;
    overflow:hidden;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}
.poster-card.state-watching{--state-color:var(--blue)}
.poster-card.state-paused{--state-color:var(--orange)}
.poster-card.state-finished{--state-color:var(--green)}
.poster-card.state-dropped{--state-color:var(--red)}
.poster-card.state-planned{--state-color:var(--gray)}
.poster-button{
    appearance:none;
    width:100%;
    border:none;
    padding:0;
    background:none;
    color:inherit;
    text-align:left;
}
.poster-image-wrap{
    position:relative;
    aspect-ratio:2/3;
    background:var(--surface-alt);
    overflow:hidden;
}
.poster-image{
    width:100%;
    height:100%;
    object-fit:cover;
}
.next-air-badge{
    position:absolute;
    top:8px;
    right:8px;
    max-width:calc(100% - 16px);
    padding:5px 8px;
    border-radius:6px;
    background:rgba(0,0,0,.82);
    color:#fff;
    font-size:11px;
    line-height:1;
    font-weight:700;
    white-space:nowrap;
    box-shadow:0 2px 8px rgba(0,0,0,.22);
}
.yamtrack-body{
    padding:12px 10px 8px;
}
.yamtrack-title{
    margin:0;
    min-height:36px;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    text-align:center;
    font-size:14px;
    line-height:1.28;
    font-weight:760;
}
.yamtrack-controls{
    display:grid;
    margin-top:auto;
    grid-template-columns:28px minmax(0,1fr) 28px;
    align-items:center;
    gap:5px;
    padding:2px 9px 10px;
}
.yamtrack-step{
    width:28px;
    height:28px;
    padding:0;
    border:none;
    border-radius:7px;
    background:var(--surface-alt);
    color:var(--muted);
    font-size:17px;
    line-height:1;
    font-weight:760;
}
.yamtrack-count{
    min-width:0;
    border:none;
    background:transparent;
    color:var(--state-color);
    padding:3px 0;
    text-align:center;
    font-size:12px;
    line-height:1.18;
    font-weight:760;
    white-space:normal;
}
.yamtrack-numbers{
    white-space:nowrap;
}
.yamtrack-episode-word{
    display:inline-block;
    font-weight:650;
}
.yamtrack-progress{
    height:4px;
    flex-shrink:0;
    background:var(--surface-alt);
    overflow:hidden;
}
.yamtrack-progress-value{
    height:100%;
    min-width:0;
    background:var(--state-color);
}
.pill-badge{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:7px 10px;
    border-radius:999px;
    background:var(--surface-alt);
    color:var(--muted);
    font-size:12px;
    font-weight:650;
}
.list-stack{display:flex;flex-direction:column;gap:10px}
.list-row{
    display:flex;
    gap:12px;
    align-items:center;
    background:var(--surface);
    border-radius:20px;
    border:1px solid var(--line);
    padding:10px;
    box-shadow:var(--shadow);
}
.list-row-button{
    flex:1;
    display:flex;
    align-items:center;
    gap:12px;
    background:none;
    border:none;
    color:inherit;
    text-align:left;
    padding:0;
}
.list-thumb{
    width:60px;
    height:90px;
    border-radius:14px;
    object-fit:cover;
    background:var(--surface-alt);
    flex-shrink:0;
}
.list-row h3{
    margin:0;
    font-size:16px;
    font-weight:700;
}
.list-row p{
    margin:4px 0 0;
    font-size:13px;
    color:var(--muted);
    line-height:1.35;
}
.list-badges{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:8px;
}
.state-dot{
    width:9px;
    height:9px;
    border-radius:999px;
    display:inline-block;
}
.divider{
    height:1px;
    background:var(--line);
    margin:10px 0 2px;
}
.calendar-toolbar{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    gap:8px;
    align-items:center;
    margin-bottom:12px;
}
.calendar-toolbar #calendarPrev{justify-self:start}
.calendar-toolbar #calendarNext{justify-self:end}
.calendar-weekdays{
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:8px;
    margin-bottom:8px;
    color:var(--muted-2);
    font-size:12px;
    font-weight:650;
    text-align:center;
}
.calendar-grid{
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:8px;
}
.day-cell{
    min-height:122px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:20px;
    padding:9px;
    box-shadow:var(--shadow);
}
.day-cell.other-month{opacity:.34}
.day-cell.today{outline:2px solid var(--accent)}
.day-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:8px;
}
.day-number{
    font-size:15px;
    font-weight:760;
}
.day-events{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.event-pill{
    width:100%;
    border:none;
    background:var(--surface-alt);
    color:inherit;
    text-align:left;
    border-radius:12px;
    padding:7px 8px;
}
.event-pill small{display:block;color:var(--muted);margin-top:2px}
.metrics-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
    gap:10px;
    margin-bottom:18px;
}
.metric-card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:20px;
    padding:14px;
    box-shadow:var(--shadow);
}
.metric-card p{
    margin:0 0 6px;
    color:var(--muted);
    font-size:13px;
}
.metric-card h3{
    margin:0;
    font-size:28px;
    line-height:1.05;
    font-weight:780;
}
.sheet{
    position:fixed;
    inset:0;
    z-index:60;
}
.sheet-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.34);
    backdrop-filter:blur(6px);
}
.sheet-panel{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:min(88dvh,760px);
    max-height:none;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    background:var(--bg);
    border-top-left-radius:28px;
    border-top-right-radius:28px;
    padding:12px 16px calc(20px + env(safe-area-inset-bottom));
    box-shadow:0 -18px 40px rgba(0,0,0,.2);
}
.sheet-handle{
    width:42px;
    height:5px;
    border-radius:999px;
    background:var(--line);
    margin:2px auto 14px;
}
.sheet-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
    margin-bottom:14px;
    flex-shrink:0;
}
.search-form{
    display:flex;
    gap:8px;
    margin-bottom:14px;
    flex-shrink:0;
}
#searchResults{
    flex:1;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding-bottom:6px;
}
.search-form input{
    flex:1;
    min-width:0;
    border:none;
    background:var(--surface);
    color:var(--text);
    border-radius:16px;
    padding:14px 16px;
    outline:none;
    box-shadow:var(--shadow);
}
.search-form button{
    border:none;
    background:var(--text);
    color:var(--bg);
    border-radius:16px;
    padding:0 16px;
    font-weight:700;
}
.search-card{
    display:flex;
    gap:12px;
    background:var(--surface);
    border:1px solid var(--line);
    padding:10px;
    border-radius:20px;
    box-shadow:var(--shadow);
}
.search-card .poster{width:64px;height:96px;border-radius:14px;background:var(--surface-alt);object-fit:cover;flex-shrink:0}
.search-content{flex:1;min-width:0}
.search-content h3{margin:0;font-size:16px;font-weight:720}
.search-content p{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.35}
.search-content .search-overview{
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.search-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.action-button{
    border:none;
    background:var(--surface-alt);
    color:var(--text);
    border-radius:12px;
    padding:10px 12px;
    font-size:14px;
    font-weight:680;
}
.action-button.primary{background:var(--text);color:var(--bg)}
.action-button.danger{background:rgba(255,69,58,.14);color:var(--red)}
.detail-card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:28px;
    padding:16px;
    box-shadow:var(--shadow);
}
.detail-back{
    margin-bottom:12px;
    border:none;
    background:none;
    color:var(--muted);
    padding:0;
    font-weight:650;
}
.detail-top{
    display:flex;
    gap:16px;
    align-items:flex-start;
    margin-bottom:18px;
}
.detail-poster{
    width:124px;
    border-radius:20px;
    background:var(--surface-alt);
    flex-shrink:0;
}
.detail-top h1{
    margin:0;
    font-size:28px;
    line-height:1.04;
    font-weight:780;
}
.detail-chip-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}
.detail-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:12px;
}
.detail-actions select,.detail-actions button{
    border:none;
    background:var(--surface-alt);
    color:var(--text);
    border-radius:14px;
    padding:12px 14px;
    font-weight:650;
}
.panel-card{
    background:var(--surface-alt);
    border-radius:20px;
    padding:14px;
    margin-top:14px;
}
.panel-card strong{display:block;margin-bottom:4px}
.accordion-stack{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.accordion{
    background:var(--surface-alt);
    border-radius:18px;
    overflow:hidden;
}
.accordion summary{
    list-style:none;
    cursor:pointer;
    height:48px;
    min-height:48px;
    padding:0 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    font-weight:720;
}
.accordion summary::-webkit-details-marker{display:none}
.accordion summary span{color:var(--muted);font-size:13px;font-weight:650}
.accordion-actions{
    display:flex;
    gap:8px;
    padding:0 16px 12px;
}
.accordion-actions button{
    border:none;
    background:var(--surface);
    color:var(--text);
    border-radius:12px;
    padding:9px 12px;
    font-weight:650;
}
.episode-row{
    display:flex;
    gap:10px;
    align-items:center;
    padding:12px 16px;
    border-top:1px solid var(--line);
    font-size:14px;
}
.episode-row.watched{opacity:.5}
.episode-row strong{flex-shrink:0}
.episode-row span{flex:1}
.episode-row button{
    border:none;
    background:var(--surface);
    color:var(--text);
    border-radius:10px;
    padding:8px 10px;
    font-weight:650;
}
.bottom-nav{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    width:100%;
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:0;
    padding:7px 10px calc(7px + env(safe-area-inset-bottom));
    background:var(--nav-bg);
    border-top:1px solid var(--line);
    backdrop-filter:blur(24px) saturate(180%);
    -webkit-backdrop-filter:blur(24px) saturate(180%);
    z-index:50;
}
.nav-button{
    border:none;
    background:transparent;
    color:var(--muted);
    padding:5px 4px 3px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    min-height:48px;
}
.nav-button.active{
    background:transparent;
    color:var(--accent);
}
.nav-icon{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.nav-label{
    font-size:10px;
    font-weight:650;
}
.empty-card{
    background:var(--surface);
    border:1px dashed var(--line);
    color:var(--muted);
    border-radius:20px;
    padding:18px;
    text-align:center;
}
.toast{
    position:fixed;
    left:50%;
    bottom:92px;
    transform:translateX(-50%);
    background:var(--text);
    color:var(--bg);
    padding:12px 16px;
    border-radius:16px;
    font-size:14px;
    font-weight:650;
    z-index:70;
    box-shadow:0 12px 28px rgba(0,0,0,.18);
}

/* Recherche */
.search-card-simple{
    position:relative;
    display:grid;
    grid-template-columns:64px minmax(0,1fr) 50px;
    align-items:center;
    gap:12px;
    min-height:116px;
    padding:10px 12px;
}
.search-poster-button{
    border:none;
    background:transparent;
    padding:0;
    border-radius:14px;
}
.search-poster-button .poster{
    width:64px;
    height:96px;
}
.search-card-simple .search-content{
    min-width:0;
}
.search-card-simple .search-content h3{
    margin:0;
    font-size:17px;
    line-height:1.22;
    font-weight:740;
}
.search-card-simple .search-content p{
    margin:7px 0 0;
    color:var(--muted);
    font-size:14px;
}
.search-side{
    position:relative;
    display:flex;
    justify-content:flex-end;
    align-items:center;
}
.search-plus-button,
.search-added-check{
    width:42px;
    height:42px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}
.search-plus-button{
    border:none;
    background:var(--accent);
    color:white;
    font-size:30px;
    font-weight:420;
    line-height:1;
}
.search-added-check{
    background:rgba(48,209,88,.15);
    color:var(--green);
    font-size:23px;
    font-weight:800;
}
.search-added-check.pending{
    color:var(--muted);
    background:var(--surface-alt);
}
.search-add-menu{
    position:absolute;
    top:48px;
    right:0;
    z-index:20;
    min-width:148px;
    overflow:hidden;
    border-radius:14px;
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:0 14px 34px rgba(0,0,0,.18);
}
.search-add-menu button{
    display:block;
    width:100%;
    border:none;
    border-bottom:1px solid var(--line);
    padding:12px 14px;
    background:var(--surface);
    color:var(--text);
    text-align:left;
    font-weight:650;
}
.search-add-menu button:last-child{
    border-bottom:none;
}


.series-quick-actions{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) minmax(0,1fr);
    align-items:center;
    gap:9px;
    width:min(100%,420px);
    margin:14px auto 0;
}
.series-quick-actions .series-rating{
    margin:0;
    height:48px;
    min-height:48px;
    padding:0 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#ff9f0a;
    font-size:15px;
    white-space:nowrap;
}
.series-quick-button{
    min-width:0;
    height:48px;
    min-height:48px;
    border:1px solid var(--line);
    border-radius:16px;
    background:var(--surface);
    color:var(--text);
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:8px 10px;
    font-weight:700;
}
.series-quick-button>span{
    font-size:18px;
    line-height:1;
}
.series-quick-button small{
    min-width:0;
    font-size:11px;
    line-height:1.1;
    color:var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.series-quick-button:disabled{
    opacity:.38;
}

/* Fiche série mobile-first */
#view-detail{
    margin:0 -16px;
}
.series-page{
    min-height:100vh;
    background:var(--bg);
}
.series-hero{
    position:relative;
    min-height:360px;
    display:flex;
    align-items:flex-end;
    overflow:hidden;
    background:var(--surface-alt);
}
.series-backdrop{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
}
.series-backdrop-shade{
    position:absolute;
    inset:0;
    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.12) 0%,
            rgba(0,0,0,.08) 42%,
            var(--bg) 94%,
            var(--bg) 100%
        );
}
.series-back-button{
    position:absolute;
    top:calc(14px + env(safe-area-inset-top));
    left:16px;
    z-index:3;
    width:40px;
    height:40px;
    border:none;
    border-radius:999px;
    background:rgba(0,0,0,.42);
    color:#fff;
    font-size:32px;
    font-weight:300;
    line-height:34px;
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
}
.series-menu-button{
    position:absolute;
    top:calc(14px + env(safe-area-inset-top));
    right:16px;
    z-index:4;
    width:40px;
    height:40px;
    border:none;
    border-radius:999px;
    background:rgba(0,0,0,.42);
    color:#fff;
    font-size:16px;
    font-weight:800;
    letter-spacing:2px;
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
}
.series-menu{
    position:absolute;
    top:calc(64px + env(safe-area-inset-top));
    right:16px;
    z-index:5;
    min-width:230px;
    overflow:hidden;
    border-radius:16px;
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:0 16px 36px rgba(0,0,0,.22);
}
.series-menu button{
    display:block;
    width:100%;
    border:none;
    border-bottom:1px solid var(--line);
    background:var(--surface);
    color:var(--text);
    padding:13px 15px;
    text-align:left;
    font-weight:650;
}
.series-menu button:last-child{
    border-bottom:none;
}
.series-menu button.danger{
    color:var(--red);
}

.series-hero-content{
    position:relative;
    z-index:2;
    width:100%;
    padding:0 20px 24px;
    text-align:center;
}
.series-hero-content h1{
    margin:0;
    font-size:31px;
    line-height:1.05;
    font-weight:800;
    text-wrap:balance;
}
.series-meta{
    margin:10px 0 0;
    color:var(--muted);
    font-size:14px;
    line-height:1.35;
}
.series-rating{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:64px;
    margin-top:12px;
    padding:8px 13px;
    border-radius:999px;
    background:var(--surface);
    color:var(--text);
    font-size:14px;
    font-weight:780;
    border:1px solid var(--line);
}
.series-content{
    padding:0 16px calc(102px + env(safe-area-inset-bottom));
}
.series-status-control{
    display:block;
    position:relative;
    margin-bottom:14px;
}
.series-status-control.no-label>span{
    display:none;
}
.series-status-control>span{
    display:block;
    margin:0 0 7px 4px;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.02em;
}
.series-status-control select{
    width:100%;
    height:48px;
    min-height:48px;
    border:none;
    outline:none;
    border-radius:18px;
    padding:0 18px;
    background:var(--text);
    color:var(--bg);
    font-size:16px;
    font-weight:760;
    text-align:center;
}

.series-status-control.no-label::after{
    content:"";
    position:absolute;
    top:50%;
    right:18px;
    width:7px;
    height:7px;
    border-right:2px solid var(--bg);
    border-bottom:2px solid var(--bg);
    transform:translateY(-68%) rotate(45deg);
    pointer-events:none;
    z-index:2;
}
.series-status-control.no-label select{
    appearance:none;
    -webkit-appearance:none;
    padding-left:42px;
    padding-right:42px;
}
.series-progress-card{
    position:relative;
    display:grid;
    grid-template-columns:1fr auto;
    gap:5px 12px;
    margin-bottom:14px;
    padding:14px;
    border-radius:18px;
    background:var(--surface);
    border:1px solid var(--line);
}
.series-progress-card>div:first-child{
    display:flex;
    align-items:baseline;
    gap:6px;
}
.series-progress-card strong{
    font-size:18px;
}
.series-progress-card span{
    color:var(--muted);
    font-size:13px;
}
.series-progress-card>span{
    align-self:center;
    color:var(--text);
    font-weight:720;
}
.series-progress-track{
    grid-column:1/-1;
    height:5px;
    border-radius:999px;
    background:var(--surface-alt);
    overflow:hidden;
}
.series-progress-value{
    height:100%;
    background:var(--state-color,var(--blue));
    border-radius:999px;
}
.series-next-card{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin-bottom:14px;
    padding:14px;
    border-radius:18px;
    background:var(--surface);
    border:1px solid var(--line);
}
.series-next-card span{
    color:var(--muted);
    font-size:13px;
}
.series-overview-wrap{
    margin:18px 2px 22px;
}
.series-overview{
    margin:0;
    color:var(--text);
    font-size:15px;
    line-height:1.55;
    display:-webkit-box;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.series-overview.expanded{
    display:block;
    overflow:visible;
}
.series-overview-toggle{
    margin-top:8px;
    padding:0;
    border:none;
    background:transparent;
    color:var(--accent);
    font-size:14px;
    font-weight:700;
}
.series-section-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:10px;
}
.series-section-title h2{
    margin:0;
    font-size:24px;
    font-weight:780;
}
.series-section-title span{
    color:var(--muted);
    font-size:14px;
}
.series-seasons{
    margin-top:0;
}
.series-delete-button{
    width:100%;
    margin-top:22px;
    border:none;
    border-radius:16px;
    padding:13px 16px;
    background:rgba(255,69,58,.12);
    color:var(--red);
    font-weight:700;
}

@media (max-width:720px){
    .calendar-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .calendar-weekdays{display:none}
    .calendar-toolbar{grid-template-columns:1fr 1fr;grid-template-areas:"prev next" "today today"}
    .calendar-toolbar #calendarPrev{grid-area:prev}
    .calendar-toolbar #calendarNext{grid-area:next}
    .calendar-toolbar #calendarToday{grid-area:today;justify-self:stretch}
    .detail-top{flex-direction:column}
    .detail-poster{width:110px}
}
@media (max-width:480px){
    #view-detail{margin:0 -12px}
    .series-hero{min-height:350px}
    .series-hero-content{padding-left:16px;padding-right:16px}

    .app-shell{padding:16px 12px calc(88px + env(safe-area-inset-bottom))}
    .hero h1,.sheet-header h2{font-size:30px}
    .poster-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
    .list-row{padding:9px}
    .list-thumb{width:54px;height:81px}
    
}

.series-menu button:disabled{
    color:var(--muted-2);
    opacity:.45;
    cursor:default;
}

.search-card-simple{
    cursor:pointer;
}
.search-plus-button,
.search-add-menu,
.search-added-check{
    cursor:default;
}


/* Connexion unifiée : clavier numérique mobile tout en gardant la saisie masquée. */
.login-code-input{
    -webkit-text-security:disc;
}

/* Authentification / profils */
.login-view{
    min-height:100dvh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:
        calc(28px + env(safe-area-inset-top))
        20px
        calc(28px + env(safe-area-inset-bottom));
}
.login-card{
    width:min(100%,390px);
    padding:26px 22px 24px;
    border-radius:30px;
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:var(--shadow);
    text-align:center;
}
.login-logo{
    width:68px;
    height:68px;
    margin:0 auto 18px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:22px;
    background:var(--text);
    color:var(--bg);
    font-size:24px;
    font-weight:800;
    letter-spacing:-.04em;
}
.login-card h1{
    margin:0;
    font-size:31px;
    line-height:1.05;
    font-weight:800;
}
.login-card>p{
    margin:10px 0 22px;
    color:var(--muted);
    font-size:14px;
    line-height:1.4;
}
.login-form{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.login-form input{
    width:100%;
    height:56px;
    border:none;
    outline:none;
    border-radius:18px;
    background:var(--surface-alt);
    color:var(--text);
    text-align:center;
    font-size:22px;
    font-weight:720;
    letter-spacing:.12em;
}
.login-form button{
    height:56px;
    border:none;
    border-radius:18px;
    background:var(--text);
    color:var(--bg);
    font-weight:760;
}
.login-error{
    min-height:20px;
    margin:12px 0 0!important;
    color:var(--red)!important;
    font-size:13px!important;
}
.profile-area{
    position:relative;
    flex-shrink:0;
}
.profile-button{
    width:46px;
    height:46px;
    border:none;
    border-radius:999px;
    background:var(--surface);
    color:var(--text);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}
.profile-menu{
    position:absolute;
    top:54px;
    right:0;
    z-index:45;
    min-width:190px;
    overflow:hidden;
    border-radius:18px;
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:0 16px 38px rgba(0,0,0,.18);
}
.profile-menu-user{
    display:flex;
    align-items:center;
    gap:10px;
    padding:13px 14px;
    border-bottom:1px solid var(--line);
}
.profile-menu-user span{
    font-size:22px;
}
.profile-menu button{
    width:100%;
    border:none;
    background:var(--surface);
    color:var(--red);
    padding:13px 14px;
    text-align:left;
    font-weight:700;
}


/* V10 - saisons + suivi à deux */
.series-quick-actions.with-heart{
    grid-template-columns:auto minmax(0,1.3fr) minmax(0,1fr) 48px;
}

.series-heart-button{
    width:48px;
    height:48px;
    border:1px solid var(--line);
    border-radius:16px;
    background:var(--surface);
    color:var(--muted);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    font-size:25px;
    line-height:1;
    font-weight:700;
    transition:
        color .15s ease,
        background .15s ease,
        transform .12s ease;
}

.series-heart-button.active{
    color:var(--red);
    background:rgba(255,69,58,.12);
}

.series-heart-button:active{
    transform:scale(.94);
}

.season-summary-info{
    min-width:0;
    display:flex;
    align-items:center;
    gap:8px;
    overflow:hidden;
}

.season-summary-name{
    min-width:0;
    color:var(--text)!important;
    font-size:inherit!important;
    font-weight:720!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.season-episode-count{
    flex-shrink:0;
    color:var(--muted)!important;
    font-size:12px!important;
    font-weight:600!important;
    white-space:nowrap;
}

.season-watch-checkbox{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    width:24px;
    height:24px;
    margin:0 0 0 auto;
    border:2px solid var(--muted-2);
    border-radius:7px;
    background:transparent;
    position:relative;
    cursor:pointer;
}

.season-watch-checkbox:checked{
    border-color:var(--accent);
    background:var(--accent);
}

.season-watch-checkbox:checked::after{
    content:"";
    position:absolute;
    left:6px;
    top:2px;
    width:6px;
    height:11px;
    border:solid #fff;
    border-width:0 2px 2px 0;
    transform:rotate(45deg);
}

.season-watch-checkbox:disabled{
    opacity:.55;
}

.series-seasons .accordion-actions{
    display:none!important;
}

@media (max-width:480px){
    .series-quick-actions.with-heart{
        grid-template-columns:auto minmax(0,1.25fr) minmax(0,.9fr) 44px;
        gap:7px;
    }

    .series-heart-button{
        width:44px;
        height:48px;
        font-size:23px;
    }

    .season-summary-info{
        gap:6px;
    }

    .season-episode-count{
        font-size:11px!important;
    }
}


/* V10.1 - finitions fiche série */
.series-quick-actions .series-rating{
    border-radius:16px;
}

.series-back-button{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    line-height:1;
}

.series-back-button svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.5;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.search-plus-button{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    line-height:1;
}

.search-plus-icon{
    width:24px;
    height:24px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.4;
    stroke-linecap:round;
}

.episode-watch-checkbox{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    width:24px;
    height:24px;
    margin:0;
    border:2px solid var(--muted-2);
    border-radius:7px;
    background:transparent;
    position:relative;
    cursor:pointer;
}

.episode-watch-checkbox:checked{
    border-color:var(--accent);
    background:var(--accent);
}

.episode-watch-checkbox:checked::after{
    content:"";
    position:absolute;
    left:6px;
    top:2px;
    width:6px;
    height:11px;
    border:solid #fff;
    border-width:0 2px 2px 0;
    transform:rotate(45deg);
}

.episode-watch-checkbox:disabled{
    opacity:.55;
}

.episode-row.watched{
    opacity:.72;
}

.season-episode-count{
    font-size:13px!important;
}

.series-delete-button{
    display:block!important;
}


/* V10.2 - finition affichage épisodes */
.series-seasons .episode-row{
    margin-left:16px;
    width:calc(100% - 16px);
    padding-left:14px;
    padding-right:16px;
}

.series-seasons .episode-row>span{
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.series-seasons .episode-row.watched>span{
    text-decoration:line-through;
    text-decoration-thickness:1.5px;
}

.series-seasons .episode-row>strong{
    flex:0 0 auto;
}

.series-seasons .episode-watch-checkbox{
    flex:0 0 auto;
}


/* V10.3 - calendrier dense */
.calendar-header{
    margin-bottom:10px;
}

.calendar-header .eyebrow{
    margin-bottom:5px;
}

.calendar-month-nav{
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 38px;
    align-items:center;
    gap:8px;
}

.calendar-month-nav h1{
    margin:0;
    text-align:center;
    font-size:28px;
    line-height:1.08;
    font-weight:800;
    text-transform:capitalize;
}

.calendar-nav-button{
    width:38px;
    height:38px;
    padding:0;
    border:none;
    border-radius:999px;
    background:var(--surface);
    color:var(--text);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:29px;
    line-height:1;
    font-weight:300;
    border:1px solid var(--line);
}

.calendar-toolbar{
    display:none!important;
}

.calendar-weekdays{
    display:grid!important;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:3px;
    margin:0 0 5px;
    padding:0 1px;
    color:var(--muted-2);
    font-size:10px;
    line-height:1;
    font-weight:750;
    text-align:center;
}

.calendar-grid{
    display:grid!important;
    grid-template-columns:repeat(7,minmax(0,1fr))!important;
    gap:3px!important;
    align-items:stretch;
}

.calendar-grid .day-cell{
    min-width:0;
    min-height:72px;
    padding:5px 4px;
    border-radius:11px;
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:none;
    overflow:hidden;
}

.calendar-grid .day-cell.other-month{
    visibility:hidden;
}

.calendar-grid .day-cell.today{
    outline:none;
    border-color:var(--accent);
}

.calendar-grid .day-head{
    min-height:17px;
    margin:0 0 3px;
    display:flex;
    justify-content:flex-start;
}

.calendar-grid .day-number{
    width:17px;
    height:17px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:10px;
    line-height:1;
    font-weight:750;
}

.calendar-grid .day-cell.today .day-number{
    background:var(--accent);
    color:#fff;
}

.calendar-grid .day-events{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.calendar-grid .event-pill{
    width:100%;
    min-width:0;
    border:none;
    border-radius:5px;
    padding:3px 3px;
    background:var(--surface-alt);
    color:var(--text);
    text-align:left;
    font-size:8.5px;
    line-height:1.12;
    font-weight:650;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    word-break:break-word;
}

/* épisodes : décalage du bloc complet + vus un peu plus grisés */
.series-seasons .episode-row{
    margin-left:24px;
    width:calc(100% - 24px);
    padding-left:16px;
}

.series-seasons .episode-row.watched{
    opacity:.62;
}

@media (max-width:720px){
    .calendar-grid{
        grid-template-columns:repeat(7,minmax(0,1fr))!important;
    }

    .calendar-weekdays{
        display:grid!important;
    }
}

@media (max-width:480px){
    .calendar-header{
        margin-top:2px;
        margin-bottom:9px;
    }

    .calendar-month-nav h1{
        font-size:25px;
    }

    .calendar-nav-button{
        width:36px;
        height:36px;
        font-size:27px;
    }

    .calendar-grid .day-cell{
        min-height:68px;
        padding:4px 3px;
        border-radius:10px;
    }

    .calendar-grid .event-pill{
        font-size:8px;
        padding:3px 2px;
    }
}


/* V10.4 - affiches dans le calendrier */
.calendar-grid .day-events{
    min-height:44px;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    gap:0;
    position:relative;
}

.calendar-grid .event-poster-button{
    width:30px;
    height:44px;
    flex:0 0 auto;
    padding:0;
    border:none;
    border-radius:5px;
    overflow:hidden;
    background:var(--surface-alt);
    color:var(--muted);
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 1px 4px rgba(0,0,0,.16);
}

.calendar-grid .day-events.multiple .event-poster-button{
    width:28px;
    height:42px;
}

.calendar-grid .day-events.multiple .event-poster-button + .event-poster-button{
    margin-left:-8px;
}

.calendar-grid .event-poster-button img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.calendar-grid .event-poster-button span{
    font-size:10px;
    font-weight:800;
}

.calendar-grid .event-more{
    position:absolute;
    right:-1px;
    bottom:-1px;
    min-width:17px;
    height:17px;
    padding:0 4px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--text);
    color:var(--bg);
    font-size:8px;
    font-weight:800;
}

/* Liste des prochaines sorties */
.calendar-upcoming{
    margin-top:22px;
    padding-bottom:12px;
}

.calendar-upcoming-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin:0 2px 10px;
}

.calendar-upcoming-head h2{
    margin:0;
    font-size:21px;
    line-height:1.1;
    font-weight:800;
}

.release-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.release-row{
    width:100%;
    min-width:0;
    min-height:76px;
    padding:7px 10px 7px 7px;
    border:none;
    border-radius:16px;
    background:var(--surface);
    color:var(--text);
    display:grid;
    grid-template-columns:44px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    text-align:left;
    border:1px solid var(--line);
}

.release-poster{
    width:44px;
    height:62px;
    border-radius:10px;
    overflow:hidden;
    background:var(--surface-alt);
    color:var(--muted);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
}

.release-poster img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.release-info{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:4px;
}

.release-info strong{
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:14px;
    line-height:1.2;
    font-weight:760;
}

.release-info span{
    color:var(--muted);
    font-size:11px;
    line-height:1.2;
    text-transform:capitalize;
}

.release-countdown{
    flex-shrink:0;
    max-width:76px;
    padding:7px 9px;
    border-radius:999px;
    background:var(--surface-alt);
    color:var(--text);
    font-size:10px;
    line-height:1.1;
    font-weight:750;
    text-align:center;
}

/* Vraie tabulation du bloc contenant les épisodes */
.series-seasons .accordion{
    background:transparent;
    overflow:visible;
}

.series-seasons .accordion>summary{
    background:var(--surface-alt);
    border-radius:18px;
}

.series-seasons .episode-list{
    width:calc(100% - 18px);
    margin:4px 0 0 18px;
    overflow:hidden;
    border-radius:14px;
    background:var(--surface-alt);
}

.series-seasons .episode-list .episode-row{
    width:100%;
    margin-left:0;
    padding-left:10px;
    padding-right:12px;
}

.series-seasons .episode-list .episode-row:first-child{
    border-top:none;
}

.series-seasons .episode-list .episode-row.watched{
    opacity:.58;
}

@media (max-width:480px){
    .calendar-grid .event-poster-button{
        width:27px;
        height:40px;
    }

    .calendar-grid .day-events.multiple .event-poster-button{
        width:25px;
        height:38px;
    }

    .calendar-grid .day-cell{
        min-height:66px;
    }

    .release-row{
        grid-template-columns:42px minmax(0,1fr) auto;
    }

    .release-poster{
        width:42px;
        height:60px;
    }

    .series-seasons .episode-list{
        width:calc(100% - 16px);
        margin-left:16px;
    }

    .series-seasons .episode-list .episode-row{
        padding-left:9px;
    }
}


/* V10.4.1 - collage saison / épisodes */
.series-seasons .episode-list{
    width:calc(100% - 14px);
    margin:0 0 0 14px;
    border-radius:0 0 14px 14px;
}

.series-seasons .accordion[open]>summary{
    border-radius:18px 18px 0 0;
}

@media (max-width:480px){
    .series-seasons .episode-list{
        width:calc(100% - 12px);
        margin-left:12px;
    }
}


/* V10.5 - loaders */
.page-loader{
    grid-column:1 / -1;
    width:100%;
    min-height:42vh;
    display:flex;
    align-items:center;
    justify-content:center;
}

.loading-spinner{
    width:34px;
    height:34px;
    border:3px solid var(--line);
    border-top-color:var(--text);
    border-radius:50%;
    animation:tv-spin .72s linear infinite;
}

@keyframes tv-spin{
    to{transform:rotate(360deg)}
}

@media (prefers-reduced-motion:reduce){
    .loading-spinner{
        animation-duration:1.5s;
    }
}

/* V10.5 - rapports */
.report-dashboard{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-bottom:22px;
}

.watch-time-card{
    width:100%;
    min-height:164px;
    border:1px solid var(--line);
    border-radius:26px;
    padding:22px 20px 18px;
    background:var(--surface);
    color:var(--text);
    box-shadow:var(--shadow);
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    text-align:left;
    touch-action:manipulation;
}

.watch-time-label{
    color:var(--muted);
    font-size:13px;
    font-weight:650;
}

.watch-time-main{
    display:flex;
    align-items:baseline;
    gap:8px;
    margin-top:6px;
}

.watch-time-main strong{
    font-size:48px;
    line-height:.95;
    letter-spacing:-2px;
    font-weight:800;
}

.watch-time-main span{
    color:var(--muted);
    font-size:20px;
    font-weight:650;
}

.watch-time-card small{
    margin-top:12px;
    color:var(--muted-2);
    font-size:11px;
}

.report-metrics{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:9px;
}

.report-metrics .metric-card{
    min-width:0;
    min-height:92px;
    padding:12px;
    border-radius:18px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.report-metrics .metric-card p{
    margin:0;
    min-height:30px;
    font-size:11px;
    line-height:1.2;
}

.report-metrics .metric-card h3{
    margin-top:7px;
    font-size:27px;
}

.report-history-block{
    margin-top:4px;
}

.report-history-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.history-group{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow:var(--shadow);
    overflow:hidden;
}

.history-group-button{
    width:100%;
    border:none;
    background:none;
    color:inherit;
    padding:8px;
    display:grid;
    grid-template-columns:48px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    text-align:left;
}

.history-thumb{
    width:48px;
    height:68px;
    border-radius:10px;
    object-fit:cover;
    background:var(--surface-alt);
}

.history-group-content{
    min-width:0;
}

.history-group-content h3{
    margin:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:14px;
    font-weight:750;
}

.history-group-content p{
    margin:4px 0 0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    color:var(--muted);
    font-size:12px;
}

.history-group-content time{
    display:block;
    margin-top:4px;
    color:var(--muted-2);
    font-size:10px;
}

.history-count{
    min-width:26px;
    height:26px;
    padding:0 7px;
    border-radius:999px;
    background:var(--surface-alt);
    color:var(--muted);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:11px;
    font-weight:750;
}

@media (max-width:480px){
    .watch-time-card{
        min-height:154px;
        border-radius:24px;
    }

    .watch-time-main strong{
        font-size:44px;
    }

    .watch-time-main span{
        font-size:18px;
    }
}


/* V10.7 - listes bibliothèque / terminées / abandonnées */
.poster-grid.list-mode{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.library-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.library-group + .library-group{
    margin-top:10px;
}

.library-group-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 4px;
}

.library-group-head h3{
    margin:0;
    font-size:15px;
    line-height:1.2;
    font-weight:760;
}

.library-group-head > span{
    min-width:24px;
    height:24px;
    padding:0 7px;
    border-radius:999px;
    background:var(--surface-alt);
    color:var(--muted);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:11px;
    font-weight:700;
}

.library-group-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.collapsible-library-group .library-group-head{
    padding:0;
}
.library-group-toggle{
    appearance:none;
    -webkit-appearance:none;
    width:100%;
    min-height:32px;
    margin:0;
    padding:2px 4px;
    border:0;
    background:transparent;
    color:var(--text);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    text-align:left;
}
.library-group-title{
    min-width:0;
    display:flex;
    align-items:baseline;
    gap:6px;
}
.library-group-label{
    font-size:15px;
    line-height:1.2;
    font-weight:760;
}
.library-group-count{
    color:var(--muted);
    font-size:12px;
    line-height:1;
    font-weight:700;
}
.library-group-chevron{
    flex:0 0 auto;
    width:8px;
    height:8px;
    margin-right:5px;
    border-right:2px solid var(--muted);
    border-bottom:2px solid var(--muted);
    transform:translateY(-2px) rotate(45deg);
    transition:transform .18s ease;
}
.collapsible-library-group.collapsed .library-group-chevron{
    transform:translate(-2px,0) rotate(-45deg);
}
.collapsible-library-group.collapsed .library-group-list{
    display:none;
}

.list-row-copy{
    min-width:0;
    flex:1;
}

.list-state-detail{
    display:block;
    margin-top:7px;
    color:var(--muted-2);
    font-size:10px;
    line-height:1.25;
}

/* V10.7 - visionnages multiples */
.episode-watch-button{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    width:26px;
    height:26px;
    margin:0;
    padding:0;
    border:2px solid var(--muted-2);
    border-radius:8px;
    background:transparent;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:10px;
    line-height:1;
    font-weight:800;
    letter-spacing:-.3px;
}

.episode-watch-button.watched{
    border-color:var(--accent);
    background:var(--accent);
}

.episode-watch-button svg{
    width:17px;
    height:17px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.episode-watch-button:disabled{
    opacity:.55;
}

.episode-watch-sheet{
    position:fixed;
    inset:0;
    z-index:10000;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
}

.episode-watch-sheet.visible{
    opacity:1;
    pointer-events:auto;
}

.episode-watch-sheet-backdrop{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:none;
    background:rgba(0,0,0,.42);
    backdrop-filter:blur(4px);
    -webkit-backdrop-filter:blur(4px);
}

.episode-watch-sheet-panel{
    position:relative;
    z-index:1;
    width:min(100% - 18px,480px);
    margin:0 9px calc(9px + env(safe-area-inset-bottom));
    padding:8px;
    border:1px solid var(--line);
    border-radius:24px;
    background:var(--surface);
    box-shadow:0 18px 60px rgba(0,0,0,.28);
    transform:translateY(18px);
    transition:transform .18s ease;
}

.episode-watch-sheet.visible .episode-watch-sheet-panel{
    transform:translateY(0);
}

.episode-watch-sheet-handle{
    width:36px;
    height:4px;
    margin:2px auto 10px;
    border-radius:999px;
    background:var(--muted-2);
    opacity:.6;
}

.episode-watch-sheet-title{
    padding:4px 8px 12px;
    display:flex;
    flex-direction:column;
    gap:3px;
}

.episode-watch-sheet-title strong{
    font-size:16px;
}

.episode-watch-sheet-title span{
    color:var(--muted);
    font-size:11px;
}

.episode-watch-sheet-action{
    width:100%;
    min-height:58px;
    padding:8px 10px;
    border:none;
    border-radius:16px;
    background:var(--surface-alt);
    color:var(--text);
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    align-items:center;
    gap:8px;
    text-align:left;
}

.episode-watch-sheet-action + .episode-watch-sheet-action{
    margin-top:7px;
}

.episode-watch-sheet-action>span{
    width:34px;
    height:34px;
    border-radius:11px;
    background:var(--surface);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    font-weight:800;
}

.episode-watch-sheet-action div{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.episode-watch-sheet-action strong{
    font-size:14px;
}

.episode-watch-sheet-action small{
    color:var(--muted);
    font-size:10px;
}

.episode-watch-sheet-action.primary>span{
    color:var(--accent);
}

.episode-watch-sheet-action.danger strong,
.episode-watch-sheet-action.danger>span{
    color:var(--red);
}

.episode-watch-sheet-cancel{
    width:100%;
    height:44px;
    margin-top:7px;
    border:none;
    border-radius:16px;
    background:transparent;
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}

@media (max-width:480px){
    .list-row{
        border-radius:17px;
    }

    .list-thumb{
        width:54px;
        height:81px;
        border-radius:12px;
    }
}

/* V10.8 - séparation À jour / Terminées */
.completed-group + .completed-group{
    margin-top:14px;
}

.completed-group .library-group-head{
    padding-top:2px;
}


/* V10.9 - bouton saison avec compteur de visionnages */
.season-watch-button{
    appearance:none;
    -webkit-appearance:none;
    flex:0 0 auto;
    width:24px;
    height:24px;
    margin:0 0 0 auto;
    padding:0;
    border:2px solid var(--muted-2);
    border-radius:7px;
    background:transparent;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:9px;
    line-height:1;
    font-weight:800;
    letter-spacing:-.25px;
    cursor:pointer;
}

.season-watch-button.watched{
    border-color:var(--accent);
    background:var(--accent);
}

.season-watch-button svg{
    width:16px;
    height:16px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.season-watch-button:disabled{
    opacity:.55;
}

/* Même petite fenêtre que le menu •••, mais ancrée au bouton cliqué */
.watch-action-menu{
    position:fixed;
    top:auto;
    right:auto;
    left:auto;
    z-index:10000;
    min-width:155px;
}

/* Le bloc épisodes est décalé : le coin bas-gauche de l'en-tête
   doit donc rester arrondi quand la saison est ouverte. */
.series-seasons .accordion[open]>summary{
    border-radius:18px 18px 0 18px;
}


/* V10.10 - saison/épisodes parfaitement collés + retrait plus léger */
.series-seasons .episode-list{
    width:calc(100% - 9px);
    margin:-1px 0 0 9px;
}

@media (max-width:480px){
    .series-seasons .episode-list{
        width:calc(100% - 8px);
        margin:-1px 0 0 8px;
    }
}

/* V10.10 - accueil : 6 séries puis "Afficher plus" */
.featured-more-wrap{
    grid-column:1 / -1;
    display:flex;
    justify-content:center;
    padding:2px 0 4px;
}

.featured-more-button{
    min-width:132px;
    height:38px;
    padding:0 18px;
    border:1px solid var(--line);
    border-radius:999px;
    background:var(--surface);
    color:var(--text);
    font-size:12px;
    font-weight:750;
    box-shadow:var(--shadow);
}

.featured-more-button:active{
    transform:scale(.98);
}


/* V10.12 - finition bloc épisodes */
.series-seasons .episode-list{
    /* Le bloc reste collé sous la saison, mais son coin supérieur gauche
       est arrondi comme son coin inférieur gauche. */
    border-radius:14px 0 14px 14px;
}

/* V10.12 - navigation à 3 entrées : Accueil / Calendrier / Recherche */
.bottom-nav{
    grid-template-columns:repeat(3,1fr);
}

/* V10.12 - Rapports dans le menu du profil */
.profile-menu .profile-menu-action,
.profile-menu .profile-menu-logout{
    width:100%;
    border:none;
    padding:13px 14px;
    text-align:left;
    font-weight:700;
}

.profile-menu .profile-menu-action{
    background:var(--surface);
    color:var(--text);
    display:flex;
    align-items:center;
    gap:10px;
    border-bottom:1px solid var(--line);
}

.profile-menu .profile-menu-action svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
    color:var(--muted);
}

.profile-menu .profile-menu-logout{
    background:var(--surface);
    color:var(--red);
}


/* V10.13 - identité TVi */
.login-logo{
    width:76px;
    height:76px;
    margin:0 auto 18px;
    display:block;
    object-fit:contain;
    border-radius:22px;
    background:transparent;
}

.home-brand{
    display:flex;
    align-items:center;
    gap:10px;
}

.home-brand-logo{
    width:38px;
    height:38px;
    display:block;
    object-fit:contain;
    flex:0 0 auto;
}

.home-brand h1{
    margin:0;
}

@media (max-width:480px){
    .home-brand-logo{
        width:36px;
        height:36px;
    }
}


/* V10.13.1 - branding simplifié */
.login-card .login-logo{
    margin-bottom:28px;
}

.home-brand{
    min-height:38px;
}

@media (max-width:480px){
    .home-brand{
        min-height:36px;
    }
}


/* V10.13.2 - iPhone installé sur l'écran d'accueil */
@media (display-mode: standalone){
    .bottom-nav{
        padding-top:5px;
        padding-bottom:calc(2px + env(safe-area-inset-bottom));
    }

    .nav-button{
        min-height:44px;
        padding-top:4px;
        padding-bottom:1px;
    }

    .app-shell{
        padding-bottom:calc(78px + env(safe-area-inset-bottom));
    }
}

/* Safari iOS peut utiliser ce mode pour une web-app ajoutée à l'accueil */
@supports (-webkit-touch-callout:none){
    @media (display-mode: standalone){
        html,
        body{
            min-height:100%;
            min-height:100dvh;
        }

        body{
            min-height:100dvh;
        }
    }
}


/* V10.13.3 - PWA iPhone : aucune marge sous la navigation */
@media (display-mode: standalone){
    html,
    body{
        min-height:100%;
        min-height:100dvh;
        padding-bottom:0 !important;
        margin-bottom:0 !important;
    }

    body{
        min-height:100dvh;
        padding-bottom:0 !important;
    }

    .bottom-nav{
        bottom:0 !important;
        padding-bottom:0 !important;
        margin-bottom:0 !important;
    }

    .app-shell{
        padding-bottom:72px !important;
    }
}

/* Logo accueil : même gabarit que le bouton profil, parfaitement aligné */
.home-brand{
    display:flex;
    align-items:center;
    min-height:44px;
}

.home-brand-logo{
    width:44px !important;
    height:44px !important;
    border-radius:50%;
    object-fit:cover;
    display:block;
    flex:0 0 44px;
}

/* Si le bouton profil utilise une taille différente, on l'aligne sur 44px */
.profile-button,
.profile-trigger,
.profile-avatar{
    width:44px;
    height:44px;
}


/* V10.13.4 - barre flottante façon Liquid Glass sur iPhone/PWA */
@media (display-mode: standalone){
    .bottom-nav{
        left:10px !important;
        right:10px !important;
        bottom:4px !important;
        width:auto !important;

        grid-template-columns:repeat(3,1fr);
        gap:2px;

        /* Le fond de la barre descend presque jusqu'au bord système.
           La zone Home Indicator reste gérée par iOS. */
        padding:
            7px
            8px
            max(9px, calc(env(safe-area-inset-bottom) - 14px))
            8px !important;

        border:1px solid rgba(255,255,255,.26) !important;
        border-radius:28px !important;

        background:rgba(245,245,250,.58) !important;
        -webkit-backdrop-filter:
            blur(28px)
            saturate(190%)
            contrast(105%);
        backdrop-filter:
            blur(28px)
            saturate(190%)
            contrast(105%);

        box-shadow:
            0 8px 30px rgba(0,0,0,.18),
            inset 0 1px 0 rgba(255,255,255,.52),
            inset 0 -1px 0 rgba(255,255,255,.10);

        overflow:hidden;
    }

    .nav-button{
        min-height:48px !important;
        padding:5px 4px 3px !important;
        border-radius:20px;
        transition:
            background .18s ease,
            color .18s ease,
            transform .12s ease;
    }

    .nav-button.active{
        background:rgba(255,255,255,.38) !important;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.40),
            0 1px 8px rgba(0,0,0,.06);
    }

    .nav-button:active{
        transform:scale(.97);
    }

    /* Laisse la place à la barre flottante dans le contenu,
       sans recréer une marge sous la barre elle-même. */
    .app-shell{
        padding-bottom:104px !important;
    }
}

@media (display-mode: standalone) and (prefers-color-scheme:dark){
    .bottom-nav{
        background:rgba(35,35,38,.58) !important;
        border-color:rgba(255,255,255,.16) !important;
        box-shadow:
            0 10px 34px rgba(0,0,0,.42),
            inset 0 1px 0 rgba(255,255,255,.18),
            inset 0 -1px 0 rgba(255,255,255,.05);
    }

    .nav-button.active{
        background:rgba(255,255,255,.11) !important;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.12);
    }
}

/* Logo accueil : même taille que le bouton profil, mais en squircle */
.home-brand-logo{
    width:44px !important;
    height:44px !important;
    flex:0 0 44px;
    display:block;
    object-fit:cover !important;
    border-radius:12px !important;
    overflow:hidden;
    background:#111;
}

.profile-button{
    width:44px !important;
    height:44px !important;
}


/* V10.13.5 - navigation inspirée de l'app Téléphone iOS */
.bottom-nav{
    position:fixed !important;
    left:10px !important;
    right:10px !important;
    bottom:4px !important;
    width:auto !important;
    z-index:50;

    display:flex !important;
    align-items:stretch;
    gap:10px;

    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    overflow:visible !important;

    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
}

.bottom-nav-main{
    position:relative;
    flex:1 1 auto;
    min-width:0;
    min-height:72px;

    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:3px;

    padding:6px;

    border:1px solid rgba(255,255,255,.58);
    border-radius:31px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.78),
            rgba(244,246,252,.58)
        );

    -webkit-backdrop-filter:
        blur(34px)
        saturate(185%);
    backdrop-filter:
        blur(34px)
        saturate(185%);

    box-shadow:
        0 7px 25px rgba(20,30,55,.15),
        inset 0 1px 0 rgba(255,255,255,.95),
        inset 0 -1px 0 rgba(255,255,255,.28);
}

.bottom-nav-main::before,
.nav-search-button::before{
    content:"";
    position:absolute;
    pointer-events:none;
    inset:1px;
    border-radius:inherit;
    background:
        linear-gradient(
            125deg,
            rgba(255,255,255,.44) 0%,
            rgba(255,255,255,.06) 42%,
            rgba(170,205,255,.13) 70%,
            rgba(255,255,255,.22) 100%
        );
    opacity:.72;
}

.bottom-nav-main .nav-button{
    position:relative;
    z-index:1;

    min-width:0;
    min-height:60px !important;
    padding:6px 3px 4px !important;

    border:0;
    border-radius:25px !important;

    background:transparent !important;
    color:#111114;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;

    box-shadow:none !important;
    transition:
        background .18s ease,
        box-shadow .18s ease,
        color .18s ease,
        transform .12s ease;
}

.bottom-nav-main .nav-button.active{
    color:var(--blue) !important;
    background:
        linear-gradient(
            135deg,
            rgba(224,231,242,.76),
            rgba(255,255,255,.46)
        ) !important;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.85),
        0 2px 9px rgba(70,90,120,.10) !important;
}

.bottom-nav-main .nav-button:active,
.nav-search-button:active{
    transform:scale(.97);
}

.bottom-nav-main .nav-icon{
    width:24px;
    height:24px;
    stroke-width:2;
}

.bottom-nav-main .nav-label{
    font-size:11px;
    line-height:1;
    font-weight:650;
    letter-spacing:-.01em;
}

/* Recherche : bouton rond détaché comme dans l'app Téléphone */
.nav-search-button{
    position:relative;
    isolation:isolate;
    flex:0 0 72px;

    width:72px;
    height:72px;
    min-width:72px;

    padding:0;
    border:1px solid rgba(255,255,255,.62);
    border-radius:50%;

    color:#111114;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.82),
            rgba(244,246,252,.60)
        );

    -webkit-backdrop-filter:
        blur(34px)
        saturate(185%);
    backdrop-filter:
        blur(34px)
        saturate(185%);

    box-shadow:
        0 7px 25px rgba(20,30,55,.15),
        inset 0 1px 0 rgba(255,255,255,.96),
        inset 0 -1px 0 rgba(255,255,255,.30);

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

    overflow:hidden;
    transition:
        color .18s ease,
        background .18s ease,
        transform .12s ease;
    touch-action:manipulation;
}

.nav-search-button.active{
    color:var(--blue);
    background:
        linear-gradient(
            135deg,
            rgba(224,231,242,.82),
            rgba(255,255,255,.58)
        );
}

.nav-search-icon{
    position:relative;
    z-index:1;
    width:29px;
    height:29px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.1;
    stroke-linecap:round;
    stroke-linejoin:round;
}

/* Laisse le contenu passer derrière la barre mais évite que la dernière
   ligne soit inaccessible. */
.app-shell{
    padding-bottom:104px !important;
}

.toast{
    bottom:104px;
}

@media (prefers-color-scheme:dark){
    .bottom-nav-main{
        border-color:rgba(255,255,255,.14);
        background:
            linear-gradient(
                180deg,
                rgba(54,54,58,.72),
                rgba(26,26,29,.60)
            );
        box-shadow:
            0 10px 30px rgba(0,0,0,.42),
            inset 0 1px 0 rgba(255,255,255,.16),
            inset 0 -1px 0 rgba(255,255,255,.05);
    }

    .bottom-nav-main::before,
    .nav-search-button::before{
        background:
            linear-gradient(
                125deg,
                rgba(255,255,255,.13) 0%,
                rgba(255,255,255,.015) 42%,
                rgba(70,120,190,.08) 72%,
                rgba(255,255,255,.08) 100%
            );
    }

    .bottom-nav-main .nav-button{
        color:#f5f5f7;
    }

    .bottom-nav-main .nav-button.active{
        color:var(--blue) !important;
        background:
            linear-gradient(
                135deg,
                rgba(105,110,120,.38),
                rgba(255,255,255,.08)
            ) !important;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.14),
            0 1px 10px rgba(0,0,0,.12) !important;
    }

    .nav-search-button{
        color:#f5f5f7;
        border-color:rgba(255,255,255,.15);
        background:
            linear-gradient(
                180deg,
                rgba(54,54,58,.76),
                rgba(26,26,29,.62)
            );
        box-shadow:
            0 10px 30px rgba(0,0,0,.42),
            inset 0 1px 0 rgba(255,255,255,.16),
            inset 0 -1px 0 rgba(255,255,255,.05);
    }

    .nav-search-button.active{
        color:var(--blue);
        background:
            linear-gradient(
                135deg,
                rgba(72,79,92,.76),
                rgba(40,40,44,.64)
            );
    }
}

/* iPhone ajouté à l'écran d'accueil : barre au plus bas possible. */
@media (display-mode:standalone){
    .bottom-nav{
        bottom:4px !important;
    }
}

@media (max-width:390px){
    .bottom-nav{
        left:7px !important;
        right:7px !important;
        gap:7px;
    }

    .bottom-nav-main{
        min-height:68px;
        border-radius:29px;
        padding:5px;
    }

    .bottom-nav-main .nav-button{
        min-height:58px !important;
    }

    .nav-search-button{
        flex-basis:68px;
        width:68px;
        height:68px;
        min-width:68px;
    }

    .bottom-nav-main .nav-label{
        font-size:10px;
    }
}


/* V10.13.6 - proportions calées sur une vraie tab bar iOS 26 */
.bottom-nav{
    left:10px !important;
    right:10px !important;
    bottom:0 !important;

    height:64px !important;
    gap:8px !important;

    align-items:center !important;

    padding:0 !important;
    margin:0 !important;
}

/* Capsule principale : hauteur système 64pt */
.bottom-nav-main{
    height:64px !important;
    min-height:64px !important;

    padding:3px !important;
    gap:1px !important;

    border-radius:32px !important;

    border:1px solid rgba(255,255,255,.34) !important;

    background:rgba(242,244,249,.28) !important;

    -webkit-backdrop-filter:
        blur(32px)
        saturate(190%) !important;
    backdrop-filter:
        blur(32px)
        saturate(190%) !important;

    box-shadow:
        0 3px 14px rgba(20,30,55,.09),
        inset 0 .5px 0 rgba(255,255,255,.58),
        inset 0 -.5px 0 rgba(255,255,255,.13) !important;
}

/* Reflet beaucoup plus discret que dans la V10.13.5 */
.bottom-nav-main::before,
.nav-search-button::before{
    inset:.5px !important;
    opacity:.38 !important;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.28) 0%,
            rgba(255,255,255,.04) 43%,
            rgba(170,205,255,.08) 72%,
            rgba(255,255,255,.14) 100%
        ) !important;
}

/* Chaque onglet reste compact dans les 64pt */
.bottom-nav-main .nav-button{
    height:58px !important;
    min-height:58px !important;

    padding:3px 2px 2px !important;

    border-radius:29px !important;

    gap:2px !important;
}

.bottom-nav-main .nav-button.active{
    background:rgba(226,230,238,.34) !important;

    box-shadow:
        inset 0 .5px 0 rgba(255,255,255,.54),
        0 1px 5px rgba(40,55,80,.05) !important;
}

.bottom-nav-main .nav-icon{
    width:22px !important;
    height:22px !important;
}

.bottom-nav-main .nav-label{
    font-size:10px !important;
    line-height:11px !important;
    font-weight:600 !important;
}

/* Recherche : cercle système, exactement la même hauteur */
.nav-search-button{
    flex:0 0 64px !important;

    width:64px !important;
    height:64px !important;
    min-width:64px !important;

    border-radius:32px !important;

    border:1px solid rgba(255,255,255,.34) !important;

    background:rgba(242,244,249,.28) !important;

    -webkit-backdrop-filter:
        blur(32px)
        saturate(190%) !important;
    backdrop-filter:
        blur(32px)
        saturate(190%) !important;

    box-shadow:
        0 3px 14px rgba(20,30,55,.09),
        inset 0 .5px 0 rgba(255,255,255,.58),
        inset 0 -.5px 0 rgba(255,255,255,.13) !important;
}

.nav-search-button.active{
    background:rgba(226,230,238,.34) !important;
}

.nav-search-icon{
    width:25px !important;
    height:25px !important;
    stroke-width:2 !important;
}

/* Mode sombre : encore plus transparent pour retrouver l'effet iOS */
@media (prefers-color-scheme:dark){
    .bottom-nav-main,
    .nav-search-button{
        border-color:rgba(255,255,255,.12) !important;

        background:rgba(42,42,46,.30) !important;

        box-shadow:
            0 4px 17px rgba(0,0,0,.24),
            inset 0 .5px 0 rgba(255,255,255,.12),
            inset 0 -.5px 0 rgba(255,255,255,.025) !important;
    }

    .bottom-nav-main .nav-button.active,
    .nav-search-button.active{
        background:rgba(255,255,255,.10) !important;
    }

    .bottom-nav-main::before,
    .nav-search-button::before{
        opacity:.28 !important;
    }
}

/* En web-app iPhone : réellement collée au bas du viewport */
@media (display-mode:standalone){
    .bottom-nav{
        bottom:0 !important;
    }

    .app-shell{
        padding-bottom:82px !important;
    }
}

/* Même taille aussi sur les petits iPhone */
@media (max-width:390px){
    .bottom-nav{
        left:8px !important;
        right:8px !important;
        bottom:0 !important;
        height:64px !important;
        gap:7px !important;
    }

    .bottom-nav-main{
        height:64px !important;
        min-height:64px !important;
        border-radius:32px !important;
    }

    .bottom-nav-main .nav-button{
        height:58px !important;
        min-height:58px !important;
    }

    .nav-search-button{
        flex-basis:64px !important;
        width:64px !important;
        height:64px !important;
        min-width:64px !important;
    }
}


/* V10.13.8 - comportement natif iPhone */
@supports (-webkit-touch-callout:none){
    /* Le haut est désormais réservé par iOS lui-même :
       aucune compensation artificielle supplémentaire. */
    .app-shell{
        padding-top:16px !important;
    }

    /* Barre collée exactement à la limite de la safe-area iOS. */
    .bottom-nav{
        bottom:env(safe-area-inset-bottom) !important;
    }

    /* On conserve juste l'espace nécessaire pour que le contenu
       ne passe pas sous la barre. */
    .app-shell{
        padding-bottom:calc(
            86px + env(safe-area-inset-bottom)
        ) !important;
    }
}

/* Petits iPhone : garder exactement le même positionnement vertical. */
@media (max-width:390px){
    @supports (-webkit-touch-callout:none){
        .bottom-nav{
            bottom:env(safe-area-inset-bottom) !important;
        }
    }
}


/* V10.13.11 - Safe-area : vrai flou progressif
   ------------------------------------------------
   RÉGLAGES À MODIFIER POUR TESTER :
   --safe-blur-height    = hauteur totale du dégradé
   --safe-blur-strength  = puissance maximale du flou
   --safe-blur-bottom    = opacité du voile tout en bas

   Exemples :
   plus court  : --safe-blur-height: 70px;
   plus long   : --safe-blur-height: 140px;
   moins flou  : --safe-blur-strength: 12px;
   plus flou   : --safe-blur-strength: 28px;
*/
:root{
    --safe-blur-height:64px;
    --safe-blur-strength:22px;
    --safe-blur-bottom:.38;
}

@supports (-webkit-touch-callout:none){
    body::after{
        content:"";
        position:fixed;
        left:0;
        right:0;
        bottom:0;

        height:max(
            var(--safe-blur-height),
            calc(env(safe-area-inset-bottom) + 28px)
        );

        pointer-events:none;
        z-index:40;

        /*
         * Le fond reste quasiment transparent.
         * C'est le MASK ci-dessous qui fait apparaître
         * progressivement le backdrop-filter.
         */
        background:
            linear-gradient(
                to top,
                rgba(245,245,250,var(--safe-blur-bottom)) 0%,
                rgba(245,245,250,.16) 28%,
                rgba(245,245,250,.055) 52%,
                rgba(245,245,250,0) 78%
            );

        -webkit-backdrop-filter:
            blur(var(--safe-blur-strength))
            saturate(165%);
        backdrop-filter:
            blur(var(--safe-blur-strength))
            saturate(165%);

        /*
         * C'est CETTE PARTIE qui transforme la bande de flou
         * en dégradé : l'effet est invisible en haut et atteint
         * 100 % en bas.
         *
         * Pour changer la courbe :
         * - monter 35% -> fondu plus court / plus brutal
         * - descendre 35% -> fondu plus long / plus doux
         */
        -webkit-mask-image:
            linear-gradient(
                to top,
                #000 0%,
                rgba(0,0,0,.96) 22%,
                rgba(0,0,0,.68) 48%,
                rgba(0,0,0,.28) 70%,
                transparent 100%
            );
        mask-image:
            linear-gradient(
                to top,
                #000 0%,
                rgba(0,0,0,.96) 22%,
                rgba(0,0,0,.68) 48%,
                rgba(0,0,0,.28) 70%,
                transparent 100%
            );
    }
}

@media (prefers-color-scheme:dark){
    @supports (-webkit-touch-callout:none){
        body::after{
            background:
                linear-gradient(
                    to top,
                    rgba(14,14,16,var(--safe-blur-bottom)) 0%,
                    rgba(14,14,16,.18) 28%,
                    rgba(14,14,16,.06) 52%,
                    rgba(14,14,16,0) 78%
                );
        }
    }
}


/* V11.0 - accueil multi-médias / films */
.movie-card{
    --state-color:var(--gray);
}

.movie-card-body{
    padding:12px 10px 13px;
}

.movie-card .yamtrack-title{
    min-height:auto;
}

.movie-runtime{
    margin:6px 0 0;
    text-align:center;
    color:var(--muted);
    font-size:12px;
    font-weight:650;
}

.movie-list-row .state-dot{
    background:var(--green);
}

.movie-page .series-quick-actions{
    grid-template-columns:1fr 1fr 1fr;
}

.construction-card{
    grid-column:1 / -1;
    min-height:260px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:34px 20px;
    border:1px solid var(--line);
    border-radius:24px;
    background:var(--surface);
    box-shadow:var(--shadow);
}

.construction-icon{
    font-size:42px;
    margin-bottom:12px;
}

.construction-card h2{
    margin:0;
    font-size:24px;
}

.construction-card p{
    margin:8px 0 0;
    color:var(--muted);
    font-size:14px;
}


/* V11.1 - Synchronisation Plex */
.plex-settings{
    position:fixed;
    inset:0;
    z-index:520;
    background:var(--bg);
    overflow:auto;
    -webkit-overflow-scrolling:touch;
}

.plex-settings-page{
    width:min(100%, 560px);
    min-height:100%;
    margin:0 auto;
    padding:
        calc(env(safe-area-inset-top) + 10px)
        16px
        calc(env(safe-area-inset-bottom) + 28px);
}

.plex-settings-header{
    display:flex;
    align-items:center;
    gap:10px;
    padding:2px 0 18px;
}

.plex-settings-header h1{
    margin:0;
    font-size:30px;
    line-height:1.05;
    letter-spacing:-.035em;
}

.plex-settings-header .eyebrow{
    margin:0 0 2px;
}

.plex-back-button{
    width:42px;
    height:42px;
    flex:0 0 42px;
    border:none;
    border-radius:14px;
    background:var(--surface);
    color:var(--text);
    font-size:34px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}

.plex-settings-content{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.plex-card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:22px;
    box-shadow:var(--shadow);
    padding:17px;
}

.plex-loading-card{
    color:var(--muted);
    text-align:center;
    padding:30px 18px;
}

.plex-card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
}

.plex-card-head h2{
    margin:0;
    font-size:19px;
    letter-spacing:-.02em;
}

.plex-card-head p,
.plex-card p{
    color:var(--muted);
}

.plex-card-head p{
    margin:4px 0 0;
    font-size:13px;
}

.plex-status-badge{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    gap:6px;
    min-height:28px;
    padding:5px 9px;
    border-radius:999px;
    background:rgba(52,199,89,.13);
    color:var(--green);
    font-size:12px;
    font-weight:760;
}

.plex-status-badge.off{
    background:var(--soft);
    color:var(--muted);
}

.plex-action-button{
    width:100%;
    min-height:48px;
    margin-top:14px;
    border:none;
    border-radius:15px;
    background:var(--text);
    color:var(--bg);
    font:inherit;
    font-weight:760;
}

.plex-action-button.secondary{
    background:var(--soft);
    color:var(--text);
}

.plex-action-button.danger{
    background:rgba(255,69,58,.12);
    color:var(--red);
}

.plex-action-button:disabled{
    opacity:.45;
}

.plex-user-list{
    display:grid;
    gap:9px;
    margin-top:14px;
}

.plex-user-button{
    width:100%;
    border:1px solid var(--line);
    border-radius:15px;
    background:var(--bg);
    color:var(--text);
    padding:12px 13px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    text-align:left;
    font:inherit;
}

.plex-user-button strong{
    display:block;
    font-size:15px;
}

.plex-user-button small{
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:12px;
}

.plex-user-button.active{
    border-color:var(--accent);
    background:var(--accent-soft);
}

.plex-user-check{
    color:var(--accent);
    font-size:19px;
    font-weight:800;
}

.plex-webhook-box{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    margin-top:12px;
}

.plex-webhook-box input{
    width:100%;
    min-width:0;
    border:1px solid var(--line);
    border-radius:13px;
    background:var(--bg);
    color:var(--text);
    padding:11px 12px;
    font:inherit;
    font-size:12px;
}

.plex-copy-button{
    min-width:78px;
    border:none;
    border-radius:13px;
    background:var(--accent-soft);
    color:var(--accent);
    font:inherit;
    font-weight:750;
    padding:0 12px;
}

.plex-steps{
    margin:12px 0 0;
    padding-left:20px;
    color:var(--muted);
    font-size:13px;
    line-height:1.55;
}

.plex-steps strong{
    color:var(--text);
}

.plex-event-box{
    margin-top:12px;
    border-radius:15px;
    background:var(--bg);
    padding:12px 13px;
}

.plex-event-title{
    font-size:14px;
    font-weight:760;
    color:var(--text);
}

.plex-event-meta{
    margin-top:4px;
    color:var(--muted);
    font-size:12px;
    line-height:1.45;
}

.plex-error{
    margin-top:12px;
    padding:10px 12px;
    border-radius:13px;
    background:rgba(255,69,58,.11);
    color:var(--red);
    font-size:12px;
    line-height:1.45;
}

.plex-note{
    margin-top:12px;
    color:var(--muted);
    font-size:12px;
    line-height:1.5;
}

.plex-auth-wait{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:12px;
    padding:11px 12px;
    border-radius:13px;
    background:var(--accent-soft);
    color:var(--accent);
    font-size:13px;
    font-weight:700;
}

.plex-auth-dot{
    width:9px;
    height:9px;
    border-radius:50%;
    background:currentColor;
    animation:plexPulse 1.1s ease-in-out infinite alternate;
}

@keyframes plexPulse{
    from{opacity:.35;transform:scale(.8)}
    to{opacity:1;transform:scale(1.08)}
}

@media(max-width:390px){
    .plex-settings-page{
        padding-left:13px;
        padding-right:13px;
    }

    .plex-settings-header h1{
        font-size:27px;
    }
}


/* V11.2 - sécurité connexion */
.login-form input:disabled,
.login-form button:disabled{
    cursor:not-allowed;
}
.login-form input:disabled{ opacity:.55; }
.login-form button:disabled{ opacity:.72; }

/* V11.2 - Pull to refresh */
.pull-refresh-indicator{
    --pull-distance:0px;
    position:fixed;
    z-index:610;
    left:50%;
    top:calc(env(safe-area-inset-top) + 4px);
    width:48px;
    height:48px;
    pointer-events:none;
    opacity:0;
    transform:
        translate(-50%, calc(-58px + var(--pull-distance)))
        scale(.82);
    transition:
        opacity .16s ease,
        transform .16s cubic-bezier(.2,.8,.2,1);
}
.pull-refresh-indicator.visible,
.pull-refresh-indicator.refreshing{ opacity:1; }
.pull-refresh-circle{
    width:48px;
    height:48px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(250,250,252,.78);
    border:1px solid rgba(255,255,255,.7);
    box-shadow:
        0 10px 28px rgba(0,0,0,.12),
        inset 0 1px 0 rgba(255,255,255,.9);
    -webkit-backdrop-filter:blur(20px) saturate(180%);
    backdrop-filter:blur(20px) saturate(180%);
    color:var(--text);
}
.pull-refresh-arrow{
    width:22px;
    height:22px;
    transform:rotate(0deg);
    transition:transform .18s ease;
}
.pull-refresh-indicator.ready .pull-refresh-arrow{
    transform:rotate(180deg);
}
.pull-refresh-spinner{
    display:none;
    width:21px;
    height:21px;
    border-radius:50%;
    border:2.4px solid rgba(120,120,128,.28);
    border-top-color:var(--accent);
    animation:pullRefreshSpin .72s linear infinite;
}
.pull-refresh-indicator.refreshing .pull-refresh-arrow{ display:none; }
.pull-refresh-indicator.refreshing .pull-refresh-spinner{ display:block; }
@keyframes pullRefreshSpin{ to{transform:rotate(360deg)} }

@media (prefers-color-scheme:dark){
    .pull-refresh-circle{
        background:rgba(28,28,30,.78);
        border-color:rgba(255,255,255,.12);
        box-shadow:
            0 10px 30px rgba(0,0,0,.32),
            inset 0 1px 0 rgba(255,255,255,.08);
    }
}


/* V11.2.1 - masquer complètement la navigation sur la page de connexion */
.bottom-nav.hidden{display:none!important;}


/* V11.2.3 - Fiche film : note + trailer + partage + coeur sur une seule ligne */
.movie-page .series-quick-actions.with-heart{
    grid-template-columns:auto minmax(0,1.25fr) minmax(0,.95fr) 48px;
    gap:8px;
}
.movie-page .series-quick-actions .series-rating{
    min-width:54px;
    padding-left:10px;
    padding-right:10px;
}

@media (max-width:480px){
    .movie-page .series-quick-actions.with-heart{
        grid-template-columns:auto minmax(0,1.2fr) minmax(0,.85fr) 44px;
        gap:7px;
    }
    .movie-page .series-quick-actions .series-rating{
        min-width:50px;
        padding-left:8px;
        padding-right:8px;
        font-size:14px;
    }
}

/* V11.2.3 - Pull-to-refresh : le contenu suit le doigt comme un rebond iOS */
.app-shell.pull-refresh-moving{
    transform:translateY(var(--page-pull-distance, 0px));
    will-change:transform;
}
.app-shell.pull-refresh-settling{
    transition:transform .22s cubic-bezier(.22,.72,.2,1);
}

/* V11.3 - Paramètres et notifications */
.settings-root-content{
    display:grid;
    gap:12px;
}

.settings-link-card{
    width:100%;
    border:0;
    border-radius:18px;
    background:var(--surface);
    box-shadow:var(--shadow);
    padding:16px;
    display:grid;
    grid-template-columns:42px minmax(0,1fr) 20px;
    align-items:center;
    gap:12px;
    text-align:left;
    color:var(--text);
    font:inherit;
    cursor:pointer;
}

.settings-link-icon{
    width:42px;
    height:42px;
    border-radius:12px;
    background:var(--accent-soft);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    color:var(--accent);
}

.settings-link-copy{
    min-width:0;
    display:grid;
    gap:3px;
}

.settings-link-copy strong{
    font-size:16px;
    font-weight:720;
}

.settings-link-copy small{
    color:var(--muted);
    font-size:13px;
}

.settings-link-chevron{
    color:var(--muted);
    font-size:28px;
    line-height:1;
    text-align:right;
}

.notification-card{
    display:grid;
    gap:14px;
}

.notification-toggle-list{
    display:grid;
    gap:2px;
}

.notification-toggle-row{
    min-height:62px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:10px 0;
    border-top:1px solid var(--line);
}

.notification-toggle-row:first-child{
    border-top:0;
}

.notification-toggle-row.disabled{
    opacity:.52;
}

.notification-toggle-copy{
    min-width:0;
    display:grid;
    gap:4px;
}

.notification-toggle-copy strong{
    font-size:15px;
    font-weight:700;
}

.notification-toggle-copy small{
    color:var(--muted);
    font-size:12px;
    line-height:1.35;
}

.settings-switch{
    position:relative;
    width:51px;
    height:31px;
    flex:0 0 auto;
}

.settings-switch input{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    margin:0;
    opacity:0;
    z-index:2;
    cursor:pointer;
}

.settings-switch-slider{
    position:absolute;
    inset:0;
    border-radius:999px;
    background:#d1d1d6;
    transition:background .18s ease;
}

.settings-switch-slider::after{
    content:"";
    position:absolute;
    width:27px;
    height:27px;
    top:2px;
    left:2px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 2px 5px rgba(0,0,0,.2);
    transition:transform .18s ease;
}

.settings-switch input:checked + .settings-switch-slider{
    background:#34c759;
}

.settings-switch input:checked + .settings-switch-slider::after{
    transform:translateX(20px);
}

.settings-switch input:disabled + .settings-switch-slider{
    opacity:.7;
}

.notification-field{
    display:grid;
    gap:8px;
}

.notification-field > span{
    font-size:13px;
    font-weight:700;
    color:var(--muted);
}

.notification-field input{
    width:100%;
    box-sizing:border-box;
    min-height:48px;
    border:1px solid var(--line);
    border-radius:13px;
    background:var(--surface);
    color:var(--text);
    font:inherit;
    font-size:16px;
    padding:0 13px;
    outline:none;
}

.notification-field input:focus{
    border-color:var(--accent);
}

.notification-note{
    margin-top:2px;
}

.notification-save-button{
    width:100%;
}



/* V11.3.1 - Test des notifications */
.notification-test-button{
    width:100%;
    margin-top:10px;
}

.notification-test-results{
    display:grid;
    gap:10px;
    margin-top:12px;
}

.notification-test-loading{
    padding:12px 14px;
    border-radius:13px;
    background:var(--surface);
    color:var(--muted);
    font-size:13px;
    text-align:center;
}

.notification-test-row{
    display:flex;
    align-items:flex-start;
    gap:11px;
    padding:12px 13px;
    border-radius:14px;
    border:1px solid var(--line);
    background:var(--surface);
}

.notification-test-row.success{
    border-color:rgba(52,199,89,.28);
    background:rgba(52,199,89,.08);
}

.notification-test-row.error{
    border-color:rgba(255,59,48,.28);
    background:rgba(255,59,48,.07);
}

.notification-test-icon{
    width:26px;
    height:26px;
    flex:0 0 26px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    font-weight:800;
    background:var(--line);
}

.notification-test-row.success .notification-test-icon{
    color:#248a3d;
    background:rgba(52,199,89,.16);
}

.notification-test-row.error .notification-test-icon{
    color:#d70015;
    background:rgba(255,59,48,.14);
}

.notification-test-copy{
    min-width:0;
    display:grid;
    gap:3px;
}

.notification-test-copy strong{
    font-size:14px;
}

.notification-test-copy span{
    color:var(--muted);
    font-size:12.5px;
    line-height:1.4;
}

.notification-test-copy code{
    width:max-content;
    max-width:100%;
    margin-top:3px;
    padding:3px 6px;
    border-radius:6px;
    background:rgba(0,0,0,.06);
    color:var(--muted);
    font-size:11px;
    overflow-wrap:anywhere;
}

/* V11.1 - portail de demandes */
.request-login-link,
.request-back-link{
    display:block;
    margin-top:12px;
    color:var(--blue);
    text-decoration:none;
    font-size:14px;
    font-weight:700;
}

.request-code-card h1{
    margin:2px 0 8px;
    font-size:28px;
    line-height:1.08;
}

.request-code-card>p:not(.login-error){
    margin:0 0 20px;
    color:var(--muted);
    font-size:14px;
}

.request-code-dots{
    display:flex;
    justify-content:center;
    gap:13px;
    margin:18px 0 24px;
}

.request-code-dots span{
    width:13px;
    height:13px;
    border-radius:50%;
    background:var(--line);
    transition:background .12s ease,transform .12s ease;
}

.request-code-dots span.filled{
    background:var(--text);
    transform:scale(1.08);
}

.request-keypad{
    width:min(100%,300px);
    margin:0 auto;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    transition:opacity .15s ease;
}

.request-keypad.disabled{
    pointer-events:none;
    opacity:.48;
}

.request-keypad button,
.request-keypad-spacer{
    height:58px;
}

.request-keypad button{
    border:none;
    border-radius:18px;
    background:var(--surface-alt);
    color:var(--text);
    font-size:23px;
    font-weight:680;
}

.request-keypad button:active{
    transform:scale(.96);
    background:var(--line);
}

.request-keypad-action{
    color:var(--muted)!important;
    font-size:20px!important;
}

.request-app-shell,
.request-admin-shell{
    width:min(100%,760px);
}

.request-hero{
    align-items:center;
}

.request-user-button{
    width:46px;
    height:46px;
    border:1px solid var(--line);
    border-radius:999px;
    background:var(--surface);
    color:var(--text);
    box-shadow:var(--shadow);
    font-weight:800;
    font-size:17px;
}

.request-user-menu-name{
    min-width:190px;
}

.request-section + .request-section{
    margin-top:26px;
}

.request-results{
    gap:10px;
}

.request-page-search{
    margin-bottom:20px;
}

.request-results-head{
    margin:0 2px 10px;
}

.request-media-card{
    align-items:center;
}

.request-media-card .poster{
    width:64px;
    height:96px;
    border-radius:14px;
    object-fit:cover;
    flex:0 0 auto;
}

.request-poster-placeholder{
    display:flex!important;
    align-items:center;
    justify-content:center;
    background:var(--surface-alt);
    color:var(--muted);
    font-size:13px;
    font-weight:800;
}

.request-media-card .search-side{
    align-self:center;
}

.request-already-requested{
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(48,209,88,.12)!important;
    color:var(--green)!important;
}

.request-confirm-panel{
    max-height:min(86vh,720px);
}

.request-confirm-head{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:16px;
}

.request-confirm-poster{
    width:76px;
    height:114px;
    border-radius:16px;
    object-fit:cover;
    flex:0 0 auto;
}

.request-confirm-head h2{
    margin:0;
    font-size:24px;
    line-height:1.08;
}

.request-confirm-meta{
    margin:7px 0 0;
    color:var(--muted);
    font-size:13px;
}

.request-confirm-overview{
    margin:0 0 14px;
    color:var(--muted);
    font-size:14px;
    line-height:1.5;
}

.request-confirm-person{
    padding:13px 14px;
    border-radius:14px;
    background:var(--surface-alt);
    font-size:14px;
}

.request-confirm-actions{
    display:grid;
    grid-template-columns:1fr 1.45fr;
    gap:10px;
    margin-top:14px;
}

.request-confirm-actions button{
    min-height:48px;
    border-radius:15px;
    font-weight:750;
}

.request-confirm-send{
    border:none;
    background:var(--blue);
    color:#fff;
}

.request-page .toast,
.request-admin-page .toast{
    z-index:500;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .18s ease, visibility .18s ease, transform .18s ease;
    transform:translateX(-50%) translateY(8px);
}

.request-page .toast.show,
.request-admin-page .toast.show{
    opacity:1;
    visibility:visible;
    transform:translateX(-50%) translateY(0);
}

/* Administration Marvin */
.request-admin-shell{
    padding-bottom:48px!important;
}

.request-admin-hero{
    margin-bottom:14px;
}

.request-admin-back{
    display:inline-block;
    margin:0 0 18px;
    color:var(--blue);
    text-decoration:none;
    font-size:16px;
    font-weight:750;
}

.request-admin-tabs{
    margin-bottom:18px;
}

.request-admin-summary{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
    margin-bottom:24px;
}

.request-admin-summary>div{
    min-width:0;
    padding:13px 8px;
    border-radius:16px;
    background:var(--surface);
    border:1px solid var(--line);
    text-align:center;
}

.request-admin-summary strong{
    display:block;
    font-size:23px;
    line-height:1;
}

.request-admin-summary span{
    display:block;
    margin-top:6px;
    color:var(--muted);
    font-size:10.5px;
    font-weight:700;
}

.request-admin-group{
    margin-bottom:28px;
}

.request-admin-group-head{
    margin:0 2px 9px;
}

.request-admin-group-head>span{
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}

.request-admin-card-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.request-admin-card{
    display:flex;
    gap:12px;
    padding:11px;
    border:1px solid var(--line);
    border-radius:20px;
    background:var(--surface);
}

.request-admin-poster{
    width:78px;
    height:117px;
    object-fit:cover;
    border-radius:14px;
    flex:0 0 auto;
}

.request-admin-card-body{
    min-width:0;
    flex:1;
}

.request-admin-card-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
}

.request-admin-card h3{
    margin:1px 0 0;
    font-size:16px;
    line-height:1.2;
}

.request-admin-card-top p{
    margin:4px 0 0;
    color:var(--muted);
    font-size:12px;
}

.request-admin-requester{
    margin:8px 0 0;
    color:var(--muted);
    font-size:12px;
}

.request-admin-overview{
    margin:7px 0 0;
    color:var(--muted);
    font-size:12.5px;
    line-height:1.4;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    overflow:hidden;
}

.request-admin-actions{
    display:flex;
    gap:7px;
    flex:0 0 auto;
}

.request-status-button{
    width:38px;
    height:38px;
    border:none;
    border-radius:13px;
    font-size:20px;
    font-weight:800;
}

.request-status-button.reject{
    background:rgba(255,69,58,.12);
    color:var(--red);
}

.request-status-button.accept{
    background:rgba(48,209,88,.14);
    color:var(--green);
}

.request-available-check{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:6px;
    min-height:38px;
    padding:0 10px;
    border-radius:13px;
    background:var(--surface-alt);
    color:var(--text);
    font-size:12px;
    font-weight:750;
}

.request-available-check input{
    width:19px;
    height:19px;
    accent-color:var(--green);
}

.request-available-check.available{
    color:var(--green);
    background:rgba(48,209,88,.12);
}

.request-status-badge{
    flex:0 0 auto;
    padding:7px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:750;
}

.request-status-badge.rejected{
    color:var(--red);
    background:rgba(255,69,58,.10);
}

.request-admin-code-head{
    align-items:flex-start;
    margin-bottom:10px;
}

.request-admin-code-head p{
    max-width:480px;
}

.request-admin-add{
    width:42px;
    height:42px;
    border:none;
    border-radius:14px;
    background:var(--blue);
    color:#fff;
    font-size:26px;
    line-height:1;
}

.request-user-row{
    width:100%;
    display:flex;
    align-items:center;
    gap:11px;
    padding:12px 13px;
    border:1px solid var(--line);
    border-radius:17px;
    background:var(--surface);
    color:var(--text);
    text-align:left;
}

.request-user-avatar{
    width:42px;
    height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:var(--surface-alt);
    font-size:17px;
    font-weight:800;
}

.request-user-row-main{
    flex:1;
    min-width:0;
}

.request-user-row-main strong,
.request-user-row-main small{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.request-user-row-main strong{
    font-size:15px;
}

.request-user-row-main small{
    margin-top:3px;
    color:var(--muted);
    font-size:11.5px;
}

.request-user-state{
    padding:5px 8px;
    border-radius:999px;
    font-size:10.5px;
    font-weight:750;
}

.request-user-state.active{
    color:var(--green);
    background:rgba(48,209,88,.10);
}

.request-user-state.inactive{
    color:var(--muted);
    background:var(--surface-alt);
}

.request-user-chevron{
    color:var(--muted);
    font-size:23px;
}

.request-user-form{
    display:flex;
    flex-direction:column;
    gap:13px;
}

.request-user-form label>span{
    display:block;
    margin:0 0 6px 2px;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}

.request-user-form input[type="text"],
.request-user-form input[type="email"],
.request-user-form input[type="password"]{
    width:100%;
    height:50px;
    border:none;
    outline:none;
    border-radius:15px;
    padding:0 14px;
    background:var(--surface-alt);
    color:var(--text);
}

.request-admin-switch-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 13px;
    border-radius:15px;
    background:var(--surface-alt);
}

.request-admin-switch-row>span{
    margin:0!important;
    color:var(--text)!important;
    font-size:14px!important;
}

.request-admin-switch-row input{
    width:21px;
    height:21px;
    accent-color:var(--green);
}

.request-admin-primary,
.request-admin-danger{
    width:100%;
    min-height:50px;
    border:none;
    border-radius:15px;
    font-weight:750;
}

.request-admin-primary{
    background:var(--blue);
    color:#fff;
}

.request-admin-danger{
    margin-top:2px;
    background:rgba(255,69,58,.10);
    color:var(--red);
}

.request-user-editor-panel{
    max-height:88vh;
}

.profile-menu .profile-menu-action.hidden{
    display:none!important;
}

@media (max-width:520px){
    .request-admin-summary{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .request-admin-card{
        align-items:flex-start;
    }

    .request-admin-poster{
        width:68px;
        height:102px;
    }

    .request-admin-card-top{
        gap:6px;
    }

    .request-admin-actions{
        flex-direction:column;
    }

    .request-available-check{
        padding:0 8px;
    }
}

.request-confirm-panel,
.request-user-editor-panel{
    height:auto!important;
    overflow-y:auto;
}

@supports (-webkit-touch-callout:none){
    body.request-admin-page::after{
        display:none;
    }
}


/* V11.1.1 - correctifs connexion */
.bottom-nav.hidden{
    display:none!important;
}

.login-stack{
    width:min(100%,390px);
    display:flex;
    flex-direction:column;
    align-items:stretch;
}

#loginView .login-card{
    width:100%;
}

.request-login-outside{
    margin:12px 0 0;
    min-height:52px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--line);
    border-radius:18px;
    background:var(--surface);
    color:var(--text);
    box-shadow:var(--shadow);
    font-size:15px;
    font-weight:760;
    text-decoration:none;
}

.request-login-outside:active{
    transform:scale(.985);
    background:var(--surface-alt);
}


/* V11.5 - finition portail Demandes */
body.request-page.request-overlay-open{
    overflow:hidden;
}

/* Le portail Demandes reprend le même flou progressif bas que TVi.
   Le point noir provenait du toast vide et non de ce dégradé. */
body.request-page::after{
    display:block!important;
}

.request-page #requestGlobalSearchResults{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-y;
    padding-bottom:calc(12px + env(safe-area-inset-bottom));
}

.request-page #requestGlobalSearchSheet .sheet-panel{
    overscroll-behavior:contain;
}

.request-page .search-plus-button .search-plus-icon{
    display:block;
    width:24px;
    height:24px;
}

.request-page .request-hero{
    min-height:46px;
}


/* V11.6 - Demandes : cartes, menus et notifications */
.request-page .request-media-card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:20px;
    box-shadow:var(--shadow);
    padding:10px;
    overflow:visible;
    transition:transform .12s ease, background .12s ease;
}

.request-page .request-media-card:active{
    transform:scale(.992);
    background:var(--surface-alt);
}

.request-page .request-media-card:focus-visible{
    outline:2px solid var(--blue);
    outline-offset:2px;
}

.request-page .request-own-check{
    border:none;
    cursor:pointer;
}

.request-item-menu{
    position:fixed;
    z-index:850;
    min-width:190px;
    overflow:hidden;
    border-radius:18px;
    background:var(--surface);
    border:1px solid var(--line);
    box-shadow:0 16px 38px rgba(0,0,0,.20);
}

.request-item-menu button{
    display:block;
    width:100%;
    min-height:46px;
    padding:12px 15px;
    border:none;
    border-bottom:1px solid var(--line);
    background:var(--surface);
    color:var(--text);
    text-align:left;
    font:inherit;
    font-size:14px;
    font-weight:720;
}

.request-item-menu button:last-child{
    border-bottom:none;
}

.request-item-menu button:active{
    background:var(--surface-alt);
}

.request-item-menu button.danger{
    color:var(--red);
}

.request-confirm-cancel{
    border:none;
    background:rgba(255,59,48,.12);
    color:var(--red);
}

.request-confirm-actions.one-action{
    grid-template-columns:1fr;
}

.profile-button{
    position:relative;
}

.profile-notification-badge{
    position:absolute;
    top:-5px;
    right:-6px;
    z-index:3;
    min-width:20px;
    height:20px;
    padding:0 5px;
    border:2px solid var(--surface);
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#FF3B30;
    color:#fff;
    font-size:11px;
    line-height:1;
    font-weight:800;
    font-variant-numeric:tabular-nums;
    box-shadow:0 2px 7px rgba(0,0,0,.18);
}

.profile-notification-badge.hidden{
    display:none!important;
}


/* V11.7 - ergonomie demandes / notifications */
.profile-menu .profile-menu-action{
    position:relative;
}

.profile-menu-action-label{
    flex:1 1 auto;
}

.profile-menu-notification-badge{
    flex:0 0 auto;
    min-width:20px;
    height:20px;
    padding:0 5px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#FF3B30;
    color:#fff;
    font-size:11px;
    line-height:1;
    font-weight:800;
    font-variant-numeric:tabular-nums;
    box-shadow:0 2px 7px rgba(0,0,0,.16);
}

.profile-menu-notification-badge.hidden{
    display:none!important;
}

.request-requester-state{
    margin-top:6px;
}

.request-requester-state:empty{
    display:none;
}

.request-other-user-pill{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:4px 9px;
    border-radius:999px;
    background:rgba(0,122,255,.10);
    color:var(--blue);
    font-size:11.5px;
    line-height:1.15;
    font-weight:750;
}

.request-reopen-button{
    min-height:38px;
    padding:0 11px;
    border:1px solid var(--line);
    border-radius:13px;
    background:var(--surface-alt);
    color:var(--text);
    font-size:11.5px;
    line-height:1.1;
    font-weight:750;
    white-space:nowrap;
}

.request-reopen-button:active{
    transform:scale(.98);
}

@media (max-width:520px){
    .request-admin-actions{
        flex-direction:row!important;
        align-items:center;
    }
}


/* V11.9 - états des demandes directement sur les cartes */
.request-page .request-media-card{
    position:relative;
    grid-template-columns:64px minmax(0,1fr);
}

/* Le bouton + / statut flotte au coin supérieur droit. Le contenu occupe donc
   toute la largeur disponible à droite de l'affiche. */
.request-page .request-media-card .request-card-action{
    position:absolute;
    top:10px;
    right:10px;
    z-index:3;
}

.request-page .request-media-card .search-content{
    padding-right:0;
}

/* On réserve de la place au bouton uniquement sur le titre et les métadonnées.
   Le synopsis, lui, peut aller jusqu'au bord droit de la carte. */
.request-page .request-media-card .search-content h3,
.request-page .request-media-card .search-content > p:not(.search-overview){
    padding-right:56px;
}
.request-page .request-media-card.is-requested .search-content h3,
.request-page .request-media-card.is-requested .search-content > p:not(.search-overview){
    padding-right:122px;
}

/* Un titre reste sur une seule ligne ; les titres longs sont tronqués proprement. */
.request-page .request-media-card .search-content h3{
    display:block;
    max-width:100%;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.request-page .request-status-pill{
    position:static;
    z-index:3;
    min-height:29px;
    max-width:112px;
    padding:6px 10px;
    border:0;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    white-space:nowrap;
    font-size:11.5px;
    line-height:1;
    font-weight:800;
    letter-spacing:-.01em;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
}

.request-page button.request-status-pill{
    cursor:pointer;
}

.request-page .request-status-pill.pending{
    color:var(--blue);
    background:rgba(10,132,255,.12);
}

.request-page .request-status-pill.accepted{
    color:var(--orange);
    background:rgba(255,159,10,.14);
}

.request-page .request-status-pill.available{
    color:var(--green);
    background:rgba(48,209,88,.14);
}

.request-page .request-status-pill.rejected{
    color:var(--red);
    background:rgba(255,69,58,.12);
}

.request-page .request-status-icon{
    font-size:12px;
    line-height:1;
    font-weight:900;
}

@media (max-width:390px){
    .request-page .request-media-card.is-requested .search-content h3,
    .request-page .request-media-card.is-requested .search-content > p:not(.search-overview){
        padding-right:112px;
    }

    .request-page .request-status-pill{
        max-width:102px;
        padding-left:8px;
        padding-right:8px;
        font-size:11px;
    }
}



/* V11.9.2 - cartes d'administration des demandes plus compactes */
.request-admin-card{
    align-items:stretch;
    gap:12px;
    padding:10px;
}

.request-admin-poster{
    width:68px;
    height:102px;
    border-radius:13px;
}

.request-admin-card-body{
    min-width:0;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:10px;
}

.request-admin-card-copy{
    min-width:0;
}

.request-admin-card h3{
    margin:1px 0 0;
    font-size:16px;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.request-admin-meta{
    margin:5px 0 0;
    color:var(--muted);
    font-size:12.5px;
}

.request-admin-requester{
    margin:7px 0 0;
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.request-admin-card-controls{
    display:flex;
    justify-content:flex-end;
    min-width:0;
}

.request-admin-actions{
    width:100%;
    display:flex;
    flex-direction:row;
    justify-content:flex-end;
    align-items:center;
    gap:7px;
}

.request-admin-actions-wide{
    justify-content:space-between;
}

.request-status-button,
.request-delete-button{
    width:38px;
    height:38px;
    flex:0 0 38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:none;
    border-radius:13px;
}

.request-delete-button{
    background:rgba(255,69,58,.10);
    color:var(--red);
}

.request-delete-button svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.request-delete-button:active,
.request-status-button:active{
    transform:scale(.96);
}

.request-available-check{
    min-height:38px;
}

.request-reopen-button{
    min-height:38px;
}

/* L'ancien résumé n'est plus utilisé dans les cartes admin. */
.request-admin-overview{
    display:none!important;
}

@media (max-width:520px){
    .request-admin-card{
        grid-template-columns:none;
    }
    .request-admin-actions,
    .request-admin-actions-wide{
        flex-direction:row!important;
        align-items:center;
    }
}

/* ---------- Livres ---------- */
.book-poster-card .poster-image-wrap{
    background:linear-gradient(145deg,var(--surface-alt),var(--surface));
}
.book-cover-wrap{
    aspect-ratio:2/3;
}
.book-cover{
    object-fit:cover;
}
.book-cover-placeholder{
    display:flex!important;
    align-items:center;
    justify-content:center;
    background:var(--surface-alt);
    color:var(--muted-2);
    font-size:34px;
}
.book-card-body{
    padding:12px 10px 13px;
}
.book-card-body .yamtrack-title{
    min-height:0;
    text-align:left;
    -webkit-line-clamp:2;
}
.book-card-author{
    margin:5px 0 0;
    color:var(--muted);
    font-size:12.5px;
    line-height:1.3;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.book-list-thumb{
    width:58px;
    height:88px;
    border-radius:11px;
}
.book-list-thumb.book-cover-placeholder{
    font-size:24px;
}
.book-ownership-badge{
    color:var(--muted);
}
.book-search-cover-wrap{
    flex:0 0 auto;
}
.book-search-cover-wrap .poster{
    object-fit:cover;
}
.book-search-meta{
    max-width:100%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.search-added-open{
    border:none;
    cursor:pointer;
}

.book-page{
    width:100%;
    max-width:100%;
    min-height:100vh;
    overflow-x:hidden;
    overflow-x:clip;
    overscroll-behavior-x:none;
}
#view-detail{
    overflow-x:hidden;
    overflow-x:clip;
    overscroll-behavior-x:none;
}
.book-series-hero{
    min-height:360px;
    background:var(--surface-alt);
}
.book-series-backdrop{
    object-fit:cover;
    object-position:center 30%;
    transform:scale(1.035);
    filter:saturate(.92) blur(1px);
}
.book-series-backdrop-empty{
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:76px;
    color:var(--muted-2);
    background:
        radial-gradient(circle at 50% 35%,rgba(10,132,255,.16),transparent 36%),
        var(--surface-alt);
}
.book-backdrop-shade{
    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.22) 0%,
            rgba(0,0,0,.08) 40%,
            var(--bg) 94%,
            var(--bg) 100%
        );
}
.book-hero-content{
    padding-bottom:24px;
}
.book-hero-content h1{
    text-shadow:0 1px 10px rgba(0,0,0,.16);
}
.book-menu-button{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    letter-spacing:0;
}
.book-menu-dots{
    display:block;
    width:20px;
    height:6px;
    fill:currentColor;
}
.book-detail-content{
    width:100%;
    max-width:100%;
    padding-top:0;
    overflow-x:clip;
}
.book-detail-controls{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:10px;
    width:100%;
    max-width:100%;
    margin-bottom:10px;
}
.book-status-control{
    position:relative;
    width:100%;
    min-width:0;
    margin:0;
}
.book-status-control::after{
    content:"";
    position:absolute;
    top:50%;
    right:16px;
    width:7px;
    height:7px;
    border-right:2px solid var(--bg);
    border-bottom:2px solid var(--bg);
    transform:translateY(-68%) rotate(45deg);
    pointer-events:none;
    z-index:2;
}
.book-status-control select{
    width:100%;
    max-width:100%;
    min-width:0;
    appearance:none;
    -webkit-appearance:none;
    padding:0 38px 0 14px;
    text-overflow:ellipsis;
    white-space:nowrap;
    overflow:hidden;
}
.book-overview-wrap{
    width:100%;
    max-width:100%;
    margin-top:18px;
}
.book-add-library-button{
    width:100%;
    min-height:48px;
    margin:2px 0 18px;
    border:none;
    border-radius:18px;
    background:var(--text);
    color:var(--bg);
    font-weight:760;
}
.book-preview-page .series-content{
    padding-bottom:calc(102px + env(safe-area-inset-bottom));
}

@media (max-width:520px){
    .book-series-hero{
        min-height:350px;
    }
    .book-series-backdrop{
        object-position:center 26%;
    }
    .book-hero-content h1{
        font-size:29px;
    }
    .book-status-control select{
        font-size:14px;
        padding-left:12px;
        padding-right:34px;
    }
    .book-status-control::after{
        right:14px;
    }
}


/* ---------- Jeux vidéo ---------- */
.game-poster-card .poster-image-wrap{
    background:linear-gradient(145deg,var(--surface-alt),var(--surface));
}
.game-cover-wrap{
    aspect-ratio:2/3;
}
.game-cover{
    object-fit:cover;
}
.game-cover-placeholder{
    display:flex!important;
    align-items:center;
    justify-content:center;
    background:var(--surface-alt);
    color:var(--muted-2);
    font-size:34px;
}
.game-card-body{
    min-width:0;
    padding:12px 10px 13px;
}
.game-card-body .yamtrack-title{
    display:block;
    min-width:0;
    min-height:0;
    text-align:left;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    -webkit-line-clamp:unset;
}
.game-list-row .list-row-copy{
    min-width:0;
}
.game-list-row .list-row-copy h3{
    display:block;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.game-list-thumb{
    width:58px;
    height:88px;
    border-radius:11px;
    object-fit:cover;
}
.game-list-thumb.game-cover-placeholder{
    font-size:24px;
}
.game-search-cover-wrap{
    flex:0 0 auto;
}
.game-search-cover-wrap .poster{
    object-fit:cover;
}
.game-search-meta{
    max-width:100%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.game-page{
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:100vh;
    overflow-x:hidden;
    overflow-x:clip;
    overscroll-behavior-x:none;
}
.game-page .series-content,
.game-detail-content,
.game-addons-section,
.game-addon-list,
.game-addon-row{
    min-width:0;
    max-width:100%;
}
.game-series-hero{
    min-height:360px;
    background:var(--surface-alt);
}
.game-series-backdrop{
    object-fit:cover;
    object-position:center 42%;
    transform:scale(1.025);
    filter:saturate(.95) blur(.6px);
}
.game-series-backdrop-cover-fallback{
    object-position:center 32%;
}
.game-series-backdrop-empty{
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:76px;
    color:var(--muted-2);
    background:
        radial-gradient(circle at 50% 35%,rgba(10,132,255,.16),transparent 36%),
        var(--surface-alt);
}
.game-backdrop-shade{
    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.20) 0%,
            rgba(0,0,0,.08) 42%,
            var(--bg) 94%,
            var(--bg) 100%
        );
}
.game-hero-content{
    padding-bottom:24px;
}
.game-hero-content h1{
    text-shadow:0 1px 10px rgba(0,0,0,.18);
}
.game-detail-content{
    width:100%;
    max-width:100%;
    padding-top:0;
    overflow-x:clip;
}
.game-detail-controls{
    grid-template-columns:minmax(0,1.35fr) minmax(0,.85fr);
}
.game-detail-controls.with-game-heart{
    grid-template-columns:minmax(0,1.18fr) minmax(0,.82fr) 48px;
    gap:8px;
    align-items:stretch;
}
.game-detail-controls.with-game-heart .book-status-control select{
    padding-left:11px;
    padding-right:30px;
}
.game-detail-controls.with-game-heart .book-status-control::after{
    right:12px;
}
.game-heart-button{
    align-self:stretch;
    flex:0 0 48px;
}
.game-overview-wrap{
    margin-top:18px;
}
.game-addons-section{
    margin:14px 0 0;
    padding:15px;
    border-radius:20px;
    background:var(--surface);
    border:1px solid var(--line);
}
.game-section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:13px;
}
.game-section-head h2{
    margin:0;
    font-size:18px;
    line-height:1.2;
    font-weight:780;
}
.game-section-head>span{
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}
.game-addon-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.game-addon-row{
    display:grid;
    grid-template-columns:50px minmax(0,1fr) minmax(110px,138px);
    align-items:center;
    gap:11px;
    min-width:0;
}
.game-addon-cover{
    width:50px;
    height:72px;
    border-radius:10px;
    object-fit:cover;
    background:var(--surface-alt);
}
.game-addon-cover.game-cover-placeholder{
    font-size:20px;
}
.game-addon-copy{
    min-width:0;
}
.game-addon-copy h3{
    margin:0;
    font-size:14px;
    line-height:1.25;
    font-weight:760;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.game-addon-copy p{
    margin:5px 0 0;
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.game-addon-select{
    position:relative;
    display:block;
    width:100%;
    min-width:0;
    margin:0;
}
.game-addon-select select{
    width:100%;
    height:40px;
    min-height:40px;
    padding-left:10px;
    padding-right:28px;
    border-radius:14px;
    font-size:12px;
}
.game-addon-select::after{
    right:12px;
}
.game-preview-page .game-addons-section{
    margin-bottom:18px;
}

@media (max-width:520px){
    .game-series-hero{
        min-height:350px;
    }
    .game-series-backdrop{
        object-position:center 38%;
    }
    .game-hero-content h1{
        font-size:29px;
    }
    .game-addon-row{
        grid-template-columns:46px minmax(0,1fr) minmax(96px,118px);
        gap:9px;
    }
    .game-addon-cover{
        width:46px;
        height:66px;
    }
    .game-addon-select select{
        font-size:11.5px;
        padding-left:8px;
        padding-right:25px;
    }
}

/* ---------- Synchronisation Xbox ---------- */
.xbox-account-meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin:10px 0 0;
    padding:12px 14px;
    border-radius:15px;
    background:var(--surface-alt);
    border:1px solid var(--line);
}
.xbox-account-meta span{
    min-width:0;
    color:var(--muted);
    font-size:13px;
}
.xbox-account-meta strong{
    flex:0 0 auto;
    color:var(--text);
    font-size:13px;
    font-weight:760;
    text-align:right;
}
.xbox-sync-error{
    margin-top:12px;
}
.xbox-history-card{
    padding-bottom:12px;
}
.xbox-title-list{
    display:flex;
    flex-direction:column;
    gap:0;
    margin-top:4px;
}
.xbox-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:13px 2px;
    border-top:1px solid var(--line);
}
.xbox-title-row:first-child{
    border-top:none;
}
.xbox-title-copy{
    min-width:0;
    flex:1 1 auto;
}
.xbox-title-copy h3{
    margin:0;
    color:var(--text);
    font-size:14.5px;
    line-height:1.25;
    font-weight:760;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.xbox-title-copy p{
    margin:5px 0 0;
    color:var(--muted);
    font-size:12px;
    line-height:1.35;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.xbox-title-copy small{
    display:block;
    margin-top:3px;
    color:var(--muted-2);
    font-size:11.5px;
    line-height:1.35;
}
.xbox-title-percent{
    flex:0 0 auto;
    min-width:44px;
    color:var(--muted);
    font-size:12.5px;
    font-weight:760;
    text-align:right;
}
.xbox-progress{
    width:100%;
    height:4px;
    margin-top:8px;
    border-radius:999px;
    overflow:hidden;
    background:var(--surface-alt);
}
.xbox-progress>span{
    display:block;
    height:100%;
    border-radius:inherit;
    background:currentColor;
    color:#107c10;
}

@media (max-width:520px){
    .xbox-account-meta{
        padding:11px 12px;
    }
    .xbox-title-row{
        gap:10px;
        padding:12px 1px;
    }
    .xbox-title-copy p{
        font-size:11.5px;
    }
}

/* Xbox -> Bibliothèque Jeux */
.xbox-import-library-card{
    overflow:hidden;
}
.xbox-import-head{
    margin-bottom:14px;
}
.xbox-import-summary{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:9px;
    margin:4px 0 15px;
}
.xbox-import-summary>div{
    min-width:0;
    padding:12px 10px;
    border-radius:16px;
    background:var(--surface-alt);
    border:1px solid var(--line);
    text-align:center;
}
.xbox-import-summary strong{
    display:block;
    font-size:19px;
    line-height:1.1;
    font-weight:800;
}
.xbox-import-summary span{
    display:block;
    margin-top:4px;
    color:var(--muted);
    font-size:11.5px;
    font-weight:650;
}
.xbox-import-toolbar{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:12px;
}
.xbox-import-search{
    width:100%;
    min-height:42px;
    padding:0 13px;
    border:1px solid var(--line);
    border-radius:14px;
    background:var(--surface-alt);
    color:var(--text);
    font:inherit;
    font-size:14px;
    outline:none;
}
.xbox-import-search:focus{
    border-color:rgba(10,132,255,.55);
    box-shadow:0 0 0 3px rgba(10,132,255,.12);
}
.xbox-import-filters{
    display:flex;
    gap:6px;
    overflow-x:auto;
    padding-bottom:2px;
    scrollbar-width:none;
}
.xbox-import-filters::-webkit-scrollbar{
    display:none;
}
.xbox-import-filters button{
    flex:0 0 auto;
    min-height:34px;
    padding:0 11px;
    border:0;
    border-radius:999px;
    background:var(--surface-alt);
    color:var(--muted);
    font:inherit;
    font-size:12.5px;
    font-weight:700;
}
.xbox-import-filters button.active{
    background:var(--text);
    color:var(--bg);
}
.xbox-import-filters button span{
    margin-left:4px;
    opacity:.72;
}
.xbox-import-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.xbox-import-card{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    gap:12px;
    padding:10px;
    border-radius:18px;
    background:var(--surface-alt);
    border:1px solid var(--line);
}
.xbox-import-card.is-imported{
    border-color:var(--line);
}
.xbox-import-card.is-ignored{
    opacity:.72;
}
.xbox-import-cover-wrap{
    position:relative;
    width:72px;
    height:104px;
    border-radius:12px;
    overflow:hidden;
    background:var(--surface);
}
.xbox-import-cover{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
}
.xbox-import-cover-placeholder{
    display:grid;
    place-items:center;
    font-size:27px;
    color:var(--muted-2);
}
.xbox-import-source-badge,
.game-platform-cover-tag{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:max-content;
    max-width:100%;
    border-radius:999px;
    color:#fff;
    font-size:10.5px;
    line-height:1;
    font-weight:800;
    letter-spacing:.01em;
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
}
.xbox-import-source-badge{
    position:absolute;
    left:6px;
    bottom:6px;
    padding:5px 7px;
}
.xbox-import-copy{
    min-width:0;
    display:flex;
    flex-direction:column;
}
.xbox-import-title-line{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:8px;
}
.xbox-import-title-line h3{
    min-width:0;
    margin:1px 0 0;
    font-size:15px;
    line-height:1.24;
    font-weight:780;
}
.xbox-import-state{
    flex:0 0 auto;
    padding:4px 7px;
    border-radius:999px;
    font-size:10px;
    line-height:1;
    font-weight:800;
}
.xbox-import-state.imported{
    background:rgba(142,142,147,.16);
    color:var(--muted);
}
.xbox-import-state.ignored{
    background:rgba(142,142,147,.16);
    color:var(--muted);
}
.xbox-import-source-title{
    margin:4px 0 0;
    color:var(--muted);
    font-size:11px;
    line-height:1.25;
}
.xbox-import-compact-stats{
    margin:9px 0 0;
    color:var(--muted);
    font-size:11.5px;
    line-height:1.25;
    font-weight:720;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.xbox-import-actions{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:auto;
    padding-top:9px;
}
.xbox-mini-button{
    min-height:31px;
    padding:0 10px;
    border:0;
    border-radius:10px;
    background:var(--surface);
    color:var(--text);
    font:inherit;
    font-size:11.5px;
    font-weight:760;
}
.xbox-mini-button.primary{
    background:var(--blue);
    color:#fff;
}
.xbox-mini-button:disabled{
    opacity:.5;
}
.xbox-import-empty{
    padding:24px 12px;
    color:var(--muted);
    text-align:center;
    font-size:13px;
}
.xbox-import-note{
    margin-top:12px;
}

/* Cartes / fiche jeu */
.game-cover-wrap{
    position:relative;
}
.game-platform-cover-tag{
    position:absolute;
    top:8px;
    left:8px;
    z-index:2;
    padding:6px 8px;
    border:1px solid currentColor;
    box-shadow:0 4px 14px rgba(0,0,0,.12);
}
.platform-xbox{
    background:rgba(16,124,16,.18) !important;
    color:#107c10 !important;
    border-color:rgba(16,124,16,.28) !important;
}
.platform-playstation{
    background:rgba(0,112,209,.16) !important;
    color:#0070d1 !important;
    border-color:rgba(0,112,209,.26) !important;
}
.platform-switch{
    background:rgba(230,0,18,.14) !important;
    color:#e60012 !important;
    border-color:rgba(230,0,18,.24) !important;
}
.platform-pc{
    background:rgba(110,110,115,.16) !important;
    color:#6e6e73 !important;
    border-color:rgba(110,110,115,.24) !important;
}
.game-platform-pill{
    border-width:1px;
    border-style:solid;
}
.game-xbox-card-stats{
    min-width:0;
    margin:7px 0 0;
    color:var(--muted);
    font-size:10.5px;
    line-height:1.25;
    font-weight:760;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.game-list-row .game-xbox-card-stats{
    margin-top:8px;
    font-size:11px;
}
.game-xbox-detail-card{
    margin:16px 0 0;
    padding:16px;
    border-radius:20px;
    background:var(--surface);
    border:1px solid var(--line);
}
.game-xbox-detail-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.game-xbox-detail-head h2{
    margin:0;
    font-size:18px;
    line-height:1.15;
    font-weight:800;
    display:flex;
    align-items:baseline;
    gap:8px;
    white-space:nowrap;
}
.game-xbox-detail-head h2 span{
    color:var(--muted);
    font-size:12.5px;
    font-weight:760;
}
.game-xbox-detail-progress{
    height:8px;
    margin-top:13px;
    border-radius:999px;
    overflow:hidden;
    background:var(--surface-alt);
}
.game-xbox-detail-progress>span{
    display:block;
    height:100%;
    border-radius:inherit;
    background:var(--green);
}
.game-xbox-detail-stats{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
    margin-top:13px;
}
.game-xbox-detail-stats>div{
    min-width:0;
    padding:11px;
    border-radius:14px;
    background:var(--surface-alt);
}
.game-xbox-detail-stats span{
    display:block;
    color:var(--muted);
    font-size:10.5px;
    line-height:1.2;
}
.game-xbox-detail-stats strong{
    display:block;
    margin-top:4px;
    font-size:12.5px;
    line-height:1.2;
    font-weight:800;
    overflow-wrap:anywhere;
}

@media (max-width:430px){
    .xbox-import-card{
        grid-template-columns:64px minmax(0,1fr);
        gap:10px;
        padding:9px;
    }
    .xbox-import-cover-wrap{
        width:64px;
        height:94px;
    }
    .xbox-import-title-line{
        display:block;
    }
    .xbox-import-state{
        display:inline-flex;
        margin-top:5px;
    }
    .game-xbox-detail-stats{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

/* V4 - jeux partagés et badges plateforme translucides */
@media (prefers-color-scheme: dark){
    .platform-xbox{ color:#5ad65a !important; }
    .platform-playstation{ color:#55aaff !important; }
    .platform-switch{ color:#ff5a67 !important; }
    .platform-pc{ color:#c7c7cc !important; }
}


/* V5 - Cartes jeux compactes : titres toujours sur une ligne */
.game-poster-card,
.game-poster-card .poster-button,
.game-poster-card .game-card-body{
    min-width:0;
    max-width:100%;
    overflow:hidden;
}
.game-poster-card .poster-button,
.game-poster-card .game-card-body,
.game-poster-card .yamtrack-title{
    width:100%;
}
.game-poster-card .yamtrack-title,
.game-list-row .list-row-copy h3,
.xbox-import-title-line h3{
    min-width:0;
    max-width:100%;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
}
.game-list-row .list-row-button{
    min-width:0;
    width:100%;
    overflow:hidden;
}
.game-list-row .list-row-copy{
    min-width:0;
    overflow:hidden;
}
.xbox-import-title-line h3{
    display:block;
}

/* Séries : épisodes non encore diffusés (TMDB) */
.series-seasons .episode-list .episode-row.upcoming {
    opacity:.48;
}
.series-seasons .episode-list .episode-row.upcoming > strong {
    text-decoration:none;
}
.series-seasons .episode-list .episode-row .episode-release-date {
    flex:0 0 auto;
    width:auto;
    max-width:48%;
    font-size:11px;
    font-weight:600;
    color:var(--muted-2);
    white-space:nowrap;
    text-align:right;
    overflow:visible;
    text-overflow:clip;
}
.series-seasons .episode-list .episode-row .episode-name {
    flex:1 1 auto;
    min-width:0;
}

/* Demandes Plex depuis le profil Chloé (fiches TMDB non ajoutées) */
.profile-plex-request {
    display: block; width: 100%; margin: 12px 0 18px; padding: 15px 16px;
    border: 1px solid rgba(120, 120, 128, .24); border-radius: 16px;
    background: #2487e9; color: white; font: inherit; font-weight: 650;
    text-align: center; cursor: pointer;
}
.profile-plex-request[data-status="pending"],
.profile-plex-request[data-status="accepted"] {
    background: rgba(120,120,128,.14); color: inherit; opacity: .75;
}
.profile-plex-request[data-status="rejected"] {
    background: rgba(200,60,60,.12); color: #df6969;
}
.profile-plex-request.hidden { display: none; }
