.navbar-x {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1030;
    transition: transform 0.4s var(--ease), background 0.3s var(--ease);
}

.navbar-x.hide { transform: translateY(-100%); }
.navbar-x.scrolled { box-shadow: var(--shadow); }

.navbar-x .inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--white);
    white-space: nowrap;
}

.brand:hover { color: var(--white); }
.brand img { height: 34px; width: auto; }
.brand span { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-menu a:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
.nav-menu a.active { color: var(--white); background: rgba(124, 58, 237, 0.2); }

/* ----- Sous-menu « Parcourir » -----
   Le bouton reprend l'apparence des liens voisins ; les couleurs du theme
   clair sont reprises ci-dessous car --violet-soft y manque de contraste. */
.nav-browse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-browse-toggle:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
[data-bs-theme="light"] .nav-browse-toggle:hover { color: var(--text); background: rgba(124, 58, 237, 0.1); }
.nav-browse-toggle.active { color: var(--violet-soft); background: rgba(124, 58, 237, 0.16); }
[data-bs-theme="light"] .nav-browse-toggle.active { color: var(--violet-deep); }

.nav-browse-caret { font-size: 0.7rem; transition: transform 0.2s var(--ease); }
.nav-browse-toggle[aria-expanded="true"] .nav-browse-caret { transform: rotate(180deg); }

/* Les sections s'etalent en colonnes : la liste complete tient sans
   transformer le menu en colonne interminable. */
.nav-browse-menu {
    display: none;
    grid-template-columns: repeat(3, minmax(148px, 1fr));
    gap: 4px 18px;
    padding: 16px 18px;
    border-radius: var(--radius);
    margin-top: 8px;
}

.nav-browse-menu.show { display: grid; }

.nav-browse-label {
    margin: 0 0 6px;
    padding: 0 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.nav-browse-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.87rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.nav-browse-link:hover { background: var(--surface-2); color: var(--text); }
.nav-browse-link.active { color: var(--violet-soft); }
[data-bs-theme="light"] .nav-browse-link.active { color: var(--violet-deep); }
.nav-browse-link i { font-size: 0.95rem; width: 17px; text-align: center; flex-shrink: 0; }

/* En dessous de 1100px le menu deborderait : on replie sur deux colonnes. */
@media (max-width: 1100px) {
    .nav-browse-menu { grid-template-columns: repeat(2, minmax(148px, 1fr)); }
}

/* Intitules de section du panneau mobile. */
.nav-mobile-label {
    padding: 14px 4px 4px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.15rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.icon-btn:hover { color: var(--white); border-color: var(--violet); transform: translateY(-2px); }

.icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 9px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-grad {
    background: var(--grad-primary);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35);
}

.btn-grad:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(124, 58, 237, 0.5); }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-weight: 600;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-ghost:hover { color: var(--white); border-color: var(--violet); background: rgba(124, 58, 237, 0.14); }

.btn-pill { border-radius: var(--radius-pill); }

.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
    background: var(--night-3);
}

.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-lg { width: 96px; height: 96px; }

.card-title-media {
    position: relative;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--night-3);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card-title-media:hover {
    transform: translateY(-6px);
    /* Survol reduit a la bordure violette : ni halo colore, ni ombre portee. */
    border-color: var(--violet);
}

.card-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.card-title-media:hover .card-poster img { transform: scale(1.08); }

.card-poster .score-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.card-poster .type-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 3px 9px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill);
    background: rgba(11, 16, 35, 0.7);
    color: #fff;
    backdrop-filter: blur(6px);
}

.card-poster .overlay {
    position: absolute;
    inset: 0;
    background: var(--grad-dark);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    gap: 8px;
    transition: opacity 0.35s var(--ease);
}

.card-title-media:hover .overlay { opacity: 1; }

.overlay .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.overlay .btn-view {
    align-self: stretch;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--grad-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
}

.card-body-media { padding: 12px 4px 4px; }

.card-body-media .title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
    color: var(--text);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.card-body-media .sub {
    font-size: 0.76rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
    /* Un nom de personnage long débordait de la carte, qui le coupait net
       (overflow:hidden). Il revient désormais à la ligne, et un mot sans
       espace — translittération, numéro de rôle — se coupe au besoin. */
    flex-wrap: wrap;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.hero {
    position: relative;
    min-height: 560px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s var(--ease);
    z-index: 0;
}

.hero-slide.active { opacity: 1; }

.hero-clean {
    background:
        radial-gradient(circle at 10% 15%, rgba(124, 58, 237, 0.22), transparent 42%),
        radial-gradient(circle at 92% 30%, rgba(14, 165, 233, 0.16), transparent 46%),
        var(--surface-solid);
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 16, 35, 0.92) 0%, rgba(11, 16, 35, 0.55) 45%, transparent 100%),
        linear-gradient(0deg, rgba(11, 16, 35, 0.95), transparent 55%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 48px;
    max-width: 1040px;
    width: 100%;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 36px;
}

.hero-poster {
    flex: 0 0 auto;
    width: 214px;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-strong);
    transition: transform 0.45s var(--ease);
}

.hero-poster:hover { transform: translateY(-5px) scale(1.02); }

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    filter: none;
    transform: none;
}

.hero-text {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 600px;
}

.hero-content .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(124, 58, 237, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.4);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
    margin-bottom: 14px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.02rem;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hero-dots {
    position: absolute;
    bottom: 24px;
    right: 32px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

.hero-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.hero-dots button.active { width: 28px; border-radius: var(--radius-pill); background: var(--grad-primary); }

.scroller {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.scroller::-webkit-scrollbar { display: none; }
.scroller > * { flex: 0 0 auto; width: 180px; scroll-snap-align: start; }

/* Flèches de défilement, injectées par scroller.js autour de chaque .scroller. */
.scroller-wrap { position: relative; }
.scroller-nav {
    position: absolute;
    top: calc(50% - 18px);
    transform: translateY(-50%);
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}
/* Affichées seulement quand il y a matière à défiler. */
.scroller-wrap.has-overflow .scroller-nav { display: inline-flex; }
.scroller-nav:hover:not(:disabled) { background: var(--violet); border-color: var(--violet); color: #fff; }
.scroller-nav:disabled { opacity: 0; pointer-events: none; }
/* Placées à l'intérieur : sur la page d'accueil .container-x n'a pas de marge
   latérale, une position extérieure sortirait de la colonne. */
.scroller-nav-prev { left: 6px; }
.scroller-nav-next { right: 6px; }

/* Sur mobile le défilement au doigt suffit : les flèches encombreraient. */
@media (max-width: 767.98px) {
    .scroller-wrap.has-overflow .scroller-nav { display: none; }
}

.search-box { position: relative; flex: 1 1 auto; min-width: 200px; max-width: 340px; }

.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 44px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.92rem;
    transition: var(--transition);
}

.search-box input:focus { outline: none; border-color: var(--violet); background: rgba(124, 58, 237, 0.1); }
.search-box .bi-search { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    max-height: 420px;
    overflow-y: auto;
    border-radius: var(--radius);
    padding: 8px;
    z-index: 1040;
    display: none;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.search-results.show { display: block; }

.search-results a {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: background 0.2s var(--ease);
}

.search-results a:hover { background: rgba(124, 58, 237, 0.16); }
.search-results img { width: 42px; height: 60px; object-fit: cover; border-radius: 6px; }
.search-results .r-title { font-weight: 600; font-size: 0.9rem; }
.search-results .r-sub { font-size: 0.76rem; color: var(--text-dim); }

.dropdown-glass {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.dropdown-glass .dropdown-item {
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 12px;
    font-size: 0.9rem;
}

.dropdown-glass .dropdown-item:hover { background: rgba(124, 58, 237, 0.16); color: var(--white); }
.dropdown-glass .dropdown-divider { border-color: var(--border); }

.footer {
    margin-top: 72px;
    border-top: 1px solid var(--border);
    background: rgba(11, 16, 35, 0.6);
    backdrop-filter: var(--blur-sm);
}

.footer .inner { max-width: var(--container); margin: 0 auto; padding: 56px 20px 28px; }

.footer h5 { font-size: 0.95rem; margin-bottom: 16px; color: var(--white); }
.footer a { display: block; color: var(--text-muted); font-size: 0.88rem; padding: 5px 0; }
.footer a:hover { color: var(--cyan); }

.footer a.icon-btn { display: inline-flex; padding: 0; font-size: 1.15rem; color: var(--text); }
.footer a.icon-btn:hover { color: var(--white); }

.cover-reposition {
    position: relative;
    width: 100%;
    aspect-ratio: 10 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: grab;
    user-select: none;
    touch-action: none;
    background: var(--night-3);
}

.cover-reposition.dragging { cursor: grabbing; }

.cover-reposition img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 50%;
    pointer-events: none;
    -webkit-user-drag: none;
}

.cover-reposition .cover-hint {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: rgba(11, 16, 35, 0.72);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
    pointer-events: none;
    opacity: 0.85;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.84rem;
}

.form-glass label { font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--text); }

.form-glass .form-control,
.form-glass .form-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
}

.form-glass .form-control:focus,
.form-glass .form-select:focus {
    background: rgba(124, 58, 237, 0.08);
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    color: var(--text);
}

.form-glass .form-control::placeholder { color: var(--text-dim); }

.auth-wrap {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

.auth-card { width: 100%; max-width: 440px; padding: 40px; }

.back-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--grad-primary);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: var(--transition);
    z-index: 1020;
    box-shadow: var(--shadow);
}

.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

.pagination-glass .page-link {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    margin: 0 3px;
    border-radius: var(--radius-sm);
    min-width: 42px;
    text-align: center;
}

.pagination-glass .page-item.active .page-link { background: var(--grad-primary); border-color: transparent; color: #fff; }
.pagination-glass .page-link:hover { border-color: var(--violet); color: var(--white); }
.pagination-glass .page-item.disabled .page-link { opacity: 0.4; }

.toast-stack {
    position: fixed;
    top: calc(var(--nav-height) + 14px);
    right: 20px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
}

.toast-x {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s var(--ease);
}

.toast-x.out { animation: toastOut 0.35s var(--ease) forwards; }
.toast-x i { font-size: 1.25rem; }
.toast-x.success i { color: var(--success); }
.toast-x.danger i { color: var(--danger); }
.toast-x.warning i { color: var(--warning); }
.toast-x.info i { color: var(--info); }
.toast-x .body { flex: 1; font-size: 0.9rem; }
.toast-x .close-x { cursor: pointer; color: var(--text-dim); background: none; border: none; }

.btn-like { color: var(--text-muted); cursor: pointer; transition: color 0.2s var(--ease); display: inline-flex; align-items: center; gap: 5px; background: transparent; border: none; padding: 0; font: inherit; }
.btn-like:hover { color: var(--danger); }
.btn-like.liked { color: var(--danger); }
/* Importance d'un rôle, à côté du personnage joué. Discret : le nom du
   personnage reste l'information principale. Ne rétrécit jamais. */
/* ===== Carte de casting (aperçu d'une fiche) =====
   Rythme identique pour chaque carte : acteur, personnage, étiquette, chacun
   sur sa ligne. Sans cela l'étiquette remontait ou descendait selon la
   longueur des noms, et les cartes ne s'alignaient plus entre elles. */
.cast-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    height: 100%;
    text-decoration: none;
}
.cast-avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
.cast-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}
.cast-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.3;
    color: var(--text);
}
/* Jamais tronqué : un nom long revient à la ligne, et une translittération
   sans espace se coupe plutôt que de déborder de la carte. */
.cast-character {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-dim);
    overflow-wrap: anywhere;
}
.cast-card .role-tag { margin-top: 3px; }

.role-tag {
    flex-shrink: 0;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-dim);
    line-height: 1.5;
}
.role-tag.is-principal {
    background: rgba(124, 58, 237, 0.2);
    color: var(--violet);
}
.role-tag.is-guest {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}

/* Commentaire atteint par un lien direct (depuis l'admin des signalements) :
   mis en évidence quelques instants pour qu'on le repère dans le fil. */
.comment-item:target,
.comment-reply:target {
    animation: comment-target 2.4s var(--ease);
    border-radius: 12px;
}
@keyframes comment-target {
    0%, 60% { background: rgba(124, 58, 237, 0.22); box-shadow: 0 0 0 2px var(--violet); }
    100% { background: transparent; box-shadow: none; }
}

/* ===== Contenu enrichi (« À propos » d'un profil) =====
   Le balisage est produit par rich_text() côté serveur ; ces règles bornent
   ce qu'un membre peut imposer à la page. */
.rich-content { line-height: 1.8; font-size: 0.92rem; overflow-wrap: anywhere; }
.rich-content > *:last-child { margin-bottom: 0; }
/* Une image trop grande ne doit pas casser la mise en page ni pousser la colonne. */
.rich-img {
    max-width: 100%;
    max-height: 340px;
    width: auto;
    border-radius: var(--radius);
    margin: 6px 0;
    display: inline-block;
}
/* Largeur choisie par l'auteur : la hauteur suit les proportions. */
.rich-img-sized { max-height: none; height: auto; }

/* Alignement d'une image seule. Le flottement la déplace sans l'extraire de sa
   ligne : le texte et les autres images continuent de s'écouler à côté. */
.rich-img-left, .rich-img-wrap.rich-img-left { float: left; margin: 6px 14px 6px 0; }
.rich-img-right, .rich-img-wrap.rich-img-right { float: right; margin: 6px 0 6px 14px; }
/* Une image flottante ne prend jamais toute la largeur : sans ce plafond, une
   image large ne laisserait au texte qu'une colonne d'un caractère. */
.rich-img-left, .rich-img-right,
.rich-img-wrap.rich-img-left, .rich-img-wrap.rich-img-right { max-width: 65%; }
/* Centrer impose en revanche une ligne à soi : c'est inhérent au centrage. */
.rich-img-center, .rich-img-wrap.rich-img-center { display: block; float: none; margin: 10px auto; }
/* Le contenu qui suit ne doit pas rester coincé contre une image flottante. */
.rich-content::after { content: ""; display: block; clear: both; }
.rich-sm { font-size: 0.8rem; }
.rich-lg { font-size: 1.25rem; font-weight: 600; }
/* Titres internes au bloc « À propos ». Volontairement plus discrets que les
   titres de section de la page, qu'ils ne doivent pas concurrencer. */
.rich-h2 { font-size: 1.15rem; font-weight: 700; margin: 14px 0 6px; }
.rich-h3 { font-size: 1rem; font-weight: 600; margin: 12px 0 4px; color: var(--text-muted); }
.rich-content > .rich-h2:first-child,
.rich-content > .rich-h3:first-child { margin-top: 0; }
.rich-list { margin: 8px 0 8px 18px; }
.rich-content blockquote {
    border-left: 3px solid var(--violet);
    padding: 4px 0 4px 14px;
    margin: 10px 0;
    color: var(--text-muted);
}
.rich-content a { color: var(--violet); }

/* Tableau : même grammaire que les autres cadres du site. */
.rich-table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: 0.88rem;
    /* Un tableau large défile dans son cadre au lieu d'élargir la page. */
    display: block;
    overflow-x: auto;
}
.rich-table td,
.rich-table th {
    border: 1px solid var(--border);
    padding: 7px 10px;
    min-width: 60px;
    vertical-align: top;
}
.rich-table tr:first-child td { background: var(--surface-2); font-weight: 600; }
/* Dans l'éditeur, les cellules vides doivent rester cliquables. */
.rich-editable .rich-table td:empty::after { content: ""; display: inline-block; min-height: 1.2em; }

/* ===== Page des paramètres ===== */
/* Navigation latérale : colonne sur grand écran, rangée défilante sur mobile. */
.settings-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    white-space: nowrap;
    transition: var(--transition);
}
.settings-nav .nav-link:hover { background: var(--surface-2); color: var(--text); }
.settings-nav .nav-link.active { background: rgba(124, 58, 237, 0.18); color: var(--violet); }
.settings-nav .nav-link .bi { font-size: 1.05rem; }

@media (max-width: 991.98px) {
    /* En rangée, la barre défile plutôt que de se replier sur plusieurs lignes. */
    .settings-nav .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .settings-nav .nav::-webkit-scrollbar { display: none; }
    .settings-nav .nav-link { width: auto; }
    .settings-nav .nav-link span { display: none; }
    .settings-nav .nav-link.active span { display: inline; }
}

/* Bootstrap masque les panneaux avec « .tab-content > .tab-pane », c'est-à-dire
   les enfants DIRECTS. Ici ils sont imbriqués dans des formulaires — nécessaire
   pour qu'un même envoi couvre plusieurs onglets — donc la règle ne les atteint
   pas et tous s'empilaient. On reprend le masquage sans exiger la filiation. */
.settings-panes .tab-pane { display: none; }
.settings-panes .tab-pane.active { display: block; }

/* Aide dépliable sous l'éditeur : présente sans encombrer. */
.settings-help > summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-muted);
    list-style: none;
}
.settings-help > summary::-webkit-details-marker { display: none; }
.settings-help > summary::before { content: "\F4FE"; font-family: "bootstrap-icons"; margin-right: 6px; }
.settings-help[open] > summary::before { content: "\F2E6"; }
.settings-help ul { margin: 8px 0 0; padding-left: 18px; font-size: 0.82rem; color: var(--text-dim); line-height: 1.7; }

/* Vidéo intégrée : cadre 16/9 qui s'adapte à la largeur disponible. */
.rich-video {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    margin: 12px 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}
.rich-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Dans l'éditeur : une vignette, car une iframe y serait impossible à
   sélectionner ou à supprimer au clavier. */
.rich-video-mark {
    display: inline-block;
    position: relative;
    max-width: 100%;
    width: 260px;
    line-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    vertical-align: middle;
    margin: 4px 0;
}
.rich-video-mark img { width: 100%; height: auto; display: block; }
.rich-video-tag {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 5px 9px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
}
.rich-video-tag .bi { color: #ff0033; }

/* Spoiler à la lecture : replié, il faut un geste délibéré pour l'ouvrir. */
.rich-spoiler { display: inline-block; margin: 4px 0; max-width: 100%; }
.rich-spoiler > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--warning);
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 600;
}
.rich-spoiler > summary::-webkit-details-marker { display: none; }
.rich-spoiler > summary::before { content: "\F630"; font-family: "bootstrap-icons"; }
.rich-spoiler[open] > summary { margin-bottom: 6px; }
.rich-spoiler[open] > summary::before { content: "\F341"; }
.rich-spoiler > span {
    display: block;
    padding: 8px 12px;
    border-left: 3px solid var(--warning);
    background: var(--surface-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Spoiler à l'édition : le texte reste lisible par son auteur, mais signalé. */
.rich-spoiler-mark {
    background: rgba(245, 158, 11, 0.16);
    border-bottom: 1px dashed var(--warning);
    padding: 0 2px;
    border-radius: 3px;
}

/* Barre d'outils de l'éditeur, dans les paramètres. */
.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--surface-2);
}
/* Les outils sont groupés par nature ; le trait vertical sépare les groupes
   sans ajouter d'élément décoratif dans le balisage. */
.rich-group { display: flex; align-items: center; gap: 2px; }
.rich-group + .rich-group { padding-left: 10px; border-left: 1px solid var(--border); }

.rich-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}
.rich-toolbar button:hover {
    background: rgba(124, 58, 237, 0.16);
    border-color: var(--violet);
    color: var(--violet);
}
.rich-toolbar button:active { transform: translateY(1px); }
/* Bouton allumé : le style est actif sous le curseur, ou va l'être en tapant. */
.rich-toolbar button.is-on {
    background: rgba(124, 58, 237, 0.24);
    border-color: var(--violet);
    color: var(--violet);
}
.rich-toolbar button:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }

/* Pastille de couleur : le champ natif est masqué, seule la pastille se voit,
   sinon le navigateur impose son propre cadre gris. */
.rich-color {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    transition: var(--transition);
}
.rich-color:hover { border-color: var(--violet); }
.rich-color input[type="color"] {
    position: absolute;
    inset: -6px;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}
.rich-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.rich-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 0; }
.rich-color input[type="color"]::-moz-color-swatch { border: none; }

/* Surface d'édition visuelle, raccordée à la barre d'outils. */
.rich-editable {
    min-height: 190px;
    max-height: 520px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}
.rich-editable:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}
/* Filet : une image collée ou insérée sans classe déborderait sinon du champ
   et forcerait un défilement horizontal. */
.rich-editable img { max-width: 100%; height: auto; }

/* Enveloppe redimensionnable. « resize » dessine la poignée native du
   navigateur dans le coin inférieur droit ; aucun script n'est nécessaire.
   Elle exige display:inline-block et overflow non visible pour s'afficher. */
.rich-img-wrap {
    display: inline-block;
    position: relative;
    resize: horizontal;
    overflow: hidden;
    max-width: 100%;
    min-width: 40px;
    line-height: 0;
    border: 1px dashed transparent;
    border-radius: var(--radius);
    /* Alignée sur le milieu de la ligne : une image insérée au fil du texte
       doit rester dans la ligne, pas s'accrocher à son sommet. */
    vertical-align: middle;
}
.rich-img-wrap:hover { border-color: var(--violet); }
/* Image désignée : les boutons d'alignement agissent sur elle. */
.rich-img-wrap.is-active { border-style: solid; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18); }
.rich-video-mark.is-active { box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35); }

/* Croix de suppression d'une image / vidéo sélectionnée : indispensable sur
   mobile, où aucune touche Suppr n'efface un élément contenteditable="false".
   L'enveloppe est en overflow:hidden (pour le redimensionnement), donc la croix
   se place À L'INTÉRIEUR du coin, avec un contour blanc pour rester visible sur
   n'importe quel GIF. Un décalage négatif serait rogné. */
.rich-del-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    opacity: 0.95;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.rich-del-btn:hover { opacity: 1; transform: scale(1.08); }
/* Cible tactile élargie sur petit écran. */
@media (max-width: 640px) {
    .rich-del-btn { width: 32px; height: 32px; font-size: 19px; top: 8px; right: 8px; }
}
.rich-img-wrap img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    pointer-events: none;
}
/* Repère visuel sur la poignée, que le navigateur dessine très discrètement. */
.rich-img-wrap::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--violet);
    border-bottom: 2px solid var(--violet);
    border-bottom-right-radius: 3px;
    pointer-events: none;
    opacity: 0.75;
}
/* Repère quand le champ est vide : contenteditable n'a pas de placeholder. */
.rich-editable:empty::before {
    content: "Présentez-vous, ajoutez une image, un GIF…";
    color: var(--text-dim);
}

@media (max-width: 575.98px) {
    .rich-toolbar { gap: 6px; }
    .rich-group + .rich-group { padding-left: 6px; }
}

/* Corps d'un commentaire : conserve les retours à la ligne, mais coupe les mots
   interminables et les URL, qui sinon débordent de la carte. */
.comment-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Mention « @pseudo » : porte le contexte quand la réponse sort de son groupe. */
.comment-mention { color: var(--violet); font-weight: 600; }
/* Aucun violet unique n'est lisible sur les deux fonds : --violet tombe a
   3:1 en sombre, --violet-soft a 2,7:1 en clair. On garde donc la teinte et
   on adapte la nuance. Mesure : 6,3:1 en sombre, 9:1 en clair. */
.comment-author,
.author-link {
    color: var(--violet-soft);
    font-weight: 700;
    text-decoration: none;
}

[data-bs-theme="light"] .comment-author,
[data-bs-theme="light"] .author-link { color: var(--violet-deep); }

.comment-author:hover,
.author-link:hover { text-decoration: underline; }

/* L'avatar devient cliquable : on le signale au survol. */
a > .avatar { transition: var(--transition); }
a:hover > .avatar { border-color: var(--violet); }

/* Fil de discussion : trois niveaux au maximum, reliés par un trait vertical.
   Au-delà, les réponses rejoignent le troisième niveau avec une @mention. */
.replies:empty { display: none; }
.replies {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}
.comment-reply + .comment-reply { margin-top: 12px; }
.comment-reply .replies { margin-top: 10px; }

.person-like:hover { color: var(--danger); border-color: var(--danger); }
.person-like.active { color: var(--danger); border-color: var(--danger); background: rgba(239, 68, 68, 0.14); }

.cal-scroll { overflow-x: auto; padding-bottom: 8px; }
.cal-inner { min-width: 940px; }

.cal-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-weekdays { margin-bottom: 8px; }

.cal-weekday {
    text-align: center;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding-bottom: 4px;
}

.cal-day {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-height: 118px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s var(--ease);
}

.cal-day:not(.cal-empty):hover { border-color: var(--border-strong); }

.cal-empty { background: transparent; border: 1px dashed var(--border); opacity: 0.35; min-height: 118px; }
.cal-nodata { background: rgba(255, 255, 255, 0.02); }

.cal-today {
    border-color: var(--violet);
    box-shadow: inset 0 0 0 1px var(--violet), 0 0 22px rgba(124, 58, 237, 0.22);
}

.cal-daynum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 6px;
}

.cal-todaytag {
    font-size: 0.58rem;
    font-weight: 700;
    background: var(--grad-primary);
    color: #fff;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
}

.cal-events { display: flex; flex-direction: column; gap: 5px; overflow: hidden; }

.cal-event {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: var(--text);
    border-radius: 7px;
    padding: 2px;
    transition: background 0.2s var(--ease);
}

.cal-event:hover { background: rgba(124, 58, 237, 0.16); color: var(--white); }

.cal-event-title {
    font-size: 0.72rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cal-more { font-size: 0.7rem; color: var(--text-dim); padding-left: 4px; }

.range-slider { position: relative; height: 40px; display: flex; align-items: center; padding: 0 9px; }
.range-track {
    position: absolute;
    left: 9px;
    right: 9px;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.range-fill {
    position: absolute;
    top: -1px;
    bottom: -1px;
    background: var(--grad-primary);
    border-radius: var(--radius-pill);
}
.range-slider input[type="range"] {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    height: 40px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}
.range-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; border: none; }
.range-slider input[type="range"]::-moz-range-track { background: transparent; border: none; }
.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--violet);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--violet);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.range-slider input[type="range"]:focus { outline: none; }
[data-range-caption] { font-weight: 600; font-size: 0.82rem; }

.btn-outline-feed {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}
.btn-outline-feed:hover { border-color: var(--violet); color: var(--text); }
.btn-outline-feed.active { border-color: var(--violet); color: var(--text); background: rgba(124, 58, 237, 0.14); }

/* "Lier une fiche" — mis en valeur avec un accent violet */
.btn-outline-feed[data-drama-toggle] {
    border-color: rgba(124, 58, 237, 0.55);
    background: rgba(124, 58, 237, 0.12);
    color: var(--violet);
}
.btn-outline-feed[data-drama-toggle] i { color: var(--violet); }
.btn-outline-feed[data-drama-toggle]:hover,
.btn-outline-feed[data-drama-toggle].active {
    border-color: var(--violet);
    background: rgba(124, 58, 237, 0.22);
    color: var(--violet);
}

.feed-post { transition: border-color 0.2s var(--ease); }

/* --- Drama picker (compose form) --- */
.drama-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    transition: var(--transition);
}
.drama-search-field:focus-within { border-color: var(--violet); }
.drama-search-field .bi-search { color: var(--text-dim); flex-shrink: 0; }
.drama-search-field input.form-control {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 9px 0;
    height: auto;
    color: var(--text);
}
.drama-search-field input.form-control:focus { border: none; background: transparent; box-shadow: none; }

/* Results render in-flow (not absolute) so they aren't clipped by the
   compose form's .glass-panel overflow:hidden. */
.drama-picker [data-drama-results].search-results,
[data-list-add-results].search-results {
    position: static;
    margin-top: 8px;
    max-height: 300px;
}

/* --- "Mes listes" index: poster previews --- */
.list-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.list-preview-img,
.list-preview-slot {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.list-preview-slot { border-style: dashed; }

/* Variante 5 affiches, pour l'onglet Listes du profil. */
/* Affiches à taille fixe (55×77) comme la sidebar de l'accueil, plutôt
   qu'étirées à la largeur de la carte : la petite variante suffit. */
.list-preview-5 { grid-template-columns: repeat(5, 55px); gap: 6px; justify-content: start; }
.list-preview-5 .list-preview-img,
.list-preview-5 .list-preview-slot { width: 55px; height: 77px; aspect-ratio: auto; }
.list-preview-empty {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    color: var(--text-dim);
    font-size: 1.4rem;
}

/* --- List page: share bar --- */
.list-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-strong);
}
.list-badge.is-public { color: #22c55e; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.12); }
.list-badge.is-private { color: var(--text-dim); background: var(--surface-2); }

.icon-btn-sm { width: 34px; height: 34px; font-size: 1rem; }

/* --- List page: item cards with a remove button --- */
/* The [hidden] attribute must beat display:grid / display:flex / display rules. */
.grid-cards[hidden], .empty-state[hidden],
[data-share-actions][hidden], [data-private-hint][hidden] { display: none !important; }

.list-item-wrap { position: relative; }
.list-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(10, 12, 24, 0.72);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}
.list-item-wrap:hover .list-item-remove,
.list-item-remove:focus-visible { opacity: 1; }
.list-item-remove:hover { background: var(--danger, #e5484d); }

@media (hover: none) {
    .list-item-remove { opacity: 1; }
}

/* Drag handle for reordering */
.list-item-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: rgba(10, 12, 24, 0.72);
    color: #fff;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    touch-action: none;
}
.list-item-wrap:hover .list-item-handle,
.list-item-handle:focus-visible { opacity: 1; }
.list-item-handle:active { cursor: grabbing; }

@media (hover: none) {
    .list-item-handle { opacity: 1; }
}

/* Drag states (SortableJS) */
.list-item-ghost { opacity: 0.35; }
.list-item-ghost .card-title-media { border: 2px dashed var(--violet); border-radius: var(--radius); }
.list-item-chosen { cursor: grabbing; }

.drama-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    max-width: 100%;
}
.drama-chip img { width: 34px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.drama-chip span { font-weight: 600; font-size: 0.9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drama-chip-remove {
    margin-left: auto;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.drama-chip-remove:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* --- Linked drama card (inside a post) --- */
.feed-drama-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-decoration: none;
    transition: var(--transition);
    max-width: 420px;
}
.feed-drama-link:hover { border-color: var(--violet); background: rgba(124, 58, 237, 0.1); }
.feed-drama-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--violet);
}
.feed-drama-title { font-weight: 600; font-size: 0.94rem; color: var(--text); }
.feed-drama-link .bi-arrow-right-short { font-size: 1.4rem; color: var(--text-dim); flex-shrink: 0; }

.filter-heading { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; }
.filter-divider { border: 0; border-top: 1px solid var(--border); margin: 14px 0; opacity: 1; }

.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    user-select: none;
    transition: all 0.2s var(--ease);
}
.genre-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.genre-chip:hover { border-color: var(--border-strong); color: var(--text); }
.genre-chip.active {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-ghost.active { color: var(--white); border-color: var(--violet); background: rgba(124, 58, 237, 0.2); }
.btn-grad.active { box-shadow: 0 8px 22px rgba(124, 58, 237, 0.5); }

/* Fiche : barre d'actions stable — les boutons dont le libellé change gardent
   une largeur fixe pour ne jamais se décaler (favori, watchlist, listes). */
.title-actions { row-gap: 12px; }
.title-actions > div,
.title-actions .dropdown { flex: 0 0 auto; }
.title-actions .btn-ghost,
.title-actions .btn-grad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}
/* Largeur minimale = libellé le plus long de chaque bouton, pour éviter
   tout redimensionnement lors du basculement d'état. */
.title-actions [data-fav-toggle] { min-width: 14.5rem; }
.title-actions [data-watch-toggle] { min-width: 14rem; }
.title-actions [data-list-picker] > .btn-ghost { min-width: 14rem; }
/* Le bloc de note (« Notez ce titre » / « Votre note : X/10 ») reste figé. */
.title-actions > div:first-child { min-width: 11rem; }
.title-actions .dropdown { width: auto; }

@media (max-width: 575.98px) {
    /* Sur mobile, les boutons occupent toute la largeur et s'empilent
       proprement plutôt que de garder une largeur fixe. */
    .title-actions { flex-direction: column; align-items: stretch; }
    .title-actions .vr { display: none; }
    .title-actions > div:first-child,
    .title-actions [data-fav-toggle],
    .title-actions [data-watch-toggle],
    .title-actions [data-list-picker],
    .title-actions [data-list-picker] > .btn-ghost,
    .title-actions .dropdown { min-width: 0; width: 100%; }
}

.nav-tabs .nav-link { color: var(--text-muted); transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.nav-tabs .nav-link:hover { color: var(--white) !important; }
.nav-tabs .nav-link.active { color: var(--white) !important; border-bottom: 2px solid var(--violet) !important; }

.detail-list dt { white-space: nowrap; }
.min-w-0 { min-width: 0; }

.title-banner { margin-bottom: 8px; }

.title-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--night) 6%, rgba(11, 16, 35, 0.72) 55%, rgba(11, 16, 35, 0.5));
}

[data-bs-theme="light"] .title-banner-overlay {
    background: linear-gradient(0deg, var(--night) 8%, rgba(244, 246, 252, 0.82) 55%, rgba(244, 246, 252, 0.62));
}

/* Thème clair : la ligne meta de la bannière (note, année, pays, épisodes…)
   était trop pâle sur le fond clair. On fonce les textes muted/dim pour la
   lisibilité (contraste AA). */
[data-bs-theme="light"] .title-banner .text-muted-2 { color: #333c5e !important; }
[data-bs-theme="light"] .title-banner .text-dim { color: #4a5479 !important; }

.profile-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(11, 16, 35, 0.85), transparent);
}

[data-bs-theme="light"] .profile-cover-overlay {
    background: linear-gradient(0deg, rgba(244, 246, 252, 0.9), transparent);
}

.wl-ep-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.wl-ep-btn:hover { border-color: var(--violet); background: rgba(124, 58, 237, 0.15); }

.watch-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.watch-link:hover { border-color: var(--wl-color); color: var(--text); transform: translateX(3px); }
.watch-link .watch-link-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wl-color);
    color: #fff;
    font-size: 1.05rem;
    flex: 0 0 auto;
}
.watch-link .bi-box-arrow-up-right { color: var(--text-dim); font-size: 0.82rem; }

.type-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 13px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--radius-pill);
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

/* Lien « commentaires » dans la ligne meta d'un article (petit icône + compteur) */
.news-comment-link { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); text-decoration: none; transition: color 0.2s var(--ease); }
.news-comment-link:hover { color: var(--violet); }

/* --- News article content (Quill output) --- */
.news-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 14px 0; }
.news-content p { margin-bottom: 1rem; }
/* Lignes vides de l'éditeur (<p><br></p> ou <p></p>) : au lieu d'une ligne
   entière (énorme vide sous les titres), on les réduit à un petit espace. */
.news-content p:empty { margin: 0; height: 0; line-height: 0; overflow: hidden; }
.news-content p:has(> br:only-child) { margin: 0; height: 0; line-height: 0; overflow: hidden; }
.news-content h2, .news-content h3, .news-content h4 { margin: 1.4rem 0 0.7rem; }
.news-content a { color: var(--cyan-deep); }
.news-content blockquote {
    border-left: 3px solid var(--violet);
    padding-left: 16px;
    margin: 1rem 0 1rem 0;
    color: var(--text-muted);
}
.news-content pre {
    background: var(--surface-2);
    padding: 12px 16px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.9rem;
}
.news-content .ql-align-center { text-align: center; }
.news-content .ql-align-right { text-align: right; }
.news-content .ql-align-justify { text-align: justify; }

.search-box [data-search-submit] { cursor: pointer; transition: color 0.2s var(--ease); }
.search-box [data-search-submit]:hover { color: var(--violet); }

/* --- Top 5 showcase (profile) --- */
.top-showcase {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.top-showcase-card {
    position: relative;
    display: block;
    color: var(--text);
}

.top-showcase-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--night-3);
    transition: var(--transition);
}

.top-showcase-card:hover .top-showcase-poster {
    transform: translateY(-4px);
    border-color: var(--violet);
}

.top-showcase-poster img { width: 100%; height: 100%; object-fit: cover; }
.top-showcase-poster .score-badge { position: absolute; top: 8px; left: 8px; z-index: 2; box-shadow: var(--shadow-sm); }

.top-rank-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    z-index: 3;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.top-showcase-title {
    display: -webkit-box;
    margin-top: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
}

@media (max-width: 640px) {
    .top-showcase { grid-template-columns: repeat(3, 1fr); }
}

/* --- Top 5 editor (settings) --- */
[data-top-results].search-results {
    position: static;
    margin-top: 8px;
    max-height: 300px;
}

.top-editor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: topn;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.top-item::before {
    counter-increment: topn;
    content: counter(topn);
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-item-poster {
    flex: 0 0 auto;
    width: 38px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.top-item-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-item-handle,
.top-item-remove {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.top-item-handle { cursor: grab; }
.top-item-handle:active { cursor: grabbing; }
.top-item-handle:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.top-item-remove:hover { color: #fff; background: var(--danger); }

.top-item-ghost { opacity: 0.4; }
.top-item-ghost .top-item { border: 1px dashed var(--violet); }
.top-item-chosen { cursor: grabbing; }

.top-editor-empty { text-align: center; padding: 16px 8px; margin: 0; font-size: 0.88rem; }

/* ===== Page d'accueil : sidebar de classements ===== */
/* Les sections rendent leur propre .container-x ; dans la colonne principale on
   le neutralise pour qu'il n'ajoute ni largeur max ni padding en double. */
.home-main .container-x { max-width: none; padding: 0; margin: 0; }
.home-main > .section-sm:first-child { padding-top: 0; }

.side-card { padding: 12px 14px; margin-bottom: 16px; }
.side-card:last-child { margin-bottom: 0; }

.side-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
}
.side-head i { color: var(--violet); }

.side-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.side-tab {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
}
.side-tab:hover { color: var(--text); border-color: var(--violet); }
.side-tab.active { background: var(--grad-primary); color: #fff; border-color: transparent; }

.rank-list { display: flex; flex-direction: column; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 5px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.15s var(--ease);
}
.rank-item:hover { background: var(--surface-2); }

.rank-num {
    flex: 0 0 auto;
    width: 16px;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-family: var(--font-display, inherit);
}
.rank-item:nth-child(1) .rank-num { color: var(--violet); }
.rank-item:nth-child(2) .rank-num { color: var(--sky, #38bdf8); }
.rank-item:nth-child(3) .rank-num { color: var(--warning); }

.rank-poster {
    flex: 0 0 auto;
    width: 55px;
    height: 77px;
    object-fit: cover;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.rank-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* Le titre passe a 3 lignes : avec une affiche de 77px la ligne est assez
   haute pour les accueillir, et les titres longs n'ont plus a etre coupes. */
.rank-title {
    color: var(--text);
    font-weight: 600;
    font-size: 0.86rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rank-meta {
    color: var(--text-dim);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.rank-meta .bi-star-fill { color: var(--warning); }
.rank-empty { color: var(--text-dim); font-size: 0.82rem; padding: 6px 5px; margin: 0; }

/* ===== Mosaïque d'actualités (accueil, style magazine) ===== */
.news-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    height: 520px;
}
.news-mosaic-big { grid-column: 1; grid-row: 1 / span 2; }
.news-mosaic-medium { grid-column: 2; grid-row: 1; }
.news-mosaic-small-wrap { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.news-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-lg);
    text-decoration: none;
    min-height: 0;
    min-width: 0;
    border: 1px solid var(--border);
}
.news-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}
.news-card:hover img { transform: scale(1.06); }
.news-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(3, 6, 20, 0.92) 0%, rgba(3, 6, 20, 0.35) 45%, rgba(3, 6, 20, 0.05) 100%);
}
.news-card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; z-index: 2; }
.news-card-tag {
    display: inline-block;
    background: var(--grad-primary);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 5px;
    margin-bottom: 9px;
}
.news-card-title { color: #fff; font-weight: 700; line-height: 1.25; margin: 0; font-size: 1rem; }
.news-mosaic-big .news-card-title { font-size: 1.7rem; }
.news-mosaic-medium .news-card-title { font-size: 1.15rem; }
.news-card-meta { color: rgba(255, 255, 255, 0.82); font-size: 0.8rem; margin-top: 8px; }

@media (max-width: 991.98px) {
    .news-mosaic { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
    .news-mosaic-big { grid-column: 1; grid-row: auto; height: 300px; }
    .news-mosaic-medium { grid-column: 1; grid-row: auto; height: 210px; }
    .news-mosaic-small-wrap { grid-column: 1; grid-row: auto; }
    .news-mosaic-small-wrap .news-card { height: 170px; }
    .news-mosaic-big .news-card-title { font-size: 1.4rem; }
}
@media (max-width: 480px) {
    .news-mosaic-small-wrap { grid-template-columns: 1fr; }
}

/* ===== Explorer : disposition « liste + filtres en sidebar » (façon MyDramaList) ===== */
/* Dans la sidebar étroite, chaque champ de filtre passe sur toute la largeur. */
.explore-sidebar .filter-panel { padding: 16px; margin-bottom: 0; }
.explore-sidebar .filter-panel .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }

/* Harmonisation des filtres en sidebar : labels uniformes + espacements réguliers */
.explore-sidebar .filter-panel .row { row-gap: 15px; margin-bottom: 15px; }
.explore-sidebar .filter-panel .row:last-child { margin-bottom: 0; }
.explore-sidebar .filter-panel label,
.explore-sidebar .filter-panel .filter-heading {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
/* Le compteur de genres et les plages de valeurs gardent une casse normale. */
.explore-sidebar .filter-panel label .text-dim,
.explore-sidebar .filter-panel [data-genre-count] {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}
.explore-sidebar .filter-panel .filter-divider { margin: 16px 0; }
/* Filtres repliables sur mobile (bouton « Filtres ») ; toujours visibles en desktop. */
@media (max-width: 991.98px) {
    .explore-sidebar { display: none; }
    .explore-sidebar.open { display: block; }
}
/* Boutons Filtrer / Réinitialiser : empilés pleine largeur dans la sidebar. */
.explore-sidebar .filter-panel .justify-content-lg-end {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.explore-sidebar .filter-panel .justify-content-lg-end .btn-grad,
.explore-sidebar .filter-panel .justify-content-lg-end .btn-ghost {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

/* Genres en liste dépliable à cocher (mode sidebar) */
.genre-details summary,
.filter-details summary { list-style: none; }
.genre-details summary::-webkit-details-marker,
.filter-details summary::-webkit-details-marker { display: none; }
/* Chaque filtre de la sidebar se déroule comme les genres, pour une lecture homogène. */
.filter-details[open] .genre-summary .bi-chevron-down { transform: rotate(180deg); }
.filter-details .filter-heading { margin-bottom: 0; }
.filter-details-body { margin-top: 8px; }
/* Séparateur discret devant chaque filtre : le <hr> après les genres devient redondant. */
.explore-sidebar .filter-panel .filter-details {
    border-top: 1px solid var(--border);
    padding-top: 15px;
}
.explore-sidebar .filter-panel .filter-divider { display: none; }
.genre-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 2px 0;
}
.genre-summary .bi-chevron-down { color: var(--text-dim); transition: transform 0.2s var(--ease); }
.genre-details[open] .genre-summary .bi-chevron-down { transform: rotate(180deg); }
.genre-check-list {
    margin-top: 8px;
    max-height: 234px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
}
/* Boutons de genre tri-état (inclure / exclure / neutre) */
.genre-opt { cursor: pointer; background: transparent; font: inherit; transition: var(--transition); }
.genre-opt-mark .bi { display: none; line-height: 1; }
.genre-opt.is-include .genre-opt-mark .bi-check-lg { display: inline-block; }
.genre-opt.is-exclude .genre-opt-mark .bi-dash-lg { display: inline-block; }

/* Variante « liste » (sidebar) */
.genre-opt-row {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 6px 9px; border: 0; border-radius: var(--radius-sm);
    text-align: left; font-size: 0.86rem; color: var(--text-muted);
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.genre-opt-row .genre-opt-mark {
    flex: 0 0 auto; width: 17px; height: 17px; border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; color: #fff;
}
.genre-opt-row:hover { background: var(--surface-2); color: var(--text); }
.genre-opt-row.is-include { color: var(--text); }
.genre-opt-row.is-include .genre-opt-mark { background: var(--violet); border-color: var(--violet); }
.genre-opt-row.is-exclude { color: var(--danger); }
.genre-opt-row.is-exclude .genre-opt-mark { background: var(--danger); border-color: var(--danger); }
.genre-opt-row.is-exclude .genre-opt-name { text-decoration: line-through; }

/* Variante « chip » (disposition grille, filtres en haut) */
.genre-opt-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
    font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
}
.genre-opt-chip .genre-opt-mark { display: none; }
.genre-opt-chip.is-include .genre-opt-mark,
.genre-opt-chip.is-exclude .genre-opt-mark { display: inline-flex; align-items: center; font-size: 0.85rem; }
.genre-opt-chip:hover { border-color: var(--violet); color: var(--text); }
.genre-opt-chip.is-include { background: rgba(124, 58, 237, 0.2); border-color: var(--violet); color: var(--text); }
.genre-opt-chip.is-exclude { background: rgba(239, 68, 68, 0.16); border-color: var(--danger); color: var(--danger); }
.genre-opt-chip.is-exclude .genre-opt-name { text-decoration: line-through; }

/* Message d'aide sous les genres */
.genre-hint { font-size: 0.72rem; color: var(--text-dim); margin: 9px 2px 0; line-height: 1.45; }
.genre-hint strong { color: var(--text-muted); font-weight: 700; }

/* Liste de titres (colonne de gauche), façon MyDramaList */
.drama-list { display: flex; flex-direction: column; gap: 14px; }
.drama-row {
    display: flex;
    gap: 22px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.drama-row:hover { border-color: var(--violet); box-shadow: var(--shadow); }
.drama-row-poster { flex: 0 0 auto; width: 156px; display: block; }
.drama-row-poster img {
    width: 156px; height: 219px; object-fit: cover;
    border-radius: 12px; display: block; box-shadow: var(--shadow);
}
.drama-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.drama-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drama-row-title { font-size: 1.12rem; font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.3; }
.drama-row-title:hover { color: var(--violet); }
.drama-row-rank { flex: 0 0 auto; font-weight: 800; color: var(--text-dim); font-size: 1rem; }
.drama-row-sub { font-size: 0.82rem; color: var(--text-dim); margin-top: -4px; }
.drama-row-meta { font-size: 0.85rem; color: var(--text-muted); }
.drama-row-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drama-row-rating .stars { font-size: 0.92rem; }
.drama-row-score { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.drama-row-synopsis {
    font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.drama-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.drama-row-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.82rem; font-weight: 600; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border);
    padding: 6px 15px; border-radius: var(--radius-pill);
    text-decoration: none; transition: var(--transition);
}
.drama-row-btn:hover { border-color: var(--violet); color: var(--violet); }
.drama-row-btn-yt i { color: #ff0000; }
.drama-row-btn-yt:hover { border-color: #ff0000; color: var(--text); }

/* Palier intermediaire : a 156px l'affiche mangerait trop de largeur sur une
   tablette etroite, on revient a l'ancienne taille avant de passer au format
   telephone. */
@media (max-width: 767.98px) {
    .drama-row { gap: 16px; }
    .drama-row-poster, .drama-row-poster img { width: 120px; }
    .drama-row-poster img { height: 172px; }
}

@media (max-width: 575.98px) {
    .drama-row { gap: 12px; padding: 12px; border-radius: var(--radius); }
    .drama-row-poster, .drama-row-poster img { width: 83px; }
    .drama-row-poster img { height: 116px; border-radius: 9px; }
    .drama-row-title { font-size: 0.98rem; }
    .drama-row-sub { font-size: 0.78rem; }
    .drama-row-meta { font-size: 0.8rem; }
    /* L'affiche perd 5px de large : autant de gagne pour le texte, donc les
       deux lignes de synopsis restent lisibles. */
    .drama-row-synopsis { -webkit-line-clamp: 2; font-size: 0.82rem; line-height: 1.5; }
    .drama-row-rating { gap: 8px; }
    .drama-row-actions { display: none; }
}

/* ===== Critiques sur le profil (mise en page facon MyDramaList) ===== */
.review-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

/* Cible d'un lien direct : reperable sans etre criard. */
.review-card.is-focused {
    border-color: var(--violet);
    box-shadow: 0 0 0 1px var(--violet);
}

.review-head {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.review-poster { flex: 0 0 auto; display: block; }
.review-poster img {
    width: 64px;
    height: 92px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.review-meta { flex: 1; min-width: 0; }

.review-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--admin-link, var(--cyan-deep));
    text-decoration: none;
    display: block;
    margin-bottom: 3px;
}

.review-title:hover { text-decoration: underline; }

.review-helpful,
.review-author {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.review-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.review-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-size: 0.8rem;
}

.review-score {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    background: var(--night-3);
    border: 1px solid var(--border);
}

.review-score span { font-size: 0.74rem; color: var(--text-dim); }
.review-score strong { font-size: 1.05rem; color: var(--text); }

.review-body { padding: 16px; }

.review-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}

.review-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.75;
    white-space: pre-line;
    word-break: break-word;
}

@media (max-width: 575.98px) {
    .review-head { flex-wrap: wrap; gap: 12px; }
    .review-poster img { width: 52px; height: 75px; }
    .review-side { flex-direction: row; align-items: center; width: 100%; }
}

/* ===== Vote d'utilite sur une critique ===== */
.review-helpful-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.review-helpful-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.review-helpful-count strong { color: var(--text); }

.review-helpful-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-left: auto;
}

.review-helpful-label {
    font-size: 0.83rem;
    color: var(--text-dim);
}

.review-vote {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.review-vote:hover { border-color: var(--violet); color: var(--text); }
.review-vote.is-active { background: var(--violet); border-color: var(--violet); color: #fff; }
.review-vote-clear { color: var(--text-dim); }
.review-vote-clear:hover { border-color: var(--danger); color: var(--danger); }

.review-helpful-login { font-size: 0.83rem; margin-left: auto; }

@media (max-width: 575.98px) {
    .review-helpful-actions { margin-left: 0; width: 100%; }
    .review-helpful-label { width: 100%; }
}

/* ===== Critique en liste sur la fiche (compacte) ===== */
.review-compact {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.review-compact-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.review-compact-head .avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.review-compact-meta { flex: 1; min-width: 0; }

.review-compact-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.86rem;
}

.review-compact-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 2px 0 0;
}

.review-compact-score {
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    background: var(--night-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
}

.review-compact-spoiler > summary {
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

/* Replie a 4 lignes ; la classe is-open leve la limite. */
.review-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-clamp.is-open {
    display: block;
    -webkit-line-clamp: unset;
}

.review-clamp p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-line;
    word-break: break-word;
}

.review-more {
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--admin-link, var(--cyan-deep));
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.review-more:hover { text-decoration: underline; }

/* ===== Barre de tri des critiques (profil) ===== */
.review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.review-toolbar-count {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.review-sort {
    display: flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
}

.review-sort-link {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.review-sort-link:hover { color: var(--text); }
.review-sort-link.is-active { background: var(--grad-primary); color: #fff; }

/* La barre de navigation est collante : sans marge de defilement, l'ancre
   « critiques » (ou « listes ») se retrouverait masquee dessous. */
#critiques,
#listes { scroll-margin-top: calc(var(--nav-height, 72px) + 16px); }

/* Compteur de cœurs sur une carte de liste (onglet Listes du profil). */
.list-card-hearts { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.list-card-hearts .bi-heart-fill { color: var(--danger); font-size: 0.85em; }

/* Critique atteinte par un lien direct sur la fiche. */
.review-compact.is-focused {
    border-color: var(--violet);
    box-shadow: 0 0 0 1px var(--violet);
}

[id^="critique-"] { scroll-margin-top: calc(var(--nav-height, 72px) + 16px); }

/* ===== Messagerie : suppression ===== */
.msg-bubble { position: relative; }

/* Discrets au repos, visibles au survol de la bulle. */
.msg-action {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.msg-bubble:hover .msg-action,
.msg-action:focus-visible { opacity: 1; }
.msg-action:hover { color: #fff; }

/* Champ de modification : lisible sur la bulle en degrade. */
[data-msg-form] input {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

[data-msg-form] input::placeholder { color: rgba(255, 255, 255, 0.6); }

/* ===== Filmographie en tableau (fiche personnalite) ===== */
.filmo-block { margin-bottom: 28px; }

/* Le tableau garde ses colonnes lisibles ; sur petit ecran il defile
   horizontalement plutot que d'ecraser le titre. */
.filmo-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.filmo-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.filmo-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.filmo-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.88rem;
}

.filmo-table tbody tr:last-child td { border-bottom: none; }
.filmo-table tbody tr:hover { background: var(--surface-2); }

.filmo-year { width: 68px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.filmo-eps { width: 62px; text-align: center; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.filmo-role { width: 210px; }
.filmo-note { width: 78px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.filmo-note .bi-star-fill { color: var(--warning); font-size: 0.8rem; }

.filmo-title {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.filmo-poster {
    width: 38px;
    height: 54px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.filmo-name {
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
    display: block;
}

.filmo-title:hover .filmo-name { color: var(--violet-soft); }
[data-bs-theme="light"] .filmo-title:hover .filmo-name { color: var(--violet-deep); }

.filmo-character { display: block; color: var(--text-muted); line-height: 1.3; margin-bottom: 3px; }

.filmo-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    white-space: nowrap;
}

.filmo-tag-principal { background: rgba(124, 58, 237, 0.18); border-color: transparent; color: var(--violet-soft); }
[data-bs-theme="light"] .filmo-tag-principal { color: var(--violet-deep); }

@media (max-width: 575.98px) {
    .filmo-table td, .filmo-table thead th { padding: 8px 10px; }
    .filmo-poster { width: 32px; height: 46px; }
}


/* ===== Bloc Amis du profil (avatars ronds) ===== */
.friend-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-avatar {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.friend-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.friend-avatar:hover { border-color: var(--violet); transform: translateY(-2px); }


/* ===== Statistiques du profil (liste, colonne d'identité) ===== */
.profile-stats { display: flex; flex-direction: column; }

.profile-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.profile-stat:last-child { border-bottom: none; }

.profile-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.86rem;
}
.profile-stat-label i { font-size: 0.95rem; width: 16px; text-align: center; }

.profile-stat-value { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Ligne de statistique cliquable : signalée au survol, sans casser la grille. */
.profile-stat-link { text-decoration: none; cursor: pointer; }
.profile-stat-link:hover { margin: 0 -8px; padding-left: 8px; padding-right: 8px; background: var(--surface-2); border-radius: var(--radius-sm); border-bottom-color: transparent; }
.profile-stat-link:hover .profile-stat-label { color: var(--text); }

/* Ligne d'abonné / abonnement dans l'onglet Abonnés. */
.follow-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease;
    min-width: 0;
}
.follow-row:hover { background: var(--surface-2); color: var(--text); }


/* ===== Éditeur de liste : lignes façon MyDramaList ===== */
.list-erows { display: flex; flex-direction: column; }

.list-erow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.list-erow:last-child { border-bottom: none; }
.list-erow.sortable-ghost { opacity: 0.4; }
.list-erow.sortable-chosen { background: var(--surface-2); }

.list-erow-handle {
    flex-shrink: 0;
    border: none;
    background: none;
    color: var(--text-dim);
    font-size: 1.1rem;
    cursor: grab;
    padding: 0 2px;
}
.list-erow-handle:active { cursor: grabbing; }

.list-erow-pos {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    font-weight: 800;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.list-erow-poster { flex-shrink: 0; display: block; }
.list-erow-img {
    width: 96px;
    height: 135px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    display: block;
}

.list-erow-body { flex: 1; min-width: 0; }
.list-erow-title {
    display: block;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    line-height: 1.3;
}
.list-erow-title:hover { color: var(--violet-soft); }
[data-bs-theme="light"] .list-erow-title:hover { color: var(--violet-deep); }
.list-erow-meta { font-size: 0.8rem; color: var(--text-dim); margin: 2px 0 4px; }
.list-erow-ratings { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 3px; }
.lr-rating { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.lr-label { color: var(--text-dim); }
.lr-stars { color: var(--warning); letter-spacing: 0.5px; }
.lr-value { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.lr-none { color: var(--text-dim); }

.list-erow-rank {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.list-erow-remove {
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    cursor: pointer;
    transition: var(--transition);
}
.list-erow-remove:hover { border-color: var(--danger); color: var(--danger); }

@media (max-width: 575.98px) {
    .list-erow { gap: 9px; padding: 10px; }
    .list-erow-img { width: 72px; height: 101px; }
    .list-erow-rank { display: none; }
}

/* ===== Cœur « j'aime » sur une liste ===== */
.list-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.list-heart:hover { color: var(--danger); border-color: var(--danger); }
.list-heart.is-liked { color: var(--danger); border-color: var(--danger); }
.list-heart.is-liked:hover { transform: scale(1.08); }

.list-heart-wrap { display: inline-flex; align-items: center; gap: 7px; }
.list-heart.is-static { cursor: default; color: var(--danger); border-color: var(--border-strong); }
.list-heart-count { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; min-width: 1ch; }

/* ================= Page Communauté : sidebar façon MyDramaList ================= */
@media (min-width: 992px) {
    .feed-sidebar { position: sticky; top: calc(var(--nav-height, 72px) + 16px); }
}

.feed-side-card { margin-bottom: 18px; }

.feed-side-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 12px;
}

.feed-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm, 10px);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition, all .15s ease);
}
.feed-nav-link:hover { background: var(--surface-2); color: var(--text); }
.feed-nav-link.active { background: var(--grad-primary); color: #fff; }
.feed-nav-link i { font-size: 1.05rem; }

.feed-me-name { font-weight: 700; color: var(--text); font-size: 1.02rem; line-height: 1.2; text-decoration: none; }
a.feed-me-name:hover { color: var(--violet); }

.feed-stats { display: flex; text-align: center; }
.feed-stat { flex: 1; }
.feed-stat + .feed-stat { border-left: 1px solid var(--border); }
.feed-stat-value { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.feed-stat-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.feed-share-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; text-decoration: none; }
.feed-share-item + .feed-share-item { border-top: 1px solid var(--border); }
.feed-share-poster { width: 40px; height: 57px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2); }
.feed-share-title { font-size: 0.86rem; font-weight: 600; color: var(--text); line-height: 1.25; }
.feed-share-meta { font-size: 0.75rem; color: var(--text-dim); }

/* Bouton commentaire du fil + boîte de réponse inline (façon X) */
.feed-comment-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--text-muted); font: inherit; cursor: pointer; padding: 0; text-decoration: none; transition: var(--transition, all .15s ease); }
.feed-comment-btn:hover { color: var(--violet); }

/* Zone de saisie d'un commentaire / d'une réponse : champ arrondi qui grandit,
   avatar à gauche, bouton d'envoi rond à droite. */
.feed-compose { display: flex; gap: 10px; align-items: flex-start; }
.feed-compose > .avatar { flex-shrink: 0; margin-top: 2px; }
.feed-compose-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.15s ease;
}
.feed-compose-field:focus-within { border-color: var(--violet); }
.feed-compose-field textarea {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    box-shadow: none;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
    padding: 7px 0;
    min-height: 22px;
    max-height: 140px;
}
.feed-compose-field textarea::placeholder { color: var(--text-dim); }
.feed-compose-send {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.feed-compose-send:hover { transform: scale(1.06); }
.feed-compose-send:disabled { opacity: 0.5; cursor: default; transform: none; }

/* Compteur de caractères restants */
.feed-compose-count { font-size: 0.74rem; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-compose-count.is-low { color: var(--danger); font-weight: 600; }
.feed-compose-field .feed-compose-count { align-self: flex-end; padding-bottom: 9px; }

/* Réponses imbriquées (fil communauté) */
.feed-reply { margin-bottom: 10px; }
.feed-reply-child { margin-bottom: 0; }
.feed-reply-actions { display: flex; align-items: center; gap: 14px; font-size: 0.78rem; padding: 4px 4px 0; }
.feed-reply-children { margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.feed-reply-children:empty { display: none; }

/* Aperçu d'image plein écran (lightbox du fil communauté) */
.feed-image-link { cursor: zoom-in; }
.feed-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}
.feed-lightbox.show { display: flex; }
.feed-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.feed-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.feed-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* Onglets du fil communauté (Public / Amis) */
.feed-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px; }
.feed-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-pill); color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: var(--transition, all .15s ease); }
.feed-tab:hover { color: var(--text); }
.feed-tab.active { background: var(--grad-primary); color: #fff; }

/* Sélecteur de visibilité dans le composer */
.feed-visibility { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 5px 10px; color: var(--text-muted); font-size: 0.85rem; }
.feed-visibility select { border: none; background: transparent; color: var(--text); font-size: 0.85rem; font-weight: 600; cursor: pointer; outline: none; }
.feed-visibility select option { color: #1a1a1a; }

/* Badge "Amis" sur une publication réservée */
.feed-visibility-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; color: var(--violet); background: rgba(124, 58, 237, 0.14); padding: 2px 8px; border-radius: var(--radius-pill); }

/* Recadreur d'avatar (paramètres) : viewport circulaire + image déplaçable/zoomable */
.avatar-cropper { max-width: 220px; margin: 0 auto; }
.avatar-crop-viewport {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: var(--night-3);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.avatar-crop-viewport.dragging { cursor: grabbing; }
.avatar-crop-viewport [data-crop-image] {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    transform-origin: 0 0;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
.avatar-crop-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--border-strong) inset;
    pointer-events: none;
}

/* Bandeau : e-mail non confirmé (invite à la vérification) */
.verify-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(14, 165, 233, 0.18));
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.88rem;
    color: var(--text);
    text-align: center;
}
.verify-banner form { margin: 0; }
.verify-banner-btn {
    border: 0;
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #0ea5e9);
    cursor: pointer;
    white-space: nowrap;
}
.verify-banner-btn:hover { filter: brightness(1.08); }

/* Filtrage de la watchlist */
.wl-hidden { display: none !important; }
.wl-filters .filter-heading { font-size: 0.8rem; color: var(--text-muted); }

/* ===== Watchlist : tableau ===== */
.wl-filters .filter-heading { font-size: 0.8rem; color: var(--text-muted); }
.wl-chip-count {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px;
    font-size: 0.72rem; font-weight: 700; line-height: 1.5; text-align: center;
    border-radius: 999px; background: rgba(124, 58, 237, 0.18); color: var(--violet);
}
.wl-table-wrap {
    background: var(--night-3); border: 1px solid var(--border);
    border-radius: var(--radius); overflow-x: auto;
}
.wl-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.9rem; }
.wl-table thead th {
    text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border);
    font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-dim); font-weight: 700; white-space: nowrap; background: var(--surface-2);
}
.wl-table tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wl-table tbody tr:last-of-type td { border-bottom: 0; }
.wl-table tbody tr.wl-item { transition: background 0.12s ease; }
.wl-table tbody tr.wl-item:hover { background: var(--surface-2); }
.wl-table .wl-c { text-align: center; }

.wl-title-cell { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); min-width: 210px; }
.wl-poster { width: 40px; height: 58px; object-fit: cover; border-radius: 7px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
.wl-title-text { display: flex; flex-direction: column; min-width: 0; }
.wl-title-main { font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.wl-title-sub { font-size: 0.76rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.wl-title-cell:hover .wl-title-main { color: var(--violet); }

.wl-muted { color: var(--text-dim); }
.wl-num { font-variant-numeric: tabular-nums; }

.wl-type { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.wl-type-drama { background: rgba(124, 58, 237, 0.16); color: var(--violet); }
.wl-type-film  { background: rgba(14, 165, 233, 0.16); color: var(--cyan-deep); }
.wl-type-anime { background: rgba(236, 72, 153, 0.16); color: #db2777; }

.wl-score { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.wl-score .bi { color: #f5b301; font-size: 0.82em; }

.wl-progress { min-width: 140px; }
.wl-progress-controls { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.wl-progress-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl-bar { height: 4px; border-radius: 999px; background: var(--border); margin-top: 7px; overflow: hidden; }
.wl-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--cyan-deep)); transition: width 0.2s ease; }

.wl-table td[data-label="Statut"] .form-select { width: auto; min-width: 100px; }
.wl-results { color: var(--text-dim); }

/* Total d'épisodes cliquable (marquer tout comme vu) */
.wl-ep-max {
    background: none; border: 0; padding: 0 2px; font: inherit; color: var(--text-dim);
    cursor: pointer; border-radius: 4px; transition: color 0.12s ease, background 0.12s ease;
}
.wl-ep-max:hover { color: var(--violet); background: rgba(124, 58, 237, 0.12); }

/* Panneau de filtres compact & repliable (watchlist) */
.wl-filters { padding: 12px 14px; margin-bottom: 16px; }
.wl-filter-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wl-search { position: relative; flex: 1 1 200px; min-width: 160px; }
.wl-search > .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.wl-search input { padding-left: 34px; }
.wl-sort { width: auto; min-width: 160px; }
.wl-toggle, .wl-reset { font-size: 0.85rem; padding: 6px 14px; display: inline-flex; align-items: center; gap: 6px; }
.wl-reset { padding: 6px 11px; }
.wl-toggle.is-open { border-color: var(--violet); color: var(--violet); background: rgba(124, 58, 237, 0.1); }
.wl-active-badge {
    min-width: 18px; padding: 0 5px; font-size: 0.72rem; font-weight: 700; line-height: 1.5;
    text-align: center; border-radius: 999px; background: var(--violet); color: #fff;
}
.wl-advanced { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.wl-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.wl-filter-grid .wl-span { grid-column: 1 / -1; }
.wl-facet .filter-heading { margin-bottom: 8px; }
.wl-range-cap { font-weight: 500; font-size: 0.78rem; }
@media (max-width: 620px) { .wl-filter-grid { grid-template-columns: 1fr; } }

/* Pagination serveur (watchlist) */
.wl-pagination { display: flex; justify-content: center; padding: 20px 0 6px; }
.wl-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wl-page-btn { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface-2, rgba(255,255,255,.03)); color: var(--text); border-radius: 10px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: background .15s, border-color .15s; }
.wl-page-btn:hover:not(.is-active):not(.is-disabled) { border-color: var(--primary, #7c3aed); }
.wl-page-btn.is-active { background: linear-gradient(135deg, #7c3aed, #0ea5e9); border-color: transparent; color: #fff; cursor: default; }
.wl-page-btn.is-disabled { opacity: .4; cursor: not-allowed; }
.wl-page-gap { padding: 0 4px; color: var(--text-dim); }
[data-watchlist].wl-loading .wl-table-wrap { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* Centre de notifications (menu de la cloche) */
.notif-menu { width: 360px; max-width: 92vw; min-width: 320px; padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.notif-title { font-weight: 700; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 6px; }
.notif-readall { background: none; border: 0; color: var(--violet); font-size: 0.76rem; font-weight: 600; cursor: pointer; padding: 0; white-space: nowrap; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: rgba(124, 58, 237, 0.09); }
.notif-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 8px; text-decoration: none; color: var(--text); border-radius: 8px; }
.notif-link:hover { background: var(--surface-2); }
.notif-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.notif-body { display: flex; flex-direction: column; min-width: 0; }
.notif-msg { font-size: 0.85rem; line-height: 1.3; }
.notif-time { font-size: 0.74rem; color: var(--text-dim); margin-top: 2px; }
.notif-mark { background: none; border: 0; padding: 8px; cursor: pointer; flex-shrink: 0; line-height: 0; }
.notif-mark-dot { display: block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--violet); background: transparent; transition: background 0.12s ease; }
.notif-item.unread .notif-mark-dot { background: var(--violet); }
.notif-mark:hover .notif-mark-dot { border-color: var(--cyan-deep); }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }
.notif-foot { display: block; text-align: center; padding: 10px; font-size: 0.82rem; font-weight: 600; color: var(--violet); text-decoration: none; border-top: 1px solid var(--border); }
.notif-foot:hover { background: var(--surface-2); color: var(--violet); }

/* Préférences de notifications (onglet paramètres) */
.notif-pref-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--border); }
.notif-pref-row:last-of-type { border-bottom: 0; }
.notif-pref-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.notif-pref-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(124, 58, 237, 0.14); color: var(--violet); font-size: 1.05rem; flex-shrink: 0; }
.notif-pref-label { font-weight: 600; font-size: 0.92rem; }
.notif-pref-desc { font-size: 0.8rem; color: var(--text-dim); }
.notif-pref-row .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; margin: 0; }

/* Repli des réponses aux commentaires (afficher la 1re + bouton) */
.replies.is-collapsed > .comment-reply ~ .comment-reply { display: none; }
.replies-toggle {
    background: none; border: 0; color: var(--violet); font-size: 0.82rem; font-weight: 600;
    cursor: pointer; padding: 2px 0 8px; display: inline-flex; align-items: center; gap: 5px;
}
.replies-toggle:hover { text-decoration: underline; }
.replies-toggle .bi { font-size: 0.9em; transition: transform 0.15s ease; }
.replies-toggle.is-open .bi { transform: rotate(180deg); }

/* "Ma note" (watchlist) : étoile violette pour la distinguer de la note globale */
.wl-score-mine .bi { color: var(--violet); }

/* Priorité de visionnage (watchlist) */
select.wl-prio { width: auto; min-width: 92px; font-weight: 600; }
select.wl-prio[data-prio="haute"]   { color: #dc2626; }
select.wl-prio[data-prio="normale"] { color: var(--text); }
select.wl-prio[data-prio="basse"]   { color: var(--text-dim); }
.wl-prio-name.wl-prio-haute   { color: #dc2626; }
.wl-prio-name.wl-prio-basse   { color: var(--text-dim); }

/* Barre de recherche dans le menu « Ajouter à une liste » */
.dropdown-glass .list-picker-search {
    position: sticky; top: -8px; z-index: 2;
    margin: -8px -8px 6px -8px; padding: 8px 8px 6px 8px;
    background: var(--surface-solid); border-bottom: 1px solid var(--border);
}
.dropdown-glass .list-picker-search input { width: 100%; }

/* Liste publique : cellules en lecture seule (statut, priorité, progression) */
.wl-prio-name { font-weight: 600; }
.wl-status-tag {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    font-size: 0.8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.wl-status-tag .bi { font-size: 0.85rem; }
.wl-status-en_cours  { color: var(--cyan-deep); }
.wl-status-a_voir    { color: var(--violet); }
.wl-status-termine   { color: #22c55e; }
.wl-status-en_pause  { color: #f59e0b; }
.wl-status-abandonne { color: var(--text-dim); }
.wl-progress-ro { display: flex; flex-direction: column; gap: 5px; }
.wl-progress-ro .wl-progress-count { font-size: 0.85rem; color: var(--text); }

/* Étiquette "Inconnu" dans la filmographie (rôle indéterminé) */
.filmo-tag-inconnu { background: rgba(148, 163, 184, 0.18); border-color: transparent; color: var(--text-dim); }
