@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --bg: #07070f;
  --bg2: #0f0f1a;
  --bg3: #16162a;
  --accent: #f5c842;
  --accent2: #c9a030;
  --text: #e8e4d8;
  --muted: #7a7690;
  --border: #2a2840;
  color-scheme: dark;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  overflow: hidden;
}

/* ── LAYOUT ── */
#app {
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100vh;
}

header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  min-height: 88px;
}

.header-logo {
  height: 68px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  flex-shrink: 0;
}

.header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-row-tools {
  gap: 10px;
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Séparateur vertical entre zones */
.header-vsep {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.07);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Séparateur horizontal (pousse vers la droite) */
.header-sep {
  flex: 1;
  min-width: 12px;
}

/* ── ZONES HEADER ── */
.hzone {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hzone-label {
  font-family: 'Syne', sans-serif;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3a3860;
  line-height: 1;
  padding-left: 2px;
}
.hzone-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── KEY BADGES (Zone C) ── */
.key-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.key-badge:hover { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); }
.key-badge.active { border-color: rgba(240,125,0,0.4); background: rgba(240,125,0,0.06); }
.key-badge.missing { border-color: rgba(240,125,0,0.3); background: rgba(240,125,0,0.05); }

.key-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #3a3860;
  transition: background 0.2s, box-shadow 0.2s;
}
.key-dot.ok      { background: #4ec94e; box-shadow: 0 0 6px rgba(78,201,78,0.5); }
.key-dot.missing { background: #f07d00; box-shadow: 0 0 6px rgba(240,125,0,0.5); }

.key-name {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.key-val {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #4a4868;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.key-badge.missing .key-name { color: #f07d00; }
.key-badge.missing .key-val  { color: #c06000; font-size: 9px; }

/* Popover édition clé */
.key-popover {
  position: fixed;
  z-index: 600;
  background: #16162a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  min-width: 260px;
}
.key-popover.hidden { display: none; }
.key-pop-label {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.key-pop-input {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: var(--text);
  padding: 7px 10px;
  outline: none;
  width: 100%;
}
.key-pop-input:focus { border-color: rgba(240,125,0,0.5); }
.key-pop-hint {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #4a4868;
  line-height: 1.5;
}
.key-pop-hint a { color: #d47830; text-decoration: none; }
.key-pop-hint a:hover { text-decoration: underline; }

/* Boutique désactivée si token manquant */
.hzone.zone-disabled .inp-seller,
.hzone.zone-disabled .btn-shops,
.hzone.zone-disabled .btn-load {
  opacity: 0.35;
  pointer-events: none;
}

/* ── API KEYS + HELP (legacy — conservé pour compatibilité) ── */
.api-keys-wrap { display: none; }
.help-wrap     { display: none; }

.help-wrap {
  position: relative;
}

/* Bouton ℹ À propos dans le header */
.btn-about {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.btn-about:hover { border-color: #f07d00; color: #f07d00; }

/* ── MODAL À PROPOS / ONBOARDING ── */
.about-panel {
  max-width: min(660px, 96vw);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.about-body {
  overflow-y: auto;
  padding: 4px 0 0;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.about-tagline {
  padding: 14px 20px 6px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.about-section {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.about-section:last-child { border-bottom: none; }

.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}
.about-list li {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.about-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #f07d00;
  font-weight: 700;
}

/* Clés API */
.about-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.about-key {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.about-key-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.about-key-head strong {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.about-key p {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}

.about-badge {
  font-family: 'Syne', sans-serif;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
}
.about-badge.required {
  background: rgba(245,200,66,0.15);
  color: #f5c842;
}
.about-badge.optional {
  background: rgba(212,120,48,0.15);
  color: #d47830;
}

.about-link {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #d47830;
  text-decoration: none;
}
.about-link:hover { text-decoration: underline; color: #f07d00; }


/* Confidentialité */
.about-privacy {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
}
.about-privacy strong { color: var(--text); font-weight: 500; }

/* Contact */
.about-contact {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.about-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.about-contact-btn:hover { border-color: #f07d00; color: #f07d00; }

/* Footer */
.about-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  gap: 12px;
}
.about-noshow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.about-noshow input[type=checkbox] { cursor: pointer; accent-color: #f07d00; }

.btn-help {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s;
}
.btn-help:hover  { color: var(--text); border-color: var(--muted); }
.btn-help.active { color: var(--accent); border-color: var(--accent); background: #1a1408; }

.help-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 300;
  width: 310px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.help-popup.hidden { display: none; }

.hp-item { display: flex; flex-direction: column; gap: 5px; }

.hp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.hp-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.hp-required { background: #1a0808; color: #e07070; border: 1px solid #3a1010; }
.hp-optional { background: #081a08; color: #6ad46a; border: 1px solid #10361a; }
.hp-beta     { background: #1a0a20; color: #c080e0; border: 1px solid #3a1060; }

.hp-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
}
.hp-desc strong { color: var(--accent); font-weight: 500; }

/* ── DOC MODAL ── */
.btn-key-doc {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s;
  margin-left: -4px;
}
.btn-key-doc:hover { color: var(--accent); border-color: var(--accent); }

.doc-modal-panel {
  width: 520px;
  max-width: 95vw;
}

.doc-modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.doc-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.doc-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.doc-step-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.doc-step-content strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.doc-step-content p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.doc-step-content a {
  color: var(--accent);
  text-decoration: none;
}
.doc-step-content a:hover { text-decoration: underline; }

.doc-muted {
  font-size: 11px;
  color: var(--border);
  font-style: italic;
}

.doc-summary {
  margin-top: 4px;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.doc-summary strong { color: var(--accent); }

input[type="text"] {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

input[type="text"]:-webkit-autofill,
input[type="text"]:-webkit-autofill:hover,
input[type="text"]:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--bg3) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

input[type="text"]::placeholder { color: var(--muted); }

.inp-seller { width: 200px; }
.inp-token { width: 185px; }
.inp-lfm   { width: 155px; }

.seller-wrap { position: relative; }

.shop-history-dd {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}

.shd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #16142a;
  transition: background 0.15s;
}
.shd-item:last-child { border-bottom: none; }
.shd-item:hover { background: var(--bg3); }

.shd-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shd-meta {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.shd-del {
  background: none;
  border: none;
  color: #3a3858;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 3px;
}
.shd-del:hover { color: #e07070; background: #1e1c38; }

.lbl-vinyl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.lbl-vinyl:hover { color: var(--text); }
.lbl-vinyl input { accent-color: var(--accent); cursor: pointer; }

.sim-depth-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.sim-icon {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}
.sim-slider-track {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#sim-depth {
  width: 76px;
  height: 4px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
#sim-depth::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 4px var(--accent);
}
#sim-depth::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 4px var(--accent);
}
.sim-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
  width: 76px;
  line-height: 1;
}

button {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 14px;
  transition: background 0.2s, transform 0.1s;
}

button:active { transform: scale(0.97); }

.btn-load {
  background: var(--accent);
  color: #07070f;
}

.btn-load:hover { background: #f7d160; }

.btn-favs {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-favs #fav-count {
  font-size: 11px;
  color: var(--accent);
  margin-left: 2px;
}

.btn-cfg {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-cfg:hover  { border-color: #d47830; color: #d47830; }
.btn-cfg.active { border-color: #d47830; color: #d47830; background: #1e1408; }

/* ── CONFIGS PANEL ── */
.cfg-panel {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  width: min(860px, 96vw);
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.07);
  border-top: none;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(240,125,0,0.06);
  display: flex;
  flex-direction: column;
  max-height: min(470px, calc(100vh - 40px));
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
}

.cfg-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-10px);
}

.cfg-panel-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.cfg-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.cfg-col-left {
  flex: 0 0 55%;
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}
.cfg-col-left .cfg-section {
  overflow-y: auto;
  min-height: 0;
}
.cfg-col-left .cfg-section::-webkit-scrollbar { width: 4px; }
.cfg-col-left .cfg-section::-webkit-scrollbar-track { background: transparent; }
.cfg-col-left .cfg-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.cfg-new-bar {
  flex-shrink: 0;
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cfg-col-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cfg-panel-header {
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cfg-panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f07d00;
}
.cfg-panel-title svg { flex-shrink: 0; }
.cfg-panel-title h2 {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f07d00;
  margin: 0;
}
.cfg-btn-close {
  width: 28px; height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #888;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.cfg-btn-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.cfg-section {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cfg-col-left .cfg-section {
  flex: 1;  /* la section gauche occupe toute la hauteur de la colonne */
}
.cfg-section + .cfg-section {
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cfg-section-label {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cfg-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.05);
}

/* config list */
.cfg-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 2px;
}
.cfg-list::-webkit-scrollbar { width: 4px; }
.cfg-list::-webkit-scrollbar-track { background: transparent; }
.cfg-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.cfg-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.cfg-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  transition: background 0.15s, border-color 0.15s;
}
.cfg-list-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.09);
}
.cfg-list-item:hover .cfg-item-actions,
.cfg-list-item.editing .cfg-item-actions { opacity: 1; }

.cfg-item-name {
  flex: 1;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #d8d8d8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}
.cfg-list-item.is-primary {
  border-color: rgba(245,200,66,0.4);
  background: rgba(245,200,66,0.06);
}
.cfg-list-item.is-primary .cfg-item-name { color: #f5c842; }

.cfg-list-item.is-secondary {
  border-color: rgba(212,120,48,0.4);
  background: rgba(212,120,48,0.07);
}
.cfg-list-item.is-secondary .cfg-item-name { color: #d47830; }
.cfg-draft-label { color: #d47830; }
.cfg-item-sub { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }

.cfg-item-rename-input {
  display: none;
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f07d00;
  outline: none;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #f07d00;
  min-width: 0;
  padding: 1px 0;
}
.cfg-list-item.editing .cfg-item-name { display: none; }
.cfg-list-item.editing .cfg-item-rename-input { display: block; }
.cfg-item-rename-input.cfg-rename-error { border-bottom-color: #c05050; color: #c05050; }

.cfg-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.cfg-btn-icon {
  width: 26px; height: 26px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #777;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.cfg-btn-icon:hover {
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border-color: rgba(255,255,255,0.15);
}
.cfg-btn-icon.cfg-btn-danger:hover {
  background: rgba(220,50,50,0.15);
  color: #e55;
  border-color: rgba(220,50,50,0.2);
}
.cfg-btn-icon.cfg-btn-rename.active {
  color: #f07d00;
  border-color: rgba(240,125,0,0.35);
}

.cfg-empty-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 4px;
  text-align: center;
}

.btn-cfg-new {
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(240,125,0,0.3);
  background: rgba(240,125,0,0.04);
  color: #f07d00;
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.02em;
}
.btn-cfg-new:hover {
  background: rgba(240,125,0,0.1);
  border-color: rgba(240,125,0,0.5);
}
.btn-cfg-new.hidden { display: none; }

/* selection slots */
.cfg-hint-block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(100,180,255,0.05);
  border: 1px solid rgba(100,180,255,0.1);
  margin-bottom: 12px;
}
.cfg-hint-icon { color: #d47830; flex-shrink: 0; margin-top: 1px; }
.cfg-hint-block p {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #5a7a99;
  line-height: 1.5;
}
.cfg-hint-block strong { color: #d47830; font-weight: 500; }

.cfg-selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cfg-selection-slot {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cfg-slot-badge {
  font-family: 'Syne', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  align-self: flex-start;
}
.cfg-slot-badge.primary {
  background: rgba(245,200,66,0.15);
  color: #f5c842;
}
.cfg-slot-badge.secondary {
  background: rgba(212,120,48,0.18);
  color: #d47830;
}
.cfg-slot-desc {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #4a5a6a;
  line-height: 1.4;
}
.cfg-slot-select {
  width: 100%;
  padding: 7px 28px 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background-color: #1e1e24;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: #ddd;
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.cfg-slot-select:focus { border-color: rgba(255,255,255,0.2); }
.cfg-slot-select.primary:focus   { border-color: rgba(245,200,66,0.45); }
.cfg-slot-select.secondary:focus { border-color: rgba(212,120,48,0.45); }

.cfg-panel-footer {
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.btn-cfg-apply {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f07d00, #e05500);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(240,125,0,0.3);
}
.btn-cfg-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(240,125,0,0.45);
}
.btn-cfg-apply:active { transform: translateY(0); }

/* ── FAVORIS READ-ONLY PANEL ── */
.favs-readonly {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.favs-empty-hint { font-size: 11px; color: var(--muted); }
.favs-readonly-item {
  font-size: 12px;
  color: var(--text);
  padding: 3px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.favs-readonly-weight {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── CONFIG EDITOR MODAL ── */
.cfg-editor-panel {
  width: min(700px, 96vw);
  height: min(540px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cfg-editor-panel.cfe-no-skip .cfe-album-compact[data-role="skip"] { display: none; }
.cfe-editor-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}
.cfg-editor-name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 2px 4px;
  outline: none;
}
.cfg-editor-name-input:focus { border-bottom-color: var(--accent); }

.cfe-add-artist-wrap {
  padding: 12px 20px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cfe-add-row { display: flex; gap: 6px; position: relative; }
.cfe-add-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
}
.cfe-add-input:focus { border-color: var(--accent); }
.cfe-add-btn {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #07070f;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 0 14px;
}
.cfe-add-btn:hover { background: var(--accent2); }

.cfe-ac {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 24px #00000080;
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
}
.cfe-ac.hidden { display: none; }
.cfe-ac-progress { padding: 10px 14px; font-size: 12px; color: var(--muted); font-style: italic; }
.cfe-ac-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cfe-ac-item:last-child { border-bottom: none; }
.cfe-ac-item:hover { background: var(--bg3); color: var(--accent); }

.cfe-artist-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cfe-entry {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.cfe-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #1a1a2e;
  border-bottom: 1px solid var(--border);
}
.cfe-entry-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--accent); }
.cfe-weight-wrap { display: flex; align-items: center; gap: 6px; }
.cfe-weight-lbl { font-size: 11px; color: var(--muted); }
.cfe-weight-range { width: 110px; accent-color: var(--accent); cursor: pointer; }
.cfe-weight-val { font-size: 11px; color: var(--muted); width: 24px; text-align: right; }
.cfe-sim-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 1px 6px;
  line-height: 1.4;
}
.cfe-sim-btn:hover, .cfe-sim-btn.active { color: var(--accent); border-color: var(--accent); }

.cfe-decade-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 12px 5px; min-height: 0; }
.cfe-decade-row:empty { display: none; }
.cfe-decade-badge {
  display: inline-flex; align-items: baseline; gap: 2px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 3px;
  color: var(--muted); cursor: default;
  font-size: 11px; font-weight: 700; padding: 1px 5px; font-family: monospace;
  line-height: 1.4;
}
.cfe-decade-badge:hover { border-color: var(--accent); color: var(--accent); }
.cfe-decade-count { font-size: 9px; font-weight: 400; opacity: 0.7; }

.cfe-raw-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 1px 5px;
  line-height: 1.4;
  font-family: monospace;
}
.cfe-raw-btn:hover, .cfe-raw-btn.active { color: var(--accent); border-color: var(--accent); }

.cfe-raw-panel { border-bottom: 1px solid var(--border); background: #0e0d1f; padding: 8px 12px; }
.cfe-raw-panel.hidden { display: none; }
.cfe-raw-status { font-size: 11px; color: var(--muted); }
.cfe-raw-summary { font-size: 11px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.cfe-raw-json-btn {
  background: none; border: 1px solid var(--border); border-radius: 3px;
  color: var(--muted); cursor: pointer; font-size: 10px; padding: 1px 5px; font-family: monospace;
}
.cfe-raw-json-btn:hover { color: var(--accent); border-color: var(--accent); }
.cfe-raw-refresh-btn {
  background: none; border: 1px solid var(--border); border-radius: 3px;
  color: var(--muted); cursor: pointer; font-size: 11px; padding: 1px 5px; line-height: 1;
}
.cfe-raw-refresh-btn:hover { color: #6ecf8e; border-color: #6ecf8e; }
.cfe-raw-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.cfe-raw-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 6px 4px; border-bottom: 1px solid var(--border); }
.cfe-raw-td { padding: 3px 6px; border-bottom: 1px solid #1e1d38; color: var(--text); vertical-align: top; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfe-raw-num { color: var(--muted); text-align: right; white-space: nowrap; }
.cfe-raw-vinyl { text-align: center; color: #6ecf8e; font-weight: 600; }
.cfe-raw-label { color: var(--muted); }
.cfe-raw-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 3px; padding: 3px 6px; border-radius: 3px; }
.cfe-raw-section-main { color: #6ecf8e; background: rgba(110,207,142,.08); }
.cfe-raw-section-app  { color: #d47830; background: rgba(212,120,48,.10); border-top: 1px solid rgba(212,120,48,.25); margin-top: 14px; }
.cfe-raw-appearances { opacity: 0.75; }
.cfe-raw-appearances tbody tr:hover td { opacity: 1; }
.cfe-raw-pre {
  margin: 8px 0 0; max-height: 260px; overflow-y: auto;
  background: #080813; border: 1px solid var(--border); border-radius: 4px;
  padding: 8px; font-size: 10px; font-family: monospace; color: #9ca3d4;
  white-space: pre; user-select: text;
}

.cfe-sim-panel { padding: 8px 12px; border-bottom: 1px solid var(--border); background: #13122a; }
.cfe-sim-panel.hidden { display: none; }
.cfe-sim-loading, .cfe-sim-empty { font-size: 11px; color: var(--muted); }
.cfe-sim-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.cfe-sim-artist {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  padding: 3px 9px;
}
.cfe-sim-artist:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cfe-sim-artist.cfe-sim-added { opacity: 0.35; cursor: default; }
.cfe-sim-artist.cfe-sim-adding { opacity: 0.5; }
.cfe-sim-pct { font-size: 10px; color: var(--muted); }

.cfe-entry-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}
.cfe-entry-del:hover { color: #c05050; }

.cfe-album-rows { display: flex; flex-direction: column; }

.cfe-album-compact {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 12px;
  border-top: 1px solid var(--border);
}
.cfe-alb-icon {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 22px;
  width: 18px;
  text-align: center;
}
.cfe-alb-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cfe-alb-info {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: default;
  padding: 2px 3px;
  line-height: 1;
  opacity: 0.6;
}
.cfe-alb-info:hover { opacity: 1; color: var(--accent); }

.cfe-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1e1c38;
  border: 1px solid #3a3860;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text);
  padding: 2px 6px 2px 8px;
  white-space: nowrap;
}
.cfe-tag-skip { background: #1e1216; border-color: #4a1a2a; color: #c08090; }
.cfe-tag-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 0 1px;
}
.cfe-tag-del:hover { color: #c05050; }

.cfe-album-input {
  flex: 1;
  min-width: 120px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  font-size: 11px;
  padding: 2px 4px;
  outline: none;
}
.cfe-album-input:focus { border-bottom-color: var(--accent); }
/* .cfe-alb-body .cfe-ac — position fixed, géré par JS */

.cfe-options-row {
  padding: 6px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.cfe-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.cfe-option-label input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.cfe-option-label:hover { color: var(--text); }

.cfe-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 200;
  background: var(--bg2);
  flex-shrink: 0;
}
.cfe-btn-save {
  flex: 1;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #07070f;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
}
.cfe-btn-save:hover { background: var(--accent2); }
.cfe-btn-cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 8px 16px;
}
.cfe-btn-cancel:hover { color: var(--text); border-color: var(--muted); }

.cfe-draft-badge {
  font-size: 11px;
  color: #d47830;
  font-weight: 600;
  letter-spacing: .03em;
  animation: cfe-pulse 2s ease-in-out infinite;
}
@keyframes cfe-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── FAVORIS PANEL ── */
.favs-panel {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 340px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 0.15s, transform 0.15s;
}

.favs-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
}

.favs-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.favs-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 0 4px;
  cursor: pointer;
}

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

.favs-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.favs-panel textarea {
  width: 100%;
  height: 220px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  line-height: 1.6;
}

.favs-panel textarea:focus { border-color: var(--accent); }

.favs-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-apply-favs {
  background: var(--accent);
  color: #07070f;
  font-weight: 600;
}

.btn-apply-favs:hover { background: #f7d160; }

.btn-clear-favs {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-clear-favs:hover { color: var(--text); border-color: var(--muted); }

.btn-more {
  background: var(--bg3);
  color: var(--accent);
  border: 1px solid var(--border);
}

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

.btn-more:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-auto {
  background: var(--bg3);
  color: #6ad46a;
  border: 1px solid #2a4a2a;
  margin-left: 6px;
}

.btn-auto:hover { border-color: #6ad46a; }

.btn-stop {
  background: var(--bg3);
  color: #e07070;
  border: 1px solid #4a2a2a;
  margin-left: 6px;
}

.btn-stop:hover { border-color: #e07070; }

.btn-retry {
  background: var(--bg3);
  color: #f5c842;
  border: 1px solid #4a3a0a;
  margin-left: 6px;
}
.btn-retry:hover { border-color: #f5c842; }

/* ── GENRE TABS BAR ── */
#genre-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
#genre-tabs-bar::-webkit-scrollbar { display: none; }

.gtab {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.gtab:hover  { color: var(--text); border-color: var(--muted); }
.gtab.active { background: var(--accent); color: #07070f; border-color: var(--accent); font-weight: 600; }

/* ── GRAPH CONTROLS OVERLAY ── */
#graph-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  display: flex;
  gap: 6px;
}
#graph-controls button {
  background: rgba(8, 7, 22, 0.82);
  border: 1px solid #3a3860;
  color: #7070a8;
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
#graph-controls button:hover { color: #c0a0ff; border-color: #6040a0; background: rgba(40, 20, 80, 0.85); }
#btn-tighten:hover  { color: #80d0ff !important; border-color: #4080c0 !important; }
#btn-expand-all:hover { color: #f5c842 !important; border-color: #a08020 !important; }

/* ── MAIN AREA ── */
#main-area {
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── LOG PANEL ── */
#log-panel {
  position: relative;
  width: 340px;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s, min-width 0.2s, opacity 0.15s;
}
#log-panel.hidden { width: 0; min-width: 0; opacity: 0; pointer-events: none; }

.log-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: ew-resize;
  z-index: 20;
  background: transparent;
  transition: background 0.15s;
}
.log-resize-handle:hover { background: var(--accent); opacity: 0.4; }

.lpanel-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lpanel-tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 4px 4px 0 0;
  transition: color 0.12s;
}
.lpanel-tab:hover  { color: var(--text); }
.lpanel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

#btn-log-sort {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
#btn-log-sort:hover { color: var(--text); border-color: var(--muted); }

#lpanel-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
#lpanel-close:hover { color: var(--text); }

.lpanel-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #2a2840 transparent;
  flex-direction: column;
  gap: 0;
}
.lpanel-content.active { display: flex; }

.lpanel-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 11px;
  text-align: center;
  margin-top: 16px;
}

/* ── SHOP INFO ── */
.shop-info-grid { display: flex; flex-direction: column; gap: 0; }
.si-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #16142a;
  gap: 8px;
}
.si-row span:first-child { color: var(--muted); flex-shrink: 0; }
.si-row span:last-child  { color: var(--text); font-weight: 500; text-align: right; }
.si-row a { color: var(--accent); text-decoration: none; font-weight: 500; }
.si-row a:hover { text-decoration: underline; }
.si-eta { color: var(--accent) !important; }
.si-eta em { color: var(--muted); font-size: 10px; font-style: normal; }
.si-score span:last-child { color: #f5c842 !important; font-weight: 700; }

.si-progress {
  padding: 8px 0 2px;
  border-top: 1px solid #1e1c38;
  margin-top: 4px;
}
.si-progress-label {
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.si-progress-bar {
  height: 4px;
  background: #1e1c38;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.si-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.si-progress-artist {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

/* ── SCORE PANEL ── */
.sp-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #1e1c38;
}
.sp-total {
  color: #f5c842;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.sp-subtitle {
  color: var(--muted);
  font-size: 12px;
}
.sp-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 14px 3px;
}
.sp-section-miss    { color: var(--muted); }
.sp-section-pending { color: #4a5a7a; }
.sp-pending-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  font-weight: 600;
}
.sp-pending-row { opacity: 0.45; }
.sp-name-pending { color: var(--muted); font-style: italic; }
.sp-pending-dot  { color: #3a4060; font-size: 14px; letter-spacing: 2px; }
.sp-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: baseline;
  padding: 5px 14px;
  border-bottom: 1px solid #0e0d1c;
  font-size: 12.5px;
}
.sp-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.sp-sim      { grid-template-columns: 1fr auto; align-items: start; }
.sp-sim-body { display: flex; flex-direction: column; }
.sp-sim-from { color: var(--muted); font-size: 11px; }
.sp-albums   { color: #6080a0; font-size: 11px; font-style: italic; padding-left: 12px; }
.sp-contrib { color: #6ad46a; font-weight: 600; font-size: 12px; text-align: right; min-width: 32px; }
.sp-zero    { color: var(--muted); }
.sp-hit     { color: #ffb700; font-size: 11px; }
.sp-miss .sp-name { color: var(--muted); }
.sp-sim .sp-name  { color: #a080e0; }
.sp-name-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.sp-name-link:hover { color: #c0a0ff; }
.sp-found .sp-name-link { color: var(--text); }
.sp-albums-toggle { display: flex; align-items: center; gap: 7px; padding: 6px 14px 5px; border-bottom: 1px solid #1a1830; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.sp-albums-toggle input[type=checkbox] { cursor: pointer; accent-color: #8060c0; margin: 0; }

/* ── LOG ENTRIES ── */
.log-entry {
  display: grid;
  grid-template-columns: 54px 16px 1fr;
  gap: 3px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid #0e0d1c;
  font-size: 12px;
  line-height: 1.5;
}
.le-time  { color: #32305a; font-variant-numeric: tabular-nums; font-size: 10.5px; }
.le-call  { color: var(--accent); font-weight: 700; }
.le-resp  { color: #6ad46a; font-weight: 700; }
.le-error { color: #e07070; font-weight: 700; }
.le-find  { color: #f5c842; font-weight: 700; }
.le-hit   { color: #ff9500; font-weight: 700; font-size: 12px; }
.le-msg   { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-find + .le-msg { color: #f5c842; }
.le-hit  + .le-msg { color: #ffb700; font-weight: 600; }
.le-detail {
  grid-column: 3;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── BTN-LOG ── */
.btn-log {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-log:hover         { color: var(--text); border-color: var(--muted); }
.btn-log.active        { color: var(--accent); border-color: var(--accent); }

/* ── GRAPH AREA ── */
#graph-wrap {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

svg#graph {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── LINKS ── */
.link {
  stroke-opacity: 0.6;
  fill: none;
}

.link-artist-release {
  stroke: #8070b8;
  stroke-width: 1.5px;
}

.link-similar {
  stroke: #f5c842;
  stroke-width: 1px;
  stroke-opacity: 0.35;
  stroke-dasharray: 6 4;
}

.link-similar2 {
  stroke: #806840;
  stroke-width: 0.8px;
  stroke-opacity: 0.25;
  stroke-dasharray: 4 4;
}

.link-discovered {
  stroke: #a080e0;
  stroke-width: 1.2px;
  stroke-opacity: 0.4;
  stroke-dasharray: 6 3;
}

/* ── NODES ── */
.node circle {
  cursor: pointer;
  transition: filter 0.15s;
}

.node:hover circle { filter: brightness(1.35); }

/* ── EXPAND BUTTON ── */
.expand-btn {
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.node:hover .expand-btn,
.node.expanded .expand-btn {
  opacity: 1;
}

.expand-btn:hover circle {
  filter: brightness(1.4);
}

.copy-btn {
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.node:hover .copy-btn { opacity: 1; }
.copy-btn:hover circle { filter: brightness(1.4); }
.copy-icon-back  { stroke-width: 1; }
.copy-icon-front { stroke-width: 1; }
.node:hover .copy-btn { opacity: 0.75; }
.copy-btn:hover { opacity: 1 !important; }

/* ── PIN BUTTON (signet concentrique) ── */
.pin-btn {
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.node:hover .pin-btn { opacity: 0.75; }
.node.pinned .pin-btn { opacity: 1; }
.pin-btn:hover { opacity: 1 !important; }
.pin-btn:hover .pin-bg { filter: brightness(1.4); }

/* Nœud pincé : légère aurore orange-rouge */
.node.pinned .node-circle {
  filter: drop-shadow(0 0 7px rgba(224,96,64,0.55));
}

/* ── TARGET ALBUM PULSE ── */
@keyframes target-pulse {
  0%, 100% { stroke-width: 1.5; stroke: #c8860a; stroke-opacity: 0.7; }
  50%       { stroke-width: 3.5; stroke: #ffe580; stroke-opacity: 1;   }
}
.node.target-album .node-circle {
  animation: target-pulse 2s ease-in-out infinite;
}

/* ── TOOLTIP TARGET BADGE ── */
.tt-target {
  background: linear-gradient(135deg, #8c4000, #ff9500);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  margin-bottom: 7px;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── TOOLTIP HINT ── */
.tt-hint {
  color: var(--accent);
  font-size: 11px;
  font-style: italic;
}

/* ── TOOLTIP ── */
#tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

#tooltip.visible { opacity: 1; }

#tooltip .tt-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  line-height: 1.3;
}

#tooltip .tt-row {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

#tooltip .tt-row span { color: var(--text); }

#tooltip .tt-cover {
  display: block;
  max-width: 90px;
  max-height: 90px;
  width: auto;
  height: auto;
  border-radius: 5px;
  margin-bottom: 8px;
  image-rendering: auto;
}

/* Tonearm */
.tonearm { cursor: pointer; }

/* Now-playing bar */
.now-playing {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #130c24;
  border: 1px solid #3a1060;
  border-radius: 10px;
  padding: 8px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  max-width: 280px;
}
.now-playing.hidden { display: none; }
.np-thumb { width: 42px; height: 42px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.np-icon { color: #c080e0; font-size: 11px; }
.np-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.np-track  { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-stop {
  background: none;
  border: none;
  color: #6a4880;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.np-stop:hover { color: #c080e0; }

/* ── STATUS BAR ── */
#status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: border-color 0.3s;
}

#status.loading {
  border-color: var(--accent);
  color: var(--text);
}

#status.restore-offer {
  pointer-events: auto;
  gap: 10px;
  max-width: 600px;
  white-space: normal;
  text-align: center;
  border-color: var(--accent);
}
.btn-restore {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  flex-shrink: 0;
}
.btn-restore.yes { background: var(--accent); color: #07070f; border: none; }
.btn-restore.no  { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-restore.yes:hover { background: var(--accent2); }
.btn-restore.no:hover  { color: var(--text); border-color: var(--muted); }

.load-elapsed {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid #3a3860;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── LOAD MORE ── */
#load-more-wrap {
  position: absolute;
  bottom: 12px;
  right: 20px;
}

/* ── LEGEND ── */
#legend {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--muted);
  line-height: 2;
}

#legend .leg-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

#legend .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── JSON INSPECTOR ─────────────────────────────────────────────────────────── */
#json-inspector {
  position: absolute;
  bottom: 60px;
  right: 16px;
  width: 420px;
  max-height: 70vh;
  background: #0d0d1e;
  border: 1px solid #3040a0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: 0 4px 24px #000a;
}
#json-inspector.hidden { display: none; }

.ji-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #161630;
  border-bottom: 1px solid #2a2a50;
  font-size: 12px;
  font-weight: 600;
  color: #8ab0f0;
}
.ji-header button {
  background: none;
  border: none;
  color: #6070a0;
  cursor: pointer;
  font-size: 14px;
}
.ji-header button:hover { color: #e07070; }

#json-inspector-body {
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 11px;
  color: #c0c8e0;
  flex: 1;
}
.ji-section { margin-bottom: 8px; }
.ji-row {
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.ji-row b { color: #6080c0; min-width: 160px; flex-shrink: 0; }
.ji-row span { color: #e0e8ff; word-break: break-all; }
.ji-row pre { font-size: 10px; color: #a0c0e0; white-space: pre-wrap; word-break: break-all; margin-top: 3px; }
.ji-vinyl { background: #0a1a0a; border-radius: 5px; padding: 5px 8px; color: #6ad46a; }
.ji-cd    { background: #1a0a0a; border-radius: 5px; padding: 5px 8px; color: #d46a6a; }
#json-inspector-body details summary {
  cursor: pointer;
  color: #5060a0;
  font-size: 11px;
  margin-top: 8px;
  user-select: none;
}
#json-inspector-body details pre {
  font-size: 9.5px;
  color: #7080a0;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
}

/* ── BTN-SHOPS ── */
.btn-shops {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-shops:hover  { color: var(--text); border-color: var(--muted); }
.btn-shops.active { color: var(--accent); border-color: var(--accent); }

/* ── SHOPS MODAL ── */
.shops-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}

.shops-modal-overlay.hidden { display: none; }

.shops-modal-panel {
  background: #16161a;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(240,125,0,0.06);
  width: 660px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shops-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

/* Header title (shops-main only) */
.shops-modal-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f07d00;
}
.shops-modal-title svg { flex-shrink: 0; }
.shops-modal-title h2 {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f07d00;
  margin: 0;
}
.shops-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Headers des modales secondaires (json, doc, cfg-editor) */
.shops-modal-header > span,
.shops-modal-header > div:not(.shops-modal-title):not(.shops-modal-header-actions) {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f07d00;
}

.shops-modal-header button:not(.cfg-btn-close):not(.premium-toggle) {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.shops-modal-header button:not(.cfg-btn-close):not(.premium-toggle):hover { color: var(--text); }

/* Ajouter boutique */
.shops-add-section {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.shops-add-row {
  display: flex;
  gap: 8px;
}

.shops-add-row input {
  flex: 1;
  font-size: 13px;
}

.shops-add-row button {
  background: var(--accent);
  color: #07070f;
  font-weight: 600;
  padding: 6px 14px;
  white-space: nowrap;
}
.shops-add-row button:hover { background: #f7d160; }
.shops-add-row button:disabled { opacity: 0.5; cursor: default; }

.shop-add-preview {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
}
.shop-add-preview.hidden { display: none; }
.shop-preview-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.shop-preview-inner .sc-btn { margin-left: auto; }
.shop-add-error {
  color: #e07070;
  font-size: 12px;
  padding: 10px 12px;
  background: #1a0808;
  border: 1px solid #4a1515;
  border-radius: 6px;
  line-height: 1.5;
}

/* Storage bar */
.shops-storage-bar {
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 4px;
}
.storage-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.storage-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.storage-label {
  font-size: 10px;
  color: var(--muted);
}
.storage-label b { color: var(--text); font-weight: 600; }

/* Liste header */
.shops-list-header {
  padding: 10px 20px 6px;
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shops-list-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.05);
}

/* Cards scrollable list */
.shop-cards {
  overflow-y: auto;
  padding: 6px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #2a2840 transparent;
}

.shops-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
  text-align: center;
  margin: 12px 0;
}

/* Shop card */
.shop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 12px;
  transition: background 0.15s, border-color 0.15s;
}
.shop-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.09);
}

.shop-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #1e1c38;
}
.shop-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e1c38;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ── ZONES DE LA CARTE ── */
.sc-zone-info {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.025);
  flex-shrink: 0;
  margin: 0 1px;
}

.sc-zone-score {
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-zone-score .sc-score-col { width: auto; }
.sc-zone-score .sc-score-star { font-size: 22px; }
.sc-zone-score .sc-score-val  { font-size: 14px; font-weight: 700; }

.sc-zone-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.sc-zone-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
}

/* Info block (gauche, dans sc-zone-info) */
.shop-card-info {
  flex: 0 0 130px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-seller-link {
  color: inherit;
  text-decoration: none;
}
.shop-seller-link:hover { text-decoration: underline; color: var(--accent); }

.shop-card-meta {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-card-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

/* Actions (dans sc-zone-main, alignées sous les pins) */
.shop-card-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.shop-card-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.shop-card-date {
  font-size: 10px;
  color: #4a4868;
  white-space: nowrap;
  text-align: center;
}

/* Status badges */
.shop-badge {
  font-family: 'Syne', sans-serif;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-complete { background: #0a2a0a; color: #6ad46a; border: 1px solid #1a4a1a; }
.badge-partial  { background: #2a1800; color: #f5c842; border: 1px solid #4a2a00; }
.badge-scanning { background: #001828; color: #6ab0d4; border: 1px solid #003040; }
.badge-fresh    { background: #1a1a2a; color: var(--muted); border: 1px solid var(--border); }
.sc-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  gap: 1px;
  padding: 0 2px;
}
.sc-score-empty { width: 46px; }
.sc-score-star {
  font-size: 16px;
  color: #f5c842;
  line-height: 1;
}
.sc-score-val {
  font-size: 11px;
  font-weight: 700;
  color: #f5c842;
  line-height: 1;
}

/* Shop card buttons */
.sc-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.sc-btn-restore {
  background: #0a1a0a;
  color: #6ad46a;
  border-color: #1a4a1a;
}
.sc-btn-restore:hover { background: #0f2a0f; border-color: #6ad46a; }

.sc-btn-resume {
  background: #001828;
  color: #6ab0d4;
  border-color: #003040;
}
.sc-btn-resume:hover { background: #00263a; border-color: #6ab0d4; }

.sc-btn-rescan {
  background: var(--bg3);
  color: var(--muted);
  border-color: var(--border);
}
.sc-btn-rescan:hover { color: var(--text); border-color: var(--muted); }

/* ── PIN STRIP (cartes boutiques) ── */
.shop-pin-strip {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 224px;  /* 7 × 32px, ne se compresse jamais */
  justify-content: space-between;  /* les 7 slots s'étalent sur toute la largeur */
}
.shop-pin-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.14);
  flex-shrink: 0;
  transition: transform 0.15s, border-color 0.15s;
}
img.shop-pin-thumb { cursor: pointer; }
img.shop-pin-thumb:hover {
  transform: scale(1.12);
  border-color: #e06040;
}
.shop-pin-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #07070f;
  cursor: pointer;
}
.shop-pin-initials:hover {
  transform: scale(1.12);
  border-color: #e06040;
}
.shop-pin-empty {
  background: transparent;
  border: 1.5px dashed rgba(255,255,255,0.1);
  cursor: default;
}
.sc-btn-clear-pins {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(224,96,64,0.08);
  color: #e06040;
  border-color: rgba(224,96,64,0.3);
  font-size: 10px;
}
.sc-btn-clear-pins:hover {
  background: rgba(224,96,64,0.18);
  border-color: #e06040;
  color: #f08070;
}

.sc-btn-del {
  background: none;
  color: #3a3858;
  border-color: transparent;
  font-size: 13px;
  padding: 4px 8px;
}
.sc-btn-del:hover { color: #e07070; background: #1e1c38; border-color: #4a2a2a; }

.sc-btn-json {
  background: none;
  color: #3a3858;
  border-color: transparent;
  font-size: 11px;
  font-family: monospace;
  padding: 4px 7px;
}
.sc-btn-json:hover { color: var(--muted); background: #1e1c38; border-color: var(--border); }

.sc-json-pre {
  background: #0d0c1e;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 11px;
  font-family: monospace;
  color: #8899bb;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: #2a2840 transparent;
}

/* Archive section separator */
.shop-archive-sep {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3a3858;
  padding: 10px 4px 4px;
}

/* Mini card grid */
.shop-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.shop-mini-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
  min-width: 0;
}
.shop-mini-card:hover { border-color: rgba(255,255,255,0.09); }

/* Gauche : avatar + score */
.smc-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Droite : nom/meta + anneaux pins */
.smc-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.smc-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Anneaux olympiques : 4 haut, 3 bas décalés */
.smc-pins {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 2px;
}
.smc-pin-row {
  display: flex;
  position: relative;
  z-index: 2;   /* row 1 (remplie) par-dessus row 2 */
}
.smc-pin-row-b {
  position: relative;
  z-index: 1;   /* row 2 (vides) en dessous */
  margin-top: -10px;
  margin-left: 12px;
}
.smc-pin-row .shop-pin-thumb {
  width: 30px;
  height: 30px;
  margin-right: -6px;
  border: 2px solid var(--bg3);
  position: relative;
}
.smc-pin-row .shop-pin-empty {
  border: 1.5px dashed rgba(255,255,255,0.15);
  background: transparent;
}
.smc-pin-row .shop-pin-thumb:last-child { margin-right: 0; }

.smc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1c38;
  flex-shrink: 0;
}
.smc-avatar-ph {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e1c38;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.smc-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
}
.smc-name:hover { color: var(--accent); }

.smc-loc {
  font-size: 9px;
  color: #5a5878;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smc-meta {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smc-score {
  font-size: 11px;
  color: #f5c842;
  font-weight: 700;
}

.smc-del {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px !important;
  padding: 2px 4px !important;
  opacity: 0;
  transition: opacity 0.15s;
}
.shop-mini-card:hover .smc-del { opacity: 1; }

/* ── POUCES PREMIUM ── */
.shop-thumb-widget {
  display: flex;
  gap: 0px;
  align-items: center;
  flex-shrink: 0;
}

.thumb-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.15;
  padding: 1px 2px;
  line-height: 1;
  transition: opacity 0.12s, transform 0.1s;
}
.thumb-btn.active      { opacity: 1; }
.thumb-btn:hover       { opacity: 0.7; transform: scale(1.2); }
.smc-thumbs            { margin-top: 2px; }
.smc-thumbs .thumb-btn { font-size: 12px; }

/* ── BOUTON PREMIUM (dev only) ── */
.premium-toggle {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s;
}
.premium-toggle.free {
  background: #14122a;
  color: #4a4868;
  border-color: var(--border);
}
.premium-toggle.free:hover { color: var(--muted); border-color: var(--muted); }
.premium-toggle.premium {
  background: #2a1800;
  color: #f5c842;
  border-color: #7a4800;
}
.premium-toggle.premium:hover { border-color: #f5c842; }

/* ── ENV BADGE ── */
#env-badge {
  position: fixed;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  font-family: monospace;
  color: var(--muted);
  opacity: 0.45;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.03em;
}
#env-badge.local { color: #6ad46a; opacity: 0.7; }
