/* ========================================
   VAULT — MÉDIATHÈQUE PERSONNELLE
   Aesthetic: Dark Cinematic / Brutalist
   ======================================== */
:root {
  --bg:        #0a0a0b;
  --bg2:       #111113;
  --bg3:       #1a1a1e;
  --border:    #222228;
  --accent:    #e8c840;
  --accent2:   #ff4d4d;
  --text:      #e8e8e4;
  --text-dim:  #666670;
  --text-mid:  #999aa8;
  --music:     #9b59b6;
  --movie:     #e74c3c;
  --series:    #2980b9;
  --game:      #27ae60;
  --makeup:    #e891a8;
  --radius:    6px;
  --sidebar-w: 220px;
  --font-title: 'Bebas Neue', sans-serif;
  --font-body:  'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── APP LAYOUT ── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 24px;
  flex-shrink: 0;
}
.sidebar-header .logo {
  padding: 0 0 32px;
}
.sidebar-close {
  display: none;
}
.logo {
  padding: 0 24px 32px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 22px; color: var(--accent); }
.logo-text {
  font-family: var(--font-title);
  font-size: 28px;
  letter-spacing: 6px;
  color: var(--text);
}

.nav-links { list-style: none; flex-shrink: 0; }
.nav-links li { }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-mid);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all .15s;
  position: relative;
}
.nav-item::before {
  content: none;
  display: none;
}
.nav-item-icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  font-family: var(--font-body);
}
.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active {
  color: var(--accent);
  background: rgba(232,200,64,.07);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}

.library-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 16px 0;
  padding: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.library-switch-btn {
  display: block;
  padding: 9px 12px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text-mid);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: center;
  transition: background .15s, color .15s;
}
.library-switch-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .04);
}
.library-switch-btn.is-active {
  background: rgba(232, 200, 64, .12);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 64, .18);
}

/* ── CLASSEMENT TOP 5 ── */
.ranking-list {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
}

.ranking-section {
  grid-column: 1 / -1;
  scroll-margin-top: calc(96px + env(safe-area-inset-top, 0px));
  margin-bottom: 22px;
}

.ranking-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-title);
  font-size: 22px;
  letter-spacing: 1.5px;
  font-weight: 400;
  color: var(--text);
}

.ranking-section-icon {
  color: var(--accent);
}

.ranking-section[data-type="music"] .ranking-section-icon { color: var(--music); }
.ranking-section[data-type="movie"] .ranking-section-icon { color: var(--movie); }
.ranking-section[data-type="series"] .ranking-section-icon { color: var(--series); }
.ranking-section[data-type="game"] .ranking-section-icon { color: var(--game); }
.ranking-section[data-type="makeup"] .ranking-section-icon { color: var(--makeup); }

.ranking-section-empty {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 13px;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.ranking-row:hover {
  border-color: rgba(232, 200, 64, .4);
  background: rgba(232, 200, 64, .06);
}

.ranking-pos {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(232, 200, 64, .14);
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 1px;
}

.ranking-row:nth-child(1) .ranking-pos { background: rgba(232, 200, 64, .28); }
.ranking-row:nth-child(2) .ranking-pos { background: rgba(200, 200, 210, .18); color: #d0d0d8; }
.ranking-row:nth-child(3) .ranking-pos { background: rgba(180, 120, 60, .22); color: #e0b080; }

.ranking-cover {
  flex-shrink: 0;
  width: 56px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.ranking-cover img,
.ranking-cover .media-cover-img,
.ranking-cover .card-cover-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ranking-body {
  min-width: 0;
  flex: 1;
}

.ranking-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 6px;
}

.ranking-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mid);
}

.ranking-avg {
  font-weight: 700;
  color: var(--accent);
}

.ranking-split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.ranking-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ranking-chip--user {
  background: rgba(232, 200, 64, 0.14);
  color: var(--accent);
  border: 1px solid rgba(232, 200, 64, 0.28);
}

.ranking-chip--public {
  background: rgba(41, 128, 185, 0.16);
  color: #7ec8e8;
  border: 1px solid rgba(90, 160, 255, 0.3);
}

.ranking-cta {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.btn-add {
  margin: 24px 20px 0;
  flex-shrink: 0;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 12px;
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: opacity .15s;
  display: block;
  text-align: center;
  text-decoration: none;
}
.btn-add:hover { opacity: .85; }

.sidebar-user {
  margin: 24px 16px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar-user-name {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.sidebar-user-role {
  display: block;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  margin-bottom: 8px;
}
.sidebar-user-link {
  display: block;
  color: var(--text-mid);
  text-decoration: none;
  padding: 6px 0;
  font-size: 13px;
}
.sidebar-user-link:hover { color: var(--accent); }

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.topbar form { display: flex; align-items: center; gap: 8px; }
#topbar .search-wrap { display: flex; align-items: center; gap: 8px; max-width: none; flex: 1; }
#topbar .search-wrap input { max-width: none; }
.topbar-control {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.topbar-control-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1;
}
.sort-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.type-pick {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-mid);
  text-decoration: none;
  font-size: 12px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .14s ease, box-shadow .18s ease;
}
.type-pick:hover { border-color: var(--accent); color: var(--text); }
.type-pick:active { transform: scale(0.97); }
.type-pick.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,200,64,.07);
  box-shadow: 0 0 0 1px rgba(232, 200, 64, .12);
}

.platform-picker-ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.platform-picker-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}
.platform-picker-empty {
  font-size: 13px;
  color: var(--text-dim);
}
.platform-picker-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 200, 64, .35);
  background: rgba(232, 200, 64, .12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.platform-picker-chip--other {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text-mid);
}
.platform-picker-families {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.platform-picker-family {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
  overflow: hidden;
}
.platform-picker-family.has-selection {
  border-color: rgba(232, 200, 64, .35);
}
.platform-picker-family-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.platform-picker-family-btn:hover,
.platform-picker-family.is-open > .platform-picker-family-btn {
  color: var(--accent);
}
.platform-picker-family-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.platform-picker-family-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.platform-picker-family-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(232, 200, 64, .18);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.platform-picker-family-count.hidden {
  display: none;
}
.platform-picker-chevron {
  font-size: 11px;
  opacity: .7;
  transition: transform .15s;
}
.platform-picker-family.is-open .platform-picker-chevron {
  transform: rotate(180deg);
}
.platform-picker-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}
.platform-picker-options.hidden {
  display: none;
}
.platform-pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  background: var(--bg2);
}
.platform-pick-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.platform-pick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.platform-pick:has(input:checked) {
  border-color: rgba(232, 200, 64, .45);
  color: var(--accent);
  background: rgba(232, 200, 64, .1);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 64, .16);
}
.platform-pick:active {
  transform: scale(0.98);
}
.platform-other-label {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px;
}
#f-platform-other {
  width: 100%;
}
.game-players-row {
  margin-top: 4px;
}
.game-players-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.game-players-option {
  margin: 0;
  cursor: pointer;
}
.game-players-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.game-players-option-text {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.game-players-option:hover .game-players-option-text {
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}
.game-players-option:has(input:checked) .game-players-option-text {
  border-color: rgba(232, 200, 64, .45);
  background: rgba(232, 200, 64, .12);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 64, .12);
}
.game-players-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Genre picker */
.form-row--year {
  margin-bottom: 14px;
}
.year-field {
  display: inline-flex;
  align-items: stretch;
  max-width: 168px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, 0) 100%), var(--bg3);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .15s, box-shadow .15s;
}
.year-field:focus-within {
  border-color: rgba(232, 200, 64, .45);
  box-shadow: 0 0 0 3px rgba(232, 200, 64, .08);
}
.year-step {
  flex: 0 0 40px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.year-step:hover {
  color: var(--accent);
  background: rgba(232, 200, 64, .08);
}
.year-input {
  width: 88px;
  min-width: 0;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 1px;
  text-align: center;
  padding: 10px 4px;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.year-input::-webkit-outer-spin-button,
.year-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.year-input::placeholder {
  color: var(--text-dim);
  opacity: .6;
}

/* Genre picker — consensus style */
.consensus-panel {
  margin-bottom: 16px;
  padding: 18px 18px 14px;
  border-radius: 14px;
  background: rgba(243, 243, 247, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.consensus-panel--genre {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.consensus-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.consensus-head-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fb923c 0%, #ef4444 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
  position: relative;
}
.consensus-head-icon::after {
  content: '';
  position: absolute;
  inset: 7px 8px 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
.consensus-head-text {
  min-width: 0;
  flex: 1;
}
.consensus-head-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 4px;
}
.consensus-head-value {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-mid);
}
.consensus-head-value.is-empty {
  color: var(--text-dim);
  font-size: 13px;
}

.genre-autocomplete {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}
.genre-chips:empty {
  display: none;
}
.genre-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 6px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}
.genre-chip--custom {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mid);
}
.genre-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.genre-chip-remove {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .12s, color .12s;
}
.genre-chip-remove:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.genre-combobox {
  position: relative;
}
.genre-search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.genre-search-input::placeholder {
  color: var(--text-dim);
}
.genre-search-input:focus {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}
.genre-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 220;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  padding: 4px 0;
}
.genre-suggestions.hidden {
  display: none !important;
}
.genre-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.genre-suggestion:hover,
.genre-suggestion.is-active {
  background: var(--bg3);
}
.genre-suggestion-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.genre-suggestion-mark {
  flex-shrink: 0;
  color: #34d399;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.genre-suggestion--create .genre-suggestion-label {
  color: var(--text-mid);
}
.genre-suggestion--create .genre-suggestion-label strong {
  color: var(--text);
  font-weight: 600;
}
.genre-suggestions-empty {
  padding: 12px 14px;
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.4;
}
.genre-autocomplete-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Where to find picker */
.consensus-panel--where {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.consensus-head-icon--where {
  background: linear-gradient(145deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.where-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.where-search-wrap {
  margin: 4px 0 10px;
}
.where-search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.where-search-input::placeholder {
  color: var(--text-dim);
}
.where-search-input:focus {
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.where-search-empty {
  margin: 10px 2px 0;
  font-size: 13px;
  color: var(--text-dim);
}
.where-search-empty.hidden,
.where-group.is-filtered-out,
.where-pick.is-filtered-out {
  display: none;
}
.where-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.where-group:last-of-type {
  border-bottom: none;
}
.where-group[open] {
  border-bottom-color: transparent;
}
.where-group-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}
.where-group-toggle::-webkit-details-marker,
.where-group-toggle::marker {
  display: none;
  content: '';
}
.where-toggle-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .22s ease, background .22s ease;
  box-shadow: 0 1px 4px rgba(96, 165, 250, 0.35);
}
.where-toggle-icon-plus {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.where-group[open] .where-toggle-icon {
  transform: rotate(45deg);
  background: #3b82f6;
}
.where-group-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.where-group-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 58%;
}
.where-group-badge {
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.28);
}
.where-group-panel {
  padding: 2px 0 10px 34px;
}
.where-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px 16px;
}
.where-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
}
.where-pick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.where-pick-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: #60a5fa;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.where-pick:has(input:checked) {
  color: var(--text);
}
.where-pick:has(input:checked) .where-pick-icon {
  background: #2563eb;
}
.where-pick:has(input:checked) .where-pick-text {
  font-weight: 600;
}
.where-footer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.where-other-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
}
.where-footer input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13px;
}
.where-footer input[type="text"]:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.45);
}
.where-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-where {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
  color: #93c5fd;
}

.platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag-platform {
  background: rgba(39,174,96,.12);
  border-color: rgba(39,174,96,.25);
  color: #86efac;
}
.form-type-readonly { color: var(--text); padding: 8px 0; }
.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--accent2);
  background: rgba(255,77,77,.08);
  border: 1px solid rgba(255,77,77,.25);
}
.delete-confirm-text { color: var(--text-mid); margin: 16px 0 24px; }

a.btn-edit,
a.btn-danger {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}
a.modal-overlay,
a.modal-close {
  text-decoration: none;
}

/* ── MAIN ── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.flash-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 3000;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(440px, calc(100vw - 32px));
  padding: 16px 18px 18px;
  background: linear-gradient(145deg, rgba(26, 26, 30, .97) 0%, rgba(14, 14, 16, .98) 100%);
  border: 1px solid rgba(232, 200, 64, .28);
  border-radius: 12px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .04) inset,
    0 0 24px rgba(232, 200, 64, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateX(-50%);
  animation: toast-in .4s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}
.flash-toast--out {
  animation: toast-out .28s ease forwards;
}
.flash-toast-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  background: rgba(39, 174, 96, .18);
  border: 1px solid rgba(110, 231, 160, .45);
  color: #6ee7a0;
  box-shadow: 0 0 16px rgba(39, 174, 96, .2);
}
.flash-toast--error {
  border-color: rgba(231, 76, 60, .35);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .04) inset,
    0 0 24px rgba(231, 76, 60, .1);
}
.flash-toast--error .flash-toast-icon {
  background: rgba(231, 76, 60, .18);
  border-color: rgba(248, 113, 113, .5);
  color: #f87171;
  box-shadow: 0 0 16px rgba(231, 76, 60, .2);
}
.flash-toast--error .flash-toast-title {
  color: #f87171;
}
.flash-toast--error .flash-toast-progress {
  background: linear-gradient(90deg, rgba(248, 113, 113, .15), #f87171);
}
.flash-toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.flash-toast-title {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.1;
}
.flash-toast-message {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-mid);
}
.flash-toast-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin: -2px -2px 0 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.flash-toast-close:hover {
  color: var(--text);
  border-color: rgba(232, 200, 64, .4);
  background: rgba(232, 200, 64, .08);
}
.flash-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), #6ee7a0);
  border-radius: 0 0 12px 12px;
  animation: toast-progress 5.2s linear forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-16px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(.96);
  }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

#topbar {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: flex-end;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 80;
  overflow: visible;
}

.members-directory {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.members-directory-label {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.members-directory-list {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.members-directory-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.members-directory-btn:hover {
  border-color: rgba(155, 89, 182, 0.45);
  color: #d8b4fe;
}
.members-directory-btn.is-active {
  border-color: rgba(155, 89, 182, 0.65);
  background: rgba(155, 89, 182, 0.16);
  color: #f0e6ff;
  font-weight: 500;
}
.members-directory-count {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.members-directory-btn.is-active .members-directory-count {
  color: #d8b4fe;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 480px;
  position: relative;
  z-index: 1;
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  z-index: 3;
}
.search-field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 15px;
  pointer-events: none;
  line-height: 1;
}
.search-wrap input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 40px 10px 36px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.search-wrap input[type="search"]::-webkit-search-cancel-button,
.search-wrap input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mid);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.search-clear:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #111113;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 5000;
  box-shadow: 0 16px 40px rgba(0,0,0,.65);
  padding: 4px 0;
  cursor: default;
  pointer-events: auto;
}
.search-dropdown.hidden {
  display: none !important;
  pointer-events: none !important;
}
.search-dropdown-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.4;
  margin: 0;
}
.search-suggestion-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.search-suggestion-row:last-child { border-bottom: none; }
.search-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  padding-right: 72px;
}
.search-suggestion-add {
  flex-shrink: 0;
  align-self: center;
  margin-right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.search-suggestion-add:hover,
.search-suggestion-add:focus {
  background: var(--accent);
  color: #fff;
}
.search-suggestion:hover,
.search-suggestion:focus {
  background: var(--bg3);
}
.search-suggestion-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.search-suggestion-sub {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.search-suggestion-type {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
}
.search-suggestion:hover .search-suggestion-type,
.search-suggestion:focus .search-suggestion-type {
  color: var(--accent);
  border-color: var(--accent);
}
.search-suggestion-owned {
  color: var(--text-mid);
  border-color: var(--border);
  background: var(--bg);
}
#sort,
#theme-filter {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 180px;
}
#sort {
  min-width: min(260px, 70vw);
}

.topbar-control--platform {
  flex: 1 1 180px;
  min-width: min(220px, 42vw);
}
.platform-filter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.topbar-control--platform .platform-filter {
  min-width: 0;
  width: 100%;
}
.platform-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.platform-filter-chips:empty {
  display: none;
}
.platform-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 200, 64, 0.35);
  background: rgba(232, 200, 64, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.platform-filter-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.platform-filter-chip-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.platform-filter-chip-remove:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.platform-filter-combobox {
  position: relative;
}
.platform-filter-search {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.platform-filter-search::placeholder {
  color: var(--text-dim);
}
.platform-filter-search:focus {
  border-color: var(--accent);
}
.platform-filter-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 230;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  padding: 4px 0;
}
.platform-filter-suggestions.hidden {
  display: none !important;
}
.platform-filter-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.platform-filter-suggestion:hover,
.platform-filter-suggestion.is-active {
  background: var(--bg3);
}
.platform-filter-suggestion-mark {
  color: var(--accent);
  font-weight: 700;
}
.platform-filter-suggestions-empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-mid);
}

/* ── GRID ── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
  padding: 28px;
}

.library-status-heading {
  grid-column: 1 / -1;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 12px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.library-status-heading:first-child {
  margin-top: 0;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(232,200,64,.12);
}

.card-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg3);
  position: relative;
  overflow: hidden;
}
.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.card:hover .card-cover img { transform: scale(1.04); }

.card-context-menu {
  position: fixed;
  z-index: 500;
  min-width: 168px;
  padding: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.card-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.card-context-item[hidden] {
  display: none !important;
}
.card-context-item:hover,
.card-context-item:focus-visible {
  background: rgba(255, 255, 255, .06);
  outline: none;
}
.card-context-item--danger {
  color: #ff8a8a;
}
.card-context-item--danger:hover,
.card-context-item--danger:focus-visible {
  background: rgba(255, 77, 77, .1);
  color: #ffb4b4;
}

.btn-bulk-select {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-bulk-select:hover,
.btn-bulk-select[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

body.bulk-select-mode .card[data-selectable] {
  cursor: pointer;
}
body.bulk-select-mode .card[data-selectable]:hover {
  border-color: rgba(155, 89, 182, .55);
}
body.bulk-select-mode .card[data-selectable].is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 200, 64, .25);
}
body.bulk-select-mode .card[data-selectable].is-selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  z-index: 2;
  pointer-events: none;
}

.bulk-select-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.bulk-select-count {
  font-size: 13px;
  font-weight: 600;
  padding-right: 6px;
  white-space: nowrap;
}
.bulk-select-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.bulk-select-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.bulk-select-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.bulk-select-btn--danger {
  border-color: rgba(255, 77, 77, .45);
  color: #ff8a8a;
}
.bulk-select-btn--danger:hover:not(:disabled) {
  background: rgba(255, 77, 77, .12);
  border-color: #ff8a8a;
  color: #ffb4b4;
}
.bulk-select-btn--ghost {
  color: var(--text-dim);
}

.card-cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--border);
}

.card-cover .media-cover-img[hidden],
.detail-cover .media-cover-img[hidden] {
  display: none;
}

.card-cover-placeholder[hidden] {
  display: none !important;
}

.card-type-badge {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-music  { background: var(--music); color: #fff; }
.badge-movie  { background: var(--movie); color: #fff; }
.badge-series { background: var(--series); color: #fff; }
.badge-game   { background: var(--game); color: #fff; }
.badge-makeup { background: var(--makeup); color: #1a1014; }

.makeup-swatches {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}
.makeup-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.makeup-palette-picker .form-label-like,
.makeup-device-options + .makeup-device-other,
.form-label-like {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 8px;
}
.makeup-color-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.makeup-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.makeup-color-input {
  flex: 1;
  min-width: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.makeup-color-input:focus {
  border-color: var(--makeup, var(--accent));
}
.makeup-color-remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text-mid);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.makeup-color-remove:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, .45);
}
.makeup-color-remove[hidden] {
  display: none !important;
}
.makeup-color-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px dashed rgba(232, 145, 168, .45);
  border-radius: var(--radius);
  background: rgba(232, 145, 168, .08);
  color: var(--makeup, #e891a8);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.makeup-color-add:hover {
  background: rgba(232, 145, 168, .14);
}
.makeup-palette-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.makeup-device-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.makeup-device-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.makeup-device-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.makeup-device-box {
  width: 14px;
  height: 14px;
  border: 1px solid var(--text-dim);
  border-radius: 3px;
  background: transparent;
  flex-shrink: 0;
}
.makeup-device-option input:checked + .makeup-device-box {
  background: var(--makeup);
  border-color: var(--makeup);
  box-shadow: inset 0 0 0 2px var(--bg2);
}
.makeup-device-option:has(input:checked) {
  border-color: var(--makeup);
}
.makeup-device-other {
  width: 100%;
  margin-top: 4px;
}
.makeup-link {
  color: var(--makeup);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.makeup-info-grid {
  margin-bottom: 12px;
}

.card-owner {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.2px;
  margin: 2px 0 4px;
  opacity: 0.9;
}

.card-collection-hints {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card-collection-hint {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  backdrop-filter: blur(4px);
}
.card-collection-hint--owned {
  background: rgba(232, 200, 64, .88);
  color: #1a1a1e;
}
.card-collection-hint--want {
  background: rgba(232, 145, 168, .9);
  color: #1a1a1e;
}
.card-collection-hint--played {
  background: rgba(39, 174, 96, .88);
  color: #fff;
}
.card-collection-hint--progress {
  background: rgba(41, 128, 185, .88);
  color: #fff;
}

.lgbt-flag {
  display: inline-block;
  width: 28px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.2);
  background: linear-gradient(
    to bottom,
    #E40303 0% 16.66%,
    #FF8C00 16.66% 33.33%,
    #FFED00 33.33% 50%,
    #008026 50% 66.66%,
    #24408E 66.66% 83.33%,
    #732982 83.33% 100%
  );
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.lgbt-flag--btn {
  width: 32px;
  height: 20px;
}
.card-lgbt-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 4px;
  background: rgba(0,0,0,.45);
  line-height: 0;
}
/* Le badge type et le drapeau LGBT ne doivent plus se superposer. */
.card-cover:has(.card-lgbt-badge) .card-type-badge {
  top: 34px;
}
.lgbt-flag--card {
  display: block;
  width: 22px;
  height: 14px;
  flex-shrink: 0;
}
.lgbt-flag--detail {
  width: 26px;
  height: 16px;
  vertical-align: middle;
}
.lgbt-toggle-row {
  margin-top: 4px;
}
.movie-format-picker {
  margin-top: 4px;
}
.movie-format-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.movie-format-option {
  margin: 0;
  cursor: pointer;
}
.movie-format-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.movie-format-option-text {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.movie-format-option:hover .movie-format-option-text {
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}
.movie-format-option:has(input:checked) .movie-format-option-text {
  border-color: rgba(90, 160, 255, .55);
  background: rgba(90, 160, 255, .12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(90, 160, 255, .12);
}
.age-rating-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-mid);
}
.card-age-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}
.card-cover:has(.card-format-badge) .card-age-badge {
  top: 34px;
}
.movie-format-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  position: relative;
  z-index: 0;
}
.movie-format-chip {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.movie-format-chip:hover {
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}
.movie-format-chip.is-active {
  border-color: rgba(90, 160, 255, .55);
  background: rgba(90, 160, 255, .14);
  color: var(--text);
}
#game-ownership-filter {
  margin-bottom: 8px;
}
.game-platform-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.platform-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.platform-brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
.platform-brand-mark--pc { color: #8ab4ff; }
.platform-brand-mark--playstation { color: #3d8bff; }
.platform-brand-mark--xbox { color: #3ddc84; }
.platform-brand-mark--nintendo { color: #ff5a5a; }
.platform-brand-mark--mobile { color: #c4a0ff; }
.platform-brand-mark--digital { color: #66c0f4; }
.card-platform-brands {
  position: absolute;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
  bottom: 8px;
}
.card-cover:has(.card-collection-hints) .card-platform-brands {
  bottom: 36px;
}
.card-platform-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(8, 8, 10, .78);
}
.card-platform-brand .platform-brand-mark {
  width: 14px;
  height: 14px;
}
.platform-picker-family-btn .platform-brand-mark {
  width: 18px;
  height: 18px;
}
.card-format-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  max-width: calc(50% - 8px);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  pointer-events: none;
}
.lgbt-toggle {
  display: block;
  cursor: pointer;
  margin: 0;
}
.lgbt-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.lgbt-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text-mid);
  transition: border-color .15s, background .15s, box-shadow .15s, color .15s;
}
.lgbt-toggle:hover .lgbt-toggle-btn {
  border-color: rgba(255,255,255,.14);
}
.lgbt-toggle.is-on .lgbt-toggle-btn,
.lgbt-toggle:has(input:checked) .lgbt-toggle-btn {
  border-color: rgba(255, 140, 0, .55);
  background: linear-gradient(135deg, rgba(228,3,3,.12), rgba(115,41,130,.16));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,237,0,.12);
}
.lgbt-toggle-text {
  font-size: 13px;
  font-weight: 600;
}
.lgbt-toggle-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}
.lgbt-detail-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-info {
  padding: 12px;
}
.card-title {
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  color: var(--text-mid);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-stars {
  margin-top: 8px;
  font-size: 13px;
}
.star.full  { color: var(--accent); }
.star.empty { color: var(--border); }
.star.half {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--accent) 50%, var(--border) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.empty-state {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  padding: 48px 20px 64px;
}
.empty-state-card {
  width: min(420px, 100%);
  padding: 32px 28px 28px;
  text-align: center;
  background: linear-gradient(160deg, rgba(26, 26, 30, .95) 0%, rgba(14, 14, 16, .98) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .04);
}
.empty-state-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232, 200, 64, .08);
  border: 1px solid rgba(232, 200, 64, .22);
  box-shadow: 0 0 24px rgba(232, 200, 64, .06);
}
.empty-state .empty-icon {
  font-size: 32px;
  line-height: 1;
  color: var(--accent);
  opacity: 1;
  display: block;
  margin: 0;
}
.empty-state-title {
  font-family: var(--font-title);
  font-size: 26px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.1;
}
.empty-state-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mid);
  margin: 0 auto 20px;
  max-width: 320px;
}
.empty-state-desc--err {
  color: #f97316;
  max-width: 100%;
}
.empty-state-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}
.empty-state-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s, color .15s;
}
a.empty-btn,
a.empty-btn:visited {
  text-decoration: none;
}
.empty-btn--primary {
  background: var(--accent);
  color: #0a0a0b;
  border: 1px solid var(--accent);
}
.empty-btn--primary:hover {
  background: #f0d050;
  border-color: #f0d050;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 200, 64, .25);
}
.empty-btn--ghost {
  background: rgba(255, 255, 255, .03);
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.empty-btn--ghost:hover {
  color: var(--accent);
  border-color: rgba(232, 200, 64, .4);
  background: rgba(232, 200, 64, .06);
  transform: translateY(-1px);
}

/* legacy — autres pages */
.empty-hint { font-size: 13px; color: var(--text-mid); max-width: 420px; margin: 0 auto 12px; line-height: 1.5; }
.empty-hint--err { color: #f97316; }
.empty-hint code { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); }
.btn-load-seed {
  display: inline-block;
  margin: 12px 0;
  padding: 12px 20px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 1px;
  text-decoration: none;
  border-radius: var(--radius);
  transition: opacity .15s;
}
.btn-load-seed:hover { opacity: .85; }
.btn-load-seed--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ── CHARGEMENT NAVIGATION (clic carte) ── */
.page-nav-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 11, .55);
  pointer-events: none;
  cursor: auto;
}

.page-nav-loading.hidden {
  display: none;
}

.page-nav-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(232, 200, 64, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: page-nav-spin .7s linear infinite;
}

@keyframes page-nav-spin {
  to { transform: rotate(360deg); }
}

/* ── MODALS ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

/* ── DETAIL MODAL ── */
.detail-box {
  width: min(760px, 96vw);
}

.detail-hero {
  display: flex;
  gap: 28px;
  padding: 28px;
}

.detail-cover {
  flex-shrink: 0;
  width: 180px;
  position: relative;
}
.detail-lgbt-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  padding: 4px;
  border-radius: 5px;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.detail-cover-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease;
}

.detail-cover-zoom:hover {
  transform: scale(1.02);
}

.detail-cover-zoom:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.detail-cover img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: none;
}

.cover-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.cover-lightbox.hidden {
  display: none;
}

.cover-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.cover-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 960px);
  max-height: 90vh;
  max-height: 90dvh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .65);
  object-fit: contain;
}

.cover-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}

.cover-lightbox-close:hover {
  background: rgba(0, 0, 0, .75);
}
.detail-cover-placeholder,
.detail-cover-zoom .card-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg3);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

.detail-meta { flex: 1; }
.detail-type { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.detail-catalogue-owner {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(41, 128, 185, .12);
  border: 1px solid rgba(41, 128, 185, .28);
  color: #7ec8e8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.detail-catalogue-editor {
  display: inline-block;
  margin: 0 0 8px 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(232, 200, 64, .1);
  border: 1px solid rgba(232, 200, 64, .28);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.detail-opinions-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
}

.detail-opinions-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.detail-opinion--featured {
  padding-bottom: 0;
}

.detail-opinion-header,
.detail-opinion-secondary-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 8px;
}

.detail-opinion-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.detail-opinion-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.detail-opinion-badges .community-role {
  margin-left: 0;
}

.detail-opinion-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 8px;
}

.detail-opinion-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-opinion-rating--inline {
  margin-left: auto;
}

.detail-opinion-rating .stars {
  font-size: 16px;
}

.detail-opinion-rating-num {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--accent);
  line-height: 1;
}

.detail-opinion-collection .community-collection {
  margin: 0;
}

.detail-opinion-collection--inline .community-collection {
  margin: 0 0 4px;
}

.detail-opinion-review {
  margin: 0;
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.55;
  font-style: italic;
}

.detail-opinion-review--short {
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-opinion--featured.detail-opinion--admin {
  border-left: 3px solid rgba(232, 200, 64, .55);
  padding-left: 12px;
}

.detail-opinion--featured.detail-opinion--self {
  border-left: 3px solid rgba(155, 89, 182, .55);
  padding-left: 12px;
}

.detail-opinion--featured.detail-opinion--proposer {
  border-left: 3px solid rgba(59, 130, 246, .55);
  padding-left: 12px;
}

.detail-opinions-others {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-opinion--secondary {
  padding: 10px 12px;
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg3);
  border: 1px solid rgba(255, 255, 255, .04);
}

.detail-opinion-secondary-top {
  margin-bottom: 4px;
}

.community-role--self {
  background: rgba(155, 89, 182, .18);
  color: #d8b4fe;
}

.community-role--proposer {
  background: rgba(59, 130, 246, .18);
  color: #93c5fd;
}
.community-role--editor {
  background: rgba(232, 200, 64, .14);
  color: #e8c840;
}

.detail-title {
  font-family: var(--font-title);
  font-size: 36px;
  letter-spacing: 2px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.detail-sub { color: var(--text-mid); font-size: 13px; margin-bottom: 16px; }
.detail-tag-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.detail-tag-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-tag-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0; }
.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-mid);
}
.tag--genre {
  border-color: rgba(155, 89, 182, .35);
  background: rgba(155, 89, 182, .12);
  color: #c9a0e0;
}
.tag--year {
  border-color: rgba(232, 200, 64, .28);
  background: rgba(232, 200, 64, .08);
  color: #e8c840;
}
.tag--theme {
  border-color: rgba(39, 174, 96, .32);
  background: rgba(39, 174, 96, .1);
  color: #86efac;
}
.detail-collection-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.detail-collection-block {
  margin-bottom: 14px;
}
.detail-collection-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.collection-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.collection-badge--played {
  background: rgba(39, 174, 96, .12);
  border: 1px solid rgba(39, 174, 96, .35);
  color: #86efac;
}
.collection-badge--want {
  background: rgba(232, 145, 168, .12);
  border: 1px solid rgba(232, 145, 168, .4);
  color: #f0b6c6;
}
.collection-badge--owned {
  background: rgba(232, 200, 64, .1);
  border: 1px solid rgba(232, 200, 64, .28);
  color: var(--accent);
}
.collection-badge--progress {
  background: rgba(41, 128, 185, .12);
  border: 1px solid rgba(41, 128, 185, .35);
  color: #7ec8e8;
}
.collection-field {
  margin-bottom: 16px;
}
.collection-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.collection-field--game {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.collection-block {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.collection-block-label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.collection-block-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.collection-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin: 0;
}
.collection-toggle:hover {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .03);
}
.collection-toggle--played:has(input:checked) {
  border-color: rgba(39, 174, 96, .4);
  background: rgba(39, 174, 96, .08);
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, .12);
}
.collection-toggle--want:has(input:checked) {
  border-color: rgba(232, 145, 168, .45);
  background: rgba(232, 145, 168, .1);
  box-shadow: inset 0 0 0 1px rgba(232, 145, 168, .14);
}
.collection-toggle--owned:has(input:checked) {
  border-color: rgba(232, 200, 64, .4);
  background: rgba(232, 200, 64, .08);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 64, .1);
}
.collection-toggle--progress:has(input:checked) {
  border-color: rgba(41, 128, 185, .45);
  background: rgba(41, 128, 185, .08);
  box-shadow: inset 0 0 0 1px rgba(41, 128, 185, .12);
}
.collection-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.collection-toggle-box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg2);
  position: relative;
  transition: border-color .15s, background .15s;
}
.collection-toggle--played:has(input:checked) .collection-toggle-box {
  border-color: rgba(39, 174, 96, .55);
  background: rgba(39, 174, 96, .18);
}
.collection-toggle--want:has(input:checked) .collection-toggle-box {
  border-color: rgba(232, 145, 168, .55);
  background: rgba(232, 145, 168, .18);
}
.collection-toggle--owned:has(input:checked) .collection-toggle-box {
  border-color: rgba(232, 200, 64, .55);
  background: rgba(232, 200, 64, .18);
}
.collection-toggle--progress:has(input:checked) .collection-toggle-box {
  border-color: rgba(41, 128, 185, .55);
  background: rgba(41, 128, 185, .18);
}
.collection-toggle:has(input:checked) .collection-toggle-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid transparent;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.collection-toggle--played:has(input:checked) .collection-toggle-box::after {
  border-color: #86efac;
}
.collection-toggle--want:has(input:checked) .collection-toggle-box::after {
  border-color: #f0b6c6;
}
.collection-toggle--owned:has(input:checked) .collection-toggle-box::after {
  border-color: var(--accent);
}
.collection-toggle--progress:has(input:checked) .collection-toggle-box::after {
  border-color: #7ec8e8;
}
.collection-toggle-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-mid);
  line-height: 1.25;
}
.collection-toggle--played:has(input:checked) .collection-toggle-label {
  color: #b8f0d0;
}
.collection-toggle--want:has(input:checked) .collection-toggle-label {
  color: #f0b6c6;
}
.collection-toggle--owned:has(input:checked) .collection-toggle-label {
  color: var(--text);
}
.collection-toggle--progress:has(input:checked) .collection-toggle-label {
  color: #b8e0f5;
}
.music-owns-format {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(232, 200, 64, .22);
  background: rgba(232, 200, 64, .05);
}
.music-owns-format.hidden {
  display: none;
}
.music-owns-format-label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.music-owns-format-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.music-owns-format-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  user-select: none;
}
.music-owns-format-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.music-owns-format-box {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg2);
  position: relative;
}
.music-owns-format-option:has(input:checked) {
  border-color: rgba(232, 200, 64, .45);
  background: rgba(232, 200, 64, .1);
}
.music-owns-format-option:has(input:checked) .music-owns-format-box {
  border-color: rgba(232, 200, 64, .55);
  background: rgba(232, 200, 64, .18);
}
.music-owns-format-option:has(input:checked) .music-owns-format-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.music-owns-format-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
}
.music-owns-format-option:has(input:checked) .music-owns-format-text {
  color: var(--text);
}
.detail-ratings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 14px;
  width: 100%;
}
.detail-rating-card {
  background: linear-gradient(135deg, rgba(26, 26, 30, .9) 0%, rgba(17, 17, 19, .95) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-rating-card--world {
  border-left: 3px solid rgba(41, 128, 185, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.detail-rating-card--personal {
  border-left: 3px solid var(--accent);
  box-shadow: inset 0 1px 0 rgba(232, 200, 64, .06);
}
.detail-rating-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-rating-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.detail-rating-card--personal .detail-rating-label--personal {
  text-transform: none;
  letter-spacing: 0.2px;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-mid);
}
.detail-rating-value {
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-rating-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}
.detail-rating-label--world {
  text-transform: none;
  letter-spacing: 0.2px;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-mid);
}
.detail-rating-source {
  margin-top: 2px;
}
a.rating-source-btn,
a.rating-source-btn:visited {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(41, 128, 185, .14) 0%, rgba(41, 128, 185, .06) 100%);
  border: 1px solid rgba(126, 200, 240, .28);
  color: #9ed4f5;
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
a.rating-source-btn:hover,
a.rating-source-btn:focus-visible {
  background: linear-gradient(135deg, rgba(41, 128, 185, .24) 0%, rgba(41, 128, 185, .12) 100%);
  border-color: rgba(126, 200, 240, .5);
  box-shadow: 0 0 20px rgba(41, 128, 185, .18);
  transform: translateY(-1px);
  color: #c8ebff;
  outline: none;
}
.rating-source-btn--static {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(41, 128, 185, .08);
  border: 1px solid rgba(126, 200, 240, .2);
  color: #9ed4f5;
}
.rating-source-btn-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(41, 128, 185, .2);
  border: 1px solid rgba(126, 200, 240, .35);
  color: #7ec8f0;
}
.rating-source-btn-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rating-source-btn-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(158, 212, 245, .65);
}
.rating-source-btn-name {
  font-size: 13px;
  font-weight: 600;
  color: #c8ebff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rating-source-btn-arrow {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(126, 200, 240, .2);
  color: rgba(200, 235, 255, .85);
  transition: background .15s, border-color .15s;
}
a.rating-source-btn:hover .rating-source-btn-arrow {
  background: rgba(126, 200, 240, .15);
  border-color: rgba(126, 200, 240, .4);
}
.detail-rating-card .stars {
  font-size: 18px;
  letter-spacing: 1px;
}
.detail-rating-card .stars--world .star.full {
  color: #7ec8f0;
}
.detail-rating-card .stars--world .star.half {
  background: linear-gradient(90deg, #7ec8f0 50%, var(--border) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.detail-rating-card .stars--world .star.empty {
  color: var(--border);
}
.detail-rating-card .rating-num {
  font-family: var(--font-title);
  font-size: 32px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 1px;
}
.detail-rating-card .rating-num--world {
  color: #7ec8f0;
}

.card-stars--world { opacity: 0.75; }
.card-stars--world .star.half {
  background: linear-gradient(90deg, #7ec8f0 50%, var(--border) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.community-rating-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.community-rating-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent);
}
.community-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.community-rating-num {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--accent);
}

.detail-body {
  padding: 0 28px 28px;
}
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Store panel (jeux) */
.store-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(22, 22, 26, .92) 0%, rgba(14, 14, 16, .98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}
.store-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
}
.detail-reviews {
  margin-bottom: 8px;
}
.detail-reviews .detail-section:first-child {
  margin-top: 0;
}
.internet-review-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.internet-review-rating .stars {
  font-size: 16px;
}
.internet-review-rating .rating-num {
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1;
  color: #7ec8f0;
}
.review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.review-links .rating-source-btn {
  flex: 1 1 100%;
  max-width: 100%;
}
.meta-link,
.jvc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  text-decoration: none;
  transition: opacity .15s;
}
.meta-link {
  color: #facc15;
}
.jvc-link {
  color: #4ade80;
}
.meta-link:hover,
.jvc-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}
.meta-link-icon,
.jvc-link-icon {
  font-size: 14px;
  line-height: 1;
}
.store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .12s;
}
.store-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.store-btn-badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
}
.store-btn-badge--ps {
  color: #ddd6fe;
  background: rgba(139, 92, 246, .18);
  border: 1px solid rgba(167, 139, 250, .35);
}
.store-btn-badge--steam {
  color: #bfdbfe;
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(96, 165, 250, .35);
}
.store-btn-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.store-btn-arrow {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-dim);
  transition: color .15s, transform .15s;
}
.store-btn--ps:hover {
  border-color: rgba(167, 139, 250, .45);
  background: rgba(167, 139, 250, .08);
}
.store-btn--ps:hover .store-btn-arrow {
  color: #c4b5fd;
  transform: translate(1px, -1px);
}
.store-btn--steam:hover {
  border-color: rgba(96, 165, 250, .45);
  background: rgba(96, 165, 250, .08);
}
.store-btn--steam:hover .store-btn-arrow {
  color: #93c5fd;
  transform: translate(1px, -1px);
}
.store-btn--compact {
  align-self: flex-start;
  margin-top: 2px;
}
.store-steam {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 14px;
  background: rgba(0, 0, 0, .12);
}
.store-steam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.store-steam-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.store-steam-hint {
  font-size: 11px;
  color: var(--text-dim);
  opacity: .75;
}
.store-steam-body {
  min-height: 44px;
}

.synopsis-text { color: var(--text-mid); line-height: 1.7; }
.review-text { color: var(--text); font-style: italic; line-height: 1.7; }

/* Steam prices */
.steam-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
}
.steam-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  animation: steamPulse 1.1s ease-in-out infinite;
}
@keyframes steamPulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1); }
}
.steam-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px dashed rgba(255, 255, 255, .08);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
}
.steam-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.steam-result-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.steam-game-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  line-height: 1.35;
}
.steam-price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.steam-price {
  font-size: 20px;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: .3px;
}
.steam-price--free {
  color: #4ade80;
}
.steam-price--na {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.steam-promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.steam-promo-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.steam-price--discount {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.steam-packs-wrap {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  min-height: 0;
}
.steam-packs-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 0;
}
.steam-packs {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.steam-packs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.steam-packs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.steam-packs-count {
  font-size: 11px;
  color: var(--text-dim);
  opacity: .8;
}
.steam-packs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.steam-pack-item {
  margin: 0;
}
.steam-pack-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.steam-pack-link:hover {
  background: rgba(96, 165, 250, .08);
  border-color: rgba(96, 165, 250, .22);
}
.steam-pack-name {
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  min-width: 0;
}
.steam-pack-price {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
}
.steam-pack-price--na {
  color: var(--text-dim);
  font-weight: 500;
}
.steam-discount-badge {
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  letter-spacing: .3px;
}
.steam-price-original {
  text-decoration: line-through;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.steam-price-final {
  color: #4ade80;
  font-weight: 700;
  font-size: 20px;
}

.community-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.community-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.community-item--admin {
  border-color: rgba(232, 200, 64, .22);
  background: rgba(232, 200, 64, .05);
}
.community-role {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(232, 200, 64, .15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: middle;
}
.community-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.community-user {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.community-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.community-status--yes {
  background: rgba(39,174,96,.15);
  color: #86efac;
}
.community-status--no {
  background: rgba(255,77,77,.12);
  color: #fca5a5;
}
.community-rating .stars {
  font-size: 15px;
}
.community-review {
  color: var(--text-mid);
  font-style: italic;
  line-height: 1.6;
  font-size: 13px;
}
.community-review--empty {
  font-style: normal;
  color: var(--text-dim);
}

.audio-player {
  width: 100%;
  margin-bottom: 12px;
  accent-color: var(--accent);
}
.youtube-embed {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: none;
  background: #000;
}

.music-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.music-info-item { }
.music-info-item--tracks {
  grid-column: 1 / -1;
}
.music-info-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.music-info-value { font-size: 14px; color: var(--text); margin-top: 2px; }
.music-tracks-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.music-tracks-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.music-tracks-num {
  flex-shrink: 0;
  width: 1.6em;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}
.music-tracks-item.is-liked .music-tracks-title-btn {
  font-weight: 600;
}
.music-tracks-title-btn {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(155, 89, 182, 0.35);
  text-underline-offset: 3px;
  user-select: none;
  -webkit-user-select: none;
}
.music-tracks-title-btn:hover {
  color: #d8b4fe;
}
.music-track-context-menu {
  position: fixed;
  z-index: 1300;
  min-width: 128px;
  padding: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.music-track-context-menu[hidden] {
  display: none;
}
.music-track-context-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.music-track-context-menu-item:hover {
  background: rgba(155, 89, 182, 0.15);
  color: #d8b4fe;
}
.music-tracks-duration {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.music-tracks-heart {
  color: #f472b6;
  font-size: 15px;
  line-height: 1;
}
.music-tracks-item:not(.is-liked) .music-tracks-heart {
  opacity: .45;
}
.music-tracks-editor .music-tracks-rows {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.music-track-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 72px auto auto auto;
  gap: 8px;
  align-items: center;
}
.music-track-edit {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(155, 89, 182, 0.25);
  background: rgba(155, 89, 182, 0.08);
  color: #d8b4fe;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.music-track-edit.has-details {
  border-color: rgba(155, 89, 182, 0.55);
  background: rgba(155, 89, 182, 0.18);
}
.music-track-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.music-track-modal[hidden] {
  display: none;
}
.music-track-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.music-track-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 22px 20px;
  border-radius: 14px;
  background: #15151b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.music-track-modal-panel--wide {
  width: min(760px, 100%);
}
.music-track-modal-section {
  margin-bottom: 16px;
}
.music-track-modal-lyrics-wrap {
  margin-bottom: 18px;
}
.music-track-modal-lyrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.music-track-modal-lyrics-block {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.music-track-modal-lyrics-text {
  margin: 0;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.music-track-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}
.music-track-modal-heading {
  margin: 0 36px 16px 0;
  font-size: 20px;
  color: var(--text);
}
.music-track-modal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.music-track-modal-story {
  margin: 0 0 16px;
  color: var(--text-mid);
  line-height: 1.55;
  white-space: pre-wrap;
}
.music-track-modal-clip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.music-track-modal-clip-link:hover {
  background: rgba(96, 165, 250, 0.18);
}
.music-track-modal-youtube {
  margin-top: 14px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 10px;
}
#music-track-modal-edit textarea,
#music-track-modal-edit input {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
.music-track-modal-save {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(155, 89, 182, 0.45);
  background: rgba(155, 89, 182, 0.2);
  color: #e9d5ff;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 640px) {
  .music-track-modal-lyrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .music-track-modal-lyrics-text {
    max-height: none;
    overflow: visible;
  }

  .music-track-modal-panel {
    touch-action: pan-y;
  }
}
.music-track-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  user-select: none;
}
.music-track-row input[name="music_track_title[]"] {
  width: 100%;
  min-width: 0;
}
.music-track-duration {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.music-track-heart {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(244, 114, 182, 0.25);
  background: rgba(244, 114, 182, 0.08);
  color: #f9a8d4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.music-track-row.is-liked .music-track-heart {
  background: rgba(244, 114, 182, 0.2);
  border-color: rgba(244, 114, 182, 0.55);
  color: #fb7185;
}
.music-track-heart:hover {
  transform: scale(1.05);
}
.music-track-remove {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.music-track-remove:hover {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}
.music-tracks-add {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(155, 89, 182, 0.45);
  background: rgba(155, 89, 182, 0.08);
  color: #d8b4fe;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.music-tracks-add:hover {
  background: rgba(155, 89, 182, 0.14);
}

/* Series seasons tracker */
.detail-section--series-seasons {
  margin-top: 18px;
}
.series-seasons-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.series-seasons-editor-head input[type="number"] {
  width: 72px;
}
.series-seasons-editor-hint {
  font-size: 12px;
  color: var(--text-dim);
}
.series-seasons-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.series-seasons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.series-season-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.series-season-row {
  display: block;
}
.series-season-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 16px;
  cursor: pointer;
  user-select: none;
}
.series-season-summary::-webkit-details-marker {
  display: none;
}
.series-season-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.72);
  border-bottom: 2px solid rgba(255, 255, 255, 0.72);
  transform: rotate(45deg);
  transition: transform .18s ease;
  flex-shrink: 0;
  margin-top: -2px;
}
.series-season-row[open] .series-season-chevron {
  transform: rotate(225deg);
  margin-top: 2px;
}
.series-season-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.series-season-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.series-season-progress-label {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  min-width: auto;
  text-align: center;
  white-space: nowrap;
}
.series-season-card.is-complete .series-season-progress-label {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}
.series-season-card.is-progress .series-season-progress-label {
  background: rgba(232, 200, 64, 0.12);
  border-color: rgba(232, 200, 64, 0.32);
  color: rgba(232, 200, 64, 0.95);
}
.series-season-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.series-season-check-icon {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.series-season-check.is-done {
  border-color: rgba(52, 211, 153, 0.55);
  background: #10b981;
  color: #fff;
}
.series-season-card.is-progress .series-season-check:not(.is-done) {
  border-color: rgba(232, 200, 64, 0.45);
  color: rgba(232, 200, 64, 0.85);
}
.series-season-episodes {
  padding: 0 16px 14px;
}
.series-season-row[open] .series-season-episodes {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}
.series-num-input {
  width: 72px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color .15s, background .15s;
}
.series-num-input::-webkit-outer-spin-button,
.series-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.series-num-input:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(255, 255, 255, 0.07);
}
.series-season-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.series-season-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.series-season-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.series-season-watched-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.series-season-watched-sep,
.series-season-watched-max {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.series-episode-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-bottom: 0;
}
.series-episode-pager-label {
  min-width: 72px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.series-episode-pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  font-size: 18px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
}
.series-episode-pager-btn:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(255, 255, 255, 0.06);
}
.series-episode-pager-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.series-season-episodes-count {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.series-season-episodes-count--inline {
  margin-bottom: 0;
  margin-left: auto;
  margin-right: 12px;
  flex-shrink: 0;
}
.series-season-episodes-count--inline span {
  white-space: nowrap;
}
.series-season-episodes-count--inline input,
.series-season-episodes-count input {
  width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.series-season-episodes-count--inline input::-webkit-outer-spin-button,
.series-season-episodes-count--inline input::-webkit-inner-spin-button,
.series-season-episodes-count input::-webkit-outer-spin-button,
.series-season-episodes-count input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.series-season-summary {
  flex-wrap: wrap;
  gap: 8px;
}
.series-season-episode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.series-episode-btn {
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.series-episode-btn:hover {
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--text);
}
.series-episode-btn.is-watched {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
.series-episode-btn--readonly {
  cursor: default;
  opacity: .72;
}
.series-episode-btn--readonly.is-watched {
  opacity: 1;
}
.series-episode-more {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
}
.series-season-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}
.series-season-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: rgba(232, 200, 64, 0.55);
  transition: width .2s ease;
}
.series-season-card.is-complete .series-season-bar span {
  background: #10b981;
}
.series-season-card.is-progress .series-season-bar span {
  background: linear-gradient(90deg, #10b981 0%, rgba(232, 200, 64, 0.75) 100%);
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.detail-copy-form {
  margin: 0;
  width: 100%;
}
.detail-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-library-add,
.btn-library-view,
a.btn-library-view,
.btn-library-remove,
a.btn-library-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.btn-library-add {
  background: var(--accent);
  color: #0a0a0b;
  border: none;
  box-shadow: 0 4px 18px rgba(232, 200, 64, .18);
}
.btn-library-add:hover {
  background: #f0d050;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(232, 200, 64, .26);
}
.btn-library-view,
a.btn-library-view {
  background: rgba(232, 200, 64, .07);
  color: var(--accent);
  border: 1px solid rgba(232, 200, 64, .32);
}
.btn-library-view:hover,
a.btn-library-view:hover {
  background: rgba(232, 200, 64, .12);
  border-color: rgba(232, 200, 64, .5);
}
.btn-library-remove,
a.btn-library-remove {
  background: rgba(255, 77, 77, .06);
  color: var(--text-mid);
  border: 1px solid rgba(255, 77, 77, .22);
}
.btn-library-remove:hover,
a.btn-library-remove:hover {
  background: rgba(255, 77, 77, .1);
  border-color: rgba(255, 77, 77, .4);
  color: var(--accent2);
}
.btn-library-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .14);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.btn-library-view .btn-library-icon {
  background: rgba(232, 200, 64, .15);
}
.btn-library-remove .btn-library-icon {
  background: rgba(255, 77, 77, .12);
}
.btn-detail-edit,
.btn-detail-remove,
.btn-detail-delete,
a.btn-detail-edit,
a.btn-detail-remove,
a.btn-detail-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-mid);
}
.btn-detail-edit:hover,
a.btn-detail-edit:hover {
  border-color: rgba(232, 200, 64, .4);
  color: var(--accent);
  background: rgba(232, 200, 64, .06);
}
.btn-detail-remove:hover,
a.btn-detail-remove:hover {
  border-color: rgba(232, 200, 64, .35);
  color: var(--accent);
  background: rgba(232, 200, 64, .05);
}
.btn-detail-delete,
a.btn-detail-delete {
  width: 100%;
}
.btn-detail-delete:hover,
a.btn-detail-delete:hover {
  border-color: rgba(255, 77, 77, .4);
  color: var(--accent2);
  background: rgba(255, 77, 77, .06);
}
.btn-detail-icon {
  font-size: 13px;
  line-height: 1;
  opacity: .9;
}

/* ── FORM MODAL ── */
.form-box {
  width: min(600px, 96vw);
  padding: 28px;
}
.form-box h2 {
  font-family: var(--font-title);
  font-size: 26px;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.form-row {
  margin-bottom: 16px;
}
.form-row label {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: rgba(232, 200, 64, .45);
  box-shadow: 0 0 0 3px rgba(232, 200, 64, .08);
}
.form-row input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.form-row input[type="number"]::-webkit-outer-spin-button,
.form-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.form-row textarea { resize: vertical; }

/* File upload (form) */
.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-upload {
  position: relative;
}
.file-upload-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.file-upload-zone:hover,
.file-upload-zone:focus-visible {
  border-color: rgba(232, 200, 64, .45);
  background: rgba(232, 200, 64, .03);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 200, 64, .08);
}
.file-upload-zone.is-dragover {
  border-color: var(--accent);
  background: rgba(232, 200, 64, .06);
}
.file-upload-preview {
  flex-shrink: 0;
  width: 72px;
  height: 96px;
  border-radius: calc(var(--radius) - 1px);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.file-upload-placeholder {
  width: 28px;
  height: 28px;
  border: 2px solid var(--text-dim);
  border-radius: 4px;
  position: relative;
  opacity: .55;
}
.file-upload-placeholder::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px solid var(--text-dim);
  border-radius: 2px;
}
.file-upload-placeholder::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid var(--text-dim);
  border-right: 1.5px solid var(--text-dim);
}
.file-upload-placeholder--audio {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(155, 89, 182, .15);
  opacity: 1;
}
.file-upload-placeholder--audio::before {
  content: '♪';
  position: static;
  border: none;
  font-size: 16px;
  color: var(--music);
  line-height: 32px;
  text-align: center;
  display: block;
}
.file-upload-placeholder--audio::after {
  display: none;
}
.file-upload-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.file-upload-btn {
  display: inline-block;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .3px;
  transition: border-color .15s, color .15s, background .15s;
}
.file-upload-zone:hover .file-upload-btn,
.file-upload-zone:focus-visible .file-upload-btn {
  border-color: rgba(232, 200, 64, .5);
  color: var(--accent);
}
.file-upload-name {
  font-size: 13px;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.file-upload-zone.has-file .file-upload-name {
  color: var(--text);
}
.file-upload-hint {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .2px;
}
.file-upload--audio .file-upload-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.form-section-title {
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin: 20px 0 12px;
}

.form-type-panels {
  margin-bottom: 4px;
}
.type-fields,
.form-type-panel {
  display: none;
}
.type-fields.active,
.form-type-panel.active {
  display: block;
  animation: form-type-fade-in .22s ease;
}
.form-box.form-type-switching .type-fields.active,
.form-box.form-type-switching .form-type-panel.active {
  animation: form-type-fade-in .24s ease;
}
@keyframes form-type-fade-in {
  from { opacity: .45; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Rating picker (form) */
.rating-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s;
}
.rating-picker:focus-within {
  border-color: rgba(255, 255, 255, .14);
}
.rating-picker--world:focus-within {
  border-color: rgba(126, 200, 240, .35);
}
.rating-picker--personal:focus-within {
  border-color: rgba(232, 200, 64, .35);
}
.rating-picker--world { --rating-color: #7ec8f0; }
.rating-picker--personal { --rating-color: var(--accent); }
.rating-picker-stars {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.rating-picker-star {
  background: none;
  border: none;
  padding: 2px 3px;
  cursor: pointer;
  line-height: 1;
  transition: transform .12s;
}
.rating-picker-star:hover {
  transform: scale(1.12);
}
.rating-picker-star-icon {
  display: block;
  font-size: 24px;
  line-height: 1;
  transition: color .12s;
}
.rating-picker-star.is-empty .rating-picker-star-icon {
  color: var(--border);
}
.rating-picker-star.is-full .rating-picker-star-icon {
  color: var(--rating-color, var(--accent));
}
.rating-picker-star.is-half .rating-picker-star-icon {
  background: linear-gradient(90deg, var(--rating-color, var(--accent)) 50%, var(--border) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rating-picker-value {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: .5px;
  color: var(--text-mid);
  white-space: nowrap;
}
.rating-picker-clear {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
.rating-picker-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
}
.rating-picker-clear--hidden {
  visibility: hidden;
  pointer-events: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 11px 24px;
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 2px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; }

.btn-secondary {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
  padding: 11px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-secondary:hover { border-color: var(--text-mid); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--accent2);
  border: 1px solid var(--accent2);
  padding: 9px 16px;
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: rgba(255,77,77,.12); }

.btn-edit {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 9px 16px;
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.btn-edit:hover { background: rgba(232,200,64,.1); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* Loading */
.loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── MOBILE / iPhone ── */
.menu-toggle,
.sidebar-overlay,
.mobile-bottom-nav {
  display: none;
}

.menu-toggle,
a.menu-toggle {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sidebar-overlay,
a.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 90;
  backdrop-filter: blur(2px);
  text-decoration: none;
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  justify-content: space-around;
  align-items: stretch;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 10px;
  min-height: 56px;
  color: var(--text-mid);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-nav-icon {
  font-size: 17px;
  line-height: 1;
  font-family: var(--font-body);
  font-variant-emoji: text;
}
.nav-item-icon {
  font-variant-emoji: text;
}

/* Icône Films — rectangle cinéma en CSS (pas d'emoji iOS) */
.nav-item-icon--film,
.mobile-nav-icon--film {
  display: inline-block;
  width: 18px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
}
.nav-item-icon--film::before,
.mobile-nav-icon--film::before {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: currentColor;
  opacity: .45;
  border-radius: 1px;
}

.mobile-nav-item.active {
  color: var(--accent);
  background: rgba(232,200,64,.06);
}

@media (max-width: 768px) {
  :root {
    --mobile-bottom-space: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  html {
    scroll-padding-bottom: var(--mobile-bottom-space);
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  .menu-toggle,
  .mobile-bottom-nav {
    display: flex;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  a.sidebar-overlay {
    display: block;
  }

  body.sidebar-open .mobile-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #sidebar {
    width: min(300px, 92vw);
    /* svh = hauteur visible avec barre Safari (évite de couper le bas du menu) */
    height: 100svh;
    max-height: 100svh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
    z-index: 140;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: calc(8px + env(safe-area-inset-top, 0));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  }

  #sidebar .nav-links {
    flex-shrink: 0;
    overflow: visible;
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  a.sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 24px;
    flex-shrink: 0;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-mid);
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-header {
    padding: 0 16px 0 20px;
    flex-shrink: 0;
  }

  .sidebar-header .logo {
    padding-bottom: 24px;
  }

  .sidebar-user {
    margin: 12px 16px 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    flex-shrink: 0;
  }

  .btn-add {
    flex-shrink: 0;
  }

  #main {
    margin-left: 0;
    padding-bottom: var(--mobile-bottom-space);
    min-height: 100dvh;
    box-sizing: border-box;
  }

  #topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    align-items: center;
  }

  .members-directory {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px;
  }

  .menu-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  #topbar .search-wrap {
    grid-column: 2 / -1;
    grid-row: 1;
    max-width: none;
  }

  #topbar .search-wrap input {
    max-width: none;
    font-size: 16px; /* évite le zoom auto sur iOS */
  }

  .sort-wrap {
    grid-column: 1 / 3;
    grid-row: 2;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }

  .topbar-control {
    flex: 1 1 0;
    min-width: 0;
  }

  .topbar-control-label {
    display: none;
  }

  .btn-bulk-select {
    grid-column: 3;
    grid-row: 2;
    width: auto;
    justify-content: center;
    align-self: stretch;
    padding: 0 12px;
    min-height: 44px;
    font-size: 13px;
  }

  #sort,
  #theme-filter,
  .platform-filter-search {
    flex: 1;
    width: 100%;
    min-width: 0;
    font-size: 16px;
    padding: 10px 32px 10px 12px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 8 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 7px;
  }

  .platform-filter {
    flex: 1 1 100%;
    min-width: 0;
  }

  .bulk-select-bar {
    left: 16px;
    right: 16px;
    bottom: calc(var(--mobile-bottom-space) + 8px);
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    max-width: calc(100vw - 32px);
  }

  .media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    padding-bottom: 8px;
  }

  .card-title {
    font-size: 15px;
  }

  .empty-state {
    padding: 12px 12px 8px;
  }

  .empty-state-card {
    padding: 20px 16px 16px;
  }

  .empty-state-icon-wrap {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
  }

  .empty-state .empty-icon {
    font-size: 24px;
  }

  .empty-state-title {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .empty-state-desc {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .empty-btn {
    padding: 11px 14px;
    font-size: 13px;
  }

  body.modal-open {
    overflow: hidden;
    height: 100%;
  }

  .modal {
    align-items: stretch;
    padding: 0;
    overflow: hidden;
  }

  .modal-box {
    width: 100% !important;
    max-height: 100dvh;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    border-radius: 0;
    border-left: none;
    border-right: none;
    scroll-padding-top: calc(56px + env(safe-area-inset-top, 0));
    scroll-padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .detail-box:has(.music-info-grid) .detail-hero {
    padding: 14px 16px 10px;
    gap: 12px;
  }

  .detail-box:has(.music-info-grid) .detail-cover {
    width: 96px;
  }

  .detail-box:has(.music-info-grid) .detail-title {
    font-size: 22px;
    line-height: 1.15;
  }

  .music-tracks-item {
    min-height: 44px;
    padding: 4px 0;
  }

  .music-tracks-title-btn {
    padding: 10px 2px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .music-track-modal {
    align-items: flex-end;
    padding: 0;
  }

  .music-track-modal-panel {
    width: 100%;
    max-height: 92dvh;
    min-height: 0;
    border-radius: 16px 16px 0 0;
    padding: 22px 16px calc(20px + env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .music-track-modal-close {
    top: calc(10px + env(safe-area-inset-top, 0));
    width: 44px;
    height: 44px;
  }

  .detail-hero {
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    gap: 16px;
    text-align: center;
  }

  .detail-cover {
    width: 140px;
  }

  .detail-meta {
    width: 100%;
  }

  .detail-title {
    font-size: 28px;
  }

  .platform-tags,
  .detail-tags,
  .detail-collection-status {
    justify-content: center;
  }

  .detail-tag-group,
  .detail-collection-block {
    align-items: center;
  }

  .detail-collection-block {
    display: flex;
    flex-direction: column;
  }

  .detail-ratings {
    align-items: stretch;
  }

  .detail-rating-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-rating-value {
    justify-content: center;
    flex-wrap: wrap;
  }

  .rating-source-btn,
  a.rating-source-btn {
    padding: 12px;
  }

  .detail-actions {
    margin-top: 16px;
    padding-top: 16px;
  }
  .btn-library-add,
  .btn-library-view,
  a.btn-library-view,
  .btn-library-remove,
  a.btn-library-remove {
    padding: 14px 16px;
    font-size: 13px;
  }
  .btn-detail-edit,
  .btn-detail-remove,
  .btn-detail-delete,
  a.btn-detail-edit,
  a.btn-detail-remove,
  a.btn-detail-delete {
    padding: 12px 10px;
    font-size: 12px;
  }

  .detail-body {
    padding: 0 16px 24px;
  }

  .music-info-grid {
    grid-template-columns: 1fr;
  }

  .form-box {
    padding: 20px 16px;
    padding-top: calc(20px + env(safe-area-inset-top, 0));
  }

  .collection-toggles {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary,
  .form-actions .btn-danger {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 16px;
  }

  .type-picker {
    gap: 6px;
  }

  .type-pick {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    padding: 10px 8px;
  }

  .platform-picker-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .platform-pick {
    min-height: 48px;
    padding: 10px 8px;
  }

  .platform-pick-label {
    font-size: 11px;
    line-height: 1.35;
  }

  #f-platform-other {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 14px;
  }

  .modal-close {
    top: calc(12px + env(safe-area-inset-top, 0));
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .nav-links .nav-item {
    padding: 14px 24px;
    min-height: 48px;
  }

  .btn-add {
    margin: 16px 20px 0;
    padding: 14px;
    font-size: 16px;
  }

  .flash-toast {
    top: max(16px, env(safe-area-inset-top, 0px));
    width: calc(100vw - 24px);
    padding: 14px 16px 16px;
  }

  .flash-toast-title {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .mobile-nav-label {
    font-size: 9px;
    letter-spacing: 0;
  }

  .media-grid {
    gap: 10px;
    padding: 12px;
  }
}

/* ── ADMIN (gestion comptes) ── */
.admin-app .mobile-bottom-nav { display: none !important; }

.admin-main {
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-wrap: wrap;
}

.admin-topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px 8px 0;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.admin-back:hover {
  color: var(--accent);
}

.admin-topbar-text {
  flex: 1;
  min-width: 0;
}

.admin-page-title {
  font-family: var(--font-title);
  font-size: 32px;
  letter-spacing: 2px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 6px;
}

.admin-page-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.admin-page-subtitle strong {
  color: var(--accent);
  font-weight: 600;
}

.admin-pending-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(243, 156, 18, .15);
  color: #fcd34d;
  font-size: 12px;
  font-weight: 600;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-topbar-btn {
  padding: 10px 18px !important;
  font-size: 15px !important;
  letter-spacing: 1px !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.admin-content {
  padding: 24px 28px 40px;
  flex: 1;
}

.admin-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.admin-alert--ok {
  color: #86efac;
  background: rgba(39, 174, 96, .08);
  border-color: rgba(39, 174, 96, .22);
}

.admin-alert--err {
  color: #fca5a5;
  background: rgba(255, 77, 77, .08);
  border-color: rgba(255, 77, 77, .22);
}

.admin-nav-links .nav-item {
  position: relative;
}

.admin-nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(243, 156, 18, .2);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}

.admin-user-card--self {
  border-color: rgba(232, 200, 64, .28);
  box-shadow: inset 0 0 0 1px rgba(232, 200, 64, .08);
}

.admin-user-card--banned {
  border-color: rgba(248, 113, 113, .28);
}

.admin-user-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-user-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: linear-gradient(145deg, rgba(232, 200, 64, .18), rgba(232, 200, 64, .06));
  border: 1px solid rgba(232, 200, 64, .22);
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-user-meta {
  flex: 1;
  min-width: 140px;
}

.admin-user-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
}

.admin-user-you {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(232, 200, 64, .12);
  border: 1px solid rgba(232, 200, 64, .22);
  vertical-align: middle;
}

.admin-user-email {
  margin: 0;
  font-size: 12px;
  color: var(--text-mid);
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 600;
}

.admin-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: #7ec8e8;
  box-shadow: 0 0 6px rgba(126, 200, 232, .6);
  animation: admin-pulse 2s ease-in-out infinite;
}

@keyframes admin-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.admin-pill--ok { background: rgba(39,174,96,.15); color: #86efac; }
.admin-pill--wait { background: rgba(243,156,18,.15); color: #fcd34d; }
.admin-pill--no { background: rgba(255,77,77,.12); color: #fca5a5; }
.admin-pill--admin { background: rgba(232,200,64,.15); color: var(--accent); }
.admin-pill--online { background: rgba(41,128,185,.15); color: #7ec8e8; }
.admin-pill--offline { background: rgba(255,255,255,.05); color: var(--text-mid); }
.admin-pill--role { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--border); }
.admin-pill--muted { color: var(--text-mid); }
.admin-pill--ban { background: rgba(220,38,38,.18); color: #fca5a5; border: 1px solid rgba(248,113,113,.35); }

.admin-user-body {
  padding: 10px 12px 12px;
}

.admin-user-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-user-banner--pending {
  background: rgba(243, 156, 18, .07);
}

.admin-user-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-mid);
}

.admin-user-banner-text strong {
  font-size: 13px;
  color: var(--text);
}

.admin-user-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-action-block {
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0;
}

.admin-action-block--wide {
  grid-column: 1 / -1;
}

.admin-action-block--moderation {
  background: rgba(255, 77, 77, .03);
  border-color: rgba(255, 77, 77, .12);
}

.admin-action-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.admin-action-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-action-form--single {
  flex-wrap: nowrap;
}

.admin-action-form--ban {
  align-items: stretch;
}

.admin-action-form--ban .admin-field-select {
  flex: 1 1 140px;
}

.admin-action-form--ban .admin-field-input--narrow {
  flex: 0 1 72px;
  width: 72px;
  min-width: 64px;
}

.admin-action-form--ban .admin-field-select--unit {
  flex: 0 1 72px;
  width: 72px;
  min-width: 64px;
  padding-left: 10px;
  padding-right: 8px;
}

.admin-action-or {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-dim);
  padding: 0 2px;
}

.admin-action-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-mid);
}

.admin-ban-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-ban-status-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
}

.admin-ban-status-text strong {
  color: #fca5a5;
}

.admin-ban-status-text span {
  color: var(--text-dim);
  font-size: 11px;
}

.admin-user-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.admin-footer-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
}

.admin-footer-block--danger {
  background: rgba(255, 77, 77, .04);
  border-color: rgba(255, 77, 77, .14);
}

.admin-footer-desc {
  margin: 0;
  font-size: 11px;
  color: var(--text-mid);
  line-height: 1.35;
}

.admin-footer-desc a {
  color: var(--accent);
  text-decoration: none;
}

.admin-footer-desc a:hover {
  text-decoration: underline;
}

.admin-footer-form {
  margin: 0;
  width: 100%;
}

.admin-footer-btn {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 30px;
  border-radius: 0;
}

.admin-field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.admin-inline-form {
  display: inline;
}

.admin-user-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-field-select,
.admin-field-input {
  flex: 1;
  min-width: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}

.admin-field-select:focus,
.admin-field-input:focus {
  border-color: rgba(232, 200, 64, .45);
  box-shadow: 0 0 0 2px rgba(232, 200, 64, .08);
}

.admin-user-muted {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
  font-style: italic;
}

.admin-footnote {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.admin-footnote p {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.55;
}

.admin-footnote p:last-child { margin-bottom: 0; }
.admin-footnote strong { color: var(--text); }

.admin-form-card {
  max-width: 480px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
}

a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.admin-form-card .form-row:last-of-type {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .admin-topbar {
    padding: 12px 16px 16px;
    padding-top: max(54px, calc(12px + constant(safe-area-inset-top)));
    padding-top: max(54px, calc(12px + env(safe-area-inset-top, 0px)));
  }

  .admin-topbar-nav {
    width: 100%;
  }

  .admin-back {
    font-size: 16px;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
  }

  .admin-content {
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  }

  .admin-page-title {
    font-size: 26px;
  }

  .admin-topbar-actions {
    width: 100%;
  }

  .admin-topbar-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-user-card-head {
    padding: 12px;
  }

  .admin-user-actions,
  .admin-user-footer {
    grid-template-columns: 1fr;
  }

  .admin-action-block--wide {
    grid-column: auto;
  }

  .admin-field-select,
  .admin-field-input {
    font-size: 16px;
    width: 100%;
  }

  .admin-action-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-action-form .btn-secondary,
  .admin-action-form .btn-edit,
  .admin-action-form .btn-danger {
    width: 100%;
  }

  .admin-action-or {
    display: none;
  }

  .admin-ban-status {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Admin — sécurité IP / fail2ban */
.admin-security-help {
  margin-bottom: 28px;
  padding: 18px 20px;
  border-radius: 12px;
  background: rgba(232, 200, 64, .06);
  border: 1px solid rgba(232, 200, 64, .22);
}

.admin-security-help-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.admin-security-help p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
}

.admin-security-help-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
}

.admin-security-help-list li + li {
  margin-top: 6px;
}

.admin-security-help-list strong {
  color: var(--text);
}

.admin-security-event-summary {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}

.admin-security-detail-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
  font-style: italic;
}

.admin-pill--inline {
  margin-right: 0;
}

/* Fail2ban dashboard (gestion_fail2ban.php) */
.f2b-dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  text-transform: lowercase;
}
.f2b-dash-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.f2b-dash-pill--ok {
  color: #86efac;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .25);
}
.f2b-dash-pill--ok::before {
  background: #22c55e;
  animation: f2b-pill-blink 2s infinite;
}
.f2b-dash-pill--err {
  color: #fda4af;
  background: rgba(244, 63, 94, .12);
  border: 1px solid rgba(244, 63, 94, .25);
}
.f2b-dash-pill--err::before {
  background: #f43f5e;
}
.f2b-dash-pill--wait {
  color: var(--text-dim);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
}
.f2b-dash-pill--wait::before {
  display: none;
}

.f2b-dash-banner--load {
  background: rgba(59, 130, 246, .08);
  border-color: #3b82f6;
  color: var(--text-mid);
  align-items: center;
}
.f2b-dash-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(147, 197, 253, .25);
  border-top-color: #93c5fd;
  border-radius: 50%;
  animation: f2b-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes f2b-spin {
  to { transform: rotate(360deg); }
}
@keyframes f2b-pill-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.f2b-dash-refresh-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono, 'JetBrains Mono', monospace);
}
.f2b-dash-refresh-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, .35);
  background: transparent;
  color: #93c5fd;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.f2b-dash-refresh-btn:hover {
  background: rgba(59, 130, 246, .12);
  border-color: rgba(59, 130, 246, .55);
}
.f2b-dash-refresh-btn.is-loading,
.f2b-dash-refresh-btn:disabled {
  opacity: .55;
  cursor: wait;
}

.f2b-dash-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
  border-left: 3px solid;
}
.f2b-dash-banner strong { color: var(--text); }
.f2b-dash-banner--ok {
  background: rgba(34, 197, 94, .08);
  border-color: #22c55e;
  color: var(--text-mid);
}
.f2b-dash-banner--err {
  background: rgba(244, 63, 94, .08);
  border-color: #f43f5e;
  color: var(--text-mid);
}
.f2b-dash-banner-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
}
.f2b-dash-banner-note code {
  font-size: 11px;
  background: rgba(255, 255, 255, .06);
  padding: 1px 5px;
  border-radius: 4px;
}

.f2b-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.f2b-allow-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  color: #fff !important;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  white-space: nowrap;
  cursor: pointer;
}

.f2b-allow-bubble:hover {
  filter: brightness(1.08);
}

.f2b-allow-dialog {
  width: min(440px, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.f2b-allow-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.f2b-allow-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.f2b-allow-dialog-close {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.f2b-allow-dialog-body {
  padding: 16px;
}

.f2b-allow-dialog-lead {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 14px;
}

.f2b-allow-ip-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.f2b-allow-form {
  margin-bottom: 18px;
}

.f2b-allow-bubble-card {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--bg2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.f2b-allow-bubble-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.f2b-allow-submit-btn {
  justify-self: start;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #16a34a, #15803d);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}

.f2b-allow-submit-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.f2b-allow-submit-btn:disabled,
.f2b-allow-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.f2b-allow-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.f2b-allow-field input[type="text"],
.f2b-allow-field input[type="password"],
.f2b-allow-del-pass input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3, var(--bg));
  color: var(--text);
  font: inherit;
}

.f2b-allow-ip-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.f2b-allow-ip-row input {
  flex: 1;
}

.f2b-allow-myip {
  border: 1px solid var(--border);
  background: var(--bg3, var(--bg));
  color: var(--text);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.f2b-allow-myip:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.f2b-allow-submit {
  justify-self: start;
}

.f2b-allow-list-wrap {
  margin-top: 4px;
}

.f2b-allow-list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.f2b-allow-del-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.f2b-allow-del-pass {
  flex: 1;
  min-width: 160px;
}

.f2b-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.f2b-dash-stat {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.f2b-dash-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
}
.f2b-dash-stat-val {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.f2b-dash-stat-val--red { color: #f43f5e; }
.f2b-dash-stat-val--amb { color: #f59e0b; }
.f2b-dash-stat-val--blue { color: #3b82f6; }
.f2b-dash-stat-val--ok { color: #22c55e; }
.f2b-dash-stat-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.f2b-dash-jails-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.f2b-dash-jails-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.f2b-dash-jails-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono, 'JetBrains Mono', monospace);
}

.f2b-dash-jails {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.f2b-jail-card {
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.f2b-jail-trigger {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: rgba(255, 255, 255, .02);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.f2b-jail-trigger:hover { background: rgba(255, 255, 255, .04); }
.f2b-jail-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.f2b-jail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  font-size: 11px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  color: var(--text-dim);
}
.f2b-jail-badge--warn { color: #fbbf24; }
.f2b-jail-badge--ban { color: #f87171; }
.f2b-jail-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.f2b-jail-trigger.is-open .f2b-jail-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.f2b-jail-panel {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
}
.f2b-jail-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.f2b-jail-mini {
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
}
.f2b-jail-mini-label {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 2px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
}
.f2b-jail-mini-val {
  font-size: 16px;
  font-weight: 700;
}
.f2b-jail-mini-val--warn { color: #f59e0b; }
.f2b-jail-mini-val--ban { color: #f43f5e; }
.f2b-jail-desc {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}
.f2b-jail-empty {
  margin: 0;
  font-size: 12px;
  color: #86efac;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  text-align: center;
  padding: 8px 0;
}
.f2b-jail-ip-table-wrap { overflow-x: auto; }
.f2b-jail-ip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.f2b-jail-ip-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono, 'JetBrains Mono', monospace);
}
.f2b-jail-ip-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
}
.f2b-jail-ip-table tr:last-child td { border-bottom: none; }
.f2b-jail-ip {
  color: #f87171;
  font-size: 12px;
}
.f2b-jail-unban {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--text-mid);
  font-size: 11px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.f2b-jail-unban:hover {
  color: #86efac;
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .08);
}

@media (max-width: 900px) {
  .f2b-dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f2b-dash-refresh-bar { flex-direction: column; align-items: flex-end; }
}
@media (max-width: 640px) {
  .f2b-dash-stats { grid-template-columns: 1fr; }
  .f2b-jail-trigger { grid-template-columns: 1fr auto; }
  .f2b-jail-badges { grid-column: 1 / -1; justify-content: flex-start; }
}

.admin-security-section {
  margin-bottom: 32px;
}

.admin-security-section + .admin-security-section {
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.admin-security-head {
  margin-bottom: 18px;
}

.admin-security-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.admin-security-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.admin-security-realip-hint {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(232, 200, 64, .25);
  border-radius: 10px;
  background: rgba(232, 200, 64, .08);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-mid);
}

.admin-security-card .admin-user-name {
  font-size: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-security-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.admin-security-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-security-table th,
.admin-security-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-security-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: var(--bg3);
}

.admin-security-table tr:last-child td {
  border-bottom: none;
}

.admin-security-row--banned {
  background: rgba(255, 77, 77, .04);
}

.admin-security-path {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-mid);
}

.admin-security-method {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-dim);
}

.admin-security-inline-unban {
  display: inline-flex;
  margin-top: 6px;
}

.btn-secondary--compact {
  padding: 6px 10px;
  font-size: 11px;
}

.admin-security-jails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.admin-security-jail-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.admin-security-jail-card--inactive {
  opacity: .55;
}

.admin-security-jail-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-security-jail-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.admin-security-jail-id {
  font-size: 10px;
  color: var(--text-mid);
}

.admin-security-jail-desc,
.admin-security-jail-meta {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.45;
}

.admin-security-jail-status {
  margin: 10px 0 0;
}

.admin-security-row--login-fail td {
  background: rgba(243, 156, 18, .04);
}

.admin-security-doc-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.admin-security-doc-link:hover {
  opacity: .85;
}

.admin-footnote a {
  color: var(--accent);
  text-decoration: none;
}

.admin-footnote a:hover {
  opacity: .85;
}

.admin-security-head--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-security-pager-meta {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mid);
}

.sec-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sec-log-updated {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.sec-log-refresh-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, transform .1s;
}

.sec-log-refresh-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sec-log-refresh-btn:active {
  transform: scale(.97);
}

.sec-log-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-mid);
  cursor: pointer;
  user-select: none;
}

.sec-log-auto-label input {
  accent-color: var(--accent);
}

/* Journal connexion — cartes accordéon */
.sec-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sec-log-card {
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .2s ease;
}

.sec-log-card:hover {
  border-color: var(--border2);
}

.sec-log-card.is-open {
  border-color: rgba(232, 200, 64, .28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
}

.sec-log-card--banned {
  border-color: rgba(255, 77, 77, .3);
}

.sec-log-card--banned.is-open {
  box-shadow: 0 8px 28px rgba(255, 77, 77, .08);
}

.sec-log-trigger {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .2s ease;
}

.sec-log-trigger:hover {
  background: rgba(255, 255, 255, .02);
}

.sec-log-trigger-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sec-log-ip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sec-log-ip {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.sec-log-origin {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sec-log-origin--locale {
  background: rgba(255, 255, 255, .06);
  color: var(--text-mid);
}

.sec-log-origin--publique {
  background: rgba(39, 174, 96, .14);
  color: #86efac;
}

.sec-log-origin--privée,
.sec-log-origin--privee {
  background: rgba(41, 128, 185, .14);
  color: #7ec8e8;
}

.sec-log-time {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sec-log-trigger-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.sec-log-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sec-log-chip--warn {
  background: rgba(243, 156, 18, .14);
  color: #fcd34d;
}

.sec-log-chip--ok {
  background: rgba(255, 255, 255, .05);
  color: var(--text-mid);
}

.sec-log-chip--ban {
  background: rgba(255, 77, 77, .14);
  color: #fca5a5;
}

.sec-log-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), border-color .2s ease;
  flex-shrink: 0;
  margin-left: 4px;
}

.sec-log-card.is-open .sec-log-chevron {
  transform: rotate(-135deg);
  border-color: var(--accent);
  margin-top: 4px;
}

.sec-log-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4, 0, .2, 1);
}

.sec-log-card.is-open .sec-log-panel {
  border-top: 1px solid var(--border);
}

.sec-log-lead {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.sec-log-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.sec-log-tile {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  transition: border-color .2s ease, background .2s ease;
}

.sec-log-card.is-open .sec-log-tile {
  animation: sec-log-tile-in .4s cubic-bezier(.4, 0, .2, 1) both;
}

.sec-log-card.is-open .sec-log-tile:nth-child(2) { animation-delay: .04s; }
.sec-log-card.is-open .sec-log-tile:nth-child(3) { animation-delay: .08s; }
.sec-log-card.is-open .sec-log-tile:nth-child(4) { animation-delay: .12s; }
.sec-log-card.is-open .sec-log-tile:nth-child(5) { animation-delay: .16s; }
.sec-log-card.is-open .sec-log-tile:nth-child(6) { animation-delay: .2s; }
.sec-log-card.is-open .sec-log-tile:nth-child(7) { animation-delay: .24s; }

@keyframes sec-log-tile-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sec-log-tile:hover {
  border-color: rgba(232, 200, 64, .2);
}

.sec-log-tile--wide {
  grid-column: 1 / -1;
}

.sec-log-tile-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sec-log-tile-value {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.sec-log-tile-value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mid);
  word-break: break-all;
}

.sec-log-tile-value--break {
  font-size: 12px;
  color: var(--text-mid);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sec-log-tile-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sec-log-copy {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-mid);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.sec-log-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sec-log-copy.is-copied {
  border-color: rgba(39, 174, 96, .4);
  color: #86efac;
  background: rgba(39, 174, 96, .1);
}

.sec-log-tile-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
}

.sec-log-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.admin-security-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.admin-security-pager-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}

.admin-security-pager-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-security-pager-btn--disabled {
  opacity: .4;
  pointer-events: none;
}

.admin-security-pager-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-security-pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.admin-security-pager-num:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-security-pager-num--active {
  border-color: var(--accent);
  background: rgba(232, 200, 64, .12);
  color: var(--accent);
}

@media (max-width: 640px) {
  .admin-security-head--split {
    flex-direction: column;
  }

  .sec-log-trigger {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .sec-log-trigger-badges {
    grid-column: 1;
    justify-content: flex-start;
  }

  .sec-log-chevron {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
  }

  .sec-log-grid {
    grid-template-columns: 1fr;
  }
}

/* Idées & problèmes */
.sidebar-feedback-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #0a0a0b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
}

.feedback-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 24px 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(232, 200, 64, 0.1);
  border: 1px solid rgba(232, 200, 64, 0.28);
  color: var(--text);
  font-size: 14px;
}

.feedback-notice-link {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.feedback-notice-link:hover { opacity: .85; }

body.feedback-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232, 200, 64, 0.08), transparent 60%),
    var(--bg);
}

.feedback-shell {
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
}

.feedback-hero {
  padding: 28px 32px 0;
  padding-top: calc(28px + env(safe-area-inset-top, 0px));
}

.feedback-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.feedback-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}

.feedback-back:hover { color: var(--accent); }

.feedback-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: 14px;
}

.feedback-admin-btn {
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}

.feedback-admin-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feedback-hero-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.feedback-brand {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 200, 64, .18), rgba(232, 200, 64, .04));
  border: 1px solid rgba(232, 200, 64, .25);
  color: var(--accent);
  font-size: 22px;
}

.feedback-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.feedback-title {
  margin: 0 0 8px;
  font-family: var(--font-title);
  font-size: clamp(36px, 6vw, 52px);
  line-height: .95;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.feedback-lead {
  margin: 0;
  max-width: 520px;
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.55;
}

.feedback-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.feedback-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.feedback-stat--highlight {
  border-color: rgba(232, 200, 64, .35);
  background: rgba(232, 200, 64, .06);
}

.feedback-stat-num {
  font-family: var(--font-title);
  font-size: 28px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--text);
}

.feedback-stat--highlight .feedback-stat-num { color: var(--accent); }

.feedback-stat-label {
  font-size: 12px;
  color: var(--text-mid);
}

.feedback-main {
  padding: 28px 32px 48px;
}

.feedback-alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
}

.feedback-alert--ok {
  background: rgba(39, 174, 96, .12);
  border: 1px solid rgba(39, 174, 96, .3);
  color: #8fd9a8;
}

.feedback-alert--err {
  background: rgba(255, 77, 77, .1);
  border: 1px solid rgba(255, 77, 77, .28);
  color: #ff8a8a;
}

.feedback-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.feedback-panel {
  padding: 24px;
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}

.feedback-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.feedback-panel-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 16px;
}

.feedback-panel-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.feedback-panel-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feedback-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feedback-segment-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.feedback-segment-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-segment-btn.is-active,
.feedback-segment-btn:has(input:checked) {
  border-color: var(--accent);
  background: rgba(232, 200, 64, .08);
  box-shadow: 0 0 0 1px rgba(232, 200, 64, .15);
}

.feedback-segment-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg2);
  font-size: 16px;
}

.feedback-segment-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feedback-segment-text strong {
  font-size: 14px;
  font-weight: 600;
}

.feedback-segment-text small {
  font-size: 11px;
  color: var(--text-mid);
}

.feedback-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.feedback-field input,
.feedback-field textarea,
.admin-feedback-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #2d2d38;
  background: var(--bg3);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}

.feedback-field input:focus,
.feedback-field textarea:focus,
.admin-feedback-form textarea:focus {
  outline: none;
  border-color: rgba(232, 200, 64, .5);
  box-shadow: 0 0 0 3px rgba(232, 200, 64, .1);
}

.feedback-submit {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0a0a0b;
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}

.feedback-submit:hover { opacity: .9; }
.feedback-submit:active { transform: scale(.99); }

.feedback-empty {
  padding: 36px 20px;
  text-align: center;
}

.feedback-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 22px;
}

.feedback-empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.feedback-empty-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 4px;
}

.feedback-item {
  position: relative;
  display: flex;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color .15s;
}

.feedback-item--unread {
  border-color: rgba(232, 200, 64, .4);
  box-shadow: 0 0 24px rgba(232, 200, 64, .06);
}

.feedback-item-accent {
  width: 4px;
  flex-shrink: 0;
  background: var(--border);
}

.feedback-item--en_attente .feedback-item-accent { background: var(--text-dim); }
.feedback-item--pris_en_compte .feedback-item-accent { background: var(--game); }
.feedback-item--refuse .feedback-item-accent { background: var(--accent2); }

.feedback-item-inner {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
}

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

.feedback-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.feedback-chip--idee {
  background: rgba(232, 200, 64, .14);
  color: var(--accent);
}

.feedback-chip--probleme {
  background: rgba(255, 77, 77, .12);
  color: #ff8a8a;
}

.feedback-chip--new {
  background: rgba(232, 200, 64, .22);
  color: #0a0a0b;
}

.feedback-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.feedback-status--pris_en_compte { color: var(--game); }
.feedback-status--refuse { color: var(--accent2); }
.feedback-status--en_attente { color: var(--text-dim); }

.feedback-item-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.feedback-item-body {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mid);
}

.feedback-item-date {
  display: block;
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.feedback-item-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  font-size: 13px;
  color: var(--text-mid);
}

.feedback-pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: feedback-pulse 1.6s ease-in-out infinite;
}

@keyframes feedback-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

.feedback-response {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
}

.feedback-response--ok {
  background: rgba(39, 174, 96, .1);
  border: 1px solid rgba(39, 174, 96, .25);
}

.feedback-response--no {
  background: rgba(255, 77, 77, .08);
  border: 1px solid rgba(255, 77, 77, .22);
}

.feedback-response-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feedback-response-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.feedback-response--ok .feedback-response-icon {
  background: rgba(39, 174, 96, .2);
  color: #8fd9a8;
}

.feedback-response--no .feedback-response-icon {
  background: rgba(255, 77, 77, .18);
  color: #ff8a8a;
}

.feedback-response-msg {
  margin: 10px 0 0;
  padding-left: 34px;
  color: var(--text-mid);
  line-height: 1.5;
}

.feedback-read-form { margin-top: 12px; padding-left: 34px; }

.feedback-read-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.feedback-read-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Admin — idées & problèmes */
.admin-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-feedback-card {
  padding: 22px;
  border-radius: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.admin-feedback-card--pending {
  border-color: rgba(232, 200, 64, .35);
  box-shadow: 0 0 30px rgba(232, 200, 64, .05);
}

.admin-feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-feedback-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.admin-feedback-user {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.admin-feedback-body {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg3);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mid);
}

.admin-feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.admin-feedback-done {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

@media (max-width: 900px) {
  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .feedback-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .feedback-notice {
    margin: 0 12px 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .feedback-hero,
  .feedback-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .feedback-hero-body {
    flex-direction: column;
    gap: 14px;
  }

  .feedback-segment {
    grid-template-columns: 1fr;
  }

  .feedback-panel {
    padding: 18px;
  }

  .feedback-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .feedback-stat {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .feedback-hero {
    padding-top: calc(12px + constant(safe-area-inset-top));
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .feedback-hero-top {
    margin-bottom: 16px;
    align-items: stretch;
  }

  .feedback-back {
    min-height: 44px;
    padding: 8px 10px 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
  }

  .feedback-back-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
    flex-shrink: 0;
  }

  .feedback-admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 11px;
    text-align: center;
  }
}

/* ── PARAMÈTRES BIBLIOTHÈQUE ── */
body.settings-page {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.settings-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  padding-top: calc(28px + env(safe-area-inset-top, 0px));
}

.settings-hero-top {
  margin-bottom: 18px;
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
}

.settings-back:hover {
  color: var(--text);
}

.settings-hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 1px;
}

.settings-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}

.settings-flash {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.settings-flash--ok {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.35);
  color: #9ae6b4;
}

.settings-flash--err {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: #fca5a5;
}

.settings-card {
  margin-top: 24px;
  padding: 24px;
  border-radius: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.settings-section + .settings-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.settings-section-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.settings-section-desc {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.settings-visibility-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-visibility-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.settings-visibility-option input {
  margin-top: 4px;
  flex-shrink: 0;
}

.settings-visibility-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  flex: 1;
}

.settings-visibility-option input:checked + .settings-visibility-box {
  border-color: rgba(155, 89, 182, 0.55);
  background: rgba(155, 89, 182, 0.08);
}

.settings-visibility-name {
  font-weight: 600;
  font-size: 15px;
}

.settings-visibility-hint {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

.settings-section--access.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.settings-access-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.settings-access-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}

.settings-access-item:hover {
  border-color: rgba(155, 89, 182, 0.35);
}

.settings-access-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.settings-access-role {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.settings-empty {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  font-style: italic;
}

.settings-actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.settings-account {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.settings-card--danger {
  margin-top: 24px;
  border-color: rgba(220, 80, 80, 0.35);
}

.settings-card--danger .settings-section-title {
  color: #e88;
}

.settings-delete-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-delete-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.settings-delete-confirm input {
  margin-top: 3px;
  flex-shrink: 0;
}

.settings-delete-password-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.settings-delete-password {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.settings-actions--danger {
  justify-content: flex-start;
}

.settings-delete-form .btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.settings-card--privacy {
  margin-top: 24px;
}

.settings-gdpr-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.settings-gdpr-subtitle {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.settings-delete-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-delete-media-option {
  margin-top: 10px;
}

.settings-legal-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
}

.settings-legal-list li + li {
  margin-top: 8px;
}

.settings-legal-list a {
  color: var(--accent);
}

.settings-legal-updated {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.settings-shell--legal .settings-legal {
  margin-bottom: 32px;
}

.settings-card--audit {
  border-color: rgba(125, 211, 252, 0.22);
}

.settings-audit-link {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(125, 211, 252, 0.06);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.settings-audit-link:hover {
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(125, 211, 252, 0.1);
}

.settings-audit-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.22);
  font-size: 20px;
}

.settings-audit-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.settings-audit-desc {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-mid);
}

.settings-audit-arrow {
  margin-left: auto;
  color: var(--text-mid);
}

.audit-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.audit-h2 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.audit-lead,
.audit-muted {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
}

.audit-muted {
  color: var(--text-mid);
  font-size: 13px;
}

.audit-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-mid);
}

.audit-findings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-finding,
.audit-past {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}

.audit-finding summary,
.audit-past > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 88px 140px 1fr;
  gap: 10px;
  align-items: start;
}

.audit-finding summary::-webkit-details-marker,
.audit-past > summary::-webkit-details-marker {
  display: none;
}

.audit-finding summary:hover,
.audit-past > summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.audit-finding[open] summary,
.audit-past[open] > summary {
  border-bottom: 1px solid var(--border);
}

.audit-sujet {
  font-weight: 650;
}

.audit-how {
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
}

.audit-how p {
  margin: 0;
  color: var(--text-mid);
  font-size: 13px;
  white-space: pre-wrap;
}

.audit-how strong {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}

.audit-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
}

.audit-sev--crit {
  background: rgba(224, 62, 62, 0.2);
  color: #ffb8bf;
}

.audit-sev--high {
  background: rgba(243, 156, 18, 0.18);
  color: #ffd992;
}

.audit-sev--mid {
  background: rgba(98, 183, 255, 0.14);
  color: #c6e4ff;
}

.audit-sev--low {
  background: rgba(154, 164, 178, 0.12);
  color: #b2bcc9;
}

.audit-past {
  margin-top: 10px;
}

.audit-past > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 650;
}

.audit-open-hint {
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 500;
}

.audit-past-body {
  padding: 4px 16px 16px;
}

@media (max-width: 720px) {
  .audit-finding summary {
    grid-template-columns: 1fr;
  }
}

/* ── MODALE RGPD (première connexion) ── */
body.gdpr-notice-open {
  overflow: hidden;
}

.gdpr-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gdpr-notice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}

.gdpr-notice-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 28px 26px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #16161a 0%, #0d0d10 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  color: var(--text);
}

.gdpr-notice-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
}

.gdpr-notice-title {
  margin: 0 0 12px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.04em;
  font-weight: 400;
  line-height: 1;
}

.gdpr-notice-lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
}

.gdpr-notice-list {
  margin: 0 0 16px;
  padding-left: 1.15rem;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}

.gdpr-notice-list li + li {
  margin-top: 10px;
}

.gdpr-notice-policy {
  margin: 0 0 20px;
  font-size: 13px;
}

.gdpr-notice-policy a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gdpr-notice-btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0a0a0b;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.gdpr-notice-btn:hover:not(:disabled) {
  opacity: 0.92;
}

.gdpr-notice-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ── TUTORIEL PREMIÈRE VISITE ── */
body.onboarding-tutorial-open {
  overflow: hidden;
}

.onboarding-tutorial-modal {
  position: fixed;
  inset: 0;
  z-index: 11900;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.onboarding-tutorial-modal.hidden {
  display: none;
}

.onboarding-tutorial-modal.is-opening .onboarding-tutorial-backdrop {
  animation: tutorial-backdrop-in .32s ease both;
}

.onboarding-tutorial-modal.is-opening .onboarding-tutorial-panel {
  animation: tutorial-panel-in .38s cubic-bezier(.2, .85, .25, 1) both;
}

.onboarding-tutorial-modal.is-closing .onboarding-tutorial-backdrop {
  animation: tutorial-backdrop-out .24s ease both;
}

.onboarding-tutorial-modal.is-closing .onboarding-tutorial-panel {
  animation: tutorial-panel-out .26s ease both;
}

.onboarding-tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.onboarding-tutorial-panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100vw);
  max-height: 100vh;
  overflow-y: auto;
  padding: 28px 24px 22px;
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #16161a 0%, #0d0d10 100%);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45);
  color: var(--text);
}

.onboarding-tutorial-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-mid);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.onboarding-tutorial-close:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.onboarding-tutorial-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 4px;
}

.onboarding-tutorial-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.onboarding-tutorial-title {
  margin: 0 0 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.04em;
  font-weight: 400;
  line-height: 1.05;
}

.onboarding-tutorial-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.onboarding-tutorial-dot {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.onboarding-tutorial-dot.is-active {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(232, 200, 64, .35);
}

.onboarding-tutorial-body {
  min-height: 120px;
  position: relative;
}

.onboarding-tutorial-step {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.onboarding-tutorial-step.is-active {
  display: block;
  animation: tutorial-step-in .32s ease forwards;
}

.onboarding-tutorial-step.is-leaving {
  display: block;
  animation: tutorial-step-out .2s ease forwards;
}

.onboarding-tutorial-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

.onboarding-tutorial-text strong {
  color: var(--text);
  font-weight: 600;
}

.onboarding-tutorial-link {
  display: inline-flex;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.onboarding-tutorial-link:hover {
  text-decoration: underline;
}

.onboarding-tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.onboarding-tutorial-btn {
  padding: 11px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0a0a0b;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.onboarding-tutorial-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(232, 200, 64, .22);
}

.onboarding-tutorial-btn:active:not(:disabled) {
  transform: translateY(0) scale(.98);
}

.onboarding-tutorial-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.onboarding-tutorial-btn--ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
  box-shadow: none;
}

.onboarding-tutorial-btn--ghost:hover:not(:disabled) {
  border-color: rgba(232, 200, 64, .28);
  color: var(--accent);
  box-shadow: none;
}

@keyframes tutorial-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tutorial-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes tutorial-panel-in {
  from { transform: translateX(-104%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes tutorial-panel-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-104%); opacity: 0; }
}

@keyframes tutorial-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tutorial-step-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-tutorial-modal.is-opening .onboarding-tutorial-backdrop,
  .onboarding-tutorial-modal.is-opening .onboarding-tutorial-panel,
  .onboarding-tutorial-modal.is-closing .onboarding-tutorial-backdrop,
  .onboarding-tutorial-modal.is-closing .onboarding-tutorial-panel,
  .onboarding-tutorial-step.is-active,
  .onboarding-tutorial-step.is-leaving {
    animation: none !important;
  }
}

/* ── VISITE GUIDÉE PHP ── */
body.vault-tour-active::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  z-index: 12000;
  pointer-events: none;
}

body.vault-tour-active [data-tour] {
  position: relative;
  z-index: 12001;
}

body.vault-tour-target-nav-game [data-tour="nav-game"],
body.vault-tour-target-library-catalogue [data-tour="library-catalogue"],
body.vault-tour-target-library-mine [data-tour="library-mine"],
body.vault-tour-target-btn-add [data-tour="btn-add"],
body.vault-tour-target-media-card [data-tour="media-card"],
body.vault-tour-target-btn-library-add [data-tour="btn-library-add"],
body.vault-tour-target-btn-detail-edit [data-tour="btn-detail-edit"],
body.vault-tour-target-collection-status [data-tour="collection-status"],
body.vault-tour-target-review-section [data-tour="review-section"],
body.vault-tour-target-cover-upload [data-tour="cover-upload"] {
  z-index: 12002 !important;
  outline: 2px solid rgba(232, 200, 64, .92);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(232, 200, 64, .18), 0 0 28px rgba(232, 200, 64, .28);
  animation: vault-tour-target-pulse 2.2s ease-in-out infinite;
}

body.vault-tour-target-media-card [data-tour="media-card"]:first-of-type {
  z-index: 12003 !important;
}

.vault-tour-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12010;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(180deg, #17171c 0%, #0d0d10 100%);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
}

.vault-tour-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.vault-tour-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
}

.vault-tour-badge--try {
  color: #0a0a0b;
  background: var(--accent);
  border-color: transparent;
}

.vault-tour-step {
  font-size: 11px;
  color: var(--text-dim);
}

.vault-tour-title {
  margin: 0 0 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: .04em;
  font-weight: 400;
  line-height: 1.05;
  color: var(--text);
}

.vault-tour-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

.vault-tour-body strong {
  color: var(--text);
}

.vault-tour-missing {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #fcd34d;
  background: rgba(252, 211, 77, .08);
  border: 1px solid rgba(252, 211, 77, .18);
}

.vault-tour-missing a {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.vault-tour-missing a:hover {
  text-decoration: underline;
}

.vault-tour-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.vault-tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #0a0a0b;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
}

.vault-tour-btn--ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
}

.vault-tour-btn--ghost:hover {
  color: var(--accent);
  border-color: rgba(232, 200, 64, .28);
}

@keyframes vault-tour-target-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232, 200, 64, .16), 0 0 18px rgba(232, 200, 64, .18); }
  50% { box-shadow: 0 0 0 6px rgba(232, 200, 64, .24), 0 0 32px rgba(232, 200, 64, .34); }
}

@media (min-width: 901px) {
  .vault-tour-panel {
    left: 240px;
    right: auto;
    top: 0;
    bottom: 0;
    width: min(320px, calc(100vw - 240px));
    max-width: 320px;
    padding: 22px 20px;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, .08);
    overflow-y: auto;
  }

  body.vault-tour-active #main {
    margin-left: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.vault-tour-target-nav-game [data-tour="nav-game"],
  body.vault-tour-target-library-catalogue [data-tour="library-catalogue"],
  body.vault-tour-target-library-mine [data-tour="library-mine"],
  body.vault-tour-target-btn-add [data-tour="btn-add"],
  body.vault-tour-target-media-card [data-tour="media-card"],
  body.vault-tour-target-btn-library-add [data-tour="btn-library-add"],
  body.vault-tour-target-btn-detail-edit [data-tour="btn-detail-edit"],
  body.vault-tour-target-collection-status [data-tour="collection-status"],
  body.vault-tour-target-review-section [data-tour="review-section"],
  body.vault-tour-target-cover-upload [data-tour="cover-upload"] {
    animation: none;
  }
}

/* ── VISITE GUIDÉE INTERACTIVE (legacy JS — inutilisé) ── */
body.interactive-tour-open {
  overflow: hidden;
}

.interactive-tour {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
}

.interactive-tour.hidden {
  display: none;
}

.interactive-tour-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.interactive-tour-spotlight {
  position: fixed;
  z-index: 12001;
  border-radius: 12px;
  border: 2px solid rgba(232, 200, 64, .85);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, .78),
    0 0 28px rgba(232, 200, 64, .28);
  pointer-events: none;
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
  animation: interactive-tour-pulse 2.2s ease-in-out infinite;
}

.interactive-tour-spotlight.hidden {
  display: none;
}

.interactive-tour-target {
  position: relative;
  z-index: 12002 !important;
}

.interactive-tour-tooltip {
  position: fixed;
  z-index: 12003;
  width: min(360px, calc(100vw - 24px));
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(165deg, #18181d 0%, #0e0e12 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  color: var(--text);
  pointer-events: auto;
  transition: top .28s ease, left .28s ease, transform .28s ease;
}

.interactive-tour-tooltip--center {
  max-width: min(440px, calc(100vw - 24px));
}

.interactive-tour-tooltip.is-bump {
  animation: interactive-tour-bump .28s ease;
}

.interactive-tour-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--text-mid);
  font: inherit;
  cursor: pointer;
}

.interactive-tour-close:hover {
  color: var(--text);
}

.interactive-tour-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-right: 28px;
}

.interactive-tour-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
}

.interactive-tour-badge.is-try {
  color: #0a0a0b;
  background: var(--accent);
  border-color: transparent;
  animation: interactive-tour-badge-pulse 1.8s ease-in-out infinite;
}

.interactive-tour-step {
  font-size: 11px;
  color: var(--text-dim);
}

.interactive-tour-title {
  margin: 0 0 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: .04em;
  font-weight: 400;
  line-height: 1.05;
}

.interactive-tour-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}

.interactive-tour-body strong {
  color: var(--text);
}

.interactive-tour-missing {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #fcd34d;
  background: rgba(252, 211, 77, .08);
  border: 1px solid rgba(252, 211, 77, .18);
}

.interactive-tour-missing-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.interactive-tour-missing-link:hover {
  text-decoration: underline;
}

.interactive-tour-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.interactive-tour-btn {
  padding: 9px 14px;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #0a0a0b;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.interactive-tour-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 200, 64, .2);
}

.interactive-tour-btn--ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
  box-shadow: none;
}

.interactive-tour-btn--ghost:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(232, 200, 64, .28);
  box-shadow: none;
}

@keyframes interactive-tour-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .78), 0 0 18px rgba(232, 200, 64, .2); }
  50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .78), 0 0 32px rgba(232, 200, 64, .42); }
}

@keyframes interactive-tour-bump {
  0% { transform: scale(.98); opacity: .7; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes interactive-tour-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .interactive-tour-spotlight,
  .interactive-tour-badge.is-try,
  .interactive-tour-tooltip.is-bump {
    animation: none !important;
    transition: none !important;
  }
}

.members-directory-lock {
  font-size: 11px;
  line-height: 1;
}

.members-directory-btn--private .members-directory-count {
  opacity: 0.75;
}

/* ── HISTORIQUE BIBLIOTHÈQUE ── */
.history-shell {
  max-width: 820px;
}

.history-card {
  padding: 0;
  overflow: hidden;
}

.history-empty {
  margin: 0;
  padding: 28px 24px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 20px;
}

.history-item-body {
  flex: 1;
  min-width: 0;
}

.history-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-item-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.history-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.history-badge--added {
  background: rgba(46, 204, 113, 0.14);
  color: #9ae6b4;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.history-badge--deleted {
  background: rgba(231, 76, 60, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(231, 76, 60, 0.28);
}

.history-badge--restored {
  background: rgba(155, 89, 182, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(155, 89, 182, 0.28);
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.history-item-source {
  color: #7ec8e8;
}

.history-item-snapshot {
  color: #c4b5fd;
}

.history-item-source::before,
.history-item-snapshot::before,
.history-item-date::before {
  content: '·';
  margin-right: 10px;
  color: var(--text-dim);
}

.history-item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.history-restore-form {
  margin: 0;
}

.history-restore-btn,
.history-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.history-restore-btn:hover,
.history-view-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.history-restore-btn {
  border-color: rgba(155, 89, 182, 0.4);
  color: #d8b4fe;
}

.history-restore-btn:hover {
  background: rgba(155, 89, 182, 0.1);
}

.history-restored-label {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

.history-week + .history-week {
  border-top: 1px solid var(--border);
}

.history-week-title {
  margin: 0;
  padding: 14px 20px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
  .settings-shell {
    padding: 12px 16px 40px;
    padding-top: calc(12px + constant(safe-area-inset-top));
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .settings-hero-top {
    margin-bottom: 10px;
  }

  .settings-back {
    min-height: 44px;
    padding: 10px 12px 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
  }

  .settings-hero h1 {
    font-size: 32px;
  }
}

@media (max-width: 640px) {
  .history-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .history-item-actions {
    width: 100%;
    padding-left: 56px;
  }
}

/* ── ADMIN GÉO-ACCÈS ── */
.admin-geo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-geo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
}

.admin-geo-card--soon {
  border-color: rgba(245, 158, 11, 0.35);
}

.admin-geo-card--current {
  border-color: rgba(41, 128, 185, 0.4);
}

.admin-geo-remove {
  display: flex;
  flex-shrink: 0;
}

.admin-geo-remove .btn-danger,
.admin-geo-card .btn-danger {
  min-height: 44px;
  min-width: 96px;
  z-index: 1;
  position: relative;
}

.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-geo-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.admin-geo-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  flex-shrink: 0;
}

.admin-geo-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.admin-geo-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.admin-geo-soon {
  color: #f59e0b;
  font-weight: 600;
}

.admin-geo-current {
  color: #60a5fa;
  font-weight: 600;
}

.admin-geo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
}

.admin-geo-form-grid {
  display: grid;
  gap: 8px;
}

.admin-geo-hint {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--text-mid);
}

@media (max-width: 768px) {
  .admin-geo-card {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .admin-geo-remove,
  .admin-geo-card .btn-danger {
    width: 100%;
  }
}

/* ========================================
   VAULT — MÉDIATHÈQUE 2026 REFRESH
   ======================================== */
body.php-app:not(.admin-app) {
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(232, 200, 64, 0.07), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(41, 128, 185, 0.06), transparent 50%),
    var(--bg);
}
body.php-app:not(.admin-app) #main {
  background: transparent;
}
body.php-app:not(.admin-app) #topbar {
  gap: 12px;
  padding: 16px 24px;
  background: rgba(17, 17, 19, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
body.php-app:not(.admin-app) #topbar::before {
  content: none;
}
body.php-app:not(.admin-app) .search-wrap input,
body.php-app:not(.admin-app) #sort,
body.php-app:not(.admin-app) #theme-filter,
body.php-app:not(.admin-app) .platform-filter-search {
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 11, 0.85);
  transition: border-color .15s, box-shadow .15s;
}
body.php-app:not(.admin-app) .search-wrap input:focus,
body.php-app:not(.admin-app) #sort:focus,
body.php-app:not(.admin-app) #theme-filter:focus,
body.php-app:not(.admin-app) .platform-filter-search:focus {
  border-color: rgba(232, 200, 64, 0.45);
  box-shadow: 0 0 0 3px rgba(232, 200, 64, 0.1);
}
body.php-app:not(.admin-app) .btn-bulk-select {
  border-radius: 10px;
}

.library-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 22px 28px 8px;
  position: relative;
  z-index: 0;
  animation: vault-lib-rise .45s ease both;
}
.library-masthead-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.library-masthead-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  letter-spacing: 3px;
  line-height: 1;
  color: var(--text);
}
.library-masthead-icon {
  color: var(--accent);
  font-size: 0.85em;
  line-height: 1;
}
.library-masthead[data-type="music"] .library-masthead-icon { color: var(--music); }
.library-masthead[data-type="movie"] .library-masthead-icon { color: var(--movie); }
.library-masthead[data-type="series"] .library-masthead-icon { color: var(--series); }
.library-masthead[data-type="game"] .library-masthead-icon { color: var(--game); }
.library-masthead[data-type="makeup"] .library-masthead-icon { color: var(--makeup); }
.library-masthead-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.library-masthead-count {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.library-masthead-add {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 200, 64, 0.4);
  background: rgba(232, 200, 64, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s;
}
.library-masthead-add:hover {
  background: rgba(232, 200, 64, 0.2);
  border-color: var(--accent);
  transform: translateY(-1px);
}

body.php-app:not(.admin-app) .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
  padding: 18px 28px 40px;
}
body.php-app:not(.admin-app) .card {
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(26, 26, 30, 0.95), rgba(14, 14, 16, 0.98));
  overflow: hidden;
}
body.php-app:not(.admin-app) .card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .18s;
  z-index: 2;
}
body.php-app:not(.admin-app) .card--music::before { background: var(--music); }
body.php-app:not(.admin-app) .card--movie::before { background: var(--movie); }
body.php-app:not(.admin-app) .card--series::before { background: var(--series); }
body.php-app:not(.admin-app) .card--game::before { background: var(--game); }
body.php-app:not(.admin-app) .card--makeup::before { background: var(--makeup); }
body.php-app:not(.admin-app) .card:hover {
  transform: translateY(-5px);
  border-color: rgba(232, 200, 64, 0.35);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}
body.php-app:not(.admin-app) .card:hover::before { opacity: 1; }
body.php-app:not(.admin-app) .card-cover {
  aspect-ratio: 3 / 4;
}
body.php-app:not(.admin-app) .card-info {
  padding: 12px 13px 14px;
}
body.php-app:not(.admin-app) .card-title {
  font-size: 15px;
  letter-spacing: 0.8px;
}
body.php-app:not(.admin-app) .card-type-badge {
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.06em;
}
body.php-app:not(.admin-app) .library-status-heading {
  margin-top: 8px;
  padding: 10px 0 8px;
  border-bottom-color: rgba(255, 255, 255, 0.06);
  color: var(--text-mid);
}
body.php-app:not(.admin-app) .library-switch {
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}
body.php-app:not(.admin-app) .library-switch-btn.is-active {
  background: rgba(232, 200, 64, 0.14);
  color: var(--accent);
}
body.php-app:not(.admin-app) .btn-add {
  border-radius: 10px;
}

@keyframes vault-lib-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .library-masthead {
    padding: 16px 18px 4px;
  }
  body.php-app:not(.admin-app) .media-grid {
    padding: 14px 18px 28px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }
}

/* ── PC : barre latérale, pas de menu ☰ ni de navigation du bas ── */
@media (min-width: 769px) {
  .menu-toggle,
  a.menu-toggle,
  .mobile-bottom-nav,
  .sidebar-overlay,
  a.sidebar-overlay,
  .sidebar-close,
  a.sidebar-close {
    display: none !important;
  }
}

/* ── iPhone : présentation téléphone, distincte du PC ── */
@media (max-width: 768px) {
  /* Plus spécifique que body.php-app #topbar { padding: 16px 24px }
     sinon le menu ☰ passe sous l’heure iOS et n’est plus cliquable. */
  body.php-app:not(.admin-app) #topbar,
  #topbar {
    padding: 10px 12px;
    padding-top: calc(10px + constant(safe-area-inset-top));
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  body.php-app:not(.admin-app) a.menu-toggle,
  a.menu-toggle {
    display: flex;
    position: relative;
    z-index: 60;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  /* Le ☰ ouvre les réglages : les catégories sont déjà en bas d’écran. */
  #sidebar .nav-links,
  #sidebar .btn-add {
    display: none;
  }

  .library-switch {
    margin: 12px 12px 0;
    padding: 6px;
    gap: 8px;
  }

  .library-switch-btn {
    padding: 14px 12px;
    font-size: 15px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ranking-row {
    min-height: 96px;
    padding: 10px;
    gap: 10px;
  }

  .ranking-title {
    font-size: 15px;
  }

  .ranking-cta {
    font-size: 14px;
  }

  .sidebar-user {
    margin: 8px 12px 0;
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-user-name {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .sidebar-user-role {
    font-size: 12px;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
  }

  .sidebar-user-link {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 14px 14px;
    margin-bottom: 6px;
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-user-link:hover,
  .sidebar-user-link:active {
    color: var(--accent);
    background: rgba(232, 200, 64, 0.1);
    border-color: rgba(232, 200, 64, 0.28);
  }

  .mobile-nav-item {
    padding: 6px 2px 8px;
    min-height: 50px;
    font-size: 9px;
    letter-spacing: 0;
  }

  /* Pas de gros titre « Séries » : déjà indiqué par l’onglet du bas. */
  .library-masthead-copy {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .library-masthead {
    position: relative;
    padding: 6px 12px 8px;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }

  .library-masthead-count,
  .library-masthead-add {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }

  .movie-format-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 10px;
    margin: 0;
    gap: 8px;
    scrollbar-width: none;
  }

  .movie-format-filter::-webkit-scrollbar {
    display: none;
  }

  .movie-format-chip {
    flex-shrink: 0;
    min-height: 36px;
    padding: 8px 14px;
  }

  body.php-app:not(.admin-app) #sort,
  body.php-app:not(.admin-app) #theme-filter {
    background-color: rgba(10, 10, 11, 0.85);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 8 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 7px;
  }

  body.php-app:not(.admin-app) .media-grid {
    padding: 8px 12px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .library-masthead { animation: none; }
  body.php-app:not(.admin-app) .card:hover { transform: none; }
}
