/* ── Auth Section (Connexion) ── */
.auth-section {
  max-width: 480px; margin: 4rem auto; padding: 0 1.5rem;
  position: relative; z-index: 1;
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.5rem 2rem;
}
.auth-title {
  font-family: var(--font-heading); font-size: 2rem; font-weight: 300;
  color: var(--gold); text-align: center; margin: 0 0 0.25rem;
  letter-spacing: 0.08em;
}
.auth-subtitle {
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
  margin: 0 0 2rem;
}
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 1.5rem;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.auth-tab {
  flex: 1; padding: 0.7rem; text-align: center;
  background: none; border: none; color: var(--text-muted);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.auth-tab.active {
  background: rgba(201,168,76,0.12); color: var(--gold);
}
.auth-tab:hover:not(.active) { color: var(--text-primary); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form .form-group label {
  display: block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.4rem;
}
.auth-form .form-group input {
  width: 100%; padding: 0.75rem 1rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.9rem;
  transition: border-color 0.2s;
}
.auth-form .form-group input:focus {
  outline: none; border-color: var(--gold);
}
.btn-auth {
  width: 100%; padding: 0.85rem; margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none; border-radius: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
  letter-spacing: 0.04em;
}
.btn-auth:hover { filter: brightness(1.1); transform: translateY(-1px); }
.auth-link {
  display: block; text-align: center; margin-top: 1rem;
  color: var(--text-muted); font-size: 0.8rem; text-decoration: none;
}
.auth-link:hover { color: var(--gold); }
.auth-alert {
  padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem;
  font-size: 0.85rem; text-align: center;
}
.auth-alert--error {
  background: rgba(231,76,94,0.1); border: 1px solid rgba(231,76,94,0.3);
  color: var(--red-hd-light);
}
.auth-alert--success {
  background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.3);
  color: #81c784;
}

/* ── Account Section (Mon Compte) ── */
.account-section {
  max-width: 1200px; margin: 0.4rem auto; padding: 0 1.5rem;
  position: relative; z-index: 1;
}
.account-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.account-header--welcome { align-items: flex-start; gap: 1.5rem; }
.account-header__title { min-width: 0; flex: 1 1 auto; }

/* ── Identité + déconnexion discrète intégrée au header ── */
.mc-welcome__identity {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.mc-welcome__identity-icon { opacity: 0.6; flex-shrink: 0; }
.mc-welcome__email {
  font-family: 'Lora', Georgia, serif;
  color: var(--text-secondary);
  word-break: break-all;
}
.mc-welcome__logout {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color .2s, border-color .2s, background .2s;
}
.mc-welcome__logout:hover {
  color: var(--gold);
  border-color: rgba(201,168,76,0.3);
  background: rgba(201,168,76,0.06);
}
.mc-welcome__logout svg { flex-shrink: 0; }
body.light-mode .mc-welcome__email { color: #554e70; }
body.light-mode .mc-welcome__logout { color: #8a8295; }
body.light-mode .mc-welcome__logout:hover {
  color: #8b6914;
  border-color: rgba(139,105,20,0.3);
  background: rgba(201,168,76,0.12);
}
.account-title {
  font-family: var(--font-heading); font-size: 1.8rem; font-weight: 300;
  color: var(--gold); margin: 0; letter-spacing: 0.06em;
  display: flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap;
}
.account-header__title .mc-welcome__greet {
  font-family: var(--font-heading); font-weight: 300;
  color: var(--text-secondary); letter-spacing: 0.04em;
  font-size: inherit;
}
.account-header__title .mc-welcome__name {
  font-family: var(--font-heading); font-weight: 400;
  color: var(--gold); letter-spacing: 0.06em;
  font-size: inherit;
}
.account-header__title .mc-welcome__tagline {
  margin: 0.35rem 0 0;
  font-size: 0.82rem; color: var(--text-muted);
  font-style: italic; letter-spacing: 0.02em;
  line-height: 1.6;
}
body.light-mode .account-header__title .mc-welcome__greet { color: #6b6484; }
body.light-mode .account-header__title .mc-welcome__name { color: #8b6914; }

/* ── Pill tier (Pro / Premium / Free) collé au prénom ── */
.mc-welcome__tier {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.15rem;
  padding: 0.2rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 999px;
  vertical-align: baseline;
  position: relative;
  top: -0.2em; /* alignement optique avec le h2 en Lora */
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.25s, border-color 0.25s;
}
.mc-welcome__tier svg {
  width: 10px; height: 10px;
  filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.4));
}
.mc-welcome__tier--pro {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.22), rgba(123, 104, 238, 0.14));
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.55);
  box-shadow: 0 0 18px rgba(201, 168, 76, 0.18), inset 0 0 0 1px rgba(201, 168, 76, 0.08);
}
.mc-welcome__tier--premium {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(201, 168, 76, 0.05));
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.4);
}
.mc-welcome__tier--essentiel {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.18), rgba(125, 211, 252, 0.06));
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.4);
}
.mc-welcome__tier--free {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.08);
}
body.light-mode .mc-welcome__tier {
  background: rgba(0, 0, 0, 0.03);
  color: #6b6484;
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .mc-welcome__tier--pro {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.15), rgba(123, 104, 238, 0.08));
  color: #8b6914;
  border-color: rgba(139, 105, 20, 0.45);
  box-shadow: 0 0 12px rgba(139, 105, 20, 0.12);
}
body.light-mode .mc-welcome__tier--premium {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.1), rgba(139, 105, 20, 0.03));
  color: #8b6914;
  border-color: rgba(139, 105, 20, 0.3);
}
body.light-mode .mc-welcome__tier--essentiel {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(2, 132, 199, 0.04));
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.35);
}

/* ── Infos inline dans le tagline (séparateur, quota IA, CTA upgrade) ── */
.mc-welcome__sep {
  margin: 0 0.45rem;
  color: rgba(255, 255, 255, 0.2);
  font-style: normal;
}
body.light-mode .mc-welcome__sep { color: rgba(0, 0, 0, 0.18); }

.mc-welcome__ai { font-style: normal; }
.mc-welcome__ai strong {
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-style: normal;
}
.mc-welcome__ai-reset {
  font-size: 0.92em;
  color: var(--text-muted);
  margin-left: 0.2rem;
  opacity: 0.8;
}
body.light-mode .mc-welcome__ai strong { color: #8b6914; }

.mc-welcome__upgrade {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  font-style: normal;
  border-bottom: 1px dashed rgba(201, 168, 76, 0.45);
  padding-bottom: 0.08rem;
  transition: color 0.2s, border-color 0.2s;
}
.mc-welcome__upgrade:hover {
  color: #fff;
  border-bottom-color: var(--gold);
}
.mc-welcome__upgrade--manage {
  color: var(--text-secondary);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}
.mc-welcome__upgrade--manage:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
body.light-mode .mc-welcome__upgrade { color: #8b6914; border-bottom-color: rgba(139, 105, 20, 0.4); }
body.light-mode .mc-welcome__upgrade:hover { color: #5a4408; border-bottom-color: #8b6914; }
body.light-mode .mc-welcome__upgrade--manage { color: #6b6484; border-bottom-color: rgba(0, 0, 0, 0.15); }
body.light-mode .mc-welcome__upgrade--manage:hover { color: #8b6914; border-bottom-color: #8b6914; }

@media (max-width: 640px) {
  .mc-welcome__tier { top: 0; margin-top: 0.35rem; font-size: 0.6rem; }
  .mc-welcome__ai-reset { display: none; }
}
.account-email {
  color: var(--text-muted); font-size: 0.8rem; margin: 0.25rem 0 0;
}
.account-actions { display: flex; gap: 0.75rem; align-items: center; }
.btn-account {
  padding: 0.5rem 1.25rem; border-radius: 8px; font-size: 0.8rem;
  font-weight: 500; text-decoration: none; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-body);
  letter-spacing: 0.03em;
}
.btn-account:not(.btn-account--outline) {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-primary); border: none;
}
.btn-account:not(.btn-account--outline):hover { filter: brightness(1.1); }
.btn-account--outline {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
}
.btn-account--outline:hover { border-color: var(--gold); color: var(--gold); }
.account-empty {
  text-align: center; padding: 4rem 2rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px;
}
.account-empty p {
  color: var(--text-muted); font-size: 1rem; margin: 0 0 1.5rem;
}
/* ── Charts Toolbar (count + search) ── */
.charts-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem;
}
.charts-count {
  color: var(--text-muted); font-size: 0.8rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
}

/* ── Lien discret « Gérer les catégories » (toolbar) ── */
.mc-cats-manage-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit; font-size: 0.78rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.mc-cats-manage-link:hover,
.mc-cats-manage-link:focus-visible {
  color: var(--gold);
  border-color: rgba(201,168,76,0.5);
  background: rgba(201,168,76,0.06);
}
.mc-cats-manage-link svg { flex-shrink: 0; }
@media (max-width: 520px) {
  .mc-cats-manage-link span { display: none; } /* icône seule sur petit mobile */
  .mc-cats-manage-link { padding: 0.4rem 0.55rem; }
}

/* ── Search ── */
.charts-search {
  display: flex; align-items: center; gap: 0;
  position: relative;
}
.charts-search__toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
}
.charts-search__toggle:hover,
.charts-search.open .charts-search__toggle {
  border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.08);
}
.charts-search__field {
  display: flex; align-items: center;
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
}
.charts-search.open .charts-search__field {
  max-width: 300px; opacity: 1;
}
.charts-search__field input {
  width: 220px; padding: 0.5rem 0.75rem; margin-left: 0.5rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.85rem; outline: none;
  transition: border-color 0.2s;
}
.charts-search__field input:focus { border-color: var(--gold); }
.charts-search__field input::placeholder { color: var(--text-muted); }
.charts-search__clear {
  display: none; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-left: -32px; margin-right: 8px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; z-index: 1;
}
.charts-search__clear:hover { color: var(--text-primary); }
.charts-search.has-query .charts-search__clear { display: flex; }

/* Search results count */
.charts-search__results {
  font-size: 0.72rem; color: var(--gold); margin-left: 0.5rem;
  white-space: nowrap; opacity: 0; transition: opacity 0.2s;
}
.charts-search.has-query .charts-search__results { opacity: 1; }

/* Card hidden by search */
.chart-card.search-hidden {
  display: none !important;
}

/* No results message */
.charts-no-results {
  display: none; text-align: center; padding: 3rem 1rem;
  color: var(--text-muted); font-size: 0.9rem;
}
.charts-no-results.visible { display: block; }

@media (max-width: 768px) {
  .charts-toolbar { flex-wrap: wrap; }
  .charts-search.open .charts-search__field { max-width: 100%; }
  .charts-search__field input { width: 100%; min-width: 150px; }
  .charts-search.open { flex: 1; }
}

/* ── View Toggle (desktop only) ──
   Sur mobile, la grille reste l'unique mode (toggle masqué + JS forcé). */
.view-toggle {
  display: flex; gap: 0.35rem; align-items: center;
}
.view-toggle__btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: none; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
}
.view-toggle__btn:hover { border-color: var(--gold); color: var(--gold); }
.view-toggle__btn.active {
  border-color: var(--gold); color: var(--gold);
  background: rgba(201,168,76,0.12);
}
@media (max-width: 768px) {
  .view-toggle { display: none; }
}

/* ── Chart Cards Grid ── */
.charts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.chart-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color 0.2s;
}
.chart-card:hover { border-color: rgba(201,168,76,0.35); }
.chart-card__thumb {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  background: #fff; text-decoration: none;
  overflow: hidden;
}
.chart-card__thumb img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.chart-card__svg-container {
  width: 100%; height: 100%; padding: 15px;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}
.chart-card__svg-container svg {
  width: 100%; height: auto; display: block;
}
.chart-card__loading {
  color: var(--text-muted); font-size: 0.75rem;
}
.chart-card__thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; opacity: 0.3;
}
.chart-card__info { flex: 1; min-width: 0; padding: 1rem 1.25rem; }
.chart-card__name {
  font-family: var(--font-heading); font-size: 1.15rem; font-weight: 400;
  margin: 0 0 0.2rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: capitalize;
}
.chart-card__name a { color: var(--gold); text-decoration: none; }
.chart-card__name a:hover { text-decoration: underline; }
.chart-card__hd {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem;
}
.chart-card__tag {
  display: inline-block; padding: 0.15rem 0.5rem;
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.2);
  border-radius: 4px; font-size: 0.65rem; color: var(--gold-light);
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
a.chart-card__tag--link {
  cursor: pointer;
}
a.chart-card__tag--link:hover {
  background: rgba(201, 168, 76, 0.22);
  border-color: rgba(201, 168, 76, 0.5);
  color: var(--gold);
}
body.light-mode a.chart-card__tag--link:hover {
  background: rgba(139, 105, 20, 0.15);
  border-color: rgba(139, 105, 20, 0.4);
  color: #8b6914;
}
.chart-card__meta {
  font-size: 0.8rem; color: var(--text-secondary); margin: 0;
}
.chart-card__city {
  font-size: 0.75rem; color: var(--text-muted); margin: 0.15rem 0 0;
}
.chart-card__actions {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0 1.25rem 1rem; align-items: center;
}
.chart-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  /* line-height + min-height : normalise <a> vs <button> sur desktop
     (sans ça les <button> sont 2-3px plus hauts à cause des UA styles). */
  line-height: 1;
  min-height: 32px;
  box-sizing: border-box;
  padding: 0.35rem 0.75rem; border-radius: 6px; font-size: 0.7rem;
  font-weight: 500; text-decoration: none; cursor: pointer;
  text-align: center; font-family: var(--font-body);
  transition: all 0.2s; border: 1px solid var(--border);
  background: none; color: var(--text-secondary);
  letter-spacing: 0.03em;
}
.chart-btn:hover { border-color: var(--gold); color: var(--gold); }
.chart-btn__icon { flex-shrink: 0; opacity: 0.85; }
.chart-btn:hover .chart-btn__icon { opacity: 1; }
.chart-btn--primary {
  background: rgba(201,168,76,0.12); border-color: var(--gold);
  color: var(--gold);
}
.chart-btn--primary:hover { background: var(--gold); color: var(--bg-primary); }
.chart-btn--delete:hover { border-color: var(--red-hd); color: var(--red-hd); }

/* ── Vue liste compacte (desktop, défaut) ──
   Replié : nom + chevron uniquement. Déplié (.is-expanded) : accordéon
   avec date/heure, ville, synthèse (type/profil/autorité/définition) et
   bouton « Générer IA » ou contenu IA si déjà généré. */

/* En vue grille (par défaut), masque la meta (date/heure) - la card affiche
   uniquement le SVG + le nom + les actions. */
.charts-grid:not(.compact) .chart-card__meta { display: none; }

/* Chevron - visible uniquement en vue liste */
.chart-card__expand { display: none; }
/* Preview de la note (20 chars) - utilisé uniquement en vue compact mobile */
.chart-card__note-preview { display: none; }

.charts-grid.compact {
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
.charts-grid.compact .chart-card {
  flex-direction: row;
  flex-wrap: wrap;            /* permet à l'accordéon de s'écouler dessous */
  align-items: center;
  gap: 0;
  padding: 0;
}
.charts-grid.compact .chart-card__thumb-wrap,
.charts-grid.compact .chart-card__theme-toggle {
  display: none;
}
/* Ligne unique : info compact + chevron, alignés à gauche */
.charts-grid.compact .chart-card__info {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-start;
  text-align: left;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  flex: 1 1 0;
  min-width: 0;
  order: 1;
  cursor: pointer;             /* header cliquable pour toggler l'accordéon */
  user-select: none;
}
/* Le nom n'est plus un lien : conserver son style mais sans souligné */
.charts-grid.compact .chart-card__name { color: var(--text-primary); }
.charts-grid.compact .chart-card__name {
  font-size: 0.95rem;
  line-height: 1.25;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
}
.charts-grid.compact .chart-card__name a {
  display: inline;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
/* Replié : on garde nom + date/heure (sur la même ligne, séparés par tirets),
   on masque le reste. */
.charts-grid.compact .chart-card__meta {
  display: inline-block;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--text-muted);
  text-align: left;
}
/* Préfixe " - " devant la meta pour le format "Nom - Date - Heure" */
.charts-grid.compact .chart-card__meta::before {
  content: ' - ';
  margin-right: 0.15rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.charts-grid.compact .chart-card__city,
.charts-grid.compact .chart-card__hd,
.charts-grid.compact .chart-card__cat-slot,
.charts-grid.compact .chart-card__heart,
.charts-grid.compact .chart-card__actions,
.charts-grid.compact .chart-card__share,
.charts-grid.compact .chart-card__quickview,
.charts-grid.compact .chart-card__ai {
  display: none;
}
/* Étoile "mon BG" */
.charts-grid.compact .chart-card { position: relative; }
.charts-grid.compact .chart-card--is-own .chart-card__info::before {
  content: '★';
  font-size: 0.82rem;
  color: var(--gold);
  margin-right: 0.1rem;
  flex-shrink: 0;
}
/* Chevron */
.charts-grid.compact .chart-card__expand {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  margin-right: 0.6rem;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
  order: 2;
  transition: transform .2s, border-color .15s, background .15s;
}
.charts-grid.compact .chart-card__expand:hover {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.55);
}
.charts-grid.compact .chart-card.is-expanded .chart-card__expand svg {
  transform: rotate(180deg);
}

/* ── Accordéon ouvert : détails + actions ── */
.charts-grid.compact .chart-card.is-expanded {
  padding-bottom: 0.8rem;
}
/* Permet à city / hd / cat-slot (enfants de info) de passer sur une nouvelle
   ligne sous le couple "Nom - Date - Heure". */
.charts-grid.compact .chart-card.is-expanded .chart-card__info {
  flex-wrap: wrap;
}
/* Quand l'accordéon est ouvert, la date/heure reste sur la ligne d'en-tête
   (déjà visible avec le nom). On retire juste le préfixe " - " redondant. */
.charts-grid.compact .chart-card.is-expanded .chart-card__meta::before { content: none; }
/* Ville + catégorie */
.charts-grid.compact .chart-card.is-expanded .chart-card__city,
.charts-grid.compact .chart-card.is-expanded .chart-card__cat-slot {
  display: block;
  order: 11;
  width: 100%;
  margin: 0.1rem 0 0;
  padding: 0 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.charts-grid.compact .chart-card.is-expanded .chart-card__cat-slot:empty { display: none; }
/* Synthèse (type / profil / autorité / définition) */
.charts-grid.compact .chart-card.is-expanded .chart-card__hd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  order: 12;
  width: 100%;
  margin: 0.45rem 0 0;
  padding: 0 0.85rem;
}
/* Boutons d'action - pleine largeur, séparés par un filet */
.charts-grid.compact .chart-card.is-expanded .chart-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  order: 13;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.55rem 0.85rem 0;
  border-top: 1px dashed rgba(201,168,76,0.22);
  align-items: center;
}
.charts-grid.compact .chart-card.is-expanded .chart-card__share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: auto;
}
.charts-grid.compact .chart-card.is-expanded .chart-card__heart {
  display: inline-flex;
  position: static;
  width: 28px; height: 28px;
  flex-shrink: 0;
  margin-left: 0.2rem;
  order: 14;
  align-items: center;
  justify-content: center;
}
/* Bloc IA : analyse existante OU bouton générer */
.charts-grid.compact .chart-card.is-expanded .chart-card__ai {
  display: block;
  order: 15;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0 0.85rem;
}
.chart-card__ai-generate {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.16), rgba(201,168,76,0.08));
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 8px;
  color: var(--gold);
  cursor: pointer;
  font-family: inherit; font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.02em;
  transition: all .2s;
}
.chart-card__ai-generate:hover:not([disabled]) {
  background: linear-gradient(135deg, var(--gold), rgba(201,168,76,0.7));
  color: var(--bg-primary);
  border-color: var(--gold);
}
.chart-card__ai-generate[disabled] { opacity: 0.55; cursor: wait; }
.chart-card__ai-feedback {
  margin-top: 0.45rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.chart-card__ai-feedback--error { color: var(--red-hd, #c94040); }
.chart-card__ai-feedback--loading { color: var(--gold); }
.chart-card__ai-feedback--ok { color: #6ba35a; }

/* ── Annotation libre par BG ──
   Bloc compact dans l'accordéon : label + textarea autosave + statut.
   Visible uniquement quand la card est dépliée (vue liste) ou en grille
   (puisque la grille montre toute la card). */
.chart-card__note {
  display: none;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0 0.85rem 0.1rem;
  box-sizing: border-box;
}
/* Vue grille : note visible directement sous les actions */
.charts-grid:not(.compact) .chart-card__note {
  display: block;
  padding: 0.5rem 1rem 0;
  margin-top: 0.4rem;
  border-top: 1px dashed var(--border);
}
/* Vue liste : note dans l'accordéon ouvert */
.charts-grid.compact .chart-card.is-expanded .chart-card__note {
  display: block;
  order: 16;
}
.chart-card__note-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.chart-card__note-label svg { flex-shrink: 0; opacity: 0.8; }
.chart-card__note-status {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}
.chart-card__note-status.is-visible { opacity: 1; }
.chart-card__note-status--saving { color: var(--gold); }
.chart-card__note-status--saved { color: #6ba35a; }
.chart-card__note-status--error { color: var(--red-hd, #c94040); }
.chart-card__note-input {
  display: block;
  width: 100%;
  min-height: 56px;
  max-height: 240px;
  padding: 0.55rem 0.7rem;
  background: rgba(201,168,76,0.04);
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.chart-card__note-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  font-style: italic;
}
.chart-card__note-input:hover {
  border-color: rgba(201,168,76,0.4);
}
.chart-card__note-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
body.light-mode .chart-card__note-input {
  background: rgba(139,105,20,0.04);
  border-color: rgba(139,105,20,0.22);
}
body.light-mode .chart-card__note-input:hover { border-color: rgba(139,105,20,0.4); }
body.light-mode .chart-card__note-input:focus {
  border-color: #8b6914;
  background: rgba(139,105,20,0.07);
  box-shadow: 0 0 0 3px rgba(139,105,20,0.12);
}
/* Mobile : padding interne réduit + petite taille */
@media (max-width: 600px) {
  .chart-card__note { padding: 0 0.65rem 0.1rem; }
  .charts-grid:not(.compact) .chart-card__note { padding: 0.45rem 0.8rem 0; }
  .chart-card__note-input { font-size: 0.85rem; min-height: 64px; }
  .chart-card__note-label { font-size: 0.66rem; }
}

/* ── Edit Modal ── */
.edit-modal {
  display: none; position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
}
.edit-modal.open { display: flex; }
.edit-modal__inner {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; max-width: 500px; width: 90%;
}
.edit-modal__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.edit-modal__header h4 {
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 400;
  color: var(--gold); margin: 0;
}
.edit-modal__close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.edit-modal__close:hover { color: var(--text-primary); }
.edit-modal .form-group { margin-bottom: 1rem; }
.edit-modal .form-group label {
  display: block; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.3rem;
}
.edit-modal .form-group input {
  width: 100%; padding: 0.6rem 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.85rem;
}
.edit-modal .form-group input:focus { outline: none; border-color: var(--gold); }
.edit-modal .form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.edit-modal .form-row:not(.form-row--date) { grid-template-columns: 1fr 1fr; }

/* Share icons in card */
.chart-card__share {
  display: flex; gap: 0.4rem; margin-top: 0.25rem;
}
.share-icon {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: all 0.2s;
}
.share-icon:hover { border-color: var(--gold); color: var(--gold); }
.share-icon--mobile-only { display: none; }
@media (max-width: 768px) { .share-icon--mobile-only { display: flex; } }
.share-icon.shared { border-color: #4caf50; color: #4caf50; }

/* ── Quick View Button ── */
.chart-card__thumb-wrap {
  position: relative;
}
.chart-card__quickview {
  position: absolute; bottom: 8px; right: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #fff; cursor: pointer;
  opacity: 0; transition: opacity 0.2s, background 0.2s;
  z-index: 2;
}
.chart-card__thumb-wrap:hover .chart-card__quickview,
.chart-card__quickview:focus { opacity: 1; }
.chart-card__quickview:hover { background: rgba(201,168,76,0.8); }

/* ── Quick View Modal ── */
.quickview-modal {
  display: none; position: fixed; inset: 0; z-index: 99990;
  align-items: center; justify-content: center;
}
.quickview-modal.open { display: flex; }
.quickview-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.8);
}
.quickview-modal__content {
  position: relative; z-index: 1;
  max-width: 90vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.quickview-modal__close {
  position: absolute; top: -12px; right: -12px;
  width: 36px; height: 36px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-primary);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 2;
}
.quickview-modal__close:hover { border-color: var(--gold); color: var(--gold); }
.quickview-modal__svg {
  background: #fff; border-radius: 12px; padding: 1.5rem;
  width: 90vw; height: 90vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.quickview-modal__svg svg {
  width: auto; height: 100%;
  max-width: 100%; max-height: 100%;
  display: block;
}

/* ── CTA Banner ── */
.cta-banner {
  margin-top: 3rem; padding: 2.5rem 2rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(123,104,238,0.06));
  border: 1px solid var(--gold); border-radius: 16px;
  position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,168,76,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.cta-banner__content {
  display: flex; align-items: center; gap: 2rem;
  position: relative; z-index: 1;
}
.cta-banner__text { flex: 1; }
.cta-banner__title {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 400;
  color: var(--gold); margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}
.cta-banner__desc {
  color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6;
  margin: 0; max-width: 500px;
}
.cta-banner__btn {
  flex-shrink: 0; display: inline-block;
  padding: 0.9rem 2rem; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); text-decoration: none;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.04em; transition: all 0.3s;
  white-space: nowrap;
}
.cta-banner__btn:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,168,76,0.3); }
@media (max-width: 768px) {
  .cta-banner__content { flex-direction: column; text-align: center; }
  .cta-banner__desc { max-width: none; }
}

/* ── Light mode overrides ── */
body.light-mode .chart-card { background: #fff; border-color: rgba(0,0,0,0.08); }
body.light-mode .chart-card:hover { border-color: rgba(139,105,20,0.3); }
body.light-mode .chart-card__thumb { background: #050c1c; }
body.light-mode .chart-card__info { color: #101e3c; }
body.light-mode .chart-card__name a { color: #101e3c; }
body.light-mode .chart-card__meta, body.light-mode .chart-card__city { color: #7a7690; }
body.light-mode .chart-card__tag { background: rgba(139,105,20,0.08); color: #8b6914; }
body.light-mode .chart-btn { border-color: rgba(0,0,0,0.12); color: #3a3850; }
body.light-mode .chart-btn:hover { border-color: #8b6914; color: #8b6914; }
body.light-mode .chart-btn--primary { background: #8b6914; color: #fff; border-color: #8b6914; }
body.light-mode .chart-btn--delete { color: #c0354a; border-color: rgba(192,53,74,0.2); }
body.light-mode .account-section { color: #101e3c; }
body.light-mode .account-title { color: #101e3c; }
body.light-mode .account-email { color: #7a7690; }
body.light-mode .btn-account:not(.btn-account--outline) { background: linear-gradient(135deg, #6b5010, #8b6914); }
body.light-mode .btn-account--outline { border-color: rgba(0,0,0,0.15); color: #3a3850; }
body.light-mode .charts-count { color: #7a7690; }
body.light-mode .charts-search__toggle { border-color: rgba(0,0,0,0.12); color: #7a7690; }
body.light-mode .charts-search__field input { background: #fff; border-color: rgba(0,0,0,0.12); color: #101e3c; }
body.light-mode .view-toggle__btn { border-color: rgba(0,0,0,0.12); color: #7a7690; }
body.light-mode .view-toggle__btn.active { border-color: #8b6914; color: #8b6914; background: rgba(139,105,20,0.06); }
body.light-mode .share-icon { border-color: rgba(0,0,0,0.1); color: #7a7690; }
body.light-mode .share-icon:hover { border-color: #8b6914; color: #8b6914; }
body.light-mode .edit-modal__inner { background: #fff; border-color: rgba(0,0,0,0.1); }
body.light-mode .edit-modal__inner h3 { color: #101e3c; }
body.light-mode .edit-modal__inner input, body.light-mode .edit-modal__inner select {
  background: #f8f6f2; border-color: rgba(0,0,0,0.12); color: #101e3c;
}
body.light-mode .quickview-modal__content { background: #fff; }
body.light-mode .quickview-modal__close { background: #fff; border-color: rgba(0,0,0,0.1); color: #101e3c; }

/* ── Heart (unsave) button on cards ── */
.chart-card { position: relative; }
.chart-card__heart {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.4); border: none;
  color: #e74c5e; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.chart-card__heart:hover { background: rgba(231,76,94,0.2); transform: scale(1.1); }
body.light-mode .chart-card__heart { background: rgba(255,255,255,0.8); }
.chart-card__theme-toggle {
  position: absolute; top: 0.4rem; right: 0.4rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.25);
  cursor: pointer; font-size: 0.8rem; display: flex;
  align-items: center; justify-content: center; transition: all 0.2s;
  padding: 0; line-height: 1;
}
.chart-card__theme-toggle:hover { background: rgba(201,168,76,0.25); }

/* Copied toast */
.copy-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--bg-primary);
  padding: 0.6rem 1.5rem; border-radius: 8px; font-size: 0.85rem;
  font-weight: 500; z-index: 9999; animation: fadeUp 0.3s ease-out;
  pointer-events: none;
}

/* ── Manager de catégories (remplace la grille BG) ── */
.mc-cats-manager {
  margin-top: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-card, rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: mcCatsMgrFade 0.25s ease-out;
}
@keyframes mcCatsMgrFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mc-cats-manager__head {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.mc-cats-manager__back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit; font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mc-cats-manager__back:hover,
.mc-cats-manager__back:focus-visible {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.03);
}
.mc-cats-manager__title {
  margin: 0; flex: 1 1 auto;
  font-family: var(--font-heading, inherit);
  font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.mc-cats-manager__add {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 8px;
  color: var(--gold);
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mc-cats-manager__add:hover,
.mc-cats-manager__add:focus-visible {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold);
}
.mc-cats-manager__desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.mc-cats-manager__list {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .mc-cats-manager__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .mc-cats-manager__list { grid-template-columns: repeat(3, 1fr); } }
.mc-cats-manager__empty {
  grid-column: 1 / -1;
  padding: 1.5rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.88rem;
}
.mc-cats-manager__empty p { margin: 0; }
.mc-cats-manager__item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mc-mgr-color, var(--gold));
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.mc-cats-manager__item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(201,168,76,0.35);
  border-left-color: var(--mc-mgr-color, var(--gold));
}
.mc-cats-manager__dot {
  width: 14px; height: 14px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--mc-mgr-color, var(--gold));
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}
.mc-cats-manager__info {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.mc-cats-manager__name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.92rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-cats-manager__meta {
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}
.mc-cats-manager__actions {
  display: flex; align-items: center; gap: 0.25rem;
  flex-shrink: 0;
}
.mc-cats-manager__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.mc-cats-manager__btn:hover,
.mc-cats-manager__btn:focus-visible {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
  color: var(--text-primary);
}
.mc-cats-manager__btn--delete:hover,
.mc-cats-manager__btn--delete:focus-visible {
  color: #e57373;
  border-color: rgba(229,115,115,0.45);
  background: rgba(229,115,115,0.08);
}
.mc-cats-manager__item.is-editing .mc-cats-manager__name { display: none; }
.mc-cats-manager__item.is-editing .mc-cats-manager__input {
  display: block;
  width: 100%;
  padding: 0.35rem 0.55rem;
  background: var(--bg-input, rgba(255,255,255,0.03));
  border: 1px solid var(--gold);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit; font-size: 0.92rem;
  outline: none;
}
.mc-cats-manager__input { display: none; }
.mc-cats-manager__palette {
  display: none;
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  padding: 0.55rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}
.mc-cats-manager__item.is-picking-color .mc-cats-manager__palette { display: flex; }
.mc-cats-manager__item.is-picking-color { flex-wrap: wrap; }
.mc-cats-manager__swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.mc-cats-manager__swatch:hover { transform: scale(1.15); }
.mc-cats-manager__swatch.is-active { border-color: #fff; box-shadow: 0 0 0 2px var(--text-muted); }

/* ── Light mode overrides ── */
body.light-mode .mc-cats-manage-link {
  color: #5a4a2a; border-color: rgba(0,0,0,0.15);
}
body.light-mode .mc-cats-manage-link:hover,
body.light-mode .mc-cats-manage-link:focus-visible {
  color: var(--gold-dark); border-color: var(--gold-dark);
  background: rgba(201,168,76,0.1);
}
body.light-mode .mc-cats-manager {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
}
body.light-mode .mc-cats-manager__back { color: #5a4a2a; }
body.light-mode .mc-cats-manager__back:hover { color: #2a2a2a; }
body.light-mode .mc-cats-manager__title { color: #2a2a2a; }
body.light-mode .mc-cats-manager__item {
  background: #fafafa;
  border-color: rgba(0,0,0,0.08);
}
body.light-mode .mc-cats-manager__item:hover { background: #f5eed8; }
body.light-mode .mc-cats-manager__name { color: #2a2a2a; }
body.light-mode .mc-cats-manager__btn { color: #5a4a2a; }
body.light-mode .mc-cats-manager__btn:hover { background: rgba(0,0,0,0.04); color: #2a2a2a; }

/* ── Body dans état manager : masque rail + grille + toolbar (hors lien Gérer) ── */
body.is-managing-cats .mc-cats,
body.is-managing-cats .charts-grid,
body.is-managing-cats .charts-toolbar { display: none; }

/* ── Bouton « Ajouter un Body Graph » en tête du panneau Mes BG ── */
.mc-add-bg-btn {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 20px;
  padding: 0.6rem 1.15rem;
  /* Ghost/outline : contraste franc avec l'onglet actif qui est en fill doré plein */
  background: transparent;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
}
.mc-add-bg-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(123, 104, 238, 0.04));
  pointer-events: none;
  transition: opacity 0.2s;
  opacity: 1;
}
.mc-add-bg-btn > * { position: relative; z-index: 1; }
.mc-add-bg-btn:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.2);
}
body.light-mode .mc-add-bg-btn {
  color: #8b6914;
  border-color: rgba(139, 105, 20, 0.4);
}
body.light-mode .mc-add-bg-btn::before {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.05), rgba(123, 104, 238, 0.03));
}
body.light-mode .mc-add-bg-btn:hover {
  background: rgba(139, 105, 20, 0.08);
  border-color: #8b6914;
  color: #8b6914;
  box-shadow: 0 4px 14px rgba(139, 105, 20, 0.18);
}
.mc-add-bg-btn svg { flex-shrink: 0; }
@media (max-width: 520px) {
  .mc-add-bg-btn { width: 100%; justify-content: center; padding: 0.7rem 1rem; }
}

.mc-charts-quota {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.mc-charts-quota--push {
  border-color: rgba(201, 168, 76, 0.38);
  box-shadow: 0 0 24px rgba(201, 168, 76, 0.08);
}
.mc-charts-quota__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.mc-charts-quota__label {
  font-size: 0.9rem; color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.mc-charts-quota__label strong {
  color: var(--gold); font-size: 1rem;
  font-family: var(--font-heading); font-weight: 500;
  margin-right: 0.2rem;
}
.mc-charts-quota__cta {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.18), rgba(201,168,76,0.06));
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: var(--radius-pill);
  color: var(--gold);
  font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.mc-charts-quota__cta:hover {
  background: linear-gradient(135deg, rgba(201,168,76,0.28), rgba(201,168,76,0.12));
  transform: translateY(-1px);
}
.mc-charts-quota__bar {
  position: relative;
  height: 5px;
  background: rgba(201, 168, 76, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.mc-charts-quota__bar-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
}
.mc-charts-quota__hint {
  margin: 0.5rem 0 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  opacity: 0.8;
  font-style: italic;
}
.mc-charts-quota__hint--full {
  color: var(--gold);
  opacity: 1;
  font-style: normal;
  font-weight: 500;
}
body.light-mode .mc-charts-quota { background: #fffdf9; }
body.light-mode .mc-charts-quota__bar { background: rgba(139, 105, 20, 0.1); }
body.light-mode .mc-charts-quota__bar-fill {
  background: linear-gradient(90deg, #b8882b 0%, #d4a94a 100%);
  box-shadow: 0 0 8px rgba(139, 105, 20, 0.35);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .account-header { flex-direction: column; gap: 1rem; text-align: center; }
  .account-header--welcome { align-items: center; }
  .account-title { justify-content: center; font-size: 1.5rem; }
  .account-header__title .mc-welcome__tagline { text-align: center; }
  .mc-welcome__identity { justify-content: center; flex-wrap: wrap; }
  .mc-charts-quota { padding: 0.85rem 1rem; }
  .mc-charts-quota__row { flex-direction: column; align-items: stretch; }
  .mc-charts-quota__cta { justify-content: center; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card__actions { padding: 0 1rem 1rem; }
  .auth-section { margin: 2rem auto; }

  /* ── Vue mobile unifiée : ligne compacte unique pour CHAQUE card ──
     Que la grille soit en mode grille ou en mode compact, l'affichage mobile
     converge vers une ligne par item : nom + preview note (20 chars) + chevron,
     hauteur réduite. Le détail reste accessible via le chevron (.is-expanded). */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .charts-grid .chart-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0;
    min-height: 44px;
  }
  /* Masquer SVG, tags HD, ville, meta, actions, share, ai à l'état replié */
  .charts-grid .chart-card:not(.is-expanded) .chart-card__thumb-wrap,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__theme-toggle,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__hd,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__meta,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__city,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__cat-slot,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__actions,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__share,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__quickview,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__heart,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__ai,
  .charts-grid .chart-card:not(.is-expanded) .chart-card__note {
    display: none;
  }
  /* Info compacte : titre du nom (lien) aligné à gauche, single line */
  .charts-grid .chart-card__info {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-start;
    text-align: left;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem 0.4rem 0.6rem;
    flex: 1 1 0;
    min-width: 0;
    order: 1;
  }
  .charts-grid .chart-card__name {
    font-size: 0.92rem;
    line-height: 1.2;
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-primary);
  }
  .charts-grid .chart-card__name a {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  /* Étoile "mon BG" */
  .charts-grid .chart-card { position: relative; }
  .charts-grid .chart-card--is-own .chart-card__info::before {
    content: '★';
    font-size: 0.82rem;
    color: var(--gold);
    margin-right: 0.1rem;
    flex-shrink: 0;
  }
  /* Chevron : visible et compact */
  .charts-grid .chart-card__expand {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 32px; height: 32px;
    margin-right: 0.45rem;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    flex-shrink: 0;
    order: 2;
    transition: transform .2s, border-color .15s, background .15s;
  }
  .charts-grid .chart-card.is-expanded .chart-card__expand svg {
    transform: rotate(180deg);
  }
  /* État déplié : on n'affiche QUE la note personnelle dans le contenu
     (consigne user 2026-05-24 : pas de meta, ville, tags HD, actions, share, IA, SVG) */
  .charts-grid .chart-card.is-expanded .chart-card__info {
    cursor: default;
  }
  .charts-grid .chart-card.is-expanded .chart-card__note {
    display: block; order: 9; width: 100%;
  }
}

/* ── Banner activation compte ── */
.mc-activated-banner {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.25rem;
  background: rgba(76,175,80,.08);
  border: 1px solid rgba(76,175,80,.25);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: #81c784;
}
.mc-activated-banner svg { flex-shrink: 0; stroke: #81c784; }
body.light-mode .mc-activated-banner { background: rgba(76,175,80,.06); color: #2e7d32; border-color: rgba(76,175,80,.3); }
body.light-mode .mc-activated-banner svg { stroke: #2e7d32; }


/* ══════════ Tier card (badge tier + compteur IA) ══════════ */
.mc-tier-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.75rem;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.mc-tier-card--premium {
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, rgba(201,168,76,0.02) 100%);
  border-color: rgba(201,168,76,0.3);
}
.mc-tier-card--pro {
  background: linear-gradient(135deg, rgba(170,130,220,0.08) 0%, rgba(170,130,220,0.02) 100%);
  border-color: rgba(170,130,220,0.3);
}
.mc-tier-card__left { display: flex; flex-direction: column; gap: 0.2rem; min-width: 150px; }
.mc-tier-card__label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: 500;
}
.mc-tier-card__name {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 400;
  color: var(--text-primary); letter-spacing: 0.03em;
}
.mc-tier-card--premium .mc-tier-card__name { color: var(--gold); }
.mc-tier-card--pro .mc-tier-card__name { color: #c9a9e6; }
.mc-tier-card__state {
  font-size: 0.72rem; color: var(--text-muted); font-style: italic;
  margin-top: 0.2rem;
}

.mc-tier-card__ai { display: flex; flex-direction: column; gap: 0.25rem; max-width: 260px; }
.mc-tier-card__ai-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.mc-tier-card__ai-value {
  font-family: var(--font-heading); font-size: 1.1rem; font-weight: 500;
  color: var(--text-primary);
}
.mc-tier-card--premium .mc-tier-card__ai-value { color: var(--gold); }
.mc-tier-card--pro .mc-tier-card__ai-value { color: #c9a9e6; }
.mc-tier-card__ai-bar {
  height: 5px; border-radius: 3px; background: rgba(255,255,255,0.06);
  overflow: hidden; margin: 0.2rem 0;
}
.mc-tier-card__ai-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 3px; transition: width 0.4s;
}
.mc-tier-card__ai-sub {
  font-size: 0.72rem; color: var(--text-muted);
}

.mc-tier-card__cta {
  display: inline-block; text-decoration: none;
  padding: 0.7rem 1.25rem; border-radius: 10px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  transition: all 0.2s; white-space: nowrap;
}
.mc-tier-card__cta--premium {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  box-shadow: 0 4px 14px rgba(201,168,76,0.22);
}
.mc-tier-card__cta--premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201,168,76,0.32);
}
.mc-tier-card__cta--pro {
  background: linear-gradient(135deg, #b794d9 0%, #8b6cb0 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(170,130,220,0.25);
}
.mc-tier-card__cta--pro:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(170,130,220,0.35);
}
.mc-tier-card__cta--manage {
  background: rgba(170,130,220,0.12);
  color: #c9a9e6;
  border: 1px solid rgba(170,130,220,0.32);
}
.mc-tier-card__cta--manage:hover {
  background: rgba(170,130,220,0.2);
}

body.light-mode .mc-tier-card {
  background: #fff; border-color: rgba(0,0,0,0.1);
}
body.light-mode .mc-tier-card--premium {
  background: linear-gradient(135deg, rgba(139,105,20,0.06) 0%, rgba(139,105,20,0.02) 100%);
  border-color: rgba(139,105,20,0.25);
}
body.light-mode .mc-tier-card--pro {
  background: linear-gradient(135deg, rgba(139,90,170,0.06) 0%, rgba(139,90,170,0.02) 100%);
  border-color: rgba(139,90,170,0.25);
}
body.light-mode .mc-tier-card__name { color: #101e3c; }
body.light-mode .mc-tier-card--premium .mc-tier-card__name { color: #8b6914; }
body.light-mode .mc-tier-card--pro .mc-tier-card__name { color: #693c96; }
body.light-mode .mc-tier-card--premium .mc-tier-card__ai-value { color: #8b6914; }
body.light-mode .mc-tier-card--pro .mc-tier-card__ai-value { color: #693c96; }
body.light-mode .mc-tier-card__ai-bar { background: rgba(0,0,0,0.07); }
body.light-mode .mc-tier-card__state { color: #888; }
body.light-mode .mc-tier-card__cta--pro,
body.light-mode .mc-tier-card__cta--premium { color: #fff; }
body.light-mode .mc-tier-card__cta--manage { color: #693c96; border-color: rgba(105,60,150,0.32); background: rgba(105,60,150,0.08); }

@media (max-width: 720px) {
  .mc-tier-card {
    grid-template-columns: 1fr; gap: 1rem; padding: 1.25rem 1.25rem;
  }
  .mc-tier-card__ai { max-width: 100%; }
  .mc-tier-card__cta { text-align: center; width: 100%; }
}

/* ── Tab navigation ── */
/* ── Premium banner ── */
.mc-premium-banner {
  position: relative; overflow: hidden;
  margin-bottom: 1.5rem; padding: 1rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(201,168,76,0.06) 0%, rgba(201,168,76,0.02) 100%);
  border: 1px solid rgba(201,168,76,0.2);
}
.mc-premium-banner__glow {
  position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.mc-premium-banner__content {
  display: flex; align-items: center; gap: 1rem;
  position: relative;
}
.mc-premium-banner__icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: rgba(201,168,76,0.12); color: var(--gold);
}
.mc-premium-banner__text {
  flex: 1; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5;
}
.mc-premium-banner__text strong { color: var(--gold); }
.mc-premium-banner__btn {
  flex-shrink: 0; display: inline-flex; align-items: center;
  padding: 0.55rem 1.3rem; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); font-size: 0.8rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 3px 10px rgba(201,168,76,0.2);
}
.mc-premium-banner__btn:hover {
  box-shadow: 0 5px 20px rgba(201,168,76,0.3); transform: translateY(-1px);
}
body.light-mode .mc-premium-banner {
  background: linear-gradient(135deg, rgba(139,105,20,0.04) 0%, rgba(139,105,20,0.01) 100%);
  border-color: rgba(139,105,20,0.18);
}
body.light-mode .mc-premium-banner__text strong { color: #8b6914; }
body.light-mode .mc-premium-banner__btn { color: #fff; }
body.light-mode .mc-sub__cta:not(.mc-sub__cta--outline) { color: #fff; }
body.light-mode .mc-sub__notice-link { color: #fff; }
@media (max-width: 600px) {
  .mc-premium-banner__content { flex-direction: column; text-align: center; }
  .mc-premium-banner__icon { margin: 0 auto; }
}

/* ── Onglets Mon Compte : segmented control premium ── */
.mc-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.4rem;
  margin: 0 0 2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.mc-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
  position: relative;
  white-space: nowrap;
}
.mc-tab:hover {
  color: var(--text-primary);
  background: rgba(201, 168, 76, 0.07);
  border-color: rgba(201, 168, 76, 0.12);
}
.mc-tab.active {
  color: #050c1c;
  background: linear-gradient(135deg, #d9b75e 0%, var(--gold) 55%, #c9a84c 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 16px rgba(201, 168, 76, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  font-weight: 600;
}
.mc-tab.active:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(201, 168, 76, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mc-tab svg {
  opacity: 0.65;
  transition: opacity 0.2s, stroke 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.mc-tab:hover svg { opacity: 0.95; }
.mc-tab.active svg {
  opacity: 1;
  stroke: #050c1c;
}
body.light-mode .mc-tabs {
  background: linear-gradient(180deg, rgba(0,0,0,0.025), rgba(0,0,0,0.01));
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}
body.light-mode .mc-tab { color: #8a828f; }
body.light-mode .mc-tab:hover {
  color: #3e2e00;
  background: rgba(139, 105, 20, 0.06);
  border-color: rgba(139, 105, 20, 0.12);
}
body.light-mode .mc-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #a68028 0%, #8b6914 55%, #7a5d10 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow:
    0 4px 14px rgba(139, 105, 20, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
body.light-mode .mc-tab.active svg { stroke: #fff; }

/* ── Panels ── */
.mc-panel { display: none; }
.mc-panel.active { display: block; }

/* ── Tools section ── */
.mc-tools { max-width: 100%; display: flex; flex-direction: column; gap: 1rem; }

/* ── Tool accordions ── */
.mc-tool-accordion {
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--bg-card);
}
.mc-tool-accordion__header {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; padding: 1.25rem 1.5rem;
  background: none; border: none; cursor: pointer;
  text-align: left; color: var(--text-primary);
  font-family: var(--font-body); transition: background 0.15s;
}
.mc-tool-accordion__header:hover { background: rgba(201,168,76,0.04); }
.mc-tool-accordion__header strong {
  display: block; font-size: 0.95rem; font-weight: 600; margin-bottom: 0.15rem;
}
.mc-tool-accordion__header small {
  display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 400;
}
.mc-tool-accordion__icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(201,168,76,0.08); color: var(--gold);
}
.mc-tool-accordion__arrow {
  margin-left: auto; color: var(--text-muted); font-size: 0.7rem;
  transition: transform 0.25s;
}
.mc-tool-accordion.open .mc-tool-accordion__arrow { transform: rotate(180deg); }
.mc-tool-accordion__body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s ease;
  padding: 0 1.5rem;
}
.mc-tool-accordion.open .mc-tool-accordion__body {
  max-height: 3000px; padding: 0 1.5rem 1.5rem;
}
body.light-mode .mc-tool-accordion { background: #fff; border-color: rgba(0,0,0,0.08); }
body.light-mode .mc-tool-accordion__header:hover { background: rgba(139,105,20,0.04); }
body.light-mode .mc-tool-accordion__icon { background: rgba(139,105,20,0.06); color: #8b6914; }

/* Premium lock */
.mc-tool-premium-lock {
  text-align: center; padding: 2rem 1rem;
}
.mc-tool-premium-lock svg { color: var(--text-muted); margin-bottom: 0.75rem; }
.mc-tool-premium-lock p {
  font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 1.25rem;
}
.mc-tool-premium-lock .mc-sub__cta { font-size: 0.85rem; }
.mc-tools__title {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 400;
  color: var(--text-primary); margin: 0 0 0.5rem;
}
.mc-tools__desc {
  font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6;
  margin: 0 0 2rem;
}
.mc-tools h3 {
  font-family: var(--font-heading); font-size: 1rem; font-weight: 500;
  color: var(--text-primary); margin: 0 0 1rem;
}

/* ── Embed config ── */
.mc-embed-config {
  display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.mc-embed-config__options {
  display: flex; flex-direction: column; gap: 1.25rem;
}
.mc-embed-field label {
  display: block; font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 0.4rem; font-weight: 500;
}
.mc-embed-field__hint {
  display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.25rem;
  opacity: 0.7; font-style: italic;
}
.mc-embed-field input[type="text"] {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.45rem 0.7rem; color: var(--text-primary);
  font-size: 0.85rem; font-family: var(--font-body);
}
.mc-embed-field input[type="text"]:focus {
  outline: none; border-color: var(--gold);
}
.mc-embed-field input[type="number"],
.mc-embed-field input[type="range"] {
  width: 100%;
}
.mc-embed-field input[type="number"] {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.45rem 0.7rem; color: var(--text-primary);
  font-size: 0.85rem; font-family: var(--font-body);
}
.mc-embed-field input[type="range"] {
  accent-color: var(--gold); height: 4px;
}
.mc-embed-toggle {
  display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.mc-embed-toggle__btn {
  flex: 1; padding: 0.45rem 0.75rem; border: none; cursor: pointer;
  font-size: 0.8rem; font-family: var(--font-body);
  background: var(--bg-input); color: var(--text-muted);
  transition: all 0.15s;
}
.mc-embed-toggle__btn.active {
  background: rgba(201,168,76,0.15); color: var(--gold); font-weight: 600;
}
.mc-embed-colors {
  display: flex; gap: 0.5rem;
}
.mc-embed-color {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: border-color 0.15s, transform 0.15s;
}
.mc-embed-color:hover { transform: scale(1.15); }
.mc-embed-color.active { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.mc-embed-color-custom {
  position: relative; width: 28px; height: 28px; border-radius: 50%;
  border: 2px dashed rgba(201,168,76,0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, transform 0.15s;
  overflow: hidden;
}
.mc-embed-color-custom:hover { transform: scale(1.15); border-color: var(--gold); }
.mc-embed-color-custom.active { border-style: solid; border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.mc-embed-color-custom input[type="color"] {
  position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px);
  border: none; padding: 0; cursor: pointer; opacity: 0;
}
.mc-embed-color-custom__icon {
  font-size: 0.85rem; font-weight: 600; color: rgba(201,168,76,0.6);
  pointer-events: none; line-height: 1;
}
.mc-embed-color-custom.active .mc-embed-color-custom__icon { display: none; }
.mc-embed-checkbox {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--text-secondary); cursor: pointer;
}
.mc-embed-checkbox input { accent-color: var(--gold); }

/* Preview */
.mc-embed-config__preview { min-height: 400px; }
.mc-embed-preview {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem; min-height: 400px;
  display: flex; align-items: center; justify-content: center;
}
.mc-embed-preview iframe { width: 100%; min-height: 380px; }

/* Code output */
.mc-embed-code { margin-bottom: 3rem; }
.mc-embed-code__hint {
  font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.75rem;
}
.mc-embed-code__wrap {
  position: relative; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem; padding-right: 5rem;
  overflow-x: auto;
}
.mc-embed-code__wrap code {
  font-size: 0.75rem; color: var(--text-secondary);
  word-break: break-all; white-space: pre-wrap;
}
.mc-embed-code__copy {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold); border-radius: 6px; padding: 0.35rem 0.75rem;
  font-size: 0.75rem; cursor: pointer; transition: background 0.15s;
}
.mc-embed-code__copy:hover { background: rgba(201,168,76,0.25); }

/* Coming soon items */
.mc-tools-coming {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem;
}
.mc-tools-coming__item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; opacity: 0.6;
}
.mc-tools-coming__item svg { flex-shrink: 0; color: var(--text-muted); margin-top: 2px; }
.mc-tools-coming__item strong { font-size: 0.85rem; color: var(--text-primary); }
.mc-tools-coming__item p { font-size: 0.75rem; color: var(--text-muted); margin: 0.2rem 0 0; }

/* Light mode */
body.light-mode .mc-embed-toggle__btn { background: #f5f3ef; color: #888; }
body.light-mode .mc-embed-toggle__btn.active { background: rgba(139,105,20,0.12); color: #8b6914; }
body.light-mode .mc-embed-color.active { border-color: #333; }

/* ── Subscription panel : carte status neutre + variantes tier ── */
.mc-sub { width: 100%; }
.mc-sub__status {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem 1.5rem 1.4rem;
  border-radius: 14px;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
/* Accent coloré subtil en bordure gauche selon tier */
.mc-sub__status::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--text-muted);
  opacity: 0.4;
}
.mc-sub__status--free::before      { background: rgba(255, 255, 255, 0.15); }
.mc-sub__status--essentiel::before { background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 100%); opacity: 0.95; }
.mc-sub__status--premium::before   { background: linear-gradient(180deg, var(--gold) 0%, #a88a3e 100%); opacity: 0.9; }
.mc-sub__status--pro::before       { background: linear-gradient(180deg, #c9a84c 0%, #7b68ee 100%); opacity: 1; }
.mc-sub__status--expired::before   { background: linear-gradient(180deg, #e07070 0%, #a04848 100%); opacity: 0.85; }
.mc-sub__status--essentiel {
  border-color: rgba(125, 211, 252, 0.22);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(125, 211, 252, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: 0 4px 24px rgba(125, 211, 252, 0.05);
}
.mc-sub__status--essentiel .mc-sub__badge {
  background: rgba(125, 211, 252, 0.14);
  color: #38bdf8;
  border-color: rgba(125, 211, 252, 0.35);
}
.mc-sub__status--premium {
  border-color: rgba(201, 168, 76, 0.22);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(201, 168, 76, 0.05) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.05);
}
/* ── Variante Pro : effet « luxe » sophistiqué ── */
.mc-sub__status--pro {
  border-color: rgba(201, 168, 76, 0.35);
  background:
    radial-gradient(140% 90% at 0% 0%, rgba(201, 168, 76, 0.09) 0%, transparent 50%),
    radial-gradient(100% 80% at 100% 100%, rgba(123, 104, 238, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  box-shadow:
    0 8px 40px rgba(123, 104, 238, 0.08),
    0 2px 12px rgba(201, 168, 76, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.mc-sub__status--pro::after {
  content: '';
  position: absolute;
  top: -1px; right: -1px;
  width: 140px; height: 140px;
  background: radial-gradient(circle at top right, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
  pointer-events: none;
  border-top-right-radius: 14px;
}
.mc-sub__status--expired { border-color: rgba(224, 112, 112, 0.2); }

.mc-sub__status-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.mc-sub__badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mc-sub__status--premium .mc-sub__badge {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.3);
}
.mc-sub__status--pro .mc-sub__badge {
  background: linear-gradient(135deg, #d9b75e 0%, var(--gold) 45%, #a88a3e 100%);
  color: #1a1609;
  border-color: rgba(201, 168, 76, 0.7);
  box-shadow:
    0 4px 18px rgba(201, 168, 76, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  width: 46px; height: 46px;
}
.mc-sub__status--pro .mc-sub__plan {
  font-size: 1.15rem;
}
.mc-sub__status--pro .mc-sub__plan strong {
  background: linear-gradient(135deg, #e0c57a 0%, var(--gold) 45%, #b8965a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold); /* fallback */
  letter-spacing: 0.04em;
  font-weight: 600;
  padding-left: 0.1rem;
  position: relative;
}
.mc-sub__status--pro .mc-sub__plan strong::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 0.55rem;
  margin-bottom: 0.15rem;
  background: var(--gold);
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
}
.mc-sub__status--expired .mc-sub__badge {
  background: rgba(224, 112, 112, 0.08);
  color: #e07070;
  border-color: rgba(224, 112, 112, 0.25);
}
.mc-sub__headline { min-width: 0; }
.mc-sub__plan {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 300;
  margin: 0 0 0.2rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}
.mc-sub__plan strong {
  font-weight: 500;
  color: var(--gold);
}
.mc-sub__status--free .mc-sub__plan strong { color: var(--text-secondary); }
.mc-sub__status--expired .mc-sub__plan strong,
.mc-sub__plan--expired { color: #e07070; }
.mc-sub__plan--cancelling { color: #e0a830; }
.mc-sub__detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.mc-sub__detail strong { color: var(--text-secondary); font-weight: 500; }

/* Grid 3 stats : souscrit / renouv. / IA */
.mc-sub__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
.mc-sub__stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}
.mc-sub__stat--ai {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(123, 104, 238, 0.03));
  border-color: rgba(201, 168, 76, 0.15);
}
.mc-sub__stat--warning {
  background: rgba(224, 112, 112, 0.05);
  border-color: rgba(224, 112, 112, 0.18);
}
.mc-sub__stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
  font-weight: 600;
}
.mc-sub__stat-value {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.mc-sub__stat--ai .mc-sub__stat-value { color: var(--gold); }
.mc-sub__stat--warning .mc-sub__stat-value { color: #e07070; }
.mc-sub__stat-unit { font-size: 0.82em; color: var(--text-muted); font-weight: 400; }
.mc-sub__stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.1rem;
}
.mc-sub__stat-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.2rem 0 0.15rem;
}
.mc-sub__stat-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #e0c968);
  border-radius: 2px;
  transition: width 0.3s;
}

/* Actions en pied de carte */
.mc-sub__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

/* Mode clair */
body.light-mode .mc-sub__status {
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.005));
  border-color: rgba(0, 0, 0, 0.07);
}
body.light-mode .mc-sub__status--premium {
  border-color: rgba(139, 105, 20, 0.25);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(139, 105, 20, 0.05) 0%, transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.005));
  box-shadow: 0 4px 20px rgba(139, 105, 20, 0.04);
}
body.light-mode .mc-sub__status--pro {
  border-color: rgba(139, 105, 20, 0.4);
  background:
    radial-gradient(140% 90% at 0% 0%, rgba(139, 105, 20, 0.08) 0%, transparent 50%),
    radial-gradient(100% 80% at 100% 100%, rgba(123, 104, 238, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.005));
  box-shadow:
    0 8px 36px rgba(123, 104, 238, 0.06),
    0 2px 12px rgba(139, 105, 20, 0.08);
}
body.light-mode .mc-sub__badge { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .mc-sub__status--premium .mc-sub__badge {
  background: rgba(139, 105, 20, 0.1);
  color: #8b6914;
  border-color: rgba(139, 105, 20, 0.35);
}
body.light-mode .mc-sub__status--pro .mc-sub__badge {
  background: linear-gradient(135deg, #b8965a 0%, #8b6914 45%, #6d520d 100%);
  color: #fff;
  border-color: rgba(139, 105, 20, 0.7);
  box-shadow:
    0 4px 16px rgba(139, 105, 20, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body.light-mode .mc-sub__status--pro .mc-sub__plan strong {
  background: linear-gradient(135deg, #a68028 0%, #8b6914 45%, #6d520d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #8b6914;
}
body.light-mode .mc-sub__status--pro .mc-sub__plan strong::after {
  background: #8b6914;
  box-shadow: 0 0 8px rgba(139, 105, 20, 0.6);
}
body.light-mode .mc-sub__plan strong { color: #8b6914; }
body.light-mode .mc-sub__status--free .mc-sub__plan strong { color: #6b6484; }
body.light-mode .mc-sub__stats { border-top-color: rgba(0, 0, 0, 0.06); }
body.light-mode .mc-sub__stat {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .mc-sub__stat--ai {
  background: linear-gradient(135deg, rgba(139, 105, 20, 0.05), rgba(123, 104, 238, 0.03));
  border-color: rgba(139, 105, 20, 0.15);
}
body.light-mode .mc-sub__stat--ai .mc-sub__stat-value { color: #8b6914; }
body.light-mode .mc-sub__actions { border-top-color: rgba(0, 0, 0, 0.06); }
body.light-mode .mc-sub__stat-bar { background: rgba(0, 0, 0, 0.04); }

@media (max-width: 520px) {
  .mc-sub__status { padding: 1.2rem 1.15rem; }
  .mc-sub__stats { grid-template-columns: 1fr; }
}
.mc-sub__upgrade { margin-bottom: 2rem; }
.mc-sub__upgrade h3 { font-family: var(--font-heading); font-size: 1.1rem; margin: 0 0 0.75rem; color: var(--text-primary); }
.mc-sub__features {
  list-style: none; padding: 0; margin: 0 0 1.25rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.mc-sub__features li {
  font-size: 0.84rem; color: var(--text-secondary); padding-left: 1.5rem;
  position: relative;
}
.mc-sub__features li::before {
  content: '✓'; position: absolute; left: 0; color: var(--gold); font-weight: 600;
}
.mc-sub__cta {
  display: inline-block; padding: 0.75rem 2rem; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(201,168,76,0.2);
}
.mc-sub__cta:hover { box-shadow: 0 6px 25px rgba(201,168,76,0.35); }
.mc-sub__cta--outline {
  background: transparent; border: 1px solid var(--gold); color: var(--gold);
  box-shadow: none;
}
.mc-sub__cta--outline:hover { background: rgba(201,168,76,0.1); }
.mc-sub__cta--pro {
  background: linear-gradient(135deg, #b794d9 0%, #8b6cb0 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(170,130,220,0.25);
}
.mc-sub__cta--pro:hover { box-shadow: 0 6px 25px rgba(170,130,220,0.4); }
body.light-mode .mc-sub__cta--pro { color: #fff; }

/* Upsell box Pro (pour users Premium) */
.mc-sub__upgrade--pro {
  margin-top: 1.75rem;
  padding: 1.5rem 1.5rem 1.75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(170,130,220,0.07) 0%, rgba(170,130,220,0.02) 100%);
  border: 1px solid rgba(170,130,220,0.25);
}
.mc-sub__upgrade--pro h3 { color: #c9a9e6; }
.mc-sub__upgrade--pro .mc-sub__features li::before { color: #c9a9e6; }
.mc-sub__upgrade-desc {
  font-size: 0.85rem; color: var(--text-muted); margin: 0 0 1rem; line-height: 1.55;
}
.mc-sub__upgrade-hint {
  font-size: 0.78rem; color: var(--text-muted); margin: 0.85rem 0 0; line-height: 1.5;
}
.mc-sub__upgrade-hint a { color: #c9a9e6; text-decoration: none; border-bottom: 1px solid rgba(201,169,230,0.3); }
.mc-sub__upgrade-hint a:hover { border-bottom-color: #c9a9e6; }
body.light-mode .mc-sub__upgrade--pro {
  background: linear-gradient(135deg, rgba(105,60,150,0.05) 0%, rgba(105,60,150,0.02) 100%);
  border-color: rgba(105,60,150,0.2);
}
body.light-mode .mc-sub__upgrade--pro h3,
body.light-mode .mc-sub__upgrade--pro .mc-sub__features li::before { color: #693c96; }
body.light-mode .mc-sub__upgrade-hint a { color: #693c96; border-bottom-color: rgba(105,60,150,0.3); }
.mc-sub__portal-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 0.6rem; font-size: 0.75rem; color: var(--text-muted);
  text-decoration: none; transition: color 0.2s;
}
.mc-sub__portal-link:hover { color: var(--gold); }
body.light-mode .mc-sub__portal-link { color: #7a7690; }
.mc-sub__orders {
  margin-top: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.mc-sub__orders-header {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(201,168,76,0.04);
}
.mc-sub__orders-header svg { color: var(--gold); flex-shrink: 0; }
.mc-sub__orders h3 {
  font-family: var(--font-heading); font-size: 0.95rem;
  font-weight: 400; margin: 0; color: var(--text-primary);
  letter-spacing: 0.03em;
}
.mc-sub__table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: #0b1428; border-radius: 10px; overflow: hidden; }
body.light-mode .mc-sub__table { background: #f8f7f5; }
.mc-sub__table thead tr { background: rgba(201,168,76,0.03); }
.mc-sub__table th {
  text-align: left; padding: 0.7rem 1.25rem;
  color: var(--gold); font-weight: 500;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
body.light-mode .mc-sub__table th { color: var(--text-muted); }
.mc-sub__table td {
  padding: 0.85rem 1.25rem; color: var(--text-secondary);
  border-bottom: 1px solid rgba(201,168,76,0.05);
  vertical-align: middle;
}
.mc-sub__table tbody tr:last-child td { border-bottom: none; }
.mc-sub__table tbody tr:hover td { background: rgba(201,168,76,0.03); }
.mc-sub__table td:first-child { color: var(--text-muted); font-size: 0.8rem; }
.mc-sub__table td:nth-child(2) { color: var(--text-primary); font-weight: 500; }
.mc-sub__table td:nth-child(3) { color: var(--gold); font-weight: 600; }
body.light-mode .mc-sub__orders { background: #fff; border-color: rgba(0,0,0,0.08); }
body.light-mode .mc-sub__orders-header { background: rgba(139,105,20,0.03); }
body.light-mode .mc-sub__table thead tr { background: rgba(139,105,20,0.02); }
body.light-mode .mc-sub__table td { border-bottom-color: rgba(0,0,0,0.04); }
body.light-mode .mc-sub__table tbody tr:hover td { background: rgba(139,105,20,0.02); }
.mc-sub__status-tag {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px;
  font-size: 0.72rem; background: rgba(201,168,76,0.12); color: var(--gold);
}
.mc-sub__status-tag--completed { background: rgba(201,168,76,0.12); color: var(--gold); }
.mc-sub__status-tag--processing { background: rgba(220,160,40,0.12); color: #e0a830; }
.mc-sub__status-tag--pending,
.mc-sub__status-tag--on-hold { background: rgba(220,160,40,0.12); color: #e0a830; }

/* État expiré */
.mc-sub__status--expired .mc-sub__badge { background: rgba(220,80,80,0.1); color: #e07070; }
.mc-sub__plan--expired { color: #e07070 !important; }
.mc-sub__notice--expired { background: rgba(220,80,80,0.06); border: 1px solid rgba(220,80,80,0.2); }
.mc-sub__notice--expired .mc-sub__notice-icon { color: #e07070; }
.mc-sub__notice--expired .mc-sub__notice-body strong { color: #e07070; }
.mc-sub__notice--expired .mc-sub__notice-link { color: var(--gold); font-weight: 600; }

/* Notice commande en attente */
.mc-sub__notice {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.5rem;
}
.mc-sub__notice--pending {
  background: rgba(220,160,40,0.08); border: 1px solid rgba(220,160,40,0.25);
}
.mc-sub__notice-icon {
  flex-shrink: 0; margin-top: 2px; color: #e0a830;
}
.mc-sub__notice-body strong { display: block; color: #e0a830; font-size: 0.88rem; margin-bottom: 0.3rem; }
.mc-sub__notice-body p { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.5rem; line-height: 1.5; }
.mc-sub__notice-link { font-size: 0.8rem; color: var(--gold); font-weight: 500; }
.mc-sub__notice-link:hover { opacity: 0.8; }

/* ── Profile panel ── */
.mc-profile { }
.mc-profile__layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start;
}
.mc-profile__form { }
.mc-profile__title { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 400; margin: 0 0 0.3rem; }
.mc-profile__desc { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 2rem; }
.mc-profile__form { display: flex; flex-direction: column; gap: 1.25rem; }
.mc-profile__field { display: flex; flex-direction: column; gap: 0.3rem; }
.mc-profile__field label { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.mc-profile__label-row { display: flex; align-items: center; gap: 0.4rem; }
.btn-random-fill {
  background: none; border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px;
  color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-random-fill:hover { color: var(--gold); border-color: var(--gold); transform: rotate(15deg); }
.mc-profile__field input,
.mc-profile__field select {
  padding: 0.55rem 0.75rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-primary); font-family: var(--font-body); font-size: 0.88rem;
  transition: border-color 0.2s;
}
.mc-profile__field input:focus,
.mc-profile__field select:focus { outline: none; border-color: var(--gold); }
.mc-profile__field input:disabled { opacity: 0.5; cursor: not-allowed; }
.mc-profile__hint { font-size: 0.7rem; color: var(--text-muted); opacity: 0.7; font-style: italic; }
.mc-profile__row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.mc-profile__row:last-of-type { grid-template-columns: 1fr 1fr; }
.mc-profile__actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.mc-profile__save {
  padding: 0.65rem 2rem; border-radius: 8px; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #050c1c; transition: box-shadow 0.2s;
}
.mc-profile__save:hover { box-shadow: 0 4px 15px rgba(201,168,76,0.25); }
.mc-profile__save:disabled { opacity: 0.6; cursor: wait; }
.mc-profile__feedback { font-size: 0.82rem; }

/* ── Live generator layout ── */
.mc-live {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start;
}
.mc-live__form { }
.mc-live__result { }
.mc-live__placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px; gap: 0.75rem; color: var(--text-muted);
  font-size: 0.85rem; text-align: center;
}
.mc-live__toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem;
  justify-content: center;
}
.mc-live__btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.78rem; font-family: var(--font-body);
  cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.mc-live__btn:hover { border-color: var(--gold); color: var(--gold); }
.mc-live__btn--save {
  background: rgba(201,168,76,0.1); border-color: rgba(201,168,76,0.3);
  color: var(--gold); font-weight: 600;
}
.mc-live__btn--save:hover { background: rgba(201,168,76,0.2); }
.mc-live__btn--save.saved { background: var(--gold); color: #050c1c; border-color: var(--gold); }
@media (max-width: 768px) {
  .mc-live { grid-template-columns: 1fr; }
}

/* Profile Body Graph */
.mc-profile__bg {
  display: none; padding: 12px; border-radius: 12px;
  align-self: start; position: sticky; top: 80px;
  overflow: hidden;
}
.mc-profile__bg.visible { display: block; }
.mc-profile__bg-container { width: 100%; line-height: 0; }
.mc-profile__bg-container svg { width: 100%; height: auto; display: block; }
/* Fond inversé (BG clair sur site nuit, BG sombre sur site jour) */
body.light-mode .mc-profile__bg {
  background: #050c1c; border: 1px solid rgba(255,255,255,0.08);
}
body:not(.light-mode) .mc-profile__bg {
  background: #fff; border: 1px solid rgba(0,0,0,0.06);
}

/* ── Thème Composite ── */
.composite-persons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.composite-person {
  padding: 1rem;
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 8px;
  background: rgba(201,168,76,0.03);
}
.composite-person__label {
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Quick-fill depuis BG enregistrés ── */
.comp-pick-wrap { position: relative; }
.comp-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 4px;
  background: transparent;
  color: var(--gold);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body, 'Lora', serif);
}
.comp-pick-btn:hover { background: rgba(201,168,76,0.1); }
.comp-pick-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;
  background: #0d1830;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 6px;
  min-width: 220px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.comp-pick-panel.open { display: block; }
.comp-pick-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #ccc;
  cursor: pointer;
  font-family: var(--font-body, 'Lora', serif);
  transition: background 0.15s;
}
.comp-pick-item:last-child { border-bottom: none; }
.comp-pick-item:hover { background: rgba(201,168,76,0.08); }
.comp-pick-item strong { color: var(--gold); font-size: 0.88rem; }
.comp-pick-item span { font-size: 0.75rem; color: #888; }
.comp-pick-search {
  width: 100%; padding: 0.5rem 0.65rem; border: none;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  background: transparent; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.82rem;
  outline: none; position: sticky; top: 0; z-index: 1;
}
.comp-pick-search::placeholder { color: var(--text-muted); opacity: 0.6; }
.comp-pick-search:focus { border-bottom-color: var(--gold); }
.comp-pick-results { max-height: 180px; overflow-y: auto; }
.comp-pick-empty { padding: 0.75rem; text-align: center; font-size: 0.78rem; color: var(--text-muted); }
body.light-mode .comp-pick-search { color: #333; }
body.light-mode .comp-pick-search::placeholder { color: #999; }
body.light-mode .comp-pick-panel { background: #fff; border-color: rgba(0,0,0,0.12); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
body.light-mode .comp-pick-item { color: #333; border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode .comp-pick-item:hover { background: rgba(139,105,20,0.06); }
body.light-mode .comp-pick-item span { color: #777; }

/* ── Toolbar + toggle ── */
.composite-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0.75rem;
}
.composite-title {
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  color: var(--gold);
  font-size: 1.15rem;
  font-style: italic;
}
.composite-mode-toggle { display: flex; gap: 0.25rem; }
.comp-mode-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  border: 1px solid rgba(201,168,76,0.3);
  background: transparent;
  color: var(--text-muted, #999);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body, 'Lora', serif);
  transition: all 0.2s;
}
.comp-mode-btn.active {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  border-color: var(--gold);
}

/* ── Layout triple BG : P1 | Composite | P2 ──
   Flex (et pas grid) pour que les panels masqués via display:none
   disparaissent vraiment et libèrent leur espace au composite. */
.composite-triple {
  display: flex;
  gap: 1rem;
  align-items: start;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.composite-triple > .comp-side-panel { flex: 1 1 0; min-width: 0; }
.composite-triple > .comp-center-panel { flex: 1.8 1 0; min-width: 0; }
.comp-center-panel { display: flex; flex-direction: column; }
.comp-center-label {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}
.comp-label-quantum {
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  font-size: 1.9rem;
  font-weight: 300;
  font-style: italic;
  color: var(--gold);
  letter-spacing: 0.12em;
  line-height: 1;
}
.comp-label-formula {
  font-family: var(--font-body, 'Lora', serif);
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(201,168,76,0.65);
  letter-spacing: 0.04em;
}
body.light-mode .comp-label-formula { color: rgba(139,105,20,0.7); }
.comp-side-panel {
  display: flex;
  flex-direction: column;
  opacity: 0.72;
}
.comp-side-panel--1 { align-items: flex-end; }
.comp-side-panel--2 { align-items: flex-start; }
.comp-side-label {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-bottom: 0.3rem;
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  font-style: italic;
  letter-spacing: 0.04em;
}
.comp-side-panel--1 .comp-side-label { text-align: right; }
.comp-side-panel--2 .comp-side-label { text-align: left; }
.comp-side-panel svg { width: 100%; height: auto; display: block; }
.comp-center-panel svg { width: 100%; height: auto; display: block; }

/* ── Légende ── */
.composite-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(201,168,76,0.1);
  font-size: 0.78rem;
  color: var(--text-muted, #999);
}
.comp-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: default;
}
.comp-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.comp-formula {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(201,168,76,0.08);
}
.comp-formula__label {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.comp-formula__value {
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  color: var(--gold);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Toolbar actions sous le composite ── */
.comp-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(201,168,76,0.1);
}
.comp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 5px;
  border: 1px solid rgba(201,168,76,0.25);
  background: transparent;
  color: #ccc;
  font-family: var(--font-body, 'Lora', serif);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.comp-action-btn:hover { background: rgba(201,168,76,0.08); color: var(--gold); border-color: rgba(201,168,76,0.4); }
.comp-action-btn--primary {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  border-color: rgba(201,168,76,0.4);
  font-weight: 600;
}
.comp-action-btn--primary:hover { background: rgba(201,168,76,0.22); }
body.light-mode .comp-action-btn { color: #555; border-color: rgba(0,0,0,0.15); }
body.light-mode .comp-action-btn:hover { color: #8b6914; }
body.light-mode .comp-action-btn--primary { color: #8b6914; border-color: rgba(139,105,20,0.4); }

/* ── Styles guide types sur home composite ── */
.comp-type-guide { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.comp-type-item { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; line-height: 1.5; }
.comp-home-legend { padding: 0.75rem 1rem; max-width: 520px; margin: 0 auto; }
.comp-home-toggle { justify-content: center; margin-bottom: 0.5rem; }

body.light-mode .composite-person { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.1); }
body.light-mode .comp-label-quantum { color: #8b6914; }
body.light-mode .comp-formula__value { color: #8b6914; }

/* Responsive */
@media (max-width: 768px) {
  .mc-embed-config { grid-template-columns: 1fr; }
  .mc-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: 12px;
  }
  .mc-tab {
    flex: 1 1 calc(50% - 0.25rem);
    font-size: 0.78rem;
    padding: 0.6rem 0.7rem;
    gap: 0.4rem;
    border-radius: 9px;
  }
  .mc-tab svg { width: 14px; height: 14px; }
}

/* ── Cancel subscription ── */
.mc-sub__cancel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201,168,76,0.08);
}
.mc-sub__cancel-btn {
  background: transparent;
  border: 1px solid rgba(220,80,80,0.3);
  color: #e07070;
  font-size: 0.82rem;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.mc-sub__cancel-btn:hover {
  background: rgba(220,80,80,0.08);
  border-color: rgba(220,80,80,0.5);
}
.mc-sub__cancel-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
}
.mc-sub__plan--cancelling { color: #e0a830 !important; }
.mc-sub__notice--cancelling {
  background: rgba(220,160,40,0.06);
  border: 1px solid rgba(220,160,40,0.2);
  margin-top: 1rem;
}
.mc-sub__notice--cancelling .mc-sub__notice-icon { color: #e0a830; }
.mc-sub__notice--cancelling .mc-sub__notice-body strong { color: #e0a830; }
body.light-mode .mc-sub__cancel-btn { border-color: rgba(220,80,80,0.25); }

/* ── Modal résiliation ── */
.mc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,12,28,0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.mc-modal {
  background: var(--bg-card, #0d1830);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
}
body.light-mode .mc-modal { background: #fff; border-color: rgba(0,0,0,0.1); }
.mc-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.mc-modal__icon { color: #e07070; margin-bottom: 0.75rem; }
.mc-modal__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}
.mc-modal__text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.mc-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.mc-modal__btn {
  padding: 0.55rem 1.3rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.mc-modal__btn--secondary {
  background: var(--bg-input, rgba(255,255,255,0.05));
  color: var(--text-muted);
}
.mc-modal__btn--secondary:hover { background: rgba(255,255,255,0.1); }
body.light-mode .mc-modal__btn--secondary { background: #f0eeeb; color: #666; }
body.light-mode .mc-modal__btn--secondary:hover { background: #e8e5e0; }
.mc-modal__btn--danger {
  background: #e07070;
  color: #fff;
}
.mc-modal__btn--danger:hover { background: #d05050; }
.mc-modal__btn--danger:disabled { opacity: 0.5; cursor: not-allowed; }
.mc-modal__loading {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}
.mc-modal__list {
  text-align: left; margin: 0.75rem 0 0 1.2rem; font-size: 0.85rem;
  color: var(--text-muted); line-height: 1.7; list-style: disc;
}
.mc-modal__input {
  display: block; width: 100%; padding: 0.6rem 0.8rem;
  margin: 0.5rem 0 1.25rem;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  background: rgba(255,255,255,0.05); color: var(--text-main);
  font-size: 0.9rem; text-align: center; letter-spacing: 0.15em;
}
body.light-mode .mc-modal__input { background: #f5f3f0; border-color: #ddd; color: #333; }
.mc-modal__input:focus { outline: none; border-color: #e07070; }

/* ── Gestion du compte (suppression) ── */
.mc-sub__danger {
  margin-top: 2.5rem; padding: 1.5rem; border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(138, 134, 148, 0.05);
}
body.light-mode .mc-sub__danger { background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.08); }
.mc-sub__danger-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.03em; margin: 0 0 0.6rem;
}
.mc-sub__danger-text {
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 1rem;
}
.mc-sub__delete-btn {
  background: transparent; border: 1px solid rgba(224, 112, 112, 0.3);
  color: #c07070; padding: 0.5rem 1.2rem; border-radius: 8px;
  font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
  margin-bottom: 20px;
}
.mc-sub__delete-btn:hover { background: rgba(224, 112, 112, 0.1); color: #e07070; }

@media (max-width: 768px) {
  .mc-sub__status { flex-direction: column; text-align: center; }
  .mc-profile__layout { grid-template-columns: 1fr; }
  .mc-profile__row { grid-template-columns: 1fr 1fr; }
  .mc-profile__bg { position: relative; top: auto; }
  .composite-persons { grid-template-columns: 1fr; }
  /* Responsive triple : composite pleine largeur, P1/P2 à 50% en dessous */
  .composite-triple > .comp-center-panel  { flex: 1 1 100%; order: 1; }
  .composite-triple > .comp-side-panel--1 { flex: 1 1 calc(50% - 0.5rem); order: 2; align-items: center; }
  .composite-triple > .comp-side-panel--2 { flex: 1 1 calc(50% - 0.5rem); order: 2; align-items: center; }
  .comp-side-panel--1 .comp-side-label,
  .comp-side-panel--2 .comp-side-label { text-align: center; }

  /* ── Mon compte mobile : vue BG ultra-compacte ─────────────────────────────
     Layout 2 lignes dense (hauteur ≈ 58 px) :
       ● Nom                           [👁 ✎ 📁 🗑]
         14 nov 1976 · 10h10 · Paris
     Dot catégorie coloré à gauche, nom + meta au centre, 4 icon buttons à droite.
     Détails HD et miniature BG accessibles sur la page « Voir ».                */

  .charts-grid { grid-template-columns: 1fr; gap: 0.5rem; }

  .charts-grid .chart-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    border-radius: 10px;
    position: relative;
    overflow: visible;
    min-height: 58px;
  }
  .charts-grid .chart-card:hover {
    border-color: rgba(201, 168, 76, 0.45);
  }

  /* Masqué par défaut en mobile (accessible via la page Voir, ou via accordéon).
     :not(.compact) pour battre la règle générique ligne ~754 qui force la note
     en display:block en vue grille (spécificité 0,3,0). */
  .charts-grid .chart-card__thumb-wrap,
  .charts-grid .chart-card__theme-toggle,
  .charts-grid .chart-card__hd,
  .charts-grid .chart-card__ai,
  .charts-grid .chart-card__share,
  .charts-grid .chart-card__quickview,
  .charts-grid .chart-card__heart { display: none; }
  .charts-grid:not(.compact) .chart-card__note { display: none; }

  /* Chevron accordéon mobile : déplie la card pour révéler la note libre */
  .charts-grid .chart-card__expand {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 30px; height: 30px;
    margin: 0;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    order: 3;
    transition: transform .2s, border-color .15s, background .15s, color .15s;
  }
  .charts-grid .chart-card__expand:hover,
  .charts-grid .chart-card__expand:focus-visible {
    background: rgba(201,168,76,0.08);
    border-color: rgba(201,168,76,0.45);
    color: var(--gold);
  }
  .charts-grid .chart-card__expand svg { transition: transform .2s; }
  .charts-grid .chart-card.is-expanded .chart-card__expand svg { transform: rotate(180deg); }

  /* Header mobile minimal : seuls dot catégorie + nom + chevron restent visibles.
     Date/heure, ville et actions passent dans l'accordéon. */
  .charts-grid:not(.compact) .chart-card__meta,
  .charts-grid:not(.compact) .chart-card__city,
  .charts-grid:not(.compact) .chart-card__actions { display: none; }

  /* Card dépliée : autorise le wrap et révèle actions + synthèse HD + IA + note
     dans l'accordéon. :not(.compact) pour battre la spécificité de la règle générique. */
  .charts-grid .chart-card.is-expanded { flex-wrap: wrap; }
  .charts-grid:not(.compact) .chart-card.is-expanded .chart-card__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.25rem;
    order: 95;
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.55rem;
    padding: 0.55rem 0 0;
    border-top: 1px dashed rgba(201,168,76,0.22);
    align-items: center;
    justify-content: flex-start;
  }
  .charts-grid:not(.compact) .chart-card.is-expanded .chart-card__hd {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    order: 96;
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.5rem;
  }
  .charts-grid:not(.compact) .chart-card.is-expanded .chart-card__ai {
    display: block;
    order: 97;
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.4rem;
  }
  .charts-grid:not(.compact) .chart-card.is-expanded .chart-card__note {
    display: block;
    order: 99;
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.55rem;
    padding: 0.55rem 0 0;
    border-top: 1px dashed rgba(201,168,76,0.22);
  }

  /* Puce catégorie retirée en mobile (consigne user 2026-05-24 : titre seul sur la ligne) */
  .charts-grid .chart-card__cat-slot { display: none; }

  /* Colonne centrale : dot catégorie + nom alignés sur une seule ligne.
     Flex permet aussi à la synthèse HD (enfant de .info, accordéon) de wrapper
     en pleine largeur dessous via flex-basis: 100%. */
  .charts-grid .chart-card__info {
    order: 1;
    flex: 1;
    min-width: 0;
    padding: 0; margin: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
  }
  .charts-grid .chart-card__name {
    display: block;
    flex: 1;
    min-width: 0;
    font-family: var(--font-heading);
    font-size: 0.98rem; font-weight: 500;
    line-height: 1.25;
    margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Meta + city : inline pour fusion sur la même ligne visuelle */
  .charts-grid .chart-card__meta,
  .charts-grid .chart-card__city {
    display: inline;
    font-family: var(--font-body);
    font-size: 0.72rem; line-height: 1.3;
    color: var(--text-muted);
    margin: 0; padding: 0;
    opacity: 0.85;
  }
  .charts-grid .chart-card__city::before {
    content: " · "; opacity: 0.5;
  }

  /* Actions : 4 icon buttons compacts à droite */
  .charts-grid .chart-card__actions {
    order: 2;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.2rem;
    padding: 0; margin: 0;
    align-items: center;
  }
  .charts-grid .chart-card__actions .chart-btn {
    width: 34px; height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 8px;
    gap: 0;
    background: transparent;
    position: relative;
  }
  .charts-grid .chart-card__actions .chart-btn__label {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  .charts-grid .chart-card__actions .chart-btn__icon {
    width: 17px; height: 17px;
    opacity: 0.75;
    transition: opacity 0.15s, transform 0.15s;
  }
  .charts-grid .chart-card__actions .chart-btn:hover .chart-btn__icon,
  .charts-grid .chart-card__actions .chart-btn:focus-visible .chart-btn__icon {
    opacity: 1;
    transform: scale(1.08);
  }

  /* Variante primary (Voir) : dorée discrète */
  .charts-grid .chart-card__actions .chart-btn--primary {
    background: rgba(201, 168, 76, 0.1);
    border-color: rgba(201, 168, 76, 0.35);
    color: var(--gold);
  }
  .charts-grid .chart-card__actions .chart-btn--primary:hover {
    background: var(--gold);
    color: var(--bg-primary);
    border-color: var(--gold);
  }
  /* Variante delete : rouge sur hover */
  .charts-grid .chart-card__actions .chart-btn--delete:hover {
    background: rgba(201, 64, 64, 0.12);
    border-color: rgba(201, 64, 64, 0.45);
    color: var(--red-hd, #c94040);
  }

  /* Light mode : ajuste contrastes */
  body.light-mode .charts-grid .chart-card__actions .chart-btn {
    background: transparent;
  }
  body.light-mode .charts-grid .chart-card__actions .chart-btn--primary {
    background: rgba(139, 105, 20, 0.08);
    border-color: rgba(139, 105, 20, 0.4);
    color: #8b6914;
  }
  body.light-mode .charts-grid .chart-card__actions .chart-btn--primary:hover {
    background: #8b6914;
    color: #fff;
  }
}

/* Très petits écrans (≤ 380 px) : on descend la meta sous le nom et on réduit le padding */
@media (max-width: 380px) {
  .charts-grid .chart-card {
    padding: 0.45rem 0.55rem 0.45rem 0.75rem;
    column-gap: 0.45rem;
  }
  .charts-grid .chart-card__name { font-size: 0.92rem; }
  .charts-grid .chart-card__meta { font-size: 0.68rem; }
  .charts-grid .chart-card__actions { gap: 0.1rem; }
  .charts-grid .chart-card__actions .chart-btn {
    width: 32px; height: 32px; min-width: 32px;
  }
  .charts-grid .chart-card__actions .chart-btn__icon {
    width: 15px; height: 15px;
  }
}

/* ── Chart card AI accordion ── */
.chart-card__ai {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.chart-card__ai-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; padding: 0.75rem 1rem;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 600;
  color: var(--gold);
  transition: background 0.2s;
}
.chart-card__ai-toggle:hover { background: rgba(201,168,76,0.06); }
.chart-card__ai-chevron {
  margin-left: auto;
  transition: transform 0.3s;
}
.chart-card__ai.open .chart-card__ai-chevron {
  transform: rotate(180deg);
}
.chart-card__ai-content {
  padding: 0 1rem 1rem;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary, #aaa);
}
.chart-card__ai-content .ai-content h3 {
  font-size: 0.95rem; color: var(--gold);
  margin: 1rem 0 0.4rem; font-family: var(--font-heading);
}
.chart-card__ai-content .ai-content h4 {
  font-size: 0.88rem; color: var(--text-primary, #e6e4e1);
  margin: 0.75rem 0 0.3rem;
}
.chart-card__ai-content .ai-content p {
  margin: 0 0 0.5rem;
}
.chart-card__ai-content .ai-content ul {
  margin: 0 0 0.5rem; padding-left: 1.2rem;
}
.chart-card__ai-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.75rem; margin-top: 0.75rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.chart-card__ai-meta {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; color: var(--text-muted, #666);
}
/* Light mode */
body.light-mode .chart-card__ai { border-top-color: rgba(0,0,0,0.08); }
body.light-mode .chart-card__ai-toggle:hover { background: rgba(201,168,76,0.08); }
body.light-mode .chart-card__ai-content { color: #555; }
body.light-mode .chart-card__ai-content .ai-content h4 { color: #333; }
body.light-mode .chart-card__ai-footer { border-top-color: rgba(0,0,0,0.06); }

/* ══════════════════════════════════════════════════════════════════
   Outil « Générateur d'analyse fine IA » (Mon Compte → Outils)
   ══════════════════════════════════════════════════════════════════ */
.mc-ai-tool__list {
  display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem;
}
.mc-ai-tool__card {
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  background: var(--bg-secondary, rgba(255,255,255,0.02));
  padding: 1rem 1.1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.mc-ai-tool__card.has-ai {
  border-color: rgba(201,168,76,0.35);
  background: linear-gradient(180deg, rgba(201,168,76,0.04), transparent);
}
.mc-ai-tool__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap;
}
.mc-ai-tool__info { flex: 1 1 260px; min-width: 0; }
.mc-ai-tool__name {
  margin: 0 0 0.2rem; font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
}
.mc-ai-tool__meta {
  margin: 0 0 0.4rem; font-size: 0.8rem; color: var(--text-secondary);
}
.mc-ai-tool__status {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; padding: 0.2rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.mc-ai-tool__status.ok {
  color: var(--gold); background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.3);
}
.mc-ai-tool__status.none {
  color: var(--text-muted, #888); background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.mc-ai-tool__status svg { flex-shrink: 0; }

.mc-ai-tool__actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center;
}
.mc-ai-tool__btn {
  font-family: inherit; font-size: 0.78rem; font-weight: 500;
  padding: 0.45rem 0.85rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: transparent; color: var(--text-primary);
  transition: all 0.18s ease;
}
.mc-ai-tool__btn:hover:not(:disabled) {
  border-color: rgba(201,168,76,0.5); background: rgba(201,168,76,0.08);
}
.mc-ai-tool__btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mc-ai-tool__btn--gen {
  border-color: rgba(201,168,76,0.6); color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.mc-ai-tool__btn--gen:hover:not(:disabled) {
  background: rgba(201,168,76,0.18);
}
.mc-ai-tool__btn--del {
  border-color: rgba(220,80,80,0.35); color: #d87070;
}
.mc-ai-tool__btn--del:hover:not(:disabled) {
  background: rgba(220,80,80,0.1); border-color: rgba(220,80,80,0.55);
}

.mc-ai-tool__body {
  margin-top: 0.9rem; padding-top: 0.9rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.mc-ai-tool__body .ai-content {
  font-size: 0.88rem; line-height: 1.65;
  color: var(--text-secondary);
}
.mc-ai-tool__body .ai-content h3,
.mc-ai-tool__body .ai-content h4 {
  color: var(--text-primary); margin: 1.2em 0 0.4em;
}
.mc-ai-tool__footer {
  margin-top: 0.8rem; padding-top: 0.6rem;
  border-top: 1px dashed var(--border, rgba(255,255,255,0.06));
}
.mc-ai-tool__credit {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; color: var(--text-muted, #888);
  font-style: italic;
}

.mc-ai-tool__feedback {
  margin-top: 0.6rem; font-size: 0.78rem; min-height: 1.1em;
}
.mc-ai-tool__feedback--loading { color: var(--gold); }
.mc-ai-tool__feedback--success { color: #6fbf6f; }
.mc-ai-tool__feedback--error   { color: #e87070; }

/* Light mode */
body.light-mode .mc-ai-tool__card {
  background: #ffffff; border-color: rgba(0,0,0,0.08);
}
body.light-mode .mc-ai-tool__card.has-ai {
  border-color: rgba(201,168,76,0.5);
  background: linear-gradient(180deg, rgba(201,168,76,0.06), #ffffff);
}
body.light-mode .mc-ai-tool__btn { border-color: rgba(0,0,0,0.12); }
body.light-mode .mc-ai-tool__status.none {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08);
}
body.light-mode .mc-ai-tool__body { border-top-color: rgba(0,0,0,0.08); }
body.light-mode .mc-ai-tool__footer { border-top-color: rgba(0,0,0,0.06); }

@media (max-width: 640px) {
  .mc-ai-tool__head { flex-direction: column; }
  .mc-ai-tool__actions { width: 100%; }
  .mc-ai-tool__btn { flex: 1 1 auto; text-align: center; }
}

/* ══════════════════════════════════════════════════════════════
   PDF Configurator (Mon Compte - Mes Outils)
   ══════════════════════════════════════════════════════════════ */
.mc-pdf-config { display: flex; flex-direction: column; gap: 1.25rem; }

/* Template picker */
.mc-pdf-template-picker {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
}
.mc-pdf-tpl-btn {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: 10px; padding: 0.6rem 1rem; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-body); color: var(--text-secondary);
  font-size: 0.82rem;
}
.mc-pdf-tpl-btn:hover { border-color: var(--gold); }
.mc-pdf-tpl-btn.active {
  border-color: var(--gold); background: rgba(201,168,76,0.08);
  color: var(--text-primary);
}
.mc-pdf-tpl-swatch {
  width: 28px; height: 36px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}
.mc-pdf-tpl-name { font-weight: 500; }

/* Pro badge */
.mc-pdf-pro-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  background: rgba(201,169,230,0.15); color: #c9a9e6;
  padding: 0.1rem 0.4rem; border-radius: 4px; margin-left: 0.4rem;
  vertical-align: middle; letter-spacing: 0.05em;
}

/* Locked field */
.mc-pdf-field--locked { opacity: 0.5; pointer-events: none; }
.mc-pdf-locked-hint {
  font-size: 0.8rem; color: var(--text-muted); margin: 0;
}
.mc-pdf-locked-hint a { color: #c9a9e6; }

/* Logo upload */
.mc-pdf-logo-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.mc-pdf-logo-preview {
  position: relative; display: inline-block;
  max-width: 200px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-secondary);
}
.mc-pdf-logo-preview img {
  display: block; max-height: 60px; width: auto;
}
.mc-pdf-logo-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mc-pdf-logo-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.5rem 0.8rem; cursor: pointer;
  font-size: 0.8rem; color: var(--text-secondary);
  font-family: var(--font-body); transition: border-color 0.2s;
}
.mc-pdf-logo-btn:hover { border-color: var(--gold); }

/* Footer preview */
.mc-pdf-footer-preview {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem;
  font-family: var(--font-body); line-height: 1.6;
  min-height: 48px;
}
.mc-pdf-footer-preview__brand {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.mc-pdf-footer-preview__therapist {
  font-size: 0.72rem; color: var(--gold);
}
.mc-pdf-footer-preview__extra {
  font-size: 0.68rem; color: var(--text-muted); font-style: italic;
  margin-top: 0.15rem;
}

/* Light mode overrides */
body.light-mode .mc-pdf-tpl-btn { background: #f5f4f0; border-color: #ddd; }
body.light-mode .mc-pdf-tpl-btn.active { background: rgba(201,168,76,0.06); }
body.light-mode .mc-pdf-tpl-swatch { border-color: rgba(0,0,0,0.1); }
body.light-mode .mc-pdf-footer-preview { background: #f5f4f0; border-color: #ddd; }
body.light-mode .mc-pdf-logo-preview { border-color: #ddd; background: #f5f4f0; }
body.light-mode .mc-pdf-logo-btn { background: #f5f4f0; border-color: #ddd; }

@media (max-width: 640px) {
  .mc-pdf-template-picker { flex-direction: column; }
  .mc-pdf-tpl-btn { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   Mon Body Graph - encadré personnel dans Mes Body Graphs
   ══════════════════════════════════════════════════════════════ */
.mc-own-bg {
  position: relative;
  margin: 0 0 2rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201,168,76,0.14), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(201,168,76,0.08), transparent 55%),
    linear-gradient(135deg, rgba(11,20,40,0.92) 0%, rgba(13,24,48,0.92) 100%);
  border: 1px solid rgba(201,168,76,0.45);
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.1) inset,
    0 4px 24px rgba(0,0,0,0.35),
    0 0 42px rgba(201,168,76,0.08);
  overflow: hidden;
}
.mc-own-bg::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(135deg, rgba(201,168,76,0.45), transparent 40%, transparent 60%, rgba(201,168,76,0.3));
  border-radius: 17px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor;
  padding: 2px;
}
.mc-own-bg > * { position: relative; z-index: 1; }

/* ── Header (titre + bouton modifier) ── */
.mc-own-bg__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.mc-own-bg__title-wrap {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  order: 1;
}
.mc-own-bg__toggle { order: 2; margin-left: auto; margin-right: 0; }
.mc-own-bg__header-actions { order: 3; }
.mc-own-bg__star {
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(201,168,76,0.55);
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}
.mc-own-bg__eyebrow {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.mc-own-bg__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.15;
  color: #f3eadd;
  margin: 0 0 0.2rem;
  word-break: break-word;
}
.mc-own-bg__meta {
  font-size: 0.82rem;
  color: rgba(243,234,221,0.65);
  margin: 0;
}
.mc-own-bg__header-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.mc-own-bg__edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  /* Hauteur identique a/button : reset des styles natifs button + hauteur fixe */
  box-sizing: border-box;
  height: 2.25rem;
  min-height: 2.25rem;
  max-height: 2.25rem;
  padding: 0 0.9rem;
  margin: 0;
  border: 1px solid rgba(201,168,76,0.4);
  background: rgba(201,168,76,0.08);
  color: var(--gold);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  transition: all .2s;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.mc-own-bg__edit-btn svg { flex-shrink: 0; display: block; }
.mc-own-bg__edit-btn:hover {
  background: rgba(201,168,76,0.18);
  border-color: rgba(201,168,76,0.7);
}
.mc-own-bg__edit-btn--view {
  background: rgba(201,168,76,0.22);
  border-color: rgba(201,168,76,0.65);
}
.mc-own-bg__edit-btn--view:hover {
  background: rgba(201,168,76,0.32);
  border-color: rgba(201,168,76,0.85);
}
body.light-mode .mc-own-bg__edit-btn {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.45);
  color: #8b7128;
}
body.light-mode .mc-own-bg__edit-btn:hover {
  background: rgba(201,168,76,0.22);
  border-color: rgba(201,168,76,0.7);
}
body.light-mode .mc-own-bg__edit-btn--view {
  background: rgba(201,168,76,0.24);
  border-color: rgba(201,168,76,0.7);
}
body.light-mode .mc-own-bg__edit-btn--view:hover {
  background: rgba(201,168,76,0.36);
}
@media (max-width: 640px) {
  .mc-own-bg__header-actions { width: 100%; }
  .mc-own-bg__edit-btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Premium : toggle « Naviguer avec Mon BG » dans le header ── */
.mc-own-bg__nav {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px dashed rgba(201,168,76,0.32);
  border-radius: 10px;
  background: rgba(201,168,76,0.04);
}
.mc-own-bg__nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  user-select: none;
}
.mc-own-bg__nav-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
  margin: 0;
}
.mc-own-bg__nav-submit {
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(201,168,76,0.55);
  background: rgba(201,168,76,0.18);
  color: var(--gold);
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.mc-own-bg__nav-submit:hover:not(:disabled) {
  background: rgba(201,168,76,0.3);
  border-color: rgba(201,168,76,0.8);
}
.mc-own-bg__nav-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}
.mc-own-bg__nav-status {
  font-size: 0.72rem;
  color: rgba(243,234,221,0.7);
  font-style: italic;
  min-height: 1em;
}
body.light-mode .mc-own-bg__nav {
  border-color: rgba(139,113,40,0.35);
  background: rgba(201,168,76,0.07);
}
body.light-mode .mc-own-bg__nav-toggle { color: #8b7128; }
body.light-mode .mc-own-bg__nav-submit {
  background: rgba(201,168,76,0.22);
  border-color: rgba(201,168,76,0.6);
  color: #8b7128;
}
body.light-mode .mc-own-bg__nav-submit:hover:not(:disabled) {
  background: rgba(201,168,76,0.35);
}
body.light-mode .mc-own-bg__nav-status { color: #665a3d; }
@media (max-width: 640px) {
  .mc-own-bg__nav { justify-content: space-between; }
  .mc-own-bg__nav-submit { flex: 0 0 auto; }
  .mc-own-bg__nav-status { flex: 1 1 100%; text-align: center; }
}

/* ── Synthèse ── */
.mc-own-bg__synthese {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.mc-own-bg__stat {
  padding: 0.7rem 0.85rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 58px;
}
.mc-own-bg__stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(243,234,221,0.5);
  font-weight: 600;
}
.mc-own-bg__stat-value {
  font-size: 0.95rem;
  color: #f3eadd;
  font-weight: 500;
  font-family: 'Cormorant Garamond', serif;
}

/* ── Body graph SVG (contient svg + sidebar + actions) ── */
.mc-own-bg__body {
  background: #ffffff;
  border-radius: 12px;
  padding: 15px 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}
.mc-own-bg__main {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 1.75rem;
}
.mc-own-bg__chart-title {
  flex-basis: 100%;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.75rem 0.75rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1.55;
  border-bottom: 1px solid rgba(201,168,76,0.18);
}
.mc-own-bg__chart-title-name { font-weight: 500; color: var(--gold); }
.mc-own-bg__chart-title-sep {
  opacity: 0.55;
  margin: 0 0.45rem;
  display: inline-block;
}
.mc-own-bg__chart-title-date,
.mc-own-bg__chart-title-city {
  color: var(--text-secondary);
  font-size: 0.92em;
}
body.light-mode .mc-own-bg__chart-title { color: #8b6914; border-bottom-color: rgba(139,105,20,0.22); }
body.light-mode .mc-own-bg__chart-title-name { color: #8b6914; }
body.light-mode .mc-own-bg__chart-title-date,
body.light-mode .mc-own-bg__chart-title-city { color: #554e70; }
@media (max-width: 640px) {
  .mc-own-bg__chart-title {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem 0.5rem;
  }
  .mc-own-bg__chart-title-sep { margin: 0 0.3rem; }
}
.mc-own-bg__svg-wrap {
  flex: 0 1 480px;
  min-width: 0;
  max-width: 480px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mc-own-bg__svg-wrap svg { display: block; margin: 0; padding: 0; }
.mc-own-bg__sidebar {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Aligner le haut des filtres avec le haut de la colonne planètes :
     colPanelY=24 dans viewBox (-5 → 325, hauteur 330) → ≈ 8.8% du haut du SVG */
  padding-top: calc(480px * (330 / 395) * 0.088);
}
.mc-own-bg__svg-wrap svg {
  width: 100%;
  height: auto;
  max-height: 560px;
}

/* ── Toggle accordéon Mon BG ── */
.mc-own-bg__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 0.6rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s, transform 0.18s;
}
.mc-own-bg__toggle:hover { background: rgba(201,168,76,0.18); }
.mc-own-bg__toggle-chevron { transition: transform 0.25s ease; }
.mc-own-bg--collapsed .mc-own-bg__toggle-chevron { transform: rotate(-90deg); }
body.light-mode .mc-own-bg__toggle {
  background: rgba(139,105,20,0.08);
  border-color: rgba(139,105,20,0.35);
  color: #8b6914;
}
body.light-mode .mc-own-bg__toggle:hover { background: rgba(139,105,20,0.18); }

/* ── Responsive smartphone : BG sur 90% du conteneur, filtres en dessous ── */
@media (max-width: 768px) {
  .mc-own-bg__main {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .mc-own-bg__svg-wrap {
    flex: 0 0 auto;
    width: 90%;
    max-width: 90%;
  }
  .mc-own-bg__sidebar {
    flex: 0 0 auto;
    width: 100%;
    padding-top: 0;
  }
}
.mc-own-bg__loading {
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
  padding: 3rem 0;
}

/* ── Fullwidth state (plein écran) ── */
.mc-own-bg--fullwidth {
  position: fixed;
  inset: 0;
  z-index: 9500;
  margin: 0;
  border-radius: 0;
  max-width: 100%;
  width: 100%;
  height: 100vh; /* fallback */
  height: 100dvh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1rem;
}
.mc-own-bg--fullwidth .mc-own-bg__body {
  min-height: calc(100vh - 280px); /* fallback */
  min-height: calc(100dvh - 280px);
  padding: 1rem;
}
.mc-own-bg--fullwidth .mc-own-bg__svg-wrap {
  max-width: 100%;
  height: 100%;
}
.mc-own-bg--fullwidth .mc-own-bg__svg-wrap svg {
  max-width: 100%;
  max-height: calc(100vh - 340px); /* fallback */
  max-height: calc(100dvh - 340px);
  width: auto;
  height: auto;
  object-fit: contain;
}
body.mc-own-bg-fullwidth-lock { overflow: hidden; }

/* ── Action bar (dans le container blanc du BG, 15px sous le graph) ── */
.mc-own-bg__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 15px;
  padding-top: 0;
}
.mc-own-bg__action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(201,168,76,0.45);
  background: rgba(201,168,76,0.08);
  color: #3a3a4e;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.mc-own-bg__action svg { flex-shrink: 0; }
.mc-own-bg__action:hover {
  background: rgba(201,168,76,0.2);
  border-color: rgba(201,168,76,0.7);
  color: #8b7128;
}
.mc-own-bg__action--primary {
  background: rgba(201,168,76,0.24);
  border-color: rgba(201,168,76,0.7);
  color: #8b7128;
}
.mc-own-bg__action--primary:hover {
  background: rgba(201,168,76,0.38);
}
/* Dark BG body variant */
.mc-own-bg__body--dark .mc-own-bg__action { color: #e0d6c8; border-color: rgba(201,168,76,0.3); background: rgba(201,168,76,0.06); }
.mc-own-bg__body--dark .mc-own-bg__action:hover { background: rgba(201,168,76,0.18); color: var(--gold); }
.mc-own-bg__body--dark .mc-own-bg__action--primary { background: rgba(201,168,76,0.2); color: var(--gold); border-color: rgba(201,168,76,0.55); }

/* ── Empty state ── */
.mc-own-bg--empty {
  text-align: center;
  padding: 2.5rem 1.75rem;
}
.mc-own-bg__empty-icon {
  color: var(--gold);
  margin-bottom: 1rem;
  opacity: 0.75;
  display: inline-block;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.35));
}
.mc-own-bg__empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #f3eadd;
  margin: 0 0 0.65rem;
}
.mc-own-bg__empty-text {
  color: rgba(243,234,221,0.65);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}
.mc-own-bg__empty-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.mc-own-bg__primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--gold) 0%, #b89538 100%);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 16px rgba(201,168,76,0.35);
  transition: all .2s;
  font-family: inherit;
}
.mc-own-bg__primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 22px rgba(201,168,76,0.5);
}

/* ── Picker ── */
.mc-own-bg__picker {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(201,168,76,0.18);
}
.mc-own-bg__picker-label {
  display: block;
  font-size: 0.78rem;
  color: rgba(243,234,221,0.65);
  margin-bottom: 0.55rem;
  font-weight: 500;
}
.mc-own-bg__picker-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}
.mc-own-bg__picker-select {
  flex: 1 1 220px;
  padding: 0.6rem 0.8rem;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(201,168,76,0.28);
  color: #f3eadd;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  max-width: 340px;
}
.mc-own-bg__picker-select:focus {
  outline: none;
  border-color: rgba(201,168,76,0.6);
}
.mc-own-bg__picker-select option {
  color: #000;
  background: #fff;
}
.mc-own-bg__picker-btn {
  padding: 0.6rem 1.1rem;
  background: rgba(201,168,76,0.14);
  border: 1px solid rgba(201,168,76,0.45);
  color: var(--gold);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.mc-own-bg__picker-btn:not(:disabled):hover {
  background: rgba(201,168,76,0.24);
}
.mc-own-bg__picker-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.mc-own-bg__picker-btn--ghost {
  background: transparent;
  border-color: rgba(201,168,76,0.25);
  color: rgba(58,58,78,0.65);
}
.mc-own-bg__picker-btn--ghost:not(:disabled):hover {
  background: rgba(201,168,76,0.08);
  color: #3a3a4e;
}

/* Panneau "Changer mon Body Graph" (état rempli) */
.mc-own-bg__changer {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(201,168,76,0.05);
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: 10px;
}
.mc-own-bg__changer[hidden] { display: none !important; }

/* ── Toolbar : filtres de vue + toggle jour/nuit (sidebar droite) ── */
.mc-own-bg__toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0;
}
.mc-own-bg__views { display: flex; flex-direction: column; gap: 0.35rem; }
.mc-own-bg__view-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  width: 100%;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.32);
  color: #3a3a4e;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.mc-own-bg__view-btn:hover { background: rgba(201,168,76,0.18); }
.mc-own-bg__view-btn.is-active {
  background: rgba(201,168,76,0.28);
  border-color: rgba(201,168,76,0.7);
  color: #8b7128;
}
.mc-own-bg__view-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.mc-own-bg__view-swatch--quantum { background: linear-gradient(135deg, #000 50%, #e74c5e 50%); }
.mc-own-bg__view-swatch--personality { background: #111; border: 1px solid #666; }
.mc-own-bg__view-swatch--design { background: #e74c5e; }
.mc-own-bg__theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  width: 100%;
  margin-top: 0.35rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.32);
  color: #3a3a4e;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.mc-own-bg__theme-btn:hover { background: rgba(201,168,76,0.18); }

/* ── Légende : calques ── */
.mc-own-bg__legend { padding: 0 0.25rem; }
.mc-own-bg__legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.mc-own-bg__legend-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b7128;
}
.mc-own-bg__legend-all {
  padding: 0.25rem 0.6rem;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.32);
  color: #8b7128;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.mc-own-bg__legend-all:hover { background: rgba(201,168,76,0.22); }
.mc-own-bg__legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.mc-own-bg__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #3a3a4e;
  cursor: pointer;
  user-select: none;
}
.mc-own-bg__legend-item input {
  accent-color: var(--gold);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── Dark BG (toggle indépendant du site) ── */
.mc-own-bg__body--dark { background: #0b1428; }
.mc-own-bg__body--dark .mc-own-bg__view-btn,
.mc-own-bg__body--dark .mc-own-bg__theme-btn { color: #f3eadd; background: rgba(201,168,76,0.1); border-color: rgba(201,168,76,0.35); }
.mc-own-bg__body--dark .mc-own-bg__view-btn:hover,
.mc-own-bg__body--dark .mc-own-bg__theme-btn:hover { background: rgba(201,168,76,0.2); }
.mc-own-bg__body--dark .mc-own-bg__view-btn.is-active { background: rgba(201,168,76,0.32); border-color: rgba(201,168,76,0.75); color: #ffd77a; }
.mc-own-bg__body--dark .mc-own-bg__legend-title,
.mc-own-bg__body--dark .mc-own-bg__legend-all { color: var(--gold); }
.mc-own-bg__body--dark .mc-own-bg__legend-item { color: #e6dccc; }

/* ── Badge ★ sur la card correspondante dans la grille ── */
.chart-card--is-own { position: relative; }
.chart-card--is-own::before {
  content: '★';
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,20,40,0.85);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.6);
  border-radius: 50%;
  font-size: 0.88rem;
  box-shadow: 0 2px 10px rgba(201,168,76,0.3);
  pointer-events: none;
}

/* ══════════════ Light mode ══════════════ */
body.light-mode .mc-own-bg {
  background:
    radial-gradient(circle at 0% 0%, rgba(201,168,76,0.12), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(201,168,76,0.08), transparent 55%),
    linear-gradient(135deg, #fdfbf6 0%, #f8f5ec 100%);
  border-color: rgba(201,168,76,0.55);
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.12) inset,
    0 4px 24px rgba(0,0,0,0.08),
    0 0 42px rgba(201,168,76,0.1);
}
body.light-mode .mc-own-bg__title,
body.light-mode .mc-own-bg__stat-value,
body.light-mode .mc-own-bg__empty-title { color: #1a1a2e; }
body.light-mode .mc-own-bg__meta,
body.light-mode .mc-own-bg__empty-text,
body.light-mode .mc-own-bg__picker-label { color: rgba(26,26,46,0.62); }
body.light-mode .mc-own-bg__stat {
  background: rgba(201,168,76,0.05);
  border-color: rgba(201,168,76,0.2);
}
body.light-mode .mc-own-bg__stat-label { color: rgba(26,26,46,0.5); }
body.light-mode .mc-own-bg__action { color: #3a3a4e; background: rgba(201,168,76,0.05); }
body.light-mode .mc-own-bg__action:hover { background: rgba(201,168,76,0.14); color: #8b7128; }
body.light-mode .mc-own-bg__action--primary { background: rgba(201,168,76,0.2); color: #8b7128; }
body.light-mode .mc-own-bg__header { border-bottom-color: rgba(201,168,76,0.22); }
body.light-mode .mc-own-bg__picker { border-top-color: rgba(201,168,76,0.22); }
body.light-mode .mc-own-bg__picker-select {
  background: #ffffff;
  border-color: rgba(201,168,76,0.32);
  color: #1a1a2e;
}
body.light-mode .chart-card--is-own::before {
  background: #ffffff;
  color: #8b7128;
  border-color: rgba(201,168,76,0.6);
}

/* ══════════════ Responsive ══════════════ */
@media (max-width: 768px) {
  .mc-own-bg { padding: 1.25rem 1rem 1.15rem; }
  .mc-own-bg__header {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
  }
  .mc-own-bg__title-wrap { flex: 1 1 auto; min-width: 0; }
  .mc-own-bg__toggle { margin-left: auto; }
  .mc-own-bg__header-actions { flex: 1 1 100%; }
  .mc-own-bg__title { font-size: 1.45rem; }
  .mc-own-bg__synthese { grid-template-columns: repeat(2, 1fr); }
  .mc-own-bg__body {
    padding: 0.75rem;
    min-height: 280px;
    flex-direction: column;
    gap: 1rem;
  }
  .mc-own-bg__sidebar { flex: 1 1 100%; width: 100%; }
  .mc-own-bg__legend-items { flex-direction: row; flex-wrap: wrap; gap: 0.3rem 0.95rem; }
  .mc-own-bg__actions { justify-content: stretch; }
  .mc-own-bg__action {
    flex: 1 1 40%;
    justify-content: center;
    font-size: 0.74rem;
    padding: 0.55rem 0.5rem;
  }
  .mc-own-bg__action span { display: none; }
  .mc-own-bg__action--primary { margin-left: 0; flex: 1 1 100%; }
  .mc-own-bg__action--primary span { display: inline; }
}

/* ────────────────────────────────────────────────────────────
 * Catégories de Body Graphs - rail, pills, drag, picker, modal
 * ──────────────────────────────────────────────────────────── */

/* ── Rail horizontal scrollable ── */
.mc-cats {
  margin: 0.25rem 0 1.25rem;
  position: relative;
}
.mc-cats__rail {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0.25rem 0.6rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--gold-rgb), 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}
.mc-cats__rail::-webkit-scrollbar { height: 4px; }
.mc-cats__rail::-webkit-scrollbar-track { background: transparent; }
.mc-cats__rail::-webkit-scrollbar-thumb {
  background: rgba(var(--gold-rgb), 0.2);
  border-radius: 2px;
}
.mc-cats__rail::-webkit-scrollbar-thumb:hover { background: rgba(var(--gold-rgb), 0.4); }

/* ── Pill catégorie ── */
.mc-cat {
  --mc-cat-color: var(--gold);
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s, transform .18s;
  scroll-snap-align: start;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mc-cat:hover {
  color: var(--text-primary);
  border-color: rgba(var(--gold-rgb), 0.35);
}
.mc-cat.active {
  background: linear-gradient(180deg, rgba(var(--gold-rgb), 0.1) 0%, rgba(var(--gold-rgb), 0.03) 100%);
  border-color: var(--mc-cat-color, var(--gold));
  color: var(--text-primary);
  box-shadow: 0 2px 10px -4px var(--mc-cat-color, rgba(var(--gold-rgb), 0.4));
}
.mc-cat:focus-visible {
  outline: 2px solid var(--mc-cat-color, var(--gold));
  outline-offset: 2px;
}
.mc-cat__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--mc-cat-color, var(--gold));
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(var(--gold-rgb), 0.08);
}
.mc-cat__dot--all {
  background: conic-gradient(from 0deg, #c9a84c, #5fb3a5, #4a7fc1, #8c6bc0, #d16b86, #c9a84c);
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.15);
}
.mc-cat__dot--none {
  background: transparent;
  border: 1.5px dashed currentColor;
  opacity: 0.5;
  box-shadow: none;
}
.mc-cat__name {
  white-space: nowrap;
  line-height: 1;
}
.mc-cat__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mc-cat.active .mc-cat__count {
  background: rgba(var(--gold-rgb), 0.15);
  color: var(--text-primary);
}

/* Menu contextuel sur pill */
.mc-cat__menu {
  width: 20px; height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
  margin-left: -0.1rem;
  margin-right: -0.25rem;
}
.mc-cat:hover .mc-cat__menu,
.mc-cat.active .mc-cat__menu {
  opacity: 0.75;
}
.mc-cat__menu:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Bouton "Nouvelle catégorie" */
.mc-cat--add {
  border-style: dashed;
  border-color: rgba(var(--gold-rgb), 0.3);
  color: rgba(var(--gold-rgb), 0.85);
  background: transparent;
}
.mc-cat--add:hover {
  background: rgba(var(--gold-rgb), 0.08);
  border-style: solid;
  color: var(--gold);
}

/* ── Drop zones (drag and drop) ── */
.mc-cat.is-drop-target {
  border-color: var(--mc-cat-color, var(--gold));
  background: color-mix(in srgb, var(--mc-cat-color, var(--gold)) 20%, transparent);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 22px -6px var(--mc-cat-color, rgba(var(--gold-rgb), 0.6));
}
.mc-cat.is-drop-target .mc-cat__count {
  background: color-mix(in srgb, var(--mc-cat-color, var(--gold)) 30%, transparent);
  color: #fff;
}

/* Fallback color-mix */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .mc-cat.is-drop-target { background: rgba(var(--gold-rgb), 0.18); }
}

/* ── Carte en cours de drag ── */
.chart-card {
  transition: opacity .2s, transform .2s, box-shadow .2s;
}
.chart-card[draggable="true"] { cursor: grab; }
.chart-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
  transform: scale(0.98);
}
body.mc-is-dragging .chart-card:not(.is-dragging) { pointer-events: none; }
body.mc-is-dragging .mc-cat { cursor: copy; }

/* ── Marqueur d'insertion (réordonnancement drag & drop) ── */
.mc-drop-marker {
  background: var(--gold, #c9a84c);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb, 201, 168, 76), 0.35),
              0 0 14px rgba(var(--gold-rgb, 201, 168, 76), 0.55);
  pointer-events: none;
  animation: mcDropMarkerPulse 1s ease-in-out infinite;
  flex-shrink: 0;
  align-self: stretch;
}
/* Mode grille : marqueur vertical entre 2 cartes */
.charts-grid:not(.compact) .mc-drop-marker {
  width: 4px;
  min-height: 180px;
}
/* Mode liste / compact : marqueur horizontal */
.charts-grid.compact .mc-drop-marker {
  width: 100%;
  height: 4px;
}
@keyframes mcDropMarkerPulse {
  0%, 100% { opacity: 0.85; transform: scaleY(1); }
  50%      { opacity: 1;    transform: scaleY(1.04); }
}

/* ── Drag tactile (long-press) : card source + clone flottant ── */
.chart-card.is-touch-dragging {
  opacity: 0.25;
  transform: scale(0.97);
  transition: opacity .15s, transform .15s;
}
.mc-touch-clone {
  position: fixed;
  z-index: 9500;
  pointer-events: none;
  opacity: 0.95;
  transform: translate(-50%, -50%) scale(1.03) rotate(-1deg);
  box-shadow: 0 22px 48px -12px rgba(0,0,0,0.55),
              0 0 0 2px rgba(var(--gold-rgb, 201,168,76), 0.6);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card, #181c2b);
  will-change: left, top;
  transition: box-shadow .15s;
  width: 220px;
  max-width: 70vw;
}
.mc-touch-clone .chart-card__actions,
.mc-touch-clone .chart-card__share,
.mc-touch-clone .chart-card__ai,
.mc-touch-clone .chart-card__expand,
.mc-touch-clone .chart-card__heart { display: none !important; }
.mc-touch-clone .chart-card {
  transform: none !important;
  margin: 0;
  opacity: 1;
}
body.mc-is-touch-dragging {
  overflow: hidden !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
body.mc-is-touch-dragging .chart-card:not(.is-touch-dragging) {
  pointer-events: none;
}
body.mc-is-touch-dragging .mc-cat.is-drop-target {
  transform: scale(1.08);
  transition: transform .15s;
}

/* ── Badge catégorie sur la carte ── */
.chart-card__cat-slot {
  position: absolute;
  top: 0.55rem;
  left: 0.9rem;
  right: 0.9rem;
  display: flex;
  pointer-events: none;
  z-index: 2;
}
.chart-card__cat {
  --mc-card-cat-color: var(--gold);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem 0.18rem 0.5rem;
  background: rgba(var(--gold-rgb), 0.06);
  border: 1px solid color-mix(in srgb, var(--mc-card-cat-color) 40%, transparent);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--mc-card-cat-color) 92%, var(--text-primary));
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@supports not (color: color-mix(in srgb, red 50%, white)) {
  .chart-card__cat {
    background: rgba(var(--gold-rgb), 0.08);
    border-color: var(--mc-card-cat-color);
    color: var(--gold);
  }
}
.chart-card__cat-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mc-card-cat-color, var(--gold));
  flex-shrink: 0;
}
.chart-card__cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* Accent sur la bordure de la carte si elle a une catégorie (subtil) */
.chart-card[data-category-id]:not([data-category-id="0"]) {
  border-left: 3px solid color-mix(in srgb, var(--mc-card-cat-color, var(--gold)) 70%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, white)) {
  .chart-card[data-category-id]:not([data-category-id="0"]) {
    border-left-color: var(--mc-card-cat-color);
  }
}

/* Ajuste le padding du nom pour laisser la place au badge en vue grille */
.charts-grid:not(.compact) .chart-card__info {
  padding-top: 1.9rem;
}
.charts-grid.compact .chart-card__cat-slot {
  position: static;
  margin-bottom: 0.3rem;
}
.charts-grid.compact .chart-card__cat {
  padding: 0.14rem 0.5rem 0.14rem 0.45rem;
  font-size: 0.64rem;
}

/* ── Bouton "Classer" sur les actions ── */
.chart-btn--cat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.chart-btn--cat[aria-expanded="true"] {
  background: rgba(var(--gold-rgb), 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Popover picker (desktop/tablette) ── */
.mc-cat-picker {
  position: fixed;
  z-index: 9200;
  width: 280px;
  max-width: calc(100vw - 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 48px -12px rgba(0,0,0,0.55), 0 2px 10px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  overflow: hidden;
}
.mc-cat-picker.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mc-cat-picker__title {
  padding: 0.85rem 1rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}
.mc-cat-picker__list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0 0.4rem 0.4rem;
}
.mc-cat-picker__item {
  --mc-cat-color: var(--gold);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.mc-cat-picker__item:hover { background: rgba(var(--gold-rgb), 0.08); }
.mc-cat-picker__item.is-current {
  border-color: rgba(var(--gold-rgb), 0.3);
  background: rgba(var(--gold-rgb), 0.05);
}
.mc-cat-picker__item-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--mc-cat-color);
  flex-shrink: 0;
}
.mc-cat-picker__item-dot--none {
  background: transparent;
  border: 1.5px dashed var(--text-muted);
}
.mc-cat-picker__item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-cat-picker__item-check {
  opacity: 0;
  color: var(--gold);
}
.mc-cat-picker__item.is-current .mc-cat-picker__item-check { opacity: 1; }
.mc-cat-picker__footer {
  border-top: 1px solid var(--border);
  padding: 0.5rem;
}
.mc-cat-picker__create {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem;
  background: none;
  border: 1px dashed rgba(var(--gold-rgb), 0.35);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.mc-cat-picker__create:hover {
  background: rgba(var(--gold-rgb), 0.08);
  border-style: solid;
}

/* ── Bottom-sheet mobile ── */
.mc-cat-sheet {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
}
.mc-cat-sheet.open { display: block; }
.mc-cat-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  animation: mcSheetFade .2s forwards;
}
@keyframes mcSheetFade { to { opacity: 1; } }
.mc-cat-sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 0.7rem 1.1rem 1.4rem;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  transform: translateY(100%);
  animation: mcSheetSlide .28s cubic-bezier(.22,1,.36,1) forwards;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@keyframes mcSheetSlide { to { transform: translateY(0); } }
.mc-cat-sheet__handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 0.9rem;
}
.mc-cat-sheet__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.8rem;
  padding: 0 0.25rem;
}
.mc-cat-sheet__list {
  margin-bottom: 0.8rem;
}
.mc-cat-sheet__item {
  --mc-cat-color: var(--gold);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.4rem;
  transition: border-color .12s, background .12s;
  text-align: left;
}
.mc-cat-sheet__item:active { background: rgba(var(--gold-rgb), 0.08); }
.mc-cat-sheet__item.is-current {
  border-color: var(--mc-cat-color);
  background: color-mix(in srgb, var(--mc-cat-color) 10%, transparent);
}
.mc-cat-sheet__item-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--mc-cat-color);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.08);
}
.mc-cat-sheet__item-dot--none {
  background: transparent;
  border: 1.5px dashed var(--text-muted);
  box-shadow: none;
}
.mc-cat-sheet__item-name { flex: 1; }
.mc-cat-sheet__item-check {
  color: var(--mc-cat-color, var(--gold));
  opacity: 0;
  flex-shrink: 0;
}
.mc-cat-sheet__item.is-current .mc-cat-sheet__item-check { opacity: 1; }
.mc-cat-sheet__btn {
  width: 100%;
  padding: 0.85rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.mc-cat-sheet__btn--primary {
  border-color: rgba(var(--gold-rgb), 0.4);
  color: var(--gold);
  background: rgba(var(--gold-rgb), 0.06);
}
.mc-cat-sheet__btn:active { transform: scale(0.98); }

/* ── Modal create/edit ── */
.mc-cat-modal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.mc-cat-modal.open { display: flex; }
.mc-cat-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mc-cat-modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  animation: mcModalPop .22s cubic-bezier(.22,1,.36,1);
}
@keyframes mcModalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.mc-cat-modal__close {
  position: absolute;
  top: 0.7rem; right: 0.9rem;
  width: 32px; height: 32px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background .12s, color .12s;
}
.mc-cat-modal__close:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.mc-cat-modal__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--gold);
  margin: 0 0 1.1rem;
  letter-spacing: 0.04em;
}
.mc-cat-modal__label {
  display: block;
  margin-bottom: 1rem;
}
.mc-cat-modal__label span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.mc-cat-modal__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color .15s, box-shadow .15s;
}
.mc-cat-modal__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.12);
}
.mc-cat-modal__palette {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.45rem;
  margin-bottom: 1.3rem;
}
.mc-cat-modal__swatch {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform .15s, border-color .15s;
  padding: 0;
}
.mc-cat-modal__swatch:hover { transform: scale(1.12); }
.mc-cat-modal__swatch.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.18);
}
.mc-cat-modal__swatch.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30%; height: 30%;
  background: #fff;
  border-radius: 50%;
  opacity: 0.85;
}
.mc-cat-modal__actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}
.mc-cat-modal__btn {
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  transition: background .12s, border-color .12s, color .12s;
}
.mc-cat-modal__btn:hover { color: var(--text-primary); border-color: rgba(var(--gold-rgb), 0.3); }
.mc-cat-modal__btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.mc-cat-modal__btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: #050c1c;
}
.mc-cat-modal__btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mc-cat-modal__danger {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.mc-cat-modal__delete {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  background: none;
  border: 1px solid rgba(231, 76, 94, 0.35);
  border-radius: 8px;
  color: #e74c5e;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.mc-cat-modal__delete:hover {
  background: rgba(231, 76, 94, 0.1);
  border-color: #e74c5e;
}
.mc-cat-modal__danger-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Light mode ── */
body.light-mode .mc-cat {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}
body.light-mode .mc-cat.active {
  background: linear-gradient(180deg, rgba(139,105,20,0.08), rgba(139,105,20,0.02));
  border-color: var(--mc-cat-color, var(--gold));
}
body.light-mode .mc-cat__count { background: rgba(0,0,0,0.05); }
body.light-mode .mc-cat__menu:hover { background: rgba(0,0,0,0.06); }
body.light-mode .chart-card__cat {
  background: rgba(255,255,255,0.85);
  color: color-mix(in srgb, var(--mc-card-cat-color) 85%, #333);
}
body.light-mode .mc-cat-picker,
body.light-mode .mc-cat-sheet__panel,
body.light-mode .mc-cat-modal__panel {
  background: #fff;
  box-shadow: 0 18px 48px -12px rgba(0,0,0,0.25);
}
body.light-mode .mc-cat-picker__item:hover { background: rgba(139,105,20,0.08); }
body.light-mode .mc-cat-modal__input { background: #f8f6f2; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .mc-cats__rail {
    gap: 0.4rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }
  .mc-cat {
    padding: 0.48rem 0.75rem;
    font-size: 0.78rem;
  }
  /* Sur mobile, le menu "..." est toujours visible (pas de hover) */
  .mc-cat:not(.mc-cat--all):not(.mc-cat--none):not(.mc-cat--add) .mc-cat__menu {
    opacity: 0.85;
    width: 24px;
    height: 24px;
    margin-right: -0.35rem;
    margin-left: 0.1rem;
  }
  .mc-cat-modal__panel { padding: 1.25rem; }
  .mc-cat-modal__palette { grid-template-columns: repeat(6, 1fr); }
  .mc-cat-picker { display: none !important; } /* mobile utilise le bottom-sheet */
}

/* ═══════════════════════════════════════════════════════════════
   Thèmes composites sauvegardés (Mon Compte)
   ═══════════════════════════════════════════════════════════════ */
.mc-composites-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.mc-composites-title {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-heading); font-size: 1.35rem; font-weight: 400;
  color: var(--gold);
  margin: 0 0 1.25rem;
}
.mc-composites-title svg { color: var(--gold); flex-shrink: 0; }
.mc-composites-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6rem; height: 1.6rem; padding: 0 0.45rem;
  background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.3);
  border-radius: 100px; font-size: 0.8rem; color: var(--gold-light);
  font-family: var(--font-body); letter-spacing: 0.02em;
}
/* Composites : style aligné sur les BG cards (rangée compacte nom + actions).
   L'aperçu, la meta date, la formule et la classe .compact ont été retirés
   au profit d'un layout unique horizontal. */
.mc-composites-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mc-composite-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
  overflow: hidden;
}
.mc-composite-card:hover {
  border-color: rgba(201,168,76,0.35);
}
.mc-composite-card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  flex-wrap: nowrap;
}
.mc-composite-card__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-composite-card__title a {
  color: var(--gold);
  text-decoration: none;
}
.mc-composite-card__title a:hover { text-decoration: underline; }
.mc-composite-card__title span {
  color: var(--text-muted);
  margin: 0 0.3rem;
  font-size: 0.9em;
}
.mc-composite-card__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

@media (max-width: 600px) {
  .mc-composites-title { font-size: 1.15rem; }
  .mc-composite-card__body { padding: 0.5rem 0.65rem; gap: 0.5rem; }
  .mc-composite-card__title { font-size: 0.88rem; }
}

/* ════════════════════════════════════════════════════════════════════════
   Refonte radicale chart-card (2026-05-25) - liste minimaliste
   Le markup est désormais : <a class="chart-card" href="..."><span class="chart-card__name">Nom</span></a>
   Plus d'accordéon, plus de SVG, plus d'actions, plus de note inline.
   Toutes les anciennes règles .chart-card__* du fichier sont du dead code.
   Ce bloc final écrase ce qui doit l'être pour garantir un rendu propre.
   ════════════════════════════════════════════════════════════════════════ */
.charts-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
  grid-template-columns: none !important;
  padding: 0;
  margin: 0.5rem 0 0;
  list-style: none;
}
.charts-grid > .chart-card {
  display: flex !important;
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0.4rem !important;
  padding: 0.45rem 0.55rem 0.45rem 0.85rem !important;
  margin: 0 !important;
  min-height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: visible;
  position: relative;
}
.charts-grid > .chart-card:hover {
  border-color: rgba(201, 168, 76, 0.45);
  background: rgba(201, 168, 76, 0.04);
}

/* Étoile "mon BG" en préfixe sur la card */
.charts-grid > .chart-card--is-own::before {
  content: '★';
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--gold);
}

/* Zone cliquable principale : nom + remarque */
.chart-card__link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  padding: 0.1rem 0;
}
.chart-card__link:hover,
.chart-card__link:focus-visible { color: var(--gold); }
.chart-card__link:focus-visible { outline: 2px dashed var(--gold); outline-offset: 2px; border-radius: 4px; }

.chart-card__name {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  color: inherit;
  text-align: left;
}

.chart-card__remark {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-block;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}
.chart-card__remark::before {
  content: '· ';
  margin-right: 0.1rem;
  font-style: normal;
  opacity: 0.6;
}

/* Groupe de boutons d'action à droite : Voir / Modifier / Classer / Supprimer */
.chart-card__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0;
  margin: 0;
}
.chart-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.chart-card__action svg { display: block; opacity: 0.85; }
.chart-card__action:hover,
.chart-card__action:focus-visible {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.3);
  outline: none;
}
.chart-card__action:hover svg { opacity: 1; }
.chart-card__action--delete:hover,
.chart-card__action--delete:focus-visible {
  color: var(--red-hd, #c94040);
  background: rgba(201, 64, 64, 0.1);
  border-color: rgba(201, 64, 64, 0.35);
}

/* Etats hidden (filtre catégorie + recherche) */
.chart-card.cat-hidden,
.chart-card.search-hidden { display: none !important; }

@media (max-width: 600px) {
  .charts-grid > .chart-card { padding: 0.4rem 0.4rem 0.4rem 0.75rem !important; gap: 0.3rem !important; min-height: 40px; }
  .chart-card__name { font-size: 0.92rem; }
  .chart-card__remark { font-size: 0.76rem; }
  .chart-card__action { width: 30px; height: 30px; }
  .chart-card__actions { gap: 0.1rem; }
}
@media (max-width: 420px) {
  /* Très petit écran : remarque masquée pour ne pas surcharger */
  .chart-card__remark { display: none; }
}
