/* Apparence des roues — entrée de menu + pop-up de personnalisation des couleurs.
   Utilise les variables de thème de l'app (--bg, --border, --text, --text-muted,
   --indigo, --hover-bg, --surface, --shadow). */

/* ── Entrée dans le menu Thème visuel ───────────────────────────── */
.wc-menu-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  width: calc(100% - 16px);
  margin: 2px 8px 4px;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s;
}
.wc-menu-entry:hover { background: var(--hover-bg, rgba(0,0,0,.05)); }
.wc-menu-ico  { font-size: 15px; color: var(--text-muted); line-height: 1; }
.wc-menu-txt  { font-weight: 500; }
.wc-menu-arrow { margin-left: auto; color: var(--text-muted); font-size: 16px; line-height: 1; }

/* ── Overlay + modale ───────────────────────────────────────────── */
/* Couche non-bloquante : transparente et TRAVERSABLE (la roue reste visible
   et cliquable derrière) ; le panneau se pose en haut à droite. */
.wc-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  background: transparent;
  pointer-events: none;
  padding: 56px 16px 16px;
}
.wc-modal {
  pointer-events: auto;
  position: fixed;
  top: 56px;
  right: 16px;
  width: 384px;   /* 360 → 384 le 2026-08-22 : libellés anglais plus larges */
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  /* Gouttière de la barre de défilement RÉSERVÉE d'emblée : sans elle, la barre
     apparaissait puis se masquait et les pastilles du nuancier semblaient
     « coupées puis se remettre en place » (constat Mélanie 2026-08-22). */
  scrollbar-gutter: stable;
  background: var(--bg, #fff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 50px -12px rgba(31, 26, 20, .40);
  color: var(--text);
  font-family: inherit;
}
.wc-live-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.wc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  cursor: grab;
  user-select: none;
}
.wc-head:active { cursor: grabbing; }
.wc-title { font-size: 15px; font-weight: 600; }
.wc-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-muted); padding: 0 2px;
}
.wc-close:hover { color: var(--text); }

/* ── Aperçu + portée ────────────────────────────────────────────── */
.wc-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.wc-prev-wrap, .wc-scope-wrap { min-width: 0; }
.wc-mini-lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.wc-prev-row { display: flex; align-items: center; gap: 8px; }
.wc-prev { flex: none; }
.wc-prev-note { font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }
/* Cases « Appliquer au thème » : style rond .ctrl-check de l'app, en liste qui passe à la ligne. */
.wc-scope-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.wc-scope-item { font-size: 12px; }

/* ── Onglets ────────────────────────────────────────────────────── */
.wc-tabs {
  display: flex; gap: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.wc-tab { font-size: 13px; padding-bottom: 8px; color: var(--text-muted); }
.wc-tab-active {
  color: var(--text); font-weight: 500;
  border-bottom: 2px solid var(--text); margin-bottom: -1px;
}
.wc-tab-soon small { font-size: 9px; opacity: .7; }

/* ── Lignes par élément ─────────────────────────────────────────── */
.wc-elem {
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 8px;
  overflow: hidden;
}
.wc-elem-head {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border: none; background: transparent;
  font: inherit; font-size: 12.5px; color: var(--text);
  cursor: pointer;
}
.wc-elem-head:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.wc-swatch {
  width: 30px; height: 20px; border-radius: 5px;
  border: 1px solid var(--border); flex: none;
}
.wc-elem-label { font-weight: 500; }

.wc-ramp {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 0 12px 11px;
}
.wc-chip {
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 5px;
  padding: 0; cursor: pointer;
}
.wc-chip-active { outline: 2px solid var(--text); outline-offset: 1px; }
.wc-custom {
  position: relative;
  aspect-ratio: 1;
  border: 1px dashed var(--border);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
}
.wc-custom:hover { color: var(--text); }
.wc-custom-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; border: none; padding: 0;
}

/* ── Couleurs par signe (2026-09-02) ────────────────────────────── */
/* Réparation au passage : l'attribut hidden perdait contre display:grid
   (règle UA battue par la feuille auteur), l'accordéon du panneau ne se
   repliait donc jamais. Cette règle le rend effectif. */
.wc-ramp[hidden], .wc-signs[hidden] { display: none; }
.wc-signs { border-top: 1px solid var(--border); padding: 2px 0 4px; }
.wc-sign-line { display: flex; align-items: center; }
.wc-sign-head {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 auto; min-width: 0;
  padding: 6px 12px 6px 26px;      /* décalé : les signes sont « sous » l'élément */
  border: none; background: transparent;
  font: inherit; font-size: 12px; color: var(--text);
  cursor: pointer;
}
.wc-sign-head:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.wc-sign-swatch { width: 24px; height: 16px; }
.wc-sign-glyph { font-size: 15px; line-height: 1; }
.wc-sign-reset {
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; line-height: 1; color: var(--text-muted);
  padding: 4px 12px 4px 6px; flex: none;
}
.wc-sign-reset:hover { color: var(--text); }
.wc-sign-ramp { padding: 0 12px 9px 26px; }

/* ── Intensité ──────────────────────────────────────────────────── */
.wc-int { display: flex; align-items: center; gap: 10px; margin: 12px 0 14px; }
.wc-int-lbl { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
/* Curseurs restylés au thème (mêmes réglages que les curseurs roulette) : au lieu
   du slider natif, différent selon Chrome/Safari. Piste var(--border) + pastille
   ronde var(--indigo) → apparence identique dans tous les navigateurs. */
.wc-int-range {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  height: 14px; background: transparent; cursor: pointer; vertical-align: middle;
}
.wc-int-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--border); }
.wc-int-range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--border); }
.wc-int-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--indigo); border: 2px solid var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.wc-int-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--indigo); border: 2px solid var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.wc-int-range:focus { outline: none; }
.wc-int-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--indigo-l); }
.wc-int-out { font-size: 12px; font-weight: 500; min-width: 34px; text-align: right; }

/* ── Pied de page ───────────────────────────────────────────────── */
.wc-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 13px;
}
.wc-reset {
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--text-muted); padding: 0;
}
.wc-reset:hover { color: var(--text); }
.wc-actions { display: flex; gap: 8px; }
.wc-btn {
  font: inherit; font-size: 12px;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface, transparent);
  color: var(--text);
  cursor: pointer;
}
.wc-btn:hover { border-color: var(--text-muted); }
.wc-btn-primary {
  background: var(--indigo, #4a4a8a);
  border-color: var(--indigo, #4a4a8a);
  color: #fff;
  font-weight: 500;
}
.wc-btn-primary:hover { filter: brightness(1.06); }

/* Position des planètes, couleurs des planètes, fond blanc (2026-08-14).
   Composants officiels (pilule CustomSelect, interrupteur .lishu-switch) :
   ici uniquement la mise en page des lignes du panneau. */
.wc-toggle { margin: 6px 0 0; font-size: 13px; }
.wc-pmode-row .csel-wrap { flex: none; }

/* Onglet Aspects (2026-08-14) : mise en page des lignes */
.wc-asp-note { margin: 10px 0 0; font-size: 12px; color: var(--text-muted, #8a8072); }
/* Plus de tout-majuscules (règle Mélanie 2026-10-03, corrigé le 2026-10-10). */
.wc-asp-section { margin: 12px 18px 2px; font-size: 11px; font-weight: 600;
                  color: var(--text-muted, #8a8072); }
/* Rangée d'aspect (revu 2026-08-22, retours Mélanie) : le LIBELLÉ ne rétrécit
   ni ne se tronque jamais (min-width: max-content) — si la place manque
   (libellés anglais plus larges), c'est la PILULE qui se décale : à droite
   quand ça tient, à la ligne EN DESSOUS sinon (flex-wrap). */
.wc-asp-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-right: 10px; }
.wc-asp-line .wc-elem-head { flex: 1 1 auto; min-width: max-content; width: auto; padding-right: 6px; }
.wc-asp-line .csel-wrap { flex: none; margin-left: auto; }
.wc-asp-line .wc-asp-preview { flex: none; }
.wc-asp-preview { width: 62px; height: 14px; flex: none; }

/* Pilule Roues / Aspects en haut du panneau (2026-08-14) */
.wc-view-row { margin: 10px 0 2px; }
/* Pilule agrandie (demande Mélanie 2026-09-02) — scopé au panneau : le
   composant .sr-wheel-switch partagé des blocs garde sa taille d'origine. */
.wc-view-row .sr-wheel-switch button { font-size: 13px; padding: 6px 12px; }  /* 16 → 12 px le 2026-10-10 : 4 pilules au lieu de 2 */

/* Pilule Glyphes (étape 2, 2026-10-10) : titres de section en « Majuscule puis
   minuscules » (règle Mélanie : jamais de tout-majuscules), nuanciers d'encre. */
.wc-gly-section { margin: 14px 12px 2px; font-size: 11px; font-weight: 600;
                  color: var(--text-muted, #8a8072); }
.wc-gly-ramp { padding: 2px 0 8px; }
.wc-gly-elems { margin: 4px 0 6px; }

/* Pilule Planètes « Personnalisées » (étape 3, 2026-10-10) : grille 2 colonnes
   pastille + nom, nuancier partagé dessous (habillage des lignes d'éléments). */
.wc-pl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin: 6px 0 4px; }
.wc-pl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 9px;
  background: transparent; font: inherit; font-size: 12.5px; color: var(--text);
  cursor: pointer; text-align: left;
}
.wc-pl-item:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.wc-pl-item.wc-elem-open { border-color: var(--text-muted); }
.wc-pl-swatch { width: 22px; height: 16px; }
.wc-pl-ramp { padding: 6px 0 10px; }

/* Titres de section des pilules (2026-10-10, validés par Mélanie) : plus petits
   et moins gras que le titre du panneau (15 px / 600), séparés par un trait fin ;
   le premier titre d'une pilule n'a pas de trait. Remplace .wc-gly-section et
   .wc-asp-section (classes laissées dans ce fichier, plus utilisées). */
.wc-sec { margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--border);
          font-size: 13px; font-weight: 500; color: var(--text); }
.wc-sec:first-child { margin-top: 8px; padding-top: 0; border-top: none; }

/* « Appliquer à » : menu déroulant à cocher dans le pied (2026-10-10) */
.wc-scope-dd { position: relative; }
.wc-scope-btn {
  font: inherit; font-size: 12px; color: var(--text); cursor: pointer;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg, #fff); white-space: nowrap;
}
.wc-scope-btn:hover { background: var(--hover-bg, rgba(0,0,0,.04)); }
.wc-scope-btn { display: inline-flex; align-items: center; gap: 6px; }
.wc-scope-chev { color: var(--text-muted); flex: none; }
.wc-scope-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 2;
  min-width: 200px; padding: 6px 8px;
  /* OPAQUE (retour Mélanie 2026-10-10 : « beaucoup trop transparent, on ne voit
     rien ») : fond plein du panneau, pas la surface translucide des menus. */
  background: var(--bg, #fff); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 30px -10px rgba(31, 26, 20, .35);
  display: flex; flex-direction: column; gap: 2px;
}
.wc-scope-menu[hidden] { display: none; }
.wc-scope-menu .wc-scope-item { padding: 5px 4px; }
.wc-scope-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.wc-foot2 { margin-top: 10px; }

/* ALIGNEMENT (exigence Mélanie 2026-10-10 : « tout doit être aligné ») : UN SEUL
   bord gauche pour tout le contenu du panneau — titre, pilule d'onglets, titres
   de section, libellés, interrupteurs, cadres des lignes, nuanciers hors cadre,
   pied. Seul l'intérieur des cadres (lignes d'éléments, de signes, d'aspects)
   garde son retrait de 12 px. Ne pas réintroduire de marge latérale ici. */
/* .theme-toggle-row (composant officiel) porte padding 6px 8px : dans le panneau,
   on annule le retrait horizontal pour que l'interrupteur tombe sur le bord gauche. */
.wc-modal .wc-toggle { padding-left: 0; padding-right: 0; }

/* Interrupteurs du panneau DANS UNE CASE identique aux lignes d'éléments
   (demande Mélanie 2026-10-10) : interrupteur (30 px) à la place de la pastille
   (30 px), même écart de 9 px → le libellé tombe exactement sous « Feu ». */
.wc-modal .wc-toggle-card {
  box-sizing: border-box; min-height: 40px;
  margin: 0 0 8px; padding: 9px 12px; gap: 9px;
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 12.5px;
}
.wc-modal .wc-toggle-card span { font-weight: 500; }

/* Pied : jamais de barre de défilement HORIZONTALE (« Appliquer à : Tous les
   thèmes » élargissait le panneau, retour Mélanie 2026-10-10). Si la ligne est
   trop longue, les boutons passent à la ligne, calés à droite. */
.wc-modal { overflow-x: hidden; }
.wc-foot { flex-wrap: wrap; gap: 10px; }
.wc-foot .wc-actions { margin-left: auto; }

/* « Appliquer à » : bouton et menu sur fond BLANC (thèmes clairs) pour trancher
   sur le panneau — en Océan tout était de la même couleur (retour Mélanie
   2026-10-10). Nocturne : voile clair, le blanc pur y serait criard. */
.wc-modal .wc-scope-btn, .wc-modal .wc-scope-menu { background: #ffffff; }
.wc-modal .wc-scope-btn:hover { background: #f6f4ef; }
[data-theme="glass"] .wc-modal .wc-scope-btn,
[data-theme="glass"] .wc-modal .wc-scope-menu { background: #1e2750; }
[data-theme="glass"] .wc-modal .wc-scope-btn:hover { background: #26305e; }

/* Pilule Angles : rangée sans objet (planètes à l'extérieur) */
.wc-row-off { opacity: .45; pointer-events: none; }
