/* =========================================================================
   Charji — User Profile + Settings
   Cluster flottant (profil + réglages) + 2 modales + i18n/RTL.
   Préfixes : .charji-user-* / .cu-*   — Module 100% autonome.
   ========================================================================= */

.charji-user-root {
  --cu-c1: #6366f1;
  --cu-c2: #22c98a;
  --cu-ink: #ffffff;
  --cu-glass: rgba(255, 255, 255, 0.78);
  --cu-glass-brd: rgba(255, 255, 255, 0.85);
  --cu-surface: #ffffff;
  --cu-surface-2: #f1f3f6;
  --cu-surface-3: #e7ebf1;
  --cu-header-bg: #f8f9fb;
  --cu-text: #0f172a;
  --cu-text-soft: #5b6577;
  --cu-text-faint: #93a0b4;
  --cu-line: rgba(15, 23, 42, 0.08);
  --cu-line-strong: rgba(15, 23, 42, 0.14);
  --cu-shadow: 0 16px 44px -14px rgba(15, 23, 42, 0.5);
  --cu-shadow-sm: 0 8px 22px -10px rgba(15, 23, 42, 0.4);
  --cu-accent: #12b981;
  --cu-danger: #ef4444;
}

html[data-charji-theme="dark"] .charji-user-root {
  --cu-glass: rgba(22, 26, 36, 0.72);
  --cu-glass-brd: rgba(255, 255, 255, 0.14);
  --cu-surface: #1a1f2b;
  --cu-surface-2: #222836;
  --cu-surface-3: #2a3140;
  --cu-header-bg: #1a1f2b;
  --cu-text: #f2f5fa;
  --cu-text-soft: #aab4c5;
  --cu-text-faint: #6b7589;
  --cu-line: rgba(255, 255, 255, 0.09);
  --cu-line-strong: rgba(255, 255, 255, 0.16);
  --cu-shadow: 0 20px 56px -16px rgba(0, 0, 0, 0.72);
  --cu-shadow-sm: 0 10px 26px -12px rgba(0, 0, 0, 0.6);
}

.charji-user-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* squircle réutilisable */
.cu-sq { -webkit-clip-path: url(#charjiSquircle); clip-path: url(#charjiSquircle); }

/* =========================================================================
   1) HEADER PLEINE LARGEUR — forme unique : rectangle à bord vague angulaire
   ========================================================================= */
.cu-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1300;
  display: none;
  transition: opacity .28s ease, transform .32s cubic-bezier(0.32, 0.72, 0, 1), visibility .28s ease;
}
body.app-mode .cu-bar { display: block; animation: cuBarIn .6s cubic-bezier(0.32, 0.72, 0, 1) both; }
@keyframes cuBarIn { 0% { opacity: 0; transform: translateY(-100%); } 100% { opacity: 1; transform: none; } }

/* Quand un popup / une sheet s'ouvre : le header NE disparaît PAS,
   il devient translucide (et reste visible). */
html.charji-route-map-peek body.app-mode .cu-bar,
html.charji-dest-map-peek body.app-mode .cu-bar,
body.app-mode:has(#overlayMobileRoot .om-sheet--expanded) .cu-bar {
  opacity: 0.4;
}

/* fond NEUTRE (couleur du thème : blanc clair / sombre dark), bord en VAGUE animée */
.cu-bar__bg {
  position: absolute; inset: 0;
  background: var(--cu-header-bg);
  box-shadow: 0 10px 30px -16px rgba(0, 0, 0, 0.45);
  -webkit-clip-path: url(#charjiWave);
  clip-path: url(#charjiWave);
}

.cu-bar__inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 11px)
    calc(18px + env(safe-area-inset-right, 0px))
    40px
    calc(18px + env(safe-area-inset-left, 0px));
}

/* bouton profil (transparent, posé sur le header) */
.cu-prof {
  display: inline-flex; align-items: center; gap: 11px; min-width: 0;
  padding: 4px; margin: -4px; background: transparent; border: none; cursor: pointer; color: #fff;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cu-prof:active { transform: scale(0.96); }

/* avatar : seul élément coloré (dégradé du thème) sur le header neutre */
.cu-bar .cu-av { width: 44px; height: 44px; font-size: 19px; color: #fff; box-shadow: 0 6px 16px -5px color-mix(in srgb, var(--cu-c2) 60%, transparent), inset 0 0 0 1.5px rgba(255, 255, 255, 0.4); }
.cu-bar .cu-dot { border-color: var(--cu-header-bg); }
.cu-bar .cu-chip-hi { color: var(--cu-text-faint); }
.cu-bar .cu-chip-name { color: var(--cu-text); max-width: 48vw; }

/* bouton réglages : second accent coloré (dégradé du thème) */
.cu-gear {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 44px; height: 44px; border: none;
  background: linear-gradient(135deg, var(--cu-c1), var(--cu-c2));
  color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--cu-c2) 70%, transparent), inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
  -webkit-clip-path: url(#charjiSquircle); clip-path: url(#charjiSquircle);
  transition: transform .26s cubic-bezier(0.34, 1.56, 0.64, 1), filter .2s ease;
}
.cu-gear:active { transform: scale(0.9); filter: brightness(1.06); }
.cu-gear__ic { display: grid; place-items: center; transition: transform .5s cubic-bezier(0.34, 1.4, 0.5, 1); }
.cu-gear__ic svg { width: 22px; height: 22px; }
@media (hover: hover) { .cu-gear:hover .cu-gear__ic { transform: rotate(75deg); } }

/* --- avatar (squircle) — générique, réutilisé par les modales --- */
.cu-av {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  isolation: isolate;
  font-weight: 800;
  color: var(--cu-ink);
  background: linear-gradient(140deg, var(--cu-c1), var(--cu-c2));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 4px 12px -4px rgba(0, 0, 0, 0.35);
  -webkit-clip-path: url(#charjiSquircle);
  clip-path: url(#charjiSquircle);
}
.cu-av--photo { background-image: var(--cu-photo); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25); }
.cu-av__txt { line-height: 1; pointer-events: none; }

.cu-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #22c98a;
  border: 2px solid var(--cu-glass);
  animation: cuPulse 2.6s ease-out infinite;
}
@keyframes cuPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 201, 138, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 201, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 201, 138, 0); }
}

.cu-chip-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.cu-chip-hi { font-size: 10.5px; font-weight: 600; color: var(--cu-text-faint); letter-spacing: 0.2px; }
.cu-chip-name { font-size: 15px; font-weight: 750; color: var(--cu-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
@media (max-width: 340px) { .cu-bar .cu-av { width: 40px; height: 40px; font-size: 17px; } .cu-bar .cu-chip-name { font-size: 14px; } }

/* =========================================================================
   2) MODALES (coquille commune)
   ========================================================================= */
.cu-modal { position: fixed; inset: 0; z-index: 100000; display: none; align-items: flex-end; justify-content: center; }
.cu-modal.is-open { display: flex; }
@media (min-width: 720px) { .cu-modal { align-items: center; padding: 24px; } }

.cu-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 10, 18, 0.46);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .34s ease;
}
.cu-modal.is-open .cu-modal__backdrop { opacity: 1; }

.cu-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--cu-surface);
  color: var(--cu-text);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 60px -10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform .46s cubic-bezier(0.32, 0.72, 0, 1);
}
.cu-modal.is-open .cu-card { transform: translateY(0); }
.cu-card--settings { max-width: 540px; }
@media (min-width: 720px) {
  .cu-card { border-radius: 28px; transform: translateY(26px) scale(0.96); opacity: 0; transition: transform .44s cubic-bezier(0.34, 1.4, 0.5, 1), opacity .3s ease; }
  .cu-modal.is-open .cu-card { transform: none; opacity: 1; }
}
.cu-card__scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.cu-iconbtn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.3); color: #fff;
  cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .15s ease;
}
.cu-iconbtn:active { transform: scale(0.9); }
.cu-iconbtn svg { width: 18px; height: 18px; }

.cu-grab { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 42px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); z-index: 5; }
@media (min-width: 720px) { .cu-grab { display: none; } }

/* entrée en cascade des sections */
.cu-modal.is-open .cu-sec, .cu-modal.is-open .cu-head__id { animation: cuRise .5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cu-modal.is-open .cu-head__id { animation-delay: .05s; }
.cu-modal.is-open .cu-sec:nth-of-type(1) { animation-delay: .09s; }
.cu-modal.is-open .cu-sec:nth-of-type(2) { animation-delay: .13s; }
.cu-modal.is-open .cu-sec:nth-of-type(3) { animation-delay: .17s; }
.cu-modal.is-open .cu-sec:nth-of-type(4) { animation-delay: .21s; }
.cu-modal.is-open .cu-sec:nth-of-type(5) { animation-delay: .25s; }
.cu-modal.is-open .cu-sec:nth-of-type(6) { animation-delay: .29s; }
.cu-modal.is-open .cu-sec:nth-of-type(7) { animation-delay: .33s; }
.cu-modal.is-open .cu-sec:nth-of-type(8) { animation-delay: .37s; }
@keyframes cuRise { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }

.cu-sec { padding: 18px 22px 4px; }
.cu-sec + .cu-sec { border-top: 1px solid var(--cu-line); }
.cu-sec__t { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--cu-text-faint); margin: 0 0 12px; }
.cu-sec__t svg { width: 15px; height: 15px; }

/* =========================================================================
   3) PROFIL — bannière, tête, bio, tags, couleurs
   ========================================================================= */
.cu-banner { position: relative; height: 132px; background: linear-gradient(120deg, var(--cu-c1), var(--cu-c2)); background-size: cover; background-position: center; overflow: hidden; }
.cu-banner--photo { background-image: var(--cu-banner-photo); }
.cu-banner::after {
  content: ""; position: absolute; inset: -40%;
  background:
    radial-gradient(40% 50% at 22% 26%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(45% 55% at 80% 30%, var(--cu-c1), transparent 62%),
    radial-gradient(50% 60% at 60% 88%, var(--cu-c2), transparent 60%);
  mix-blend-mode: soft-light; opacity: 0.85;
  animation: cuMesh 16s ease-in-out infinite alternate;
}
.cu-banner--photo::after { display: none; }
@keyframes cuMesh { 0% { transform: translate(-3%, -2%) scale(1.05); } 100% { transform: translate(4%, 3%) scale(1.14); } }
.cu-card__close { position: absolute; top: 12px; right: 12px; z-index: 6; }
.cu-banner__edit { position: absolute; bottom: 12px; right: 12px; z-index: 6; }

.cu-head { position: relative; padding: 0 22px 4px; margin-top: -42px; }
.cu-head__av { width: 92px; height: 92px; font-size: 40px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 10px 26px -8px rgba(0, 0, 0, 0.45); border: 4px solid var(--cu-surface); }
.cu-head__av { position: relative; }
.cu-head__av .cu-av-cam { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--cu-accent); color: #fff; border: 3px solid var(--cu-surface); cursor: pointer; z-index: 2; }
.cu-head__av .cu-av-cam svg { width: 15px; height: 15px; }
.cu-head__id { margin-top: 10px; }
.cu-name-row { display: flex; align-items: center; gap: 8px; }
.cu-name { font-size: 22px; font-weight: 800; color: var(--cu-text); background: transparent; border: none; padding: 2px 4px; margin: 0 -4px; width: 100%; border-radius: 8px; outline: none; }
.cu-name:focus { background: var(--cu-surface-2); box-shadow: inset 0 0 0 2px var(--cu-accent); }
.cu-handle { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--cu-text-faint); cursor: pointer; }
.cu-handle .cu-copy-ic { width: 13px; height: 13px; opacity: 0.7; }
.cu-handle .cu-copy-ic svg { width: 13px; height: 13px; }
.cu-handle.is-copied { color: var(--cu-accent); }
.cu-handle__since { color: var(--cu-text-faint); font-weight: 600; }

.cu-bio { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--cu-line-strong); border-radius: 14px; background: var(--cu-surface-2); color: var(--cu-text); padding: 12px 14px; font: inherit; font-size: 14px; line-height: 1.45; outline: none; transition: box-shadow .18s ease, border-color .18s ease; }
.cu-bio:focus { border-color: transparent; box-shadow: 0 0 0 2px var(--cu-accent); }
.cu-bio-count { text-align: right; font-size: 11px; color: var(--cu-text-faint); margin-top: 4px; }

.cu-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cu-tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--cu-surface-2); color: var(--cu-text); border: 1px solid var(--cu-line); animation: cuPop .3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.cu-tag--mine { background: linear-gradient(135deg, var(--cu-c1), var(--cu-c2)); color: var(--cu-ink); border-color: transparent; }
.cu-tag__x { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); cursor: pointer; font-size: 11px; line-height: 1; }
.cu-tag--suggest { cursor: pointer; border-style: dashed; color: var(--cu-text-soft); }
.cu-tag--suggest:active { transform: scale(0.94); }
@keyframes cuPop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
.cu-tag-add { display: flex; gap: 8px; margin-top: 10px; }
.cu-tag-input { flex: 1 1 auto; border: 1px solid var(--cu-line-strong); border-radius: 12px; background: var(--cu-surface-2); color: var(--cu-text); padding: 9px 12px; font: inherit; font-size: 13px; outline: none; }
.cu-tag-input:focus { box-shadow: 0 0 0 2px var(--cu-accent); border-color: transparent; }
.cu-sub-lbl { font-size: 11px; color: var(--cu-text-faint); margin: 12px 0 7px; font-weight: 700; letter-spacing: 0.3px; }

.cu-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.cu-swatch { position: relative; width: 38px; height: 38px; cursor: pointer; border: none; transition: transform .15s ease; -webkit-clip-path: url(#charjiSquircle); clip-path: url(#charjiSquircle); }
.cu-swatch:active { transform: scale(0.9); }
.cu-swatch.is-sel { outline: 3px solid var(--cu-accent); outline-offset: 2px; }
.cu-swatch--auto { display: grid; place-items: center; color: #fff; }
.cu-swatch--auto svg { width: 18px; height: 18px; }
.cu-hue { margin-top: 12px; width: 100%; height: 16px; border-radius: 999px; -webkit-appearance: none; appearance: none; background: linear-gradient(90deg, #f00, #ff7f00, #ff0, #0f0, #0ff, #00f, #8b00ff, #f00); outline: none; cursor: pointer; }
.cu-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid rgba(0, 0, 0, 0.2); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); cursor: pointer; }
.cu-hue::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid rgba(0, 0, 0, 0.2); cursor: pointer; }

.cu-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--cu-surface) 72%, transparent); border-top: 1px solid var(--cu-line); }
.cu-btn { flex: 1 1 auto; border: none; border-radius: 15px; padding: 14px 16px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, filter .2s ease; }
.cu-btn:active { transform: scale(0.97); }
.cu-btn--primary { color: #fff; background: linear-gradient(135deg, var(--cu-c1), var(--cu-c2)); box-shadow: 0 10px 24px -10px var(--cu-c2); }
.cu-btn--ghost { flex: 0 0 auto; background: var(--cu-surface-2); color: var(--cu-text-soft); }
.cu-btn--primary.is-saved { animation: cuSaved .5s ease; }
@keyframes cuSaved { 0% { transform: scale(1); } 40% { transform: scale(1.05); filter: brightness(1.12); } 100% { transform: scale(1); } }
.cu-file { display: none; }

/* =========================================================================
   4) RÉGLAGES — header, langues, rangées, contrôles
   ========================================================================= */
.cu-set-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; background: var(--cu-surface); border-bottom: 1px solid var(--cu-line); }
.cu-set-head__ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--cu-c1), var(--cu-c2)); color: #fff; }
.cu-set-head__ic svg { width: 19px; height: 19px; }
.cu-set-head b { flex: 1 1 auto; font-size: 18px; font-weight: 800; }
.cu-set-close { background: var(--cu-surface-2); color: var(--cu-text); }

/* grille de langues */
.cu-langs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .cu-langs { grid-template-columns: repeat(3, 1fr); } }
.cu-lang {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border: 1.5px solid var(--cu-line-strong); border-radius: 16px;
  background: var(--cu-surface-2); color: var(--cu-text);
  cursor: pointer; font: inherit; text-align: left;
  transition: transform .14s ease, border-color .18s ease, box-shadow .2s ease;
}
.cu-lang:active { transform: scale(0.96); }
.cu-lang__flag { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18)); }
.cu-lang__lbl { font-size: 14px; font-weight: 700; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-lang__chk { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--cu-accent); color: #fff; font-size: 12px; opacity: 0; transform: scale(0.5); transition: opacity .2s ease, transform .2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cu-lang.is-sel { border-color: var(--cu-accent); background: var(--cu-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cu-accent) 18%, transparent); }
.cu-lang.is-sel .cu-lang__chk { opacity: 1; transform: scale(1); }

/* rangées de réglages */
.cu-set { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--cu-line); }
.cu-sec .cu-set:first-of-type { border-top: none; }
.cu-set__tx { flex: 1 1 auto; min-width: 0; }
.cu-set__tx b { font-size: 14.5px; font-weight: 650; color: var(--cu-text); }
.cu-set__val { font-size: 13px; font-weight: 700; color: var(--cu-text-faint); }
.cu-set--link { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cu-set--link:active { opacity: 0.6; }
.cu-set__chev { color: var(--cu-text-faint); display: grid; place-items: center; }
.cu-set__chev svg { width: 18px; height: 18px; }
.cu-set--danger .cu-set__tx b { color: var(--cu-danger); }
.cu-set--danger .cu-set__chev { color: var(--cu-danger); }

/* toggle */
.cu-toggle { position: relative; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 999px; border: none; background: var(--cu-line-strong); cursor: pointer; transition: background .2s ease; }
.cu-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); transition: transform .24s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cu-toggle.is-on { background: linear-gradient(135deg, var(--cu-c1), var(--cu-c2)); }
.cu-toggle.is-on::after { transform: translateX(20px); }

/* segmented */
.cu-seg { display: inline-flex; flex: 0 0 auto; background: var(--cu-surface-2); border-radius: 11px; padding: 3px; gap: 2px; }
.cu-seg button { border: none; background: transparent; color: var(--cu-text-soft); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 9px; cursor: pointer; transition: background .18s ease, color .18s ease; white-space: nowrap; }
.cu-seg button.is-on { background: var(--cu-surface); color: var(--cu-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); }

/* select */
.cu-select { flex: 0 0 auto; border: 1px solid var(--cu-line-strong); border-radius: 10px; background: var(--cu-surface-2); color: var(--cu-text); padding: 7px 10px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; outline: none; }
.cu-select:focus { box-shadow: 0 0 0 2px var(--cu-accent); border-color: transparent; }

/* range */
.cu-range-wrap { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.cu-range { width: 120px; height: 6px; -webkit-appearance: none; appearance: none; border-radius: 999px; background: var(--cu-line-strong); outline: none; cursor: pointer; }
.cu-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--cu-accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); cursor: pointer; }
.cu-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--cu-accent); border: 2px solid #fff; cursor: pointer; }
.cu-range__val { min-width: 22px; text-align: center; font-size: 13px; font-weight: 800; color: var(--cu-text); }

.cu-sec:last-child { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }

/* toast */
.cu-toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); z-index: 100002; padding: 12px 20px; border-radius: 14px; background: rgba(15, 23, 42, 0.94); color: #fff; font-size: 14px; font-weight: 700; box-shadow: var(--cu-shadow); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cu-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* sparkles */
.cu-spark { position: fixed; z-index: 100001; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; will-change: transform, opacity; }

/* =========================================================================
   5) RTL
   ========================================================================= */
.charji-user-root[dir="rtl"] .cu-card,
.charji-user-root[dir="rtl"] .cu-set__tx,
.charji-user-root[dir="rtl"] .cu-name,
.charji-user-root[dir="rtl"] .cu-lang { text-align: right; }
.charji-user-root[dir="rtl"] .cu-card__close { right: auto; left: 12px; }
.charji-user-root[dir="rtl"] .cu-banner__edit { right: auto; left: 12px; }
.charji-user-root[dir="rtl"] .cu-head__av .cu-av-cam { right: auto; left: -2px; }
.charji-user-root[dir="rtl"] .cu-set-close { margin-left: 0; }
.charji-user-root[dir="rtl"] .cu-lang { text-align: right; }

/* =========================================================================
   6) Accessibilité (scopé à mes panneaux — n'affecte pas le reste de l'app)
   ========================================================================= */
html.cu-large .cu-card .cu-set__tx b,
html.cu-large .cu-card .cu-name,
html.cu-large .cu-card .cu-bio,
html.cu-large .cu-card .cu-lang__lbl,
html.cu-large .cu-card .cu-tag,
html.cu-large .cu-card .cu-btn { font-size: 1.12em; }
html.cu-large .charji-user-chip .cu-chip-name { font-size: 15px; }

html.cu-contrast .charji-user-root {
  --cu-line: rgba(0, 0, 0, 0.4);
  --cu-line-strong: rgba(0, 0, 0, 0.6);
  --cu-text-faint: var(--cu-text-soft);
}
html[data-charji-theme="dark"].cu-contrast .charji-user-root {
  --cu-line: rgba(255, 255, 255, 0.4);
  --cu-line-strong: rgba(255, 255, 255, 0.6);
}

/* =========================================================================
   7) Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .cu-dot, .cu-banner::after { animation: none !important; }
  .cu-bar > *, .cu-card, .cu-modal__backdrop, .cu-modal.is-open .cu-sec, .cu-modal.is-open .cu-head__id { animation: none !important; transition-duration: .001s !important; }
}
html.cu-reduce .cu-dot,
html.cu-reduce .cu-banner::after,
html.cu-reduce .cu-bar > *,
html.cu-reduce .cu-modal.is-open .cu-sec,
html.cu-reduce .cu-modal.is-open .cu-head__id { animation: none !important; }
html.cu-reduce .cu-gear__ic { transition: none !important; }
