/* ═══════════════════════════════════════════════════
   watchlist.css — Pi Web · Watchlist Module (refonte)
   Sections : loader · breadcrumb · toolbar · grilles
              cartes animé · panel détail · modals
              badges · star widget · toast · skeleton
              page de partage · responsive
═══════════════════════════════════════════════════ */

/* ─── PAGE LOADER 3×3 ──────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes loader-blink {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.loader {
  position: relative;
  width: 40px;
  height: 40px;
}
.square {
  background: #ddd;
  width: 10px;
  height: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -5px;
  margin-left: -5px;
}
[data-theme="light"] .square {
  background: #555;
}
#sq1 {
  margin-top: -25px;
  margin-left: -25px;
  animation: loader-blink 675ms ease-in-out 0ms infinite alternate;
}
#sq2 {
  margin-top: -25px;
  animation: loader-blink 675ms ease-in-out 75ms infinite alternate;
}
#sq3 {
  margin-top: -25px;
  margin-left: 15px;
  animation: loader-blink 675ms ease-in-out 150ms infinite;
}
#sq4 {
  margin-left: -25px;
  animation: loader-blink 675ms ease-in-out 225ms infinite;
}
#sq5 {
  animation: loader-blink 675ms ease-in-out 300ms infinite;
}
#sq6 {
  margin-left: 15px;
  animation: loader-blink 675ms ease-in-out 375ms infinite;
}
#sq7 {
  margin-top: 15px;
  margin-left: -25px;
  animation: loader-blink 675ms ease-in-out 450ms infinite;
}
#sq8 {
  margin-top: 15px;
  animation: loader-blink 675ms ease-in-out 525ms infinite;
}
#sq9 {
  margin-top: 15px;
  margin-left: 15px;
  animation: loader-blink 675ms ease-in-out 600ms infinite;
}

/* ─── BREADCRUMB ────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "DM Mono", monospace;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--text);
}
.breadcrumb .current {
  color: var(--text);
}

/* ─── PAGE HEADER ───────────────────────────────────── */
.wl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.wl-header h1 {
  font-family: "Syne", sans-serif;
  font-size: 1.6rem;
  color: var(--text);
  margin: 0;
}

/* ─── BOUTON "ADD" (style néo-brutaliste existant) ──── */
.button {
  --font-color: var(--accent-contrast);
  --bg-color-sub: var(--accent-2);
  --bg-color: var(--accent);
  position: relative;
  width: 160px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border: none;
  box-shadow: var(--shadow-card);
  background-color: var(--bg-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-family: "Syne", sans-serif;
  flex-shrink: 0;
}
.button,
.button__icon,
.button__text {
  transition:
    background-color var(--transition),
    transform var(--transition);
}
.button .button__text {
  transform: translateX(20px);
  color: var(--font-color);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}
.button .button__icon {
  position: absolute;
  transform: translateX(119px);
  height: 100%;
  width: 39px;
  background-color: var(--bg-color-sub);
  display: flex;
  align-items: center;
  justify-content: center;
}
.button .svg {
  width: 20px;
  stroke: var(--font-color);
}
.button:hover {
  background-color: var(--accent-2);
}
.button:hover .button__text {
  color: transparent;
}
.button:hover .button__icon {
  width: 158px;
  transform: translateX(0);
}
.button:active {
  transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════
   WATCHLISTS — grille (watchlists.html)
═══════════════════════════════════════════════════ */
.wl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}
.wl-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s;
  position: relative;
  display: flex;
  flex-direction: column;
}
[data-theme="light"] .wl-card {
  background: #fff;
  border-color: #e0e0e0;
}
.wl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: var(--shadow-lg);
}
.wl-card-cover {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
}
.wl-card-cover-placeholder {
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(var(--accent-rgb), 0.35);
}
[data-theme="light"] .wl-card-cover-placeholder {
  background: linear-gradient(135deg, #e8e8f0, #d0d0e8);
}
.wl-card-body {
  padding: 0.9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.wl-card-title {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-card-meta {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
}
.wl-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.wl-card:hover .wl-card-actions {
  opacity: 1;
}
.wl-card-icon-btn {
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 6px;
  color: #ccc;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  transition:
    color 0.2s,
    background 0.2s;
}
.wl-card-icon-btn:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
}
.wl-card-icon-btn.danger:hover {
  color: #ff4444;
}
.wl-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-family: "DM Mono", monospace;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--link);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  white-space: nowrap;
}
.wl-card-badge.default-badge {
  background: rgba(255, 165, 0, 0.12);
  color: #ffa940;
  border-color: rgba(255, 165, 0, 0.25);
}

.wl-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.85rem;
}

/* ─── ÉTATS VIDES ENRICHIS (0.6.0) ────────────────── */
.wl-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 3rem 1.5rem;
}
.wl-empty-state-icon {
  color: var(--accent);
  opacity: 0.55;
  margin-bottom: 0.4rem;
}
.wl-empty-state h2 {
  font-size: 1.15rem;
}
.wl-empty-state p {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}
.wl-empty-state-cta {
  margin-top: 0.4rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Syne", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.22);
  transition:
    background var(--transition),
    transform var(--transition);
}
.wl-empty-state-cta:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}
.wl-empty-state-cta:active {
  transform: translateY(0);
}

/* ─── BADGE « NOUVEAU » (0.6.0) ────────────────────── */
.badge-new {
  background: rgba(247, 255, 99, 0.202);
  color: var(--new-badge);
  border: 1px solid rgba(250, 255, 99, 0.583);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════
   TOOLBAR (watchlist.html)
═══════════════════════════════════════════════════ */
.wl-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.wl-title-display {
  font-family: "Syne", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wl-entry-count {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 0.18rem 0.6rem;
  flex-shrink: 0;
  white-space: nowrap;
}
[data-theme="light"] .wl-entry-count {
  background: #f0f0f0;
  border-color: #ddd;
}

.filter-tabs {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
[data-theme="light"] .filter-tabs {
  background: #eee;
}
.filter-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.filter-tab:hover:not(.active) {
  color: var(--text);
}

.sort-select,
.btn-export {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
[data-theme="light"] .sort-select,
[data-theme="light"] .btn-export {
  background: #f0f0f0;
  border-color: #ddd;
}
.btn-export:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
.sort-select {
  color: var(--text);
}

/* Barre de recherche */
.wl-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  padding: 0 0.6rem;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
[data-theme="light"] .wl-search-wrap {
  background: #f5f5f5;
  border-color: #ddd;
}
.wl-search-wrap:focus-within {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}
.wl-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}
.wl-search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  width: 120px;
  padding: 0.38rem 0;
  transition: width 0.2s;
}
.wl-search-input:focus {
  width: 180px;
}
.wl-search-input::placeholder {
  color: var(--text-muted);
}
.wl-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}
.wl-search-clear:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════════════════
   LISTE D'ANIMÉS — cartes riches (vue principale)
═══════════════════════════════════════════════════ */
#wl-cards {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
[data-theme="light"] #wl-cards {
  border-color: #e0e0e0;
}
.table-empty {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
}

.anime-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 12px;
  min-height: 96px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
[data-theme="light"] .anime-card {
  border-bottom-color: #f0f0f0;
}
.anime-card:last-child {
  border-bottom: none;
}
.anime-card:hover {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .anime-card:hover {
  background: rgba(0, 0, 0, 0.025);
}
.anime-card.active {
  background: rgba(var(--accent-rgb), 0.08);
  border-left: 3px solid var(--accent);
}
.anime-card.pinned {
  background: rgba(255, 165, 0, 0.035);
}
.anime-card.pinned:hover {
  background: rgba(255, 165, 0, 0.06);
}

/* Actions pin/fav — visibles au hover (toujours visibles sur mobile) */
.ac-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.18s;
  flex-shrink: 0;
  width: 28px;
}
.anime-card:hover .ac-actions {
  opacity: 1;
}
.ac-pin,
.ac-fav {
  width: 28px !important;
  height: 28px !important;
}

/* Cover portrait — priorité au "maximum d'informations" */
.ac-cover {
  width: 56px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.ac-cover-ph {
  width: 56px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(var(--accent-rgb), 0.5);
  flex-shrink: 0;
}

/* Corps : titre + 2 lignes d'infos */
.ac-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ac-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ac-title {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ac-title-en {
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}
.ac-info-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}
.ac-info-line .dot {
  opacity: 0.4;
}
.ac-stars {
  display: inline-flex;
  gap: 1px;
  flex-shrink: 0;
}
.ac-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.ac-progress-bar {
  flex: 1;
  max-width: 90px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
[data-theme="light"] .ac-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}
.ac-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}
.card-ep-quick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.card-ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--link);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.card-ep-btn:hover {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.55);
  transform: translateY(-1px);
}
.card-ep-btn:active {
  transform: translateY(0);
}
.card-ep-count {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  color: var(--text);
  min-width: 1.1em;
  text-align: center;
}
.ac-genres {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 1px;
}
.ac-genre-chip {
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  padding: 0.06rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
[data-theme="light"] .ac-genre-chip {
  background: #f0f0f0;
  border-color: #e0e0e0;
}

.cs-star {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 12px;
}
.cs-star-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.cs-star-bg path {
  fill: #444;
}
[data-theme="light"] .cs-star-bg path {
  fill: #ccc;
}
.cs-star-fg path {
  fill: #e6b800;
}

/* Chevron droite */
.ac-right {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.5;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.anime-card:hover .ac-right {
  opacity: 1;
  transform: translateX(2px);
}
.anime-card.active .ac-right {
  opacity: 1;
  color: var(--accent);
}

/* ─── VUE GRILLE (Database) ─────────────────────────── */
#wl-cards.wl-poster-grid,
#share-cards.wl-poster-grid,
#wl-suggestions .wl-poster-grid,
#share-suggestions .wl-poster-grid,
#cat-suggestions .wl-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 12px;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.poster-card {
  position: relative;
  display: block;
  padding: 0;
  min-height: 0;
  border-bottom: none;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
[data-theme="light"] .poster-card {
  background: linear-gradient(135deg, #e8e8f0, #d0d0e8);
}
.poster-card.active {
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
  border-left: none;
  box-shadow: 0 0 0 2px var(--accent);
}
.poster-card:hover {
  transform: translateY(-3px) scale(1.03);
  z-index: 2;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.poster-cover {
  width: 100%;
  height: 100%;
}
.poster-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poster-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 8px 8px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88),
    rgba(0, 0, 0, 0.45) 55%,
    transparent
  );
  opacity: 0;
  transition: opacity 0.18s ease;
}
.poster-card:hover .poster-overlay {
  opacity: 1;
}
.poster-title {
  font-family: "Syne", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  margin-bottom: 4px;
}
.poster-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.poster-badges .badge {
  font-size: 0.58rem;
  padding: 0.1rem 0.35rem;
}
.poster-quick {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 6px;
}
.poster-ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.poster-ep-btn:hover {
  background: rgba(var(--accent-rgb), 0.4);
  border-color: rgba(var(--accent-rgb), 0.65);
}
.poster-ep-count {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  color: #fff;
  min-width: 1.2em;
  text-align: center;
}

/* ─── BADGES (statuts / type / audio) ───────────────── */
.badge {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  font-family: "DM Mono", monospace;
  font-size: 0.63rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-watched {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.badge-watching {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}
.badge-paused {
  background: rgba(253, 216, 53, 0.15);
  color: #fdd835;
  border: 1px solid rgba(253, 216, 53, 0.3);
}
[data-theme="light"] .badge-paused {
  color: #8a6d00;
}
.badge-dropped {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}
.badge-planned {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}
.badge-airing {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}
.badge-finished {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.badge-not_aired {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}
.badge-cancelled {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}
.badge-type-movie {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--link);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}
.badge-type-serie {
  background: rgba(33, 150, 243, 0.15);
  color: #64b5f6;
  border: 1px solid rgba(33, 150, 243, 0.25);
}
.badge-type-oav {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.badge-genre {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .badge-genre {
  background: #f0f0f0;
  border-color: #e0e0e0;
}
.badge-avail-yes {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.badge-avail-no {
  background: rgba(158, 158, 158, 0.12);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.25);
}

/* ─── STAR WIDGET (SVG, demi-étoiles) ─────────────────── */
.star-widget {
  display: inline-flex;
  gap: 2px;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}
.sw-star {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
  transition: transform 0.12s;
}
.sw-star-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.sw-star-bg path {
  fill: #444;
}
[data-theme="light"] .sw-star-bg path {
  fill: #ccc;
}
.sw-star-fg path {
  fill: #e6b800;
}
@keyframes star-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
.sw-star.pop {
  animation: star-pop 0.28s ease;
}
.star-widget.large .sw-star {
  width: 26px;
  height: 26px;
}
.star-widget.small .sw-star {
  width: 14px;
  height: 14px;
}

/* ─── BOOKMARK (FAVORI) ──────────────────────────────── */
.fav-label {
  --color: #e6b800;
  --sz: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: var(--sz);
  user-select: none;
  fill: var(--color);
  width: 30px;
  height: 30px;
}
.fav-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.fav-label .save-regular,
.fav-label .save-solid {
  position: absolute;
  transform-origin: top;
  animation: keyframes-fill 0.5s;
  width: var(--sz);
  height: var(--sz);
}
.fav-label .save-solid {
  display: none;
}
.fav-label input:checked ~ .save-regular {
  display: none;
}
.fav-label input:checked ~ .save-solid {
  display: block;
}
@keyframes keyframes-fill {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scaleY(1.2);
  }
}

/* ─── PIN ────────────────────────────────────────────── */
.pin-label {
  width: 34px;
  height: 34px;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition:
    background 0.2s,
    transform 0.15s;
}
.pin-label input {
  display: none;
}
.pin-svg {
  width: 13px;
  height: auto;
  transform: rotate(35deg);
  fill: none;
  stroke: #666;
  transition:
    fill 0.2s,
    stroke 0.2s;
}
.pin-label:hover {
  background: rgba(255, 255, 255, 0.09);
}
[data-theme="light"] .pin-label:hover {
  background: rgb(244, 238, 255);
}
.pin-label:active {
  transform: scale(0.9);
}
.pin-label input:checked ~ .pin-svg {
  fill: rgb(255, 0, 0);
  stroke: white;
}
.pin-label input:checked ~ .pin-svg line {
  stroke: rgb(255, 0, 0);
}
.pin-label input:checked ~ .pin-svg path {
  stroke: rgb(255, 0, 0);
}

/* ─── SAVE BUTTON (panel footer) ─────────────────────── */
.action_has {
  --color: 0 0% 60%;
  --sz: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--sz) * 2.3);
  width: calc(var(--sz) * 2.3);
  padding: 0.3rem;
  border-radius: 0.375rem;
  border: 0.0625rem solid hsl(var(--color));
  background: transparent;
  color: hsl(var(--color));
  transition:
    border-color 0.2s,
    color 0.2s;
  flex-shrink: 0;
}
.has_saved:hover {
  border-color: var(--accent);
}
.has_saved svg {
  overflow: visible;
  height: calc(var(--sz) * 1.6);
  width: calc(var(--sz) * 1.6);
  color: hsl(var(--color));
  transition: color 0.2s;
}
.has_saved:hover svg {
  color: var(--accent);
}

/* Infos animé — tableau compact */
.pnl-info-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .pnl-info-table {
  border-color: #eee;
}
.pnl-info-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.pnl-info-row:last-child {
  border-bottom: none;
}
.pnl-info-row:has(.toggle-switch) {
  align-items: center;
}
.pnl-info-label {
  font-family: sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 96px;
  flex-shrink: 0;
}
.notes-block .pnl-info-label {
  width: 132px;
}
.pnl-info-val {
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  color: var(--text);
}
.pnl-info-val a {
  color: var(--link);
  text-decoration: none;
}
.pnl-info-val a:hover {
  text-decoration: underline;
}

.pnl-info-row-editable {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.pnl-info-row-editable:hover {
  background: rgba(var(--accent-rgb), 0.07);
}
.pnl-info-row-editable .pnl-info-val-display {
  cursor: pointer;
}
.pnl-notes-tags-display {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.pnl-note-score-val {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.pnl-info-val-edit select,
.pnl-info-val-edit input[type="text"],
.pnl-info-val-edit input[type="number"],
.pnl-info-val-edit input[type="date"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
[data-theme="light"] .pnl-info-val-edit select,
[data-theme="light"] .pnl-info-val-edit input[type="text"],
[data-theme="light"] .pnl-info-val-edit input[type="number"],
[data-theme="light"] .pnl-info-val-edit input[type="date"] {
  background: #f8f8f8;
  border-color: #ddd;
  color: #111;
}
.pnl-info-row-block {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.pnl-info-row-block .pnl-info-label {
  width: auto;
}
.pnl-info-row-block .pnl-info-val-edit {
  display: block;
  width: 100%;
}
.pnl-info-row-block .pnl-info-val-edit textarea {
  width: 100%;
  min-height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  color: var(--text);
  font-family: sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}
[data-theme="light"] .pnl-info-row-block .pnl-info-val-edit textarea {
  background: #f8f8f8;
  border-color: #ddd;
  color: #111;
}

.pnl-title-en {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0 0 0.3rem 0;
}

/* Genres */
.pnl-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Synopsis */
.panel-description {
  font-family: sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-height: 140px;
  overflow-y: auto;
  border-left: 2px solid rgba(var(--accent-rgb), 0.3);
  padding-left: 0.75rem;
}
.panel-desc-lang-toggle {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.panel-desc-lang-toggle button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  padding: 0.12rem 0.4rem;
  cursor: pointer;
  transition: all 0.15s;
}
.panel-desc-lang-toggle button.active {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--link);
  border-color: rgba(var(--accent-rgb), 0.35);
}

/* Nouvelle saison */
.pnl-new-season {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}
.pnl-ns-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: #ff9800;
  display: flex;
}
.pnl-ns-title {
  font-family: sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ff9800;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pnl-ns-text {
  font-family: sans-serif;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.pnl-ns-link {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--link);
  text-decoration: none;
}
.pnl-ns-link:hover {
  text-decoration: underline;
}

/* Disponibilité streaming */
.pnl-availability {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pnl-avail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
  color: var(--text);
}
.pnl-avail-row .pnl-avail-platform {
  color: var(--text-muted);
}

/* Section title + fields */
.panel-section-title {
  font-family: "DM Mono", monospace;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
  margin-top: 0.1rem;
}
[data-theme="light"] .panel-section-title {
  border-top-color: #eee;
}

.panel-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.panel-field label {
  font-family: sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.panel-field select,
.panel-field input[type="text"],
.panel-field input[type="number"],
.panel-field input[type="date"],
.panel-field input[type="url"],
.panel-field textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.7rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
[data-theme="light"] .panel-field select,
[data-theme="light"] .panel-field input,
[data-theme="light"] .panel-field textarea {
  background: #f8f8f8;
  border-color: #ddd;
  color: #111;
}
.panel-field select:focus,
.panel-field input:focus,
.panel-field textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.panel-field textarea {
  resize: vertical;
  min-height: 75px;
}
.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.rewatch-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
.rewatch-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.rewatch-row label {
  font-family: sans-serif;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}

.btn-del-entry {
  display: inline-flex;
  align-items: center;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: var(--radius-sm);
  color: #f44336;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: auto;
  overflow: hidden;
  flex-shrink: 0;
}
.btn-del-icon {
  flex-shrink: 0;
  display: block;
}
.btn-del-label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  transition:
    max-width 0.25s ease,
    margin-left 0.25s ease,
    opacity 0.2s ease;
}
.btn-del-entry:hover {
  background: rgba(244, 67, 54, 0.2);
}
.btn-del-entry:hover .btn-del-label {
  max-width: 120px;
  margin-left: 0.4rem;
  opacity: 1;
}

.panel-score-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.episode-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}
.episode-control.compact {
  width: auto;
  min-width: 110px;
}
.episode-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(138, 92, 246, 0.45);
  background: rgba(138, 92, 246, 0.18);
  color: #f4f2ff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}
.episode-step-btn:hover {
  background: rgba(138, 92, 246, 0.28);
  border-color: rgba(138, 92, 246, 0.7);
  transform: translateY(-1px);
}
.score-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
[data-theme="light"] .score-reset-btn {
  background: #f2f2f2;
  border-color: #e0e0e0;
}
.score-reset-btn:hover {
  background: rgba(244, 67, 54, 0.12);
  border-color: rgba(244, 67, 54, 0.3);
  color: #f44336;
}
.autosave-ind {
  font-family: "DM Mono", monospace;
  font-size: 0.63rem;
  color: var(--text-muted);
  transition: color 0.3s;
  white-space: nowrap;
}
.autosave-ind.saving {
  color: var(--accent);
}
.autosave-ind.saved {
  color: #4caf50;
}

/* mini-loader dans le panel */
.ep-loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}
.ep-loader {
  position: relative;
  width: 40px;
  height: 40px;
}
.ep-sq {
  background: #ddd;
  width: 10px;
  height: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -5px;
  margin-left: -5px;
}
[data-theme="light"] .ep-sq {
  background: #555;
}
.ep-sq.n1 {
  margin-top: -25px;
  margin-left: -25px;
  animation: loader-blink 675ms ease-in-out 0ms infinite alternate;
}
.ep-sq.n2 {
  margin-top: -25px;
  animation: loader-blink 675ms ease-in-out 75ms infinite alternate;
}
.ep-sq.n3 {
  margin-top: -25px;
  margin-left: 15px;
  animation: loader-blink 675ms ease-in-out 150ms infinite;
}
.ep-sq.n4 {
  margin-left: -25px;
  animation: loader-blink 675ms ease-in-out 225ms infinite;
}
.ep-sq.n5 {
  animation: loader-blink 675ms ease-in-out 300ms infinite;
}
.ep-sq.n6 {
  margin-left: 15px;
  animation: loader-blink 675ms ease-in-out 375ms infinite;
}
.ep-sq.n7 {
  margin-top: 15px;
  margin-left: -25px;
  animation: loader-blink 675ms ease-in-out 450ms infinite;
}
.ep-sq.n8 {
  margin-top: 15px;
  animation: loader-blink 675ms ease-in-out 525ms infinite;
}
.ep-sq.n9 {
  margin-top: 15px;
  margin-left: 15px;
  animation: loader-blink 675ms ease-in-out 600ms infinite;
}

@media (max-width: 768px) {
  .ac-actions {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════
   MODALS (création watchlist / ajout animé)
═══════════════════════════════════════════════════ */
/* Sur mobile, le panneau de détail (z-index 250) couvre l'écran : sans ce niveau, la fenêtre de partage
   ouverte depuis ce panneau s'affichait DERRIÈRE lui (et le panneau devenait inerte). */
.adult-confirm-overlay,
.share-anime-overlay {
  z-index: 300;
}
.adult-confirm-card {
  max-width: 430px;
}
.adult-confirm-message {
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}
.adult-confirm-card .modal-btn-row {
  margin-top: 1.3rem;
}
.adult-confirm-card .modal-btn {
  flex: 1;
}
.modal-field {
  margin-bottom: 0.9rem;
}
.modal-field label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: sans-serif;
  margin-bottom: 0.35rem;
}
.modal-field input,
.modal-field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.85rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.82rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}
[data-theme="light"] .modal-field input,
[data-theme="light"] .modal-field select {
  background: #f5f5f5;
  border-color: #ddd;
  color: #111;
}
.modal-field input:focus,
.modal-field select:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.modal-hint {
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.modal-btn {
  width: 100%;
  padding: 0.78rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Syne", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--transition),
    transform var(--transition);
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.22);
}
.modal-btn:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28);
}
.modal-btn:active {
  transform: translateY(0);
}
.modal-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  margin-top: 0;
}
[data-theme="light"] .modal-btn.secondary {
  background: #eee;
  border-color: #ccc;
}
.modal-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.modal-row-2 .modal-field {
  margin-bottom: 0;
}
.modal-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.modal-btn-row .modal-btn {
  margin-top: 0;
}

.modal-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-bottom: 0.9rem;
}
.toggle-label {
  font-family: sans-serif;
  font-size: 0.82rem;
  color: var(--text);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #444;
  border-radius: 21px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(17px);
}

/* Résultats de recherche (add modal) */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s;
}
[data-theme="light"] .search-result {
  background: #f5f5f5;
  border-color: #e0e0e0;
}
.search-result:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.3);
}
.sr-cover {
  width: 34px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.sr-info {
  flex: 1;
  min-width: 0;
}
.sr-title {
  font-family: "Syne", sans-serif;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-sub {
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.search-hint {
  text-align: center;
  padding: 1rem;
  font-family: "DM Mono", monospace;
  font-size: 0.73rem;
  color: var(--text-muted);
}
.sr-section-label {
  font-family: "DM Mono", monospace;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding: 0.55rem 0.2rem 0.25rem;
  margin-top: 0.2rem;
}
.sr-badge-cat,
.sr-badge-ani {
  font-family: "DM Mono", monospace;
  font-size: 0.57rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 0.3rem;
}
.sr-badge-cat {
  background: rgba(76, 175, 80, 0.12);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.25);
}
.sr-badge-ani {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--link);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}
.sr-create-row {
  text-align: center;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .sr-create-row {
  border-top-color: #eee;
}

/* ─── TOAST ──────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  z-index: 9000;
}
.toast {
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  animation: toast-in var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
[data-theme="light"] .toast {
  background: #fff;
  border-color: #e0e0e0;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}
.toast.hiding {
  animation: toast-out 0.28s ease forwards;
}

/* ─── SKELETON ───────────────────────────────────────── */
@keyframes shimmer {
  0% {
    background-position: -800px 0;
  }
  100% {
    background-position: 800px 0;
  }
}
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.8s infinite linear;
  border-radius: 6px;
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 800px 100%;
}
.sk-cover {
  height: 110px;
  border-radius: 0;
}
.sk-body {
  padding: 0.9rem 1rem;
}
.sk-line {
  height: 13px;
  margin-bottom: 0.45rem;
  border-radius: 4px;
}
.sk-short {
  width: 55%;
}

/* ─── COPY BUTTON ────────────────────────────────────── */
.copy {
  --button-bg: #2a2a2e;
  --button-hover-bg: #3a3a3e;
  --button-text-color: #cccccc;
  --button-hover-text-color: var(--link);
  --button-border-radius: var(--radius-sm);
  --button-diameter: 34px;
  --button-outline-width: 1px;
  --button-outline-color: rgba(var(--accent-rgb), 0.5);
  --tooltip-bg: #1a1a1f;
  --toolptip-border-radius: 6px;
  --tooltip-font-family: "DM Mono", monospace;
  --tooltip-font-size: 11px;
  --tootip-text-color: #e0e0e0;
  --tooltip-padding-x: 7px;
  --tooltip-padding-y: 6px;
  --tooltip-offset: 8px;
  box-sizing: border-box;
  width: var(--button-diameter);
  height: var(--button-diameter);
  border-radius: var(--button-border-radius);
  background-color: var(--button-bg);
  color: var(--button-text-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  outline: none;
  flex-shrink: 0;
  transition: background 0.2s;
}
[data-theme="light"] .copy {
  --button-bg: #eee;
  --button-hover-bg: #e0e0e0;
  --button-text-color: #555;
  --button-hover-text-color: var(--accent);
  --tooltip-bg: #fff;
  --tootip-text-color: #333;
}
.tooltip {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: var(--tooltip-font-size) var(--tooltip-font-family);
  color: var(--tootip-text-color);
  background: var(--tooltip-bg);
  padding: var(--tooltip-padding-y) var(--tooltip-padding-x);
  border-radius: var(--toolptip-border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.tooltip::before {
  content: attr(data-text-initial);
}
.tooltip::after {
  content: "";
  position: absolute;
  bottom: calc(var(--tooltip-padding-y) / 2 * -1);
  width: var(--tooltip-padding-y);
  height: var(--tooltip-padding-y);
  background: inherit;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
  pointer-events: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.copy svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.checkmark {
  display: none;
}
.copy:hover .tooltip,
.copy:focus:not(:focus-visible) .tooltip {
  opacity: 1;
  visibility: visible;
  top: calc((100% + var(--tooltip-offset)) * -1);
}
.copy:focus:not(:focus-visible) .tooltip::before {
  content: attr(data-text-end);
}
.copy:focus:not(:focus-visible) .clipboard {
  display: none;
}
.copy:focus:not(:focus-visible) .checkmark {
  display: block;
}
.copy.copied .clipboard {
  display: none;
}
.copy.copied .checkmark {
  display: block;
}
.copy:hover,
.copy:focus {
  background-color: var(--button-hover-bg);
}
.copy:active {
  outline: var(--button-outline-width) solid var(--button-outline-color);
}
.copy:hover svg {
  color: var(--button-hover-text-color);
}

/* ─── SHARE BUTTON + POPUP ───────────────────────────── */
.share-wrap {
  position: relative;
  flex-shrink: 0;
}
.share-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.share-toggle-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
.share-toggle-btn.share-active {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--link);
  background: rgba(var(--accent-rgb), 0.1);
}
[data-theme="light"] .share-toggle-btn {
  background: #f0f0f0;
  border-color: #ddd;
}
[data-theme="light"] .share-toggle-btn.share-active {
  background: rgba(var(--accent-rgb), 0.08);
}
.share-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 300px;
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}
[data-theme="light"] .share-popup {
  background: #fff;
  border-color: #e0e0e0;
  box-shadow: var(--shadow-lg);
}
.share-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
  font-family: "Syne", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.share-disable-btn {
  background: none;
  border: none;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  color: #f44336;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}
.share-disable-btn:hover {
  opacity: 0.7;
}
.share-link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.share-link-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  outline: none;
  min-width: 0;
}
[data-theme="light"] .share-link-row input {
  background: #f5f5f5;
  border-color: #ddd;
}

/* ─── VUE LISTE / GRILLE (toggle) ────────────────────── */
.view-toggle {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
}
[data-theme="light"] .view-toggle {
  background: #eee;
}
.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.view-toggle-btn:hover {
  color: var(--text);
}
.view-toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* ─── KEBAB "PLUS D'OPTIONS" (Export/Import CSV) ─────── */
.wl-more-wrap {
  position: relative;
  flex-shrink: 0;
}
.wl-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.wl-more-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
[data-theme="light"] .wl-more-btn {
  background: #f0f0f0;
  border-color: #ddd;
}
.wl-more-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  z-index: 300;
  box-shadow: var(--shadow-lg);
}
[data-theme="light"] .wl-more-popup {
  background: #fff;
  border-color: #e0e0e0;
  box-shadow: var(--shadow-lg);
}
.wl-more-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
  cursor: pointer;
  transition: background 0.15s;
}
.wl-more-item:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

/* ─── FILTRES AVANCÉS (genre / studio / année) ────────── */
.adv-filter-wrap {
  position: relative;
  flex-shrink: 0;
}
.adv-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.adv-filter-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
[data-theme="light"] .adv-filter-btn {
  background: #f0f0f0;
  border-color: #ddd;
}
.adv-filter-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
}
.adv-filter-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-height: 420px;
  overflow-y: auto;
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}
.adv-filter-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .adv-filter-popup-header {
  border-bottom-color: #eee;
}
.adv-filter-popup-title {
  font-family: "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.adv-filter-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.2s;
}
.adv-filter-close-btn:hover {
  color: var(--text);
}

[data-theme="light"] .adv-filter-popup {
  background: #fff;
  border-color: #e0e0e0;
}
.adv-filter-section {
  margin-bottom: 0.9rem;
}
.adv-filter-section:last-of-type {
  margin-bottom: 0;
}
.adv-filter-section-title {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.adv-filter-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.adv-filter-genres .filter-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .adv-filter-genres .filter-tab {
  background: #f0f0f0;
  border-color: #e0e0e0;
}
.adv-filter-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.adv-filter-scores .filter-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
[data-theme="light"] .adv-filter-scores .filter-tab {
  background: #f0f0f0;
  border-color: #e0e0e0;
}
.adv-filter-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.adv-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .adv-filter-toggle:not(.active) {
  background: #f0f0f0;
  border-color: #e0e0e0;
}
.adv-filter-toggle.active,
.adv-filter-toggle.active:hover,
.adv-filter-toggle.active:focus,
.adv-filter-genres .filter-tab.active,
[data-theme="light"] .adv-filter-genres .filter-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}
.adv-filter-toggle:focus-visible,
.adv-filter-genres .filter-tab:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.adv-filter-toggle svg {
  flex-shrink: 0;
}
.adv-filter-toggle.active .adv-filter-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.adv-filter-empty {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.adv-filter-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
[data-theme="light"] .adv-filter-select {
  background: #f5f5f5;
  border-color: #ddd;
}
.adv-filter-actions {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .adv-filter-actions {
  border-top-color: #eee;
}
.adv-filter-reset-btn {
  width: 100%;
  background: none;
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: var(--radius-sm);
  color: #f44336;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  padding: 0.45rem;
  cursor: pointer;
  transition: background 0.2s;
}
.adv-filter-reset-btn:hover {
  background: rgba(244, 67, 54, 0.1);
}

/* ─── FLOU CONTENU +18 ────────────────────────────────── */
/* .adult-blur est dans style.css (chargé sur toutes les pages). */

/* Voile décoratif (non cliquable) : vignettes, grilles, suggestions, recherche */
.adult-veil-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.adult-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  pointer-events: none;
}
.adult-veil svg {
  width: 34%;
  height: 34%;
  max-width: 22px;
  max-height: 22px;
  flex-shrink: 0;
}

/* Image principale d'une fiche +18 : un clic affiche, un clic re-floute */
.adult-cover {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.adult-cover .fp-cover,
.adult-cover .fp-cover-ph {
  box-shadow: none;
}
.adult-cover-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  padding: 0;
  color: #fff;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s;
}
.adult-cover-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}
.adult-cover-btn:focus-visible {
  outline-offset: -4px;
}
.adult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-family: "Syne", sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 6px 20px rgba(0, 0, 0, 0.55);
}
.adult-cover.is-revealed .adult-cover-btn {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.5rem;
  background: transparent;
}
.adult-cover-hide {
  display: inline-flex;
  padding: 0.35rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s;
}
.adult-cover-hide svg {
  width: 16px;
  height: 16px;
}
.adult-cover.is-revealed:hover .adult-cover-hide,
.adult-cover-btn:focus-visible .adult-cover-hide {
  opacity: 1;
}
@media (hover: none) {
  .adult-cover-hide {
    opacity: 1;
  }
}

/* ─── FILTRES SENSIBLES (Catalogue) ───────────────────── */
.adv-filter-sensitive-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
}
.adv-filter-sensitive-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
.adv-filter-sensitive-toggle[aria-expanded="true"] {
  color: var(--link);
  border-color: rgba(var(--accent-rgb), 0.35);
}
@media (max-width: 480px) {
  .adv-filter-popup {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 70vh;
  }
}

/* ─── BOUTON STATS DE PARTAGE ─────────────────────────── */
.wl-stats-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.wl-stats-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
[data-theme="light"] .wl-stats-btn {
  background: #f0f0f0;
  border-color: #ddd;
}

.share-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.share-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
[data-theme="light"] .share-stats-row {
  background: #f8f8f8;
  border-color: #e8e8e8;
}
.share-stats-label {
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.share-stats-val {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* ─── TOGGLES DE PRÉFÉRENCE (remplace les checkbox natives) ── */
.panel-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0;
}

/* ─── BLOC REPLIABLE (mode ajout, panel, synopsis) ───── */
.dp-collapse {
  margin-bottom: 0.4rem;
}
.dp-collapse-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
[data-theme="light"] .dp-collapse-summary {
  background: #f0f0f0;
  border-color: #ddd;
}
.dp-collapse-summary:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
.dp-collapse-summary::-webkit-details-marker {
  display: none;
}
.dp-collapse-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition:
    transform 0.2s ease,
    color 0.2s;
}
.dp-collapse[open] .dp-collapse-summary {
  color: var(--link);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.dp-collapse[open] .dp-collapse-chevron {
  transform: rotate(180deg);
  color: var(--link);
}

/* ─── VUE PLEINE PAGE (fiche animé dédiée) ───────────── */
.wl-fullpage-content {
  padding: 0 !important;
  max-width: none !important;
  overflow-x: hidden;
  position: relative;
}

/* Conteneur principal qui remonte pour chevaucher le hero */
.fp-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  position: relative;
  z-index: 2;
}

/* Hero banner (background image blurred) */
.fp-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 350px;
  background-size: cover;
  background-position: center 20%;
  filter: blur(16px) saturate(1.2);
  transform: scale(1.05); /* hide blur edges */
  opacity: 0.6;
  z-index: 0;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}
.fp-hero-overlay {
  display: none;
}

.fp-topbar {
  margin: 1.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 4;
  width: fit-content;
}
.fp-back-btn,
.fp-share-btn,
.fp-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(20, 20, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  color: #e8e8f0;
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.fp-back-btn {
  padding: 0.4rem 0.8rem;
}
.fp-share-btn,
.fp-add-btn {
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  flex-shrink: 0;
}
.fp-share-btn {
  margin-left: 0.5rem;
}
.fp-back-btn:hover,
.fp-share-btn:hover,
.fp-add-btn:hover {
  background: rgba(20, 20, 26, 0.75);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}
[data-theme="light"] .fp-back-btn,
[data-theme="light"] .fp-share-btn,
[data-theme="light"] .fp-add-btn {
  background: rgba(255, 255, 255, 0.55);
  color: #2a2a35;
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .fp-back-btn:hover,
[data-theme="light"] .fp-share-btn:hover,
[data-theme="light"] .fp-add-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.2);
}

/* ── Ligne titre + bouton d'ajout (déplacé depuis le topbar) ──────── */
.fp-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fp-title-row .fp-title {
  flex: 1;
  min-width: 0;
}

/* ── Ligne discrète "Partagé par X" sous le titre ─────────────────── */
.fp-shared-by-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Rubrique AniList distincte (score + lien réel) ───────────────── */
.fp-anilist-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.9rem;
  background: rgba(201, 94, 209, 0.06);
  border: 1px solid rgba(201, 94, 209, 0.22);
  border-radius: var(--radius-sm);
}
.fp-anilist-label {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c95ed1;
  font-weight: 700;
}
.fp-anilist-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fp-anilist-pct {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.fp-anilist-link {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--link);
  text-decoration: none;
  margin-left: auto;
}
.fp-anilist-link:hover {
  text-decoration: underline;
}
.fp-anilist-none {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

.fp-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar gauche */
.fp-col-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.25rem;
}
.fp-cover-wrap {
  position: relative;
  margin-top: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.fp-cover,
.fp-cover-ph {
  width: 240px;
  height: 340px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  background: rgba(var(--accent-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fp-actions-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.fp-info-box {
  padding: 0;
}

/* Colonne principale */
.fp-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding-top: 1rem;
}
.fp-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  z-index: 3;
}
.fp-title {
  font-family: "Syne", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
[data-theme="light"] .fp-title {
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
}
.fp-title-en {
  font-family: "DM Mono", monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.fp-badges-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.fp-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.fp-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.fp-genres .badge-genre {
  padding: 0.3rem 0.75rem;
  font-size: 0.7rem;
  border-radius: 20px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--link);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}
.fp-desc:not(.panel-description) {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.panel-description.fp-desc {
  font-family: sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid rgba(var(--accent-rgb), 0.45);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  max-height: none;
  overflow-y: visible;
}
[data-theme="light"] .panel-description.fp-desc {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
  border-left-color: rgba(var(--accent-rgb), 0.45);
}
.fp-avail-box {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .fp-avail-box {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.05);
}

/* Formulaire d'édition perso : refonte en grille propre */
.fp-edit-card {
  padding: 0.4rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.fp-edit-card .fp-section-title {
  grid-column: 1 / -1;
  font-size: 0.95rem;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-theme="light"] .fp-edit-card .fp-section-title {
  border-bottom-color: #eee;
}
.fp-edit-card .fp-section-title:first-child {
  margin-top: 0;
}

.fp-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  grid-column: span 1;
  min-width: 0;
}
.fp-field label {
  font-family: sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.fp-field select,
.fp-field input[type="text"],
.fp-field input[type="number"],
.fp-field input[type="date"],
.fp-field input[type="url"],
.fp-field textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
  box-sizing: border-box;
}
[data-theme="light"] .fp-field select,
[data-theme="light"] .fp-field input,
[data-theme="light"] .fp-field textarea {
  background: #f4f4f4;
  border-color: #ddd;
  color: #111;
}
.fp-field select:focus,
.fp-field input:focus,
.fp-field textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .fp-field select:focus,
[data-theme="light"] .fp-field input:focus,
[data-theme="light"] .fp-field textarea:focus {
  background: #fff;
}

.fp-field textarea {
  resize: vertical;
  min-height: 80px;
}

.fp-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Champs qui prennent toute la largeur par défaut s'ils contiennent ces éléments */
.fp-field:has(textarea),
.fp-field:has(#p-tags),
.fp-field:has(#p-plat) {
  grid-column: 1 / -1;
}

/* Fix pour les navigateurs ne supportant pas :has(), on utilise les ids si possible ou on assure un bon flow. 
   On peut cibler les enfants de .fp-edit-card de manière positionnelle pour être safe. */
.fp-edit-card > .fp-field:nth-child(8), /* platform */
.fp-edit-card > .fp-field:nth-child(9), /* review */
.fp-edit-card > .fp-field:nth-child(10) /* tags */ {
  grid-column: 1 / -1;
}

.fp-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  grid-column: span 1;
  margin-top: 0.5rem;
}
.fp-toggle-row .toggle-label {
  font-family: sans-serif;
  font-size: 0.85rem;
  color: var(--text);
}

.fp-footer {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}
[data-theme="light"] .fp-footer {
  border-top-color: #eee;
}
.fp-footer .autosave-ind {
  margin-right: auto;
  margin-left: 0;
}

/* ─── FP STATUS/SCORE — contrôle plein façon AniList ─── */
.fp-status-block {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.fp-status-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 2.2rem 0.6rem 1rem;
  font-family: "Syne", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 13px;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
  transition: background-color var(--transition);
}
.fp-status-select:hover {
  background-color: var(--accent-2);
}
.fp-status-select option {
  background: var(--bg-2);
  color: var(--text);
  font-weight: 500;
}
.fp-score-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── FP USER FIELDS — flux continu, sans encart ──────── */
.fp-user-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.fp-footer-inline {
  margin-top: 0.6rem;
}

/* ─── FULLPAGE — "Mes notes" en lignes éditables (façon AniList) ─── */
.fp-notes-title {
  font-family: "Inter", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.fp-notes-table {
  display: flex;
  flex-direction: column;
  margin-top: 0.6rem;
}
.fp-notes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .fp-notes-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
.fp-notes-row:last-child {
  border-bottom: none;
}
.fp-notes-label {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.fp-notes-value {
  background: transparent;
  border: none;
  outline: none;
  text-align: right;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  padding: 0.15rem 0;
  width: 100%;
  max-width: 140px;
  cursor: text;
  transition: color 0.2s;
}
.fp-notes-value:focus {
  color: var(--accent);
}
.fp-notes-toggle-cell {
  display: flex;
  justify-content: flex-end;
}

.fp-tags-field {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.1rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.2s;
  margin-top: -0.6rem;
}
.fp-tags-field:focus {
  border-color: var(--accent);
}
.fp-tags-field::placeholder {
  color: var(--text-faint);
}

.fp-review-block {
  border-left: 2px solid rgba(var(--accent-rgb), 0.4);
  padding-left: 0.75rem;
  margin-top: 1rem;
}
.fp-review-label {
  font-family: "Inter", sans-serif;
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: block;
}
.fp-review-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 44px;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 0;
}
.fp-review-textarea::placeholder {
  color: var(--text-faint);
}

/* ─── MY NOTES — édition en ligne par champ ───── */
.notes-block {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.fp-edit-card .notes-block {
  grid-column: 1 / -1;
}
.notes-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
  margin-top: 0.1rem;
}
[data-theme="light"] .notes-block-header {
  border-top-color: #eee;
}
.notes-block-title {
  font-family: "DM Mono", monospace;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.fp-edit-card .notes-block-title {
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}

.fp-edit-card .notes-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}

/* ─── Widgets natifs — spinners number / date picker ─────── */
.panel-field input[type="number"]::-webkit-inner-spin-button,
.panel-field input[type="number"]::-webkit-outer-spin-button,
.fp-field input[type="number"]::-webkit-inner-spin-button,
.fp-field input[type="number"]::-webkit-outer-spin-button,
.pnl-info-val-edit input[type="number"]::-webkit-inner-spin-button,
.pnl-info-val-edit input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.panel-field input[type="number"],
.fp-field input[type="number"],
.pnl-info-val-edit input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.panel-field input[type="date"]::-webkit-calendar-picker-indicator,
.fp-field input[type="date"]::-webkit-calendar-picker-indicator,
.pnl-info-val-edit input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}
[data-theme="light"]
  .panel-field
  input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"]
  .fp-field
  input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"]
  .pnl-info-val-edit
  input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.35);
}

@media (max-width: 860px) {
  .fp-topbar {
    margin: 0.5rem 0 1rem;
  }
  .fp-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .fp-col-left,
  .fp-col-right {
    display: contents;
  }
  .fp-topbar {
    order: 1;
    width: 100%;
  }
  .fp-cover-wrap {
    order: 2;
    margin-top: 0;
  }
  .fp-title-area {
    order: 3;
    align-items: center;
    text-align: center;
  }
  .fp-title-row {
    justify-content: center;
  }
  .fp-status-block {
    order: 3;
    justify-content: center;
  }
  .fp-tags-field {
    order: 4;
  }
  .fp-section-genres {
    order: 5;
  }
  .fp-section-tags {
    order: 5;
  }
  .fp-section-desc {
    order: 6;
  }
  .fp-info-box {
    order: 7;
  }
  .fp-anilist-block,
  .notes-block {
    order: 7;
  }
  .fp-section-newseason {
    order: 8;
  }
  .fp-avail-box {
    order: 9;
  }
  .fp-user-fields,
  .fp-edit-card {
    order: 10;
  }
  .fp-cover,
  .fp-cover-ph {
    width: 180px;
    height: 252px;
  }
  .fp-title {
    font-size: 1.8rem;
    text-align: center;
  }
}
@media (max-width: 500px) {
  .fp-container {
    padding: 0 1rem 2rem;
  }
}

/* ─── PAGE PARTAGE PUBLIC ────────────────────────────── */
.share-header {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.share-header h1 {
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  color: var(--text);
  margin: 0 0 0.4rem 0;
}
.share-header p {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.share-cta {
  text-align: center;
  padding: 2rem 1.5rem;
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.share-cta a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.share-cta a:hover {
  text-decoration: underline;
}

/* ─── DATABASE ADMIN — édition champs catalogue ──────── */
.db-admin-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.db-avail-config {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.db-avail-config input {
  flex: 1;
}
.db-avail-config select {
  width: auto;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .wl-toolbar {
    align-items: stretch;
  }
  .wl-title-display {
    max-width: 100%;
  }
  .wl-entry-count {
    align-self: flex-start;
  }
  .filter-tabs {
    width: 100%;
  }
  .wl-search-wrap {
    width: 100%;
  }
  .wl-search-input {
    flex: 1;
    width: auto;
  }
  .wl-search-input:focus {
    width: auto;
  }
  .toast-container {
    bottom: 1rem;
    right: 0.5rem;
    left: 0.5rem;
  }
  .toast {
    justify-content: center;
  }
  .ac-cover,
  .ac-cover-ph {
    width: 48px;
    height: 68px;
  }
  #wl-cards.wl-poster-grid,
  #share-cards.wl-poster-grid,
  #wl-suggestions .wl-poster-grid,
  #share-suggestions .wl-poster-grid,
  #cat-suggestions .wl-poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
  }
}
@media (max-width: 480px) {
  .wl-header {
    align-items: flex-start;
  }
  .modal-card {
    padding: 1.2rem;
  }
  .modal-row-2 {
    grid-template-columns: 1fr;
  }
  .panel-row {
    grid-template-columns: 1fr;
  }
  .share-popup,
  .wl-more-popup {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 70vh;
    overflow-y: auto;
  }
}

.share-score-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}
.share-score-toggle-row > span {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ─── FLOATING LABEL FIELDS (My Notes — édition, panel latéral) ─── */
.fl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.fl-group {
  position: relative;
  margin-bottom: 1.3rem;
}
.fl-group:last-child {
  margin-bottom: 0;
}
.fl-input,
.fl-textarea,
.fl-select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.55rem 0.1rem 0.5rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.fl-textarea {
  resize: vertical;
  min-height: 60px;
}
.fl-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.fl-input:focus,
.fl-textarea:focus,
.fl-select:focus {
  border-bottom-color: var(--accent);
}
.fl-label {
  position: absolute;
  left: 0.1rem;
  top: 0.55rem;
  color: var(--text-muted);
  font-family: sans-serif;
  font-size: 0.82rem;
  pointer-events: none;
  transition: 0.18s ease all;
}
.fl-group:not(.fl-static) .fl-input:focus + .fl-label,
.fl-group:not(.fl-static) .fl-input:not(:placeholder-shown) + .fl-label,
.fl-group:not(.fl-static) .fl-textarea:focus + .fl-label,
.fl-group:not(.fl-static) .fl-textarea:not(:placeholder-shown) + .fl-label,
.fl-group.fl-static .fl-label {
  top: -0.8rem;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fl-group:not(.fl-static) .fl-input:focus + .fl-label,
.fl-group:not(.fl-static) .fl-textarea:focus + .fl-label,
.fl-group.fl-static .fl-input:focus + .fl-label,
.fl-group.fl-static .fl-select:focus + .fl-label {
  color: var(--accent);
}

/* ─── BANNIÈRE WATCHLIST (fond personnalisable) ──────── */
.wl-banner {
  position: relative;
  height: 170px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}
.wl-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 15, 20, 0.1) 0%,
    rgba(15, 15, 20, 0.8) 100%
  );
  pointer-events: none;
}
[data-theme="light"] .wl-banner-overlay {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(15, 15, 20, 0.55) 100%
  );
}
.wl-banner-edit-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 1.5rem 0.9rem 0;
  padding: 0.42rem 0.85rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.2s;
}
.wl-banner-edit-btn:hover {
  background: rgba(0, 0, 0, 0.68);
}
@media (max-width: 768px) {
  .wl-banner {
    height: 120px;
  }
  .wl-banner-edit-btn span {
    display: none;
  }
}

/* ─── SÉLECTEUR DE FOND (modale création / édition watchlist) ─ */
.wl-cover-field .modal-hint {
  margin: 0 0 0.6rem 0;
}
.wl-cover-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.wl-cover-thumb {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  background: none;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.wl-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wl-cover-thumb:hover {
  transform: translateY(-1px);
}
.wl-cover-thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.wl-cover-custom-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.78rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}
[data-theme="light"] .wl-cover-custom-input {
  background: #f5f5f5;
  border-color: #ddd;
  color: #111;
}
.wl-cover-custom-input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

/* ─── ANIMÉS SIMILAIRES (fiche plein page) ───────────── */
.fp-similar-section {
  margin-top: 0.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .fp-similar-section {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.fp-similar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s;
}
.fp-similar-toggle:hover,
.fp-similar-toggle:hover .fp-similar-chevron {
  color: var(--accent);
}
.fp-similar-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition:
    transform 0.2s ease,
    color 0.2s;
}
.fp-similar-toggle.open .fp-similar-chevron {
  transform: rotate(90deg);
  color: var(--link);
}

.fp-similar-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
}

.fp-similar-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  scrollbar-width: none;
  min-width: 0;
  flex: 1;
}
.fp-similar-track::-webkit-scrollbar {
  display: none;
}

.fp-similar-card {
  flex-shrink: 0;
  width: 126px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  scroll-snap-align: start;
}
.fp-similar-cover {
  position: relative;
  width: 126px;
  height: 189px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
}
.fp-similar-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fp-similar-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fp-similar-badges {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.fp-similar-score {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  color: #fff;
}
.fp-similar-title {
  font-family: "Syne", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fp-similar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.fp-similar-nav:hover {
  background: rgba(255, 255, 255, 0.12);
}
[data-theme="light"] .fp-similar-nav {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
@media (max-width: 480px) {
  .fp-similar-nav {
    display: none;
  }
}

/* ── Ligne compacte d'info de partage (fiche animé partagé) ────── */
.share-info-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin: 0.4rem 0 1.1rem;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted, #aaa);
  position: relative;
  z-index: 10;
}
.share-info-avatar,
.share-info-avatar-ph {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.share-info-avatar-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
}
.share-info-dot {
  opacity: 0.4;
}
.share-info-review {
  font-style: italic;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.share-info-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.share-info-link:hover {
  text-decoration: underline;
}
@media (max-width: 480px) {
  .share-info-review {
    max-width: 140px;
  }
}

/* ── Exact & Similar Results ──────────────────────────────── */
.cat-results-section-header {
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text, #fff);
  padding: 0.5rem 0.2rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="light"] .cat-results-section-header {
  color: #333;
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
.cat-no-exact-msg {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
[data-theme="light"] .cat-no-exact-msg {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}
.suggestion-score-header {
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 1.5rem 0.2rem 0.5rem;
  padding-left: 0.2rem;
  font-weight: 500;
}
.suggestion-match-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}
.suggestion-match-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}
.anime-card .suggestion-match-icon {
  right: 40px; /* offset for the existing chevron */
  top: 50%;
  transform: translateY(-50%);
}
.suggestion-match-popup {
  position: absolute;
  top: 35px;
  right: 0;
  background: #1a1a1f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  width: max-content;
  max-width: 280px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  cursor: default;
}
[data-theme="light"] .suggestion-match-popup {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.anime-card .suggestion-match-popup {
  top: auto;
  bottom: 0;
  right: 70px;
}
.suggestion-match-title {
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.3rem;
}
[data-theme="light"] .suggestion-match-title {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
.suggestion-match-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}
.suggestion-match-row:last-child {
  margin-bottom: 0;
}
.suggestion-match-pass {
  color: #4caf50;
}
.suggestion-match-fail {
  color: #f44336;
  text-decoration: line-through;
  opacity: 0.7;
}
.suggestion-match-label {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Suggestions en vue grille : l'icône et la fenêtre de détail restent DANS la
   carte poster (elle a overflow: hidden, tout ce qui dépasse serait coupé). */
.anime-card.poster-card .suggestion-match-icon {
  top: 6px;
  right: 6px;
  transform: none;
}
.anime-card.poster-card .suggestion-match-popup {
  top: 30px;
  bottom: auto;
  right: 0;
  width: 104px;
  max-height: 100px;
  overflow-y: auto;
  padding: 0.4rem 0.5rem;
}
.poster-card .suggestion-match-title {
  display: none;
}
.poster-card .suggestion-match-label {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 768px) {
  .anime-card.poster-card .suggestion-match-popup {
    width: 78px;
  }
}

/* ─── BARRE DE PROGRESSION (vue plein page) ──────────── */
.fp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
}
.fp-progress-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
[data-theme="light"] .fp-progress-bar-track {
  background: rgba(0, 0, 0, 0.08);
}
.fp-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 0.3s ease;
}
.fp-progress-label {
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── MODALE AJOUT MULTI-WATCHLIST ────────────────────── */
.wp-create-row {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.wp-create-form {
  display: none;
  margin-top: 0.6rem;
}
.wp-create-form.open {
  display: block;
}
.wl-undo-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--link);
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  padding: 0;
  flex-shrink: 0;
}

/* ─── PARTAGE PUBLIC — filtre, bandeau, badge, action rapide (0.6.1) ── */
.wl-shared-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  margin-bottom: 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  font-family: "DM Mono", monospace;
  font-size: 0.76rem;
  color: var(--text);
}
.wl-shared-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.wl-shared-banner-actions button {
  white-space: nowrap;
}
.wl-shared-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
}
[data-theme="light"] .wl-shared-banner-btn {
  background: #f0f0f0;
  border-color: #ddd;
}
.wl-shared-banner-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}
.wl-shared-banner-btn.danger {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.35);
  color: #f44336;
}
.wl-shared-banner-btn.danger:hover {
  background: rgba(244, 67, 54, 0.2);
}
.modal-btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}
.modal-btn.danger:hover {
  background: linear-gradient(135deg, #f05252, #e53535);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.38);
}

.badge-share-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.badge-share-link svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.card-share-disable-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: var(--radius-sm);
  color: #f44336;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  padding: 0.22rem 0.4rem;
  cursor: pointer;
  transition: background 0.2s;
  overflow: hidden;
  flex-shrink: 0;
}
.card-share-disable-btn:hover {
  background: rgba(244, 67, 54, 0.2);
}
.card-share-disable-label {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  transition:
    max-width 0.25s ease,
    opacity 0.2s ease,
    margin-left 0.25s ease;
}
.card-share-disable-btn:hover .card-share-disable-label {
  max-width: 130px;
  opacity: 1;
  margin-left: 0.15rem;
}

/* ─── DATABASE ADMIN BAR ─────────────────────────── */
.db-admin-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.btn-admin-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  font-family: "Syne", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-action:hover {
  background: rgba(var(--accent-rgb), 0.2);
}

/* ═══════════════════════════════════════════════════
   MODALE D'AJOUT D'ANIMÉ — recherche unifiée (0.6.2)
═══════════════════════════════════════════════════ */
#modal-add [hidden] {
  display: none !important;
}
.modal-card.add-modal-card {
  max-width: 760px;
}

/* Search box */
.add-search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.85rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.add-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.add-search-box svg {
  flex-shrink: 0;
  color: var(--text-muted);
}
.add-search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 16px; /* >= 16px: prevents the iOS Safari zoom on focus */
  padding: 0.7rem 0;
}
.add-search-box input::placeholder {
  color: var(--text-muted);
}
.add-count {
  flex-shrink: 0;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Tabs */
.add-tabs {
  display: flex;
  gap: 0.3rem;
  margin: 0.9rem 0 0.7rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.add-tab {
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.add-tab:hover {
  color: var(--text);
}
.add-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.add-tab small {
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 8px;
  background: var(--bg-3);
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
}
.add-tab small:empty {
  display: none;
}

/* Type chips + view toggle */
.add-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.add-chips {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.add-chip {
  min-height: 32px;
  padding: 0.3rem 0.75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.add-chip:hover {
  color: var(--text);
}
.add-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

/* Results */
.add-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.7rem;
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding: 2px;
}
.add-results.is-list {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
.add-results > .search-hint {
  grid-column: 1 / -1;
}
.add-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.add-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}
.add-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
}
[data-theme="light"] .add-poster {
  background: linear-gradient(135deg, #e8e8f0, #d0d0e8);
}
.add-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.add-poster .adult-veil-wrap,
.add-preview-cover .adult-veil-wrap {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.add-card.is-in-list .add-poster {
  opacity: 0.55;
}
.add-src {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
}
.add-src.cat {
  background: rgba(76, 175, 80, 0.85);
}
.add-src.ani {
  background: rgba(201, 94, 209, 0.85);
}
.add-franchise-count {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
}
.add-info {
  display: block;
  padding: 0.5rem 0.6rem 0.6rem;
}
.add-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}
.add-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.64rem;
}
.add-in-list {
  margin-top: 0.35rem;
}
.add-possible-match {
  display: block;
  margin-top: 0.35rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text);
  font-size: 0.68rem;
  line-height: 1.4;
}
.add-results.is-list .add-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.add-results.is-list .add-poster {
  flex-shrink: 0;
  width: 48px;
}
.add-results.is-list .add-src {
  display: none;
}
.add-results.is-list .add-info {
  flex: 1;
  min-width: 0;
  padding: 0.3rem 0.5rem 0.3rem 0;
}
.add-results.is-list .add-title {
  -webkit-line-clamp: 1;
  line-clamp: 1;
  font-size: 0.85rem;
}

/* Load more + footer */
.add-more {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 0.8rem;
  padding: 0.7rem;
  background: none;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  color: var(--link);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.add-more:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.08);
}
.add-more:disabled {
  opacity: 0.6;
  cursor: default;
}
.add-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.add-foot-info {
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
}
.add-manual-btn {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.add-manual-btn:hover {
  border-color: var(--border-hover);
}

/* Preview (sheet shown before adding) */
.add-preview-back {
  min-height: 36px;
  margin-bottom: 0.9rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
  cursor: pointer;
  transition: color 0.2s;
}
.add-preview-back:hover {
  color: var(--text);
}
.add-preview-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.add-preview-cover {
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a24, #2a2a3e);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.add-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.add-preview-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}
.add-preview-title {
  margin: 0;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}
.add-preview-sub {
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.74rem;
}
.add-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.add-preview-desc-title {
  margin: 1rem 0 0.4rem;
  color: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.add-preview-desc {
  max-height: 200px;
  overflow-y: auto;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(var(--accent-rgb), 0.35);
  color: var(--text-muted);
  font-family: "Inter", sans-serif;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.add-preview-actions {
  align-items: stretch;
  margin-top: 1rem;
}
.add-preview-link {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--link);
  font-family: "Syne", sans-serif;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.add-preview-link:hover {
  border-color: var(--border-hover);
}

@media (max-width: 480px) {
  .add-results {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    max-height: 46vh;
  }
  .add-preview-body {
    flex-direction: column;
    align-items: center;
  }
  .add-preview-main {
    width: 100%;
  }
  .add-preview-actions {
    flex-direction: column;
  }
}



/* ─── PATCH 0.6.5 : fiche plein écran mobile ─────────────
   Force le passage en une seule colonne sur les petits écrans.
   Les nouvelles sections AniList ne doivent jamais élargir la fiche.
*/
@media screen and (max-width: 860px) {
  #fullpage-content,
  .wl-fullpage-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .wl-fullpage-content .fp-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .wl-fullpage-content .fp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
    gap: 1.25rem;
  }

  .wl-fullpage-content .fp-grid > *,
  .wl-fullpage-content .fp-col-left,
  .wl-fullpage-content .fp-col-right,
  .wl-fullpage-content .fp-title-area,
  .wl-fullpage-content .fp-title-row,
  .wl-fullpage-content .fp-section,
  .wl-fullpage-content .fp-info-box,
  .wl-fullpage-content .sheet-block,
  .wl-fullpage-content .sheet-info-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .wl-fullpage-content .fp-col-left,
  .wl-fullpage-content .fp-col-right {
    display: contents !important;
  }

  .wl-fullpage-content .fp-title,
  .wl-fullpage-content .fp-title-en,
  .wl-fullpage-content .sheet-rel-link,
  .wl-fullpage-content .sheet-char-name,
  .wl-fullpage-content .sheet-char-va {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .wl-fullpage-content .fp-title {
    font-size: clamp(1.45rem, 6vw, 1.8rem);
    text-align: center;
  }

  .wl-fullpage-content .fp-title-row {
    width: 100%;
    justify-content: center;
  }

  .wl-fullpage-content .fp-anilist-row,
  .wl-fullpage-content .fp-shared-by-line {
    flex-wrap: wrap;
    min-width: 0;
  }

  .wl-fullpage-content .sheet-chars {
    grid-template-columns: minmax(0, 1fr);
  }

  .wl-fullpage-content .fp-topbar {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 380px) {
  .wl-fullpage-content .fp-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .wl-fullpage-content .fp-back-btn {
    max-width: calc(100vw - 76px);
    min-width: 0;
  }
}
