/* Polices auto-hébergées pour l'éditeur de texte incrusté (image/vidéo) — noms préfixés Focato*
   pour ne jamais entrer en collision avec une police système du même nom générique. */
@font-face { font-family: 'FocatoPoppinsBold';   src: url('/fonts/Poppins-Bold.ttf') format('truetype');       font-weight: 700; font-display: swap; }
@font-face { font-family: 'FocatoAnton';         src: url('/fonts/Anton-Regular.ttf') format('truetype');      font-display: swap; }
@font-face { font-family: 'FocatoPacifico';      src: url('/fonts/Pacifico-Regular.ttf') format('truetype');   font-display: swap; }
@font-face { font-family: 'FocatoSpaceMonoBold'; src: url('/fonts/SpaceMono-Bold.ttf') format('truetype');     font-weight: 700; font-display: swap; }
@font-face { font-family: 'FocatoAbrilFatface';  src: url('/fonts/AbrilFatface-Regular.ttf') format('truetype'); font-display: swap; }

.txted-text-el:empty:before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,.55);
  pointer-events: none;
}
.txted-box {
  position: absolute; transform-origin: 50% 50%; touch-action: none; cursor: move; pointer-events: auto;
  border-radius: 6px; outline: 1.5px dashed transparent; transition: outline-color .15s;
}
.txted-box:not(.active):hover { outline-color: rgba(255,255,255,.35); }
.txted-box.active { outline: 1.5px dashed var(--teal); }
.txted-text-el { white-space: pre-wrap; outline: none; padding: .15em .35em; min-width: 1ch; word-wrap: break-word; overflow-wrap: break-word; }
.txted-handle-rotate {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px;
  border-radius: 50%; background: var(--teal); cursor: grab; display: flex; align-items: center; justify-content: center;
}
.txted-handle-resize {
  position: absolute; bottom: -9px; right: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--teal); cursor: nwse-resize;
}
.txted-del-btn {
  position: absolute; top: -12px; right: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(20,10,5,.85); border: 1.5px solid rgba(255,255,255,.3); color: #fff; font-size: 13px;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.txted-edit-icon { left: -12px; right: auto; background: rgba(78,205,196,.85); }
.txted-snap-guide { position: absolute; background: var(--teal); pointer-events: none; display: none; z-index: 5; }
.txted-snap-guide.v { top: 0; bottom: 0; width: 1px; }
.txted-snap-guide.h { left: 0; right: 0; height: 1px; }
.txted-align-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.05); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.txted-align-btn.active { border-color: var(--teal); background: var(--teal-faint); }
.txted-add-btn {
  background: none; border: none; color: rgba(255,255,255,.7); font-size: 22px; cursor: pointer; padding: 4px 8px; line-height: 1;
}

/* Picker carrousel ("+" pour ajouter des images/vidéos au post) — son contenu n'avait aucune
   contrainte de largeur et s'étalait sur toute la fenêtre sur grand écran, contrairement aux
   autres volets pleine-hauteur de l'app qui restent centrés dans la largeur de l'app (520px). */
#carousel-picker-overlay > * { max-width: 520px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }

:root {
  --bg: #273331;
  --bg2: #1e2a28;
  --amber: #E8AA43;
  --amber-dim: rgba(232,170,67,0.5);
  --amber-faint: rgba(232,170,67,0.08);
  --amber-border: rgba(232,170,67,0.15);
  --teal: #4ECDC4;
  --teal-dim: rgba(78,205,196,0.5);
  --teal-faint: rgba(78,205,196,0.08);
  --teal-border: rgba(78,205,196,0.15);
  --white: rgba(255,255,255,0.85);
  --white-dim: rgba(255,255,255,0.4);
  --white-faint: rgba(255,255,255,0.06);
  --green: #4CAF50;
  --green-dim: rgba(76,175,80,0.5);
  --green-faint: rgba(76,175,80,0.08);
  --green-border: rgba(76,175,80,0.15);
  --blue: #378ADD;
  --blue-dim: rgba(55,138,221,0.5);
  --blue-faint: rgba(55,138,221,0.08);
  --blue-border: rgba(55,138,221,0.15);
  --red: rgba(220,80,80,0.85);
  --red-dim: rgba(220,80,80,0.5);
  --red-faint: rgba(220,80,80,0.08);
  --red-border: rgba(220,80,80,0.15);
  --purple: #A78BFA;
  --purple-dim: rgba(167,139,250,0.5);
  --purple-faint: rgba(167,139,250,0.08);
  --purple-border: rgba(167,139,250,0.15);
  --orange: #FF8C42;
  --orange-dim: rgba(255,140,66,0.5);
  --orange-faint: rgba(255,140,66,0.08);
  --orange-border: rgba(255,140,66,0.15);
  /* Legacy compat */
  --accent: #E8AA43;
  --accent-dim: rgba(232,170,67,0.5);
  --accent-glow: rgba(232,170,67,0.15);
  --text: rgba(255,255,255,0.85);
  --text-dim: rgba(255,255,255,0.4);
  --text-mid: rgba(255,255,255,0.65);
  --border: rgba(232,170,67,0.15);
  --border-mid: rgba(232,170,67,0.3);
  --surface: rgba(232,170,67,0.06);
  --surface-card: rgba(42, 62, 59, 0.6);
  --surface-card-border: rgba(90, 130, 125, 0.22);
  --surface-card-divider: rgba(90, 130, 125, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
html, body { width: 100%; height: 100%; background: #1a2625; font-family: 'DM Sans', -apple-system, sans-serif; overflow: hidden; color: var(--white); }

/* ── AUTH PAGE ── */
#page-auth {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  background: radial-gradient(ellipse at 50% 30%, #2d3d3b 0%, #1a2625 60%, #111e1c 100%);
  transition: opacity .3s;
}
#page-auth.hidden { opacity: 0; pointer-events: none; }
.auth-card {
  width: calc(100% - 48px); max-width: 340px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}
.auth-logo {
  width: 90vw; max-width: 700px; height: auto;
  filter: drop-shadow(0 4px 20px rgba(232,170,67,.2));
  animation: authFadeUp .9s cubic-bezier(.22,.61,.36,1) both;
}
.auth-card {
  animation: authFadeUp .9s cubic-bezier(.22,.61,.36,1) .25s both;
}
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-sub {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 15px; color: rgba(255,255,255,.45); text-align: center;
  line-height: 1.5; margin-top: -20px;
}
.auth-forgot-link {
  text-align: center; margin-top: 4px;
  font-family: 'Quicksand', sans-serif; font-size: 10px;
  color: rgba(255,255,255,.35); letter-spacing: .06em;
}
.auth-forgot-link span {
  cursor: pointer; text-decoration: underline;
  transition: color .2s;
}
.auth-forgot-link span:hover { color: var(--amber); }
.auth-box {
  width: 100%; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.auth-label {
  font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255,255,255,.4);
}
.auth-input-wrap {
  display: flex; align-items: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; overflow: hidden; transition: border-color .2s;
}
.auth-input-wrap:focus-within { border-color: rgba(255,255,255,.3); }
.auth-input {
  flex: 1; background: transparent; border: none;
  color: rgba(255,255,255,.5); font-family: 'Quicksand', sans-serif; font-size: 13px;
  padding: 13px 14px; outline: none; letter-spacing: .12em;
  -webkit-appearance: none;
}
.auth-input::placeholder { color: rgba(255,255,255,.25); letter-spacing: .12em; }
.auth-input-icon {
  width: 40px; height: 100%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: rgba(255,255,255,.25); font-size: 14px; padding-right: 4px;
}
.auth-btn {
  width: 100%; background: #fff; color: #1a2625; border: none;
  padding: 15px; font-family: 'DM Sans', sans-serif; font-size: 14px;
  font-weight: 700; letter-spacing: .01em;
  cursor: pointer; transition: opacity .2s; border-radius: 10px;
}
.auth-btn:hover { opacity: .88; }
.auth-hint {
  font-family: 'Quicksand', sans-serif; font-size: 9px; color: rgba(255,255,255,.25);
  text-align: center; letter-spacing: .06em;
}
.auth-error { font-family: 'Quicksand', sans-serif; font-size: 10px; color: var(--red); letter-spacing: .06em; text-align: center; min-height: 14px; }

/* Popup auth — creation de compte : loader puis confirmation. Reprend le gabarit
   de #onb-welcome-overlay (fond floute + carte var(--bg2)), en teal comme les volets. */
.auth-modal-overlay {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(5,3,1,.88); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.auth-modal-overlay.open { display: flex; }
.auth-modal-card {
  background: var(--bg2); border: 1px solid var(--teal-border);
  border-radius: 22px; padding: 32px 26px 26px;
  max-width: 330px; width: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; box-shadow: 0 12px 48px rgba(0,0,0,.7);
}
.auth-modal-title {
  font-family: 'Cormorant Garamond', serif; font-size: 22px;
  color: var(--teal); letter-spacing: .04em; line-height: 1.3;
}
.auth-modal-txt {
  font-family: 'Quicksand', sans-serif; font-size: 12px;
  color: var(--white-dim); letter-spacing: .05em; line-height: 1.65;
}
.auth-modal-mail {
  font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--teal); letter-spacing: .04em; word-break: break-all;
  background: var(--teal-faint); border: 1px solid var(--teal-border);
  border-radius: 10px; padding: 10px 12px; width: 100%; box-sizing: border-box;
}
.auth-modal-btn {
  width: 100%; background: var(--teal); color: #10201e; border: none;
  padding: 14px; font-family: 'DM Sans', sans-serif; font-size: 14px;
  font-weight: 700; border-radius: 10px; cursor: pointer; transition: opacity .2s;
}
.auth-modal-btn:hover { opacity: .88; }

.auth-tabs {
  display: flex; width: 100%; border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.auth-tab {
  flex: 1; background: transparent; border: none; color: rgba(255,255,255,.4);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
  padding: 11px 8px; cursor: pointer; transition: all .2s; letter-spacing: .01em;
}
.auth-tab.active {
  background: rgba(232,170,67,.18); color: var(--amber);
  border-bottom: 2px solid var(--amber);
}

/* ── MAIN APP ── */
#page-main {
  position: fixed; inset: 0; z-index: 10;
  background: var(--bg) url('/Images/Interface/background-image.png') center/cover no-repeat;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
#page-main.visible { opacity: 1; pointer-events: all; }

/* ── GLOBAL HEADER (unique, persistent) ── */
#global-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 72px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: rgba(20, 30, 28, 0.97);
  border-bottom: 0.5px solid var(--amber-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.gh-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--amber), #7a4e10);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--amber-dim);
}
.gh-avatar svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gh-info { flex: 1; min-width: 0; cursor: default; }
.gh-info.session-active { cursor: pointer; }
.gh-info.session-active:hover { opacity: .82; transition: opacity .15s; }
.gh-info.session-active:active { opacity: .65; }
.gh-name {
  font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 400;
  color: var(--amber); letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gh-sub {
  font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--white-dim); margin-top: 1px;
}
.gh-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gh-time {
  font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 400;
  color: var(--white-dim); letter-spacing: .04em;
}
.gh-led { width: 6px; height: 6px; border-radius: 50%; background: var(--white-dim); transition: background .3s; }
.gh-led.on { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ── SCREENS ── */
.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  background: transparent;
  padding-top: calc(72px + env(safe-area-inset-top));
}
.screen.active { display: flex; }
#screen-result {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  background: transparent;
  padding-top: calc(72px + env(safe-area-inset-top));
}
#screen-result.active { display: flex; }

/* ── SCROLL ── */
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.pad { padding: 16px 20px 100px; display: flex; flex-direction: column; gap: 14px; }

/* ── BOTTOM NAV ── */
.bottomnav {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(20, 30, 28, 0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--surface-card-border);
  z-index: 50;
}
.nav-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 14px;
  border: none; background: transparent; cursor: pointer;
  transition: all .15s;
}
.nav-btn.active { background: var(--amber); }
.nav-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--amber-dim); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active svg { stroke: #3a2100; }
#nav-account { position: relative; }
.nav-dot { position: absolute; top: 6px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); border: 1.5px solid var(--bg1); pointer-events: none; }

/* ── PUBLICATION HISTORY ── */
/* touch-action: pan-y — le défilement vertical reste au navigateur, mais l'horizontal
   appartient à la card (swipe d'annulation). Sans ça le navigateur s'appropriait le geste
   dès qu'il partait en biais et l'annulait (touchcancel) : le swipe semblait ne pas marcher. */
.pub-hist-card { display: flex; gap: 10px; align-items: center; background: var(--surface-card); border: 1px solid var(--surface-card-border); border-radius: 12px; padding: 12px 0 12px 14px; overflow: hidden; touch-action: pan-y; }
.pub-hist-status-zone {
  flex-shrink: 0; align-self: stretch; width: 64px; margin: -12px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-family: 'Quicksand', sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #fff; text-align: center; padding: 0 4px;
}
.pub-hist-status-zone svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.pub-hist-status-zone.status-published { background: var(--green); }
.pub-hist-status-zone.status-pending { background: var(--orange); }
.pub-hist-status-zone.status-error { background: var(--red); }
.pub-hist-status-zone.status-publishing { background: var(--teal); }
.pub-hist-status-zone.status-draft { background: rgba(255,255,255,.14); }
.pub-hist-status-zone .pub-hist-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: brand-spin .8s linear infinite; }
.pub-hist-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; margin-bottom: 4px; }
.pub-hist-icon-other { background: rgba(200,146,42,0.08); border: 1px solid var(--amber-border); color: var(--amber-dim); font-family: 'Quicksand', sans-serif; font-size: 8px; font-weight: 700; }
.pub-hist-body { flex: 1; min-width: 0; }

/* ── GRAPHIQUE 30 JOURS ── */
.graph30j-panel { max-width: 360px; }
@media (min-width: 600px) {
  .graph30j-panel { max-width: 480px; padding: 28px !important; }
}
.g30j-bar { transform-box: fill-box; transform-origin: center; cursor: pointer; }
.g30j-bar:hover { animation: g30jPulse 0.7s ease-in-out infinite; }
@keyframes g30jPulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.1); }
}
#graph30j-hover-label { min-height: 14px; text-align: center; margin-top: 6px; font-family: 'Quicksand', sans-serif; font-size: 10px; letter-spacing: .06em; color: var(--teal); }
.pub-hist-dish { font-family: 'Quicksand', sans-serif; font-size: 13px; color: var(--white); letter-spacing: .04em; }
.pub-hist-caption { font-family: 'DM Sans', sans-serif; font-size: 11.5px; color: var(--white-dim); line-height: 1.45; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; cursor: pointer; }
.pub-hist-card.open .pub-hist-caption { -webkit-line-clamp: unset; display: block; }
.pub-hist-datetime { flex-shrink: 0; text-align: right; font-family: 'Quicksand', sans-serif; font-size: 9px; color: var(--white-dim); letter-spacing: .04em; line-height: 1.5; }
.pub-hist-thumb { position: relative; flex-shrink: 0; width: 44px; height: 44px; margin: 0 3px 3px 0; }
.pub-hist-thumb-media { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.45); background: linear-gradient(90deg, var(--bg2) 25%, rgba(46,31,10,.4) 50%, var(--bg2) 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite linear; }
.pub-hist-thumb.pub-hist-thumb-loaded .pub-hist-thumb-media { animation: none; background: #111; }
.pub-hist-thumb-ghost { position: absolute; inset: 0; border-radius: 8px; background: var(--surface-card-border); }
.pub-hist-thumb-ghost-1 { z-index: 1; transform: translate(3px, -3px) rotate(4deg); background: rgba(255,255,255,.14); }
.pub-hist-thumb-ghost-2 { z-index: 0; transform: translate(5px, -5px) rotate(8deg); background: rgba(255,255,255,.07); }
.pub-hist-thumb-count { position: absolute; z-index: 3; bottom: -3px; right: -6px; background: rgba(0,0,0,.75); color: #fff; font-family: 'Quicksand', sans-serif; font-size: 8px; font-weight: 700; border-radius: 8px; padding: 1px 4px; line-height: 1.3; }
.pub-hist-chevron { flex-shrink: 0; width: 16px; height: 16px; color: var(--white-dim); transition: transform .2s; align-self: center; }
.pub-hist-card.open .pub-hist-chevron { transform: rotate(180deg); }

/* ── ARC INPUT SHEET ── */
#cmNoStratSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#cmNoStratSheet .sheet-handle { background: var(--teal-border); }
#cmRegenQuotaSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#cmRegenQuotaSheet .sheet-handle { background: var(--teal-border); }
#arcInputSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#arcInputSheet .sheet-handle { background: var(--teal-border); }
#arcInputSheet .sheet-title { color: var(--teal); }
#arcInputSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#arcInputSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }
#arc-input-field:focus { border-color: var(--teal) !important; }

/* ── CHANGEMENT D'ADRESSE EMAIL ── */
#changeEmailSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#changeEmailSheet .sheet-handle { background: var(--teal-border); }
#changeEmailSheet .sheet-title { color: var(--teal); }
#changeEmailSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#changeEmailSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }
.ce-input {
  width: 100%; box-sizing: border-box; margin-bottom: 10px; padding: 12px 14px;
  background: rgba(0,0,0,.22); border: 1px solid var(--teal-border); border-radius: 10px;
  color: var(--white); font-family: 'DM Sans', sans-serif; font-size: 14px;
}
.ce-input:focus { outline: none; border-color: var(--teal); }

/* ── ARC CHIPS ── */
.arc-chip { display: flex; align-items: center; justify-content: space-between; background: rgba(56,178,172,0.06); border: 1px solid var(--teal-border); border-radius: 10px; padding: 9px 14px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--white); }
.arc-chip button { background: transparent; border: none; color: var(--teal-dim); font-size: 14px; cursor: pointer; padding: 0 0 0 12px; transition: color .15s; }
.arc-chip button:hover { color: var(--teal); }
.arc-empty { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--white-dim); font-style: italic; padding: 4px 2px; }

/* ── HOME SCREEN ── */
.hero {
  border-radius: 18px; overflow: hidden; height: 280px; position: relative;
  background: linear-gradient(135deg, #1e2a28, #2d3d3b);
  border: 2.5px solid var(--amber);
}
.hero-shimmer {
  position: absolute; inset: -2.5px; z-index: 4; pointer-events: none;
  border-radius: 18px; overflow: hidden; padding: 2.5px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.hero-shimmer::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,220,.45) 45%, rgba(255,255,255,.6) 50%, rgba(255,255,220,.45) 55%, transparent 70%);
  animation: heroShimmer 3.5s ease-in-out 0.8s infinite;
}
@keyframes heroShimmer {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, rgba(39,51,49,.85) 40%, rgba(14,10,6,.2) 70%, transparent 100%); z-index: 1; }
.hero-text { position: absolute; bottom: 116px; left: 18px; z-index: 2; }
.hero-text h2 { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 400; color: #fff; line-height: 1.15; }
.hero-text h2 span { color: var(--amber); font-style: italic; }
.hero-text p { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 4px; font-family: 'Quicksand', sans-serif; letter-spacing: .08em; }
.actions-plate {
  display: flex; width: 164px; height: 164px;
  border-radius: 50%; border: 2.5px solid var(--amber);
  overflow: hidden; margin: 0 auto;
  position: relative; z-index: 3;
}
#screen-home .actions-plate { margin-top: -96px; }
.plate-half {
  display: flex; align-items: center; justify-content: center;
  width: 50%; height: 100%; border: none; cursor: pointer;
  transition: filter .15s; position: relative; overflow: hidden;
}
.plate-half:active { filter: brightness(0.88); }
.plate-half.left {
  background: #c8922a; color: #3a2100;
  border-right: 1px solid rgba(58,33,0,.2);
}
.plate-half.right {
  background: var(--amber); color: #3a2100;
}
.plate-half canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
}
.plate-half svg {
  width: 38px; height: 38px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  position: relative; z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(255,255,220,.3));
}
.plate-half .plate-shimmer {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,220,.22) 45%, rgba(255,255,220,.38) 50%, rgba(255,255,220,.22) 55%, transparent 65%);
  animation: plateShimmer 3.5s ease-in-out infinite;
}
.plate-half.right .plate-shimmer { animation-delay: .4s; }
@keyframes plateShimmer {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}
.sec-header { display: flex; justify-content: space-between; align-items: baseline; }
.sec-header h3 { font-size: 16px; font-weight: 700; color: var(--white); }
.actu-refresh-btn {
  width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  background: var(--teal-faint); border: 0.5px solid var(--teal-border); color: var(--teal);
  cursor: pointer; transition: opacity .15s; padding: 0; flex-shrink: 0;
}
.actu-refresh-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.actu-refresh-btn:disabled { opacity: .4; cursor: default; }
.actu-refresh-btn.is-loading svg { animation: actuRefreshSpin .8s linear infinite; }
@keyframes actuRefreshSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.recents { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.recents::-webkit-scrollbar { display: none; }
.rec-card { flex-shrink: 0; width: 120px; }
.rec-img { height: 150px; border-radius: 14px; margin-bottom: 8px; background: linear-gradient(90deg, #1e2a28 25%, #2d3d3b 50%, #1e2a28 75%); background-size: 200% 100%; animation: shimmer 2s infinite linear; }
.rec-name { height: 10px; border-radius: 5px; width: 75%; background: linear-gradient(90deg, #1e2a28 25%, #2d3d3b 50%, #1e2a28 75%); background-size: 200% 100%; animation: shimmer 2s infinite linear; margin-bottom: 5px; }
.rec-date { height: 8px; border-radius: 5px; width: 50%; background: linear-gradient(90deg, #1e2a28 25%, #2d3d3b 50%, #1e2a28 75%); background-size: 200% 100%; animation: shimmer 2s infinite linear; }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bento-card { background: var(--surface-card); border-radius: 16px; padding: 14px; border: 0.5px solid var(--surface-card-border); }
.bento-card.full { grid-column: 1 / -1; }
.bento-icon { width: 32px; height: 32px; background: rgba(232,170,67,.12); border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.bento-title { font-size: 12px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.bento-bar { height: 4px; background: rgba(232,170,67,.15); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.bento-fill { height: 100%; width: 75%; background: linear-gradient(90deg, var(--amber), #e6a830); border-radius: 4px; }
.bento-text { font-size: 10px; color: var(--white-dim); line-height: 1.4; font-family: 'Quicksand', sans-serif; letter-spacing: .04em; }
.bento-num { font-size: 24px; font-weight: 800; color: var(--amber); margin-bottom: 4px; font-family: 'Cormorant Garamond', serif; }
.bento-quote { font-size: 12px; color: rgba(232,170,67,.85); font-style: italic; line-height: 1.6; font-family: 'Cormorant Garamond', serif; }
.bento-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: rgba(232,170,67,.4); font-weight: 700; margin-bottom: 6px; font-family: 'Quicksand', sans-serif; }

/* ── CRÉATION SCREEN ── */
.session-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 0.5px solid var(--amber-border);
  background: rgba(14,10,6,.98); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0; z-index: 10; position: relative;
}
.session-thumb { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--amber-dim); border-radius: 8px; flex-shrink: 0; }
.session-info { flex: 1; min-width: 0; }
.session-info-name { font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 400; color: var(--amber); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-info-sub { font-family: 'Quicksand', sans-serif; font-size: 8px; color: var(--white-dim); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; line-height: 1.4; }
.cancel-btn {
  background: transparent; border: 1px solid var(--amber-border); color: var(--amber-dim);
  font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .1em;
  text-transform: uppercase; padding: 6px 10px; cursor: pointer; flex-shrink: 0;
  border-radius: 6px; transition: color .2s, border-color .2s;
}
.cancel-btn:hover { color: var(--amber); border-color: var(--amber); }
.session-content {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px; min-height: 0;
  scrollbar-width: thin; scrollbar-color: var(--amber-border) transparent;
}

/* ── PHOTO MINIATURE (après analyse) ── */
#upload-block { transition: all .4s cubic-bezier(.4,0,.2,1); }
#upload-block.analysing { pointer-events: none; }
#dz.shrunk {
  height: 90px !important; min-height: 0 !important; cursor: default;
  border-radius: 12px; transition: all .45s cubic-bezier(.4,0,.2,1);
}
#dz.shrunk #dz-filled { display: block !important; }
#dz.shrunk #dz-empty { display: none !important; }
#dz.shrunk #preview-photo {
  height: 90px !important; border-radius: 10px;
  transition: height .45s cubic-bezier(.4,0,.2,1);
}
#dz.shrunk button { display: none; }
#format-block-analyser { transition: all .3s; }
#format-block-analyser.hidden { opacity: 0; pointer-events: none; max-height: 0; overflow: hidden; margin: 0; padding: 0; }

/* ── GEN CARD ── */
.gen-card {
  width: 80%; margin: 0 auto;
  position: relative; border: 1px solid var(--surface-card-border);
  background: var(--surface-card); overflow: hidden;
  border-radius: 16px;
}
.gen-card img.result-img, .gen-card video {
  width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in;
}
/* Jauge liquide qui remplit la carte */
.gen-card-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 0%; background: linear-gradient(to top, rgba(90,130,125,.25), rgba(90,130,125,.06));
  transition: height 1s ease; pointer-events: none; z-index: 1;
}
/* Scan animation */
.gen-card .scan-line {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2;
}
.gen-card .scan-line::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(90,130,125,.22), transparent);
  animation: scan 2s ease-in-out infinite;
}
/* Bg flou pendant loading */
.gen-card .card-bg-blur {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: blur(14px) brightness(.3); transform: scale(1.08);
  z-index: 0;
}
.gen-card-status {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 12px 14px;
  background: linear-gradient(to top, rgba(14,10,6,.95) 50%, transparent);
  display: flex; flex-direction: column; gap: 6px; z-index: 3;
}
.gen-card-label {
  font-family: 'Quicksand', sans-serif; font-size: 9px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--amber);
}
/* ── CARROUSEL AVANT / APRÈS (résultat génération) ── */
.result-carousel { position: absolute; inset: 0; z-index: 1; }
.result-carousel-track {
  display: flex; width: 100%; height: 100%; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.result-carousel-track::-webkit-scrollbar { display: none; }
.result-carousel-slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; }
.result-carousel-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in;
}
.result-carousel-tag {
  position: absolute; top: 10px; left: 10px; z-index: 4;
  font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.85); background: rgba(14,10,6,.55); padding: 4px 10px; border-radius: 99px;
}
.result-carousel-dots {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 4;
}
.result-carousel-dot {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35);
  transition: background .2s, transform .2s;
}
.result-carousel-dot.active { background: var(--amber); transform: scale(1.3); }
.gen-gauge {
  height: 2px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden;
}
.gen-gauge-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  border-radius: 2px; transition: width .8s ease;
}
/* Bouton dl */
.gen-dl-btn {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  background: rgba(14,10,6,.82); border: 1px solid var(--amber-border);
  color: var(--amber); font-family: 'Quicksand', sans-serif; font-size: 9px;
  letter-spacing: .08em; padding: 5px 10px; border-radius: 7px;
  cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 4px;
  transition: border-color .2s;
}
.gen-dl-btn:hover { border-color: var(--amber); }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border-radius: 18px; border: 1.5px dashed var(--surface-card-border);
  background: var(--surface-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px 20px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover { border-color: rgba(90,130,125,.45); background: rgba(42,62,59,.8); }
.upload-zone.filled { border-color: var(--amber); }
.upload-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(42,62,59,.9); display: flex; align-items: center; justify-content: center; }
.upload-title { font-size: 15px; font-weight: 700; color: var(--white); }
.upload-sub { font-size: 12px; color: var(--amber-dim); text-align: center; line-height: 1.5; font-family: 'Quicksand', sans-serif; letter-spacing: .04em; }
.upload-btns { display: flex; gap: 10px; margin-top: 6px; }
.ubtn { padding: 10px 20px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border: none; cursor: pointer; font-family: 'Quicksand', sans-serif; }
.ubtn.p { background: var(--amber); color: #3a2100; }
.ubtn.g { background: var(--surface-card); color: var(--amber); border: 0.5px solid var(--surface-card-border); }
.start-btn {
  width: 100%; background: var(--amber); color: #1a2625; border: none;
  padding: 15px; font-family: 'DM Sans', sans-serif; font-size: 13px;
  font-weight: 500; letter-spacing: .08em; cursor: pointer; text-transform: uppercase;
  border-radius: 12px; transition: opacity .2s;
  position: relative; overflow: hidden;
}
.start-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,220,.22) 45%, rgba(255,255,220,.38) 50%, rgba(255,255,220,.22) 55%, transparent 65%);
  animation: plateShimmer 3.5s ease-in-out 1.2s infinite;
  pointer-events: none;
}
.start-btn:hover { opacity: .88; }
.start-btn:disabled { opacity: .25; cursor: not-allowed; }

/* ── FORMAT SELECTOR ── */
.fmt-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--surface-card-border); background: var(--surface-card);
  color: var(--amber-dim); font-family: 'Quicksand', sans-serif; font-size: 10px;
  letter-spacing: .08em; transition: all .15s;
}
.fmt-btn.active { border-color: var(--amber); background: rgba(232,170,67,.15); color: var(--amber); }
.fmt-icon { border: 1.5px solid currentColor; border-radius: 3px; flex-shrink: 0; }
/* ── CAMERA MODE SELECTOR ── */
.cam-btn {
  width: 100%; padding: 8px 4px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--surface-card-border); background: var(--surface-card);
  color: var(--amber-dim); font-family: 'Quicksand', sans-serif; font-size: 9px;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  transition: all .15s;
}
.cam-btn.active { border-color: var(--amber); background: rgba(232,170,67,.15); color: var(--amber); }
/* ── CAMERA PRESET — round plate buttons ── */
.cam-preset-row { display: flex; justify-content: center; gap: 16px; margin: 4px 0 2px; }
.cam-preset-btn {
  width: 62px; height: 62px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--surface-card-border);
  background: radial-gradient(circle at 50% 42%, var(--surface-card) 55%, rgba(0,0,0,.18) 100%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.025), 0 2px 8px rgba(0,0,0,.22);
  color: var(--amber-dim); font-family: 'Quicksand', sans-serif;
  font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; text-align: center;
  line-height: 1.15; transition: all .2s; flex-shrink: 0;
}
.cam-preset-btn.active {
  border-color: var(--amber); color: var(--amber);
  background: radial-gradient(circle at 50% 42%, rgba(232,170,67,.14) 55%, rgba(232,170,67,.04) 100%);
  box-shadow: inset 0 0 0 4px rgba(232,170,67,.06), 0 0 14px rgba(232,170,67,.12);
}
.preview-photo-big {
  width: 100%; border-radius: 14px; object-fit: cover;
  max-height: 260px; display: none; border: 1px solid var(--surface-card-border);
}
.preview-photo-big.show { display: block; }

/* ── BOTTOM SHEET ── */
.sheet-overlay { position: fixed; inset: 0; background: rgba(5,3,1,.7); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(4px); }
.sheet-overlay.open { opacity: 1; pointer-events: all; }
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 201;
  background: #110d06; border-top: 1px solid var(--amber-border);
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
  border-radius: 20px 20px 0 0;
  max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 3px; background: var(--amber-border); border-radius: 2px; margin: 12px auto 0; }
.sheet-title { font-family: 'Cormorant Garamond', serif; font-size: 14px; font-weight: 300; letter-spacing: .12em; color: var(--amber-dim); text-align: center; padding: 12px 24px 6px; text-transform: uppercase; }
.sheet-sep { height: 0.5px; background: var(--amber-border); margin: 0 24px 4px; }
.sheet-item { display: flex; align-items: center; gap: 16px; padding: 14px 28px; cursor: pointer; transition: background .15s; border: none; background: transparent; width: 100%; text-align: left; }
.sheet-item:hover, .sheet-item:active { background: rgba(232,170,67,.05); }
.sheet-item-icon { width: 36px; height: 36px; border: 1px solid var(--amber-border); background: var(--amber-faint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; border-radius: 10px; }
.sheet-item-label { font-size: 14px; color: var(--white); }
.sheet-item-sub { font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; color: var(--white-dim); text-transform: uppercase; margin-top: 2px; }
.sheet-item-arrow { font-size: 12px; color: var(--amber-dim); margin-left: auto; }
.sheet-cancel { display: flex; align-items: center; justify-content: center; padding: 13px; margin: 4px 24px 0; border: 1px solid var(--amber-border); background: transparent; cursor: pointer; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--white-dim); width: calc(100% - 48px); border-radius: 10px; transition: color .2s, border-color .2s; }
.sheet-cancel:hover { color: var(--amber); border-color: var(--amber); }

/* ── "CHOISIR UNE IMAGE" — carte flottante centrée (univers teal, cohérent avec #planningDetailSheet) ── */
#bottomSheet {
  top: 50%; left: 50%; bottom: auto; right: auto;
  width: min(340px, calc(100vw - 48px));
  background: var(--bg2); border: 1px solid var(--teal-border); border-radius: 20px;
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#bottomSheet.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }
#bottomSheet .sheet-handle { display: none; }
#bottomSheet .sheet-title { color: var(--teal); }
#bottomSheet .sheet-sep { background: var(--teal-border); }
#bottomSheet .sheet-item:hover, #bottomSheet .sheet-item:active { background: var(--teal-faint); }
#bottomSheet .sheet-item-icon { border-color: var(--teal-border); background: var(--teal-faint); }
#bottomSheet .sheet-item-arrow { color: var(--teal-dim); }
#bottomSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#bottomSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }

/* ── CARTE SOURCE PHOTO — "sort" de l'assiette (bouton droit uniquement) ── */
#plateSheet {
  top: 50%; left: 50%; bottom: auto; right: auto;
  width: min(300px, calc(100vw - 56px));
  background: var(--bg2); border: 1px solid var(--amber-border); border-radius: 20px;
  padding-bottom: 8px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  --pd-dx: 0px; --pd-dy: 0px; --pd-origin-radius: 50%;
}
#plateSheet.open {
  opacity: 1; pointer-events: all;
  animation: pd-fly-in .48s cubic-bezier(.25,.55,.35,1) forwards;
}
#plateSheet .sheet-title { color: var(--amber); }

/* ── QUOTA IMAGES/VIDÉOS DÉPASSÉ — carte flottante centrée (même famille que #plateSheet) ── */
#quotaLimitSheet {
  top: 50%; left: 50%; bottom: auto; right: auto;
  width: min(300px, calc(100vw - 56px));
  background: var(--bg2); border: 1px solid var(--amber-border); border-radius: 20px;
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#quotaLimitSheet.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }

/* ── CM ONBOARDING SHEET ── */
#cmo-fabio-header {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 0 4px;
}
#cmo-fabio-header img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--amber-border);
}
#cmo-fabio-header span {
  font-family: 'Quicksand', sans-serif; font-size: 18px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #ffffff;
}
.cmo-intro { font-family: 'DM Sans', sans-serif; font-size: 12px; line-height: 1.6; color: var(--white-dim); text-align: center; padding: 0 24px 12px; }
.cmo-skip-link { position: absolute; top: 14px; right: 16px; font-family: 'Quicksand', sans-serif; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--white-dim); cursor: pointer; background: none; border: none; }
.cmo-skip-link:hover { color: var(--teal); }
.cmo-question { padding: 12px 24px 4px; }
.cmo-question-label { font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-dim); margin-bottom: 8px; }
.cmo-opts { display: flex; flex-direction: column; gap: 8px; }
.cmo-opt { display: block; width: 100%; text-align: left; padding: 11px 14px; border: 1px solid var(--teal-border); background: rgba(255,255,255,.02); color: var(--white); font-family: 'DM Sans', sans-serif; font-size: 12.5px; border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.cmo-opt.selected { border-color: var(--teal); background: rgba(78,205,196,.12); color: var(--teal); }
.cmo-opts.chips { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.cmo-opts.chips .cmo-opt { width: auto; flex: none; padding: 8px 14px; font-size: 11px; border-radius: 16px; }
.cmo-opt-autre { opacity: .7; font-style: italic; }
.cmo-opt-autre.selected { opacity: 1; font-style: normal; }
.cmo-autre-input { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px 14px; background: rgba(255,255,255,.02); border: 1px solid var(--teal); border-radius: 10px; font-size: 12.5px; line-height: 1.6; color: var(--white); font-family: 'DM Sans', sans-serif; outline: none; resize: none; overflow: hidden; min-height: 44px; -webkit-appearance: none; appearance: none; color-scheme: dark; }
.cmo-autre-input::placeholder { color: var(--white-dim); }
.cmo-textarea, .cmo-input { display: block; width: 100%; box-sizing: border-box; padding: 12px 14px; background: rgba(255,255,255,.04); border: 1px solid var(--teal-border); border-radius: 12px; font-size: 13px; line-height: 1.6; color: var(--white); font-family: 'DM Sans', sans-serif; outline: none; }
.cmo-textarea { height: 90px; resize: none; }
.cmo-input::placeholder, .cmo-textarea::placeholder { color: var(--white-dim); }
.cmo-next-btn { display: flex; align-items: center; justify-content: center; padding: 13px; margin: 16px 24px 4px; border: 1px solid var(--teal); background: var(--teal-faint); cursor: pointer; font-family: 'Quicksand', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); width: calc(100% - 48px); border-radius: 10px; transition: opacity .2s; }
.cmo-next-btn:disabled { opacity: .35; pointer-events: none; }
.cmo-loading-wrap { display: flex; flex-direction: column; align-items: center; padding: 36px 24px 28px; }
.cmo-spinner { width: 48px; height: 48px; border-radius: 50%; border: 3px solid rgba(78,205,196,.18); border-top-color: var(--teal); animation: brand-spin 1s linear infinite; margin-bottom: 18px; }
.cmo-loading-txt { font-family: 'Quicksand', sans-serif; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-dim); text-align: center; line-height: 1.8; }

/* ── JAUGE CIRCULAIRE GÉNÉRIQUE (teal) ── */
.circ-loader { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(78,205,196,.18); border-top-color: var(--teal); animation: brand-spin 1s linear infinite; }
.circ-loader-sm { width: 22px; height: 22px; border-width: 2.5px; }
.circ-loader-xs { width: 14px; height: 14px; border-width: 2px; }

.logo-pos-btn { width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--amber-border); color: var(--amber-dim); font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.logo-pos-btn.selected { background: rgba(200,146,42,.18); border-color: var(--amber); color: var(--amber); }
.cmo-cards { display: flex; flex-direction: column; gap: 10px; padding: 4px 24px 4px; }
.cmo-card { border: 1px solid var(--teal-border); background: rgba(255,255,255,.02); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.cmo-card.selected { border-color: var(--teal); background: rgba(78,205,196,.08); }
.cmo-card-title { font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 400; color: var(--teal); margin-bottom: 4px; }
.cmo-card-objectif { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--white-dim); line-height: 1.5; margin-bottom: 8px; }
.cmo-card-mix { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cmo-card-mix-item { font-family: 'Quicksand', sans-serif; font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-dim); border: 1px solid var(--teal-border); border-radius: 10px; padding: 3px 8px; }
.cmo-card-tone { font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .08em; color: var(--white-dim); margin-bottom: 8px; font-style: italic; }
.cmo-card-example { font-family: 'DM Sans', sans-serif; font-size: 11.5px; line-height: 1.55; color: var(--white); background: rgba(255,255,255,.03); border-radius: 8px; padding: 8px 10px; margin-top: 6px; white-space: pre-wrap; }
#cmOnboardingSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#cmOnboardingSheet, #cmOnboardingSheet * { font-family: 'Inter', sans-serif; }
#cmOnboardingSheet .sheet-handle { background: var(--teal-border); }
#cmOnboardingSheet .sheet-title { color: var(--teal-dim); font-family: 'Poppins', sans-serif; }
#cmOnboardingSheet .sheet-sep { background: var(--teal-border); }
#cmOnboardingSheet .cmo-card-title { font-family: 'Poppins', sans-serif; }

/* ── TYPOGRAPHIE GLOBALE — cohérence ── */
/* Tout ce qui est label/tag/technique : Quicksand */
.phase-label, .gen-card-label, .pc-name, .progress-txt,
.cancel-btn, .gen-dl-btn, .upload-sub, .upload-title,
.bento-text, .bento-lbl, .auth-label, .auth-hint {
  font-family: 'Quicksand', sans-serif;
}
/* Titres / noms expressifs : Cormorant */
.session-info-name, .topbar-title, .hero-text h2,
.bento-quote, .analyse-txt {
  font-family: 'Cormorant Garamond', serif;
}
/* UI courante : DM Sans */
.start-btn, .final-btn, .auth-btn, .plate-half,
.upload-title, .setting-lbl {
  font-family: 'DM Sans', sans-serif;
}


.phase-label { font-family: 'Quicksand', sans-serif; font-size: 16px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber-dim); display: flex; align-items: center; gap: 8px; }
.phase-label::after { content: ''; flex: 1; height: 0.5px; background: var(--surface-card-border); }
.phase-block { display: flex; flex-direction: column; gap: 10px; }

/* ── ANALYSE SPINNER ── */
.analyse-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0; }
.analyse-dots { display: flex; gap: 6px; }
.analyse-dot { width: 5px; height: 5px; background: var(--amber); border-radius: 50%; animation: adot 1.2s infinite; opacity: .2; }
.analyse-dot:nth-child(2) { animation-delay: .15s; }
.analyse-dot:nth-child(3) { animation-delay: .3s; }
@keyframes adot { 0%,100%{opacity:.2;transform:scale(1)} 40%{opacity:1;transform:scale(1.3)} }
.analyse-txt { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 14px; color: var(--white-dim); text-align: center; }

/* ── ÉTAPE QUALITÉ → CARTES STYLES (reveal une par une, en scale) ── */
#phase-quality.leaving { animation: fadeSlideUp .3s ease both; pointer-events: none; }
#phase-previews.cards-hidden { height: 0; overflow: hidden; margin: 0; pointer-events: none; }
#phase-previews.cards-visible { height: auto; overflow: visible; pointer-events: auto; }

/* ── PREVIEW CARDS (styles) ── */
.previews-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview-card {
  position: relative; border: 1px solid var(--surface-card-border); background: var(--surface-card);
  overflow: hidden; cursor: pointer; aspect-ratio: 1/1; border-radius: 12px;
  transition: border-color .2s, box-shadow .2s, opacity .4s cubic-bezier(.34,1.56,.64,1), transform .4s cubic-bezier(.34,1.56,.64,1);
}
#phase-previews.cards-hidden .preview-card { opacity: 0; transform: scale(.7); transition: none; }
.previews-grid .preview-card:nth-child(1) { transition-delay: 0s; }
.previews-grid .preview-card:nth-child(2) { transition-delay: .12s; }
.previews-grid .preview-card:nth-child(3) { transition-delay: .24s; }
.previews-grid .preview-card:nth-child(4) { transition-delay: .36s; }
.preview-card.selected { border: 2px solid var(--amber); }
.preview-card.dimmed { opacity: .4; }
.preview-card.no-ready { cursor: default; }
.preview-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-shimmer { position: absolute; inset: 0; }
.pc-recommended { border: 2px solid var(--amber) !important; box-shadow: 0 0 18px rgba(232,170,67,.25); }
.pc-badge-ia { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: var(--amber); color: #1a2625; font-family: 'Quicksand', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: .1em; padding: 4px 10px; border-radius: 20px; white-space: nowrap; z-index: 10; }
.pc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(8px) brightness(.4); }
.preview-scan { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.preview-scan::after { content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(232,170,67,.2), transparent); animation: scan 1.8s ease-in-out infinite; }
@keyframes scan { 0%{left:-60%} 100%{left:160%} }
.pc-label { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 8px 8px; background: linear-gradient(to top, rgba(14,10,6,.95), transparent); }
.pc-name { font-family: 'Quicksand', sans-serif; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }



/* ── PROGRESS STEPS ── */
.progress-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.progress-steps { display: flex; gap: 3px; }
.progress-step { flex: 1; height: 2px; background: var(--amber-border); position: relative; overflow: hidden; border-radius: 2px; }
.progress-step.done { background: var(--amber); }
.progress-step.active::after { content: ''; position: absolute; inset: 0; background: var(--amber); animation: pfill 2s ease-in-out infinite; }
@keyframes pfill { 0%{transform:scaleX(0);transform-origin:left} 50%{transform:scaleX(1);transform-origin:left} 51%{transform:scaleX(1);transform-origin:right} 100%{transform:scaleX(0);transform-origin:right} }
.progress-txt { font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; color: var(--white-dim); }

/* ── BUTTONS ── */
.final-btn { width: 100%; background: var(--amber); color: #1a2625; border: none; padding: 14px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; letter-spacing: .08em; cursor: pointer; text-transform: uppercase; border-radius: 10px; transition: opacity .2s; display: block; text-align: center; text-decoration: none; margin-top: 4px; }
.final-btn:hover { opacity: .85; }
.secondary-btn { width: 100%; background: transparent; border: 1px solid var(--amber-border); color: var(--amber-dim); padding: 11px; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .12em; cursor: pointer; text-transform: uppercase; border-radius: 10px; transition: color .2s, border-color .2s; margin-top: 4px; }
.secondary-btn:hover { color: var(--amber); border-color: var(--amber); }
.err-msg { font-family: 'Quicksand', sans-serif; font-size: 10px; color: var(--red); letter-spacing: .06em; padding: 8px 0; }

/* ── BIBLIOTHÈQUE ── */
#screen-library { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
/* -- LIBRARY IMPORT DROPZONE -- */
.lib-upload-zone {
  margin: 14px auto 0;
  width: calc(25% - 1.05px);
  aspect-ratio: 1;
  border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px; cursor: pointer;
  transition: transform .15s;
}
.lib-upload-zone:active { transform: scale(.94); }
.lib-upload-zone .upload-icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #e8c473 0%, var(--amber) 45%, #a97418 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 2px 5px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  transition: filter .15s;
}
.lib-upload-zone:hover .upload-icon,
.lib-upload-zone.dragover .upload-icon { filter: brightness(1.1); }
.lib-upload-label {
  font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--amber-dim); text-align: center; line-height: 1.3;
}
.lib-upload-zone.dragover .lib-upload-label { color: var(--amber); }
.lib-upload-zone.uploading { opacity: .6; pointer-events: none; }

.tabs { display: flex; gap: 6px; padding: 14px 20px 0; flex-shrink: 0; position: relative; align-items: flex-start; }
.tab { flex: 1; padding: 6px 4px; box-sizing: border-box; height: 40px; border-radius: 10px 10px 0 0; font-size: 9px; font-weight: 700; text-align: center; cursor: pointer; border: 3px solid transparent; border-bottom: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: all .15s; font-family: 'Quicksand', sans-serif; letter-spacing: .03em; line-height: 1.2; position: relative; }
.tab.active { background: var(--amber); color: #3a2100; border-color: var(--amber); z-index: 3; }
.tab.inactive { background: rgba(255,255,255,.05); color: rgba(255,255,255,.3); z-index: 0; }
.tab svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* -- LIBRARY FRAME (les onglets inactifs glissent sous le cadre) -- */
.lib-frame {
  position: relative; z-index: 2;
  background: var(--surface-card);
  border: 3px solid var(--amber);
  border-radius: 0 0 10px 10px;
  margin: 0 20px;
  overflow: hidden;
  flex: 0 0 auto;
}

/* -- LIBRARY PAGINATION -- */
.lib-pagination { display: none; align-items: center; justify-content: center; gap: 16px; padding: 12px 20px 0; flex-shrink: 0; }
.lib-pagination.show { display: flex; }
.lib-page-btn {
  background: var(--surface-card); border: 1px solid var(--surface-card-border); color: var(--amber);
  width: 32px; height: 32px; border-radius: 8px; font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: 'Quicksand', sans-serif;
}
.lib-page-btn:disabled { opacity: .3; cursor: default; }
.lib-page-indicator {
  font-family: 'Quicksand', sans-serif; font-size: 10px; letter-spacing: .08em; color: var(--amber-dim);
  min-width: 40px; text-align: center;
}

.lib-panel { display: none; }
.lib-panel.active { display: block; }

.lib-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 0; }
.lib-loader svg { animation: lib-spin 1.2s linear infinite; }
.lib-loader span { font-family: 'Quicksand', sans-serif; font-size: 11px; letter-spacing: .08em; color: var(--amber-dim); }
.lib-loader.hidden { display: none; }
@keyframes lib-spin { to { transform: rotate(360deg); } }

.lib-thumb.shimmer { background: linear-gradient(90deg, #1a1208 25%, #2e1f0a 50%, #1a1208 75%); background-size: 200% 100%; animation: shimmer 1.8s infinite linear; }
.lib-thumb.shimmer img { opacity: 0; transition: opacity .3s ease; }
.lib-thumb.loaded img { opacity: 1; }

/* align-content:start — sans lui, la grille (qui est un item flex du .lib-page-track) est
   etiree a la hauteur de la page voisine la plus remplie, et l'espace en trop est reparti
   ENTRE les rangees : la derniere page, moins remplie, s'affichait avec des trous. */
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; box-sizing: border-box; align-content: start; }
.lib-card { aspect-ratio: 1; border-radius: 2px; overflow: hidden; background: var(--bg2); position: relative; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lib-panel.active .lib-card { animation: libCardIn .35s ease-out backwards; }
.lib-panel.active .lib-card:nth-child(2) { animation-delay: .03s; }
.lib-panel.active .lib-card:nth-child(3) { animation-delay: .06s; }
.lib-panel.active .lib-card:nth-child(4) { animation-delay: .09s; }
.lib-panel.active .lib-card:nth-child(5) { animation-delay: .12s; }
.lib-panel.active .lib-card:nth-child(6) { animation-delay: .15s; }
.lib-panel.active .lib-card:nth-child(n+7) { animation-delay: .18s; }
@keyframes libCardIn {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: scale(1); }
}
.lib-thumb { width: 100%; height: 100%; background: linear-gradient(135deg, #1e140a, #2a1a0a); display: flex; align-items: center; justify-content: center; }
.lib-badge { position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; border-radius: 4px; background: rgba(14,10,6,.85); display: flex; align-items: center; justify-content: center; }
.lib-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 6px; background: rgba(14,10,6,.75); font-size: 8px; font-weight: 700; font-family: 'Quicksand', sans-serif; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card img, .lib-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-delete-btn { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); border: 0.5px solid rgba(255,255,255,.15); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; z-index: 12; padding: 0; }
.lib-card:hover .lib-delete-btn { opacity: 1; }

/* ── LIBRARY VIEWER (pellicule) ── */
#lib-viewer { position: fixed; inset: 0; z-index: 500; background: var(--bg2); display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity .25s; }
#lib-viewer.open { opacity: 1; pointer-events: all; }
.lv-topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; flex-shrink: 0; }
.lv-btn-back, .lv-btn-trash { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; flex-shrink: 0; }
.lv-btn-trash { color: rgba(255,100,100,.95); }
.lv-counter { font-family: 'Quicksand', sans-serif; font-size: 11px; color: rgba(255,255,255,.45); letter-spacing: .06em; }
.lv-main { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; }
#lv-img, #lv-video { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; user-select: none; -webkit-user-drag: none; touch-action: none; }
.lv-strip { height: 76px; flex-shrink: 0; display: flex; align-items: center; gap: 3px; overflow-x: auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); scrollbar-width: none; scroll-behavior: smooth; }
.lv-strip::-webkit-scrollbar { display: none; }
.lv-strip-thumb { flex-shrink: 0; width: 56px; height: 56px; border-radius: 6px; object-fit: cover; cursor: pointer; opacity: .45; border: 2px solid transparent; transition: opacity .18s, border-color .18s; }
.lv-strip-thumb.active { opacity: 1; border-color: #fff; }

/* ── SOCIALS ── */
.slbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--amber-dim); font-family: 'Quicksand', sans-serif; }
.net-list { background: var(--surface-card); border: 0.5px solid var(--surface-card-border); border-radius: 14px; overflow: hidden; }
.net-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 0.5px solid var(--surface-card-divider); }
.net-row:last-child { border-bottom: none; }
.net-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.net-icon.ig { background: linear-gradient(135deg, rgba(193,53,132,.2), rgba(253,193,104,.2)); }
.net-icon.tk { background: rgba(255,255,255,.06); }
.net-icon.fb { background: rgba(24,119,242,.1); }
.net-name-lbl { font-size: 13px; font-weight: 700; color: var(--white); }
.net-handle { font-size: 10px; color: var(--amber-dim); font-family: 'Quicksand', sans-serif; margin-top: 1px; }
.net-handle.off { color: rgba(255,255,255,.25); }
.ios-toggle { width: 46px; height: 28px; border-radius: 14px; position: relative; cursor: pointer; flex-shrink: 0; transition: background .25s; border: none; }
.ios-toggle.on { background: var(--green); }
.ios-toggle.off { background: rgba(255,255,255,.14); }
.ios-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; position: absolute; top: 2px; transition: left .25s cubic-bezier(.4,0,.2,1); box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.ios-toggle.on .ios-thumb { left: 20px; }
.ios-toggle.off .ios-thumb { left: 2px; }
.history-item { display: flex; align-items: center; gap: 12px; background: var(--surface-card); border: 0.5px solid var(--surface-card-border); border-radius: 12px; padding: 12px 14px; }
.hist-thumb { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg,#1e140a,#2a1a0a); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hist-thumb img, .hist-thumb video { width: 100%; height: 100%; object-fit: cover; }
.hist-info { flex: 1; }
.hist-name { font-size: 12px; font-weight: 700; color: var(--white); }
.hist-meta { font-size: 10px; color: var(--amber-dim); margin-top: 2px; font-family: 'Quicksand', sans-serif; }
.hist-badge { font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; font-family: 'Quicksand', sans-serif; }
.hist-badge.ok { background: rgba(76,175,80,.12); color: var(--green); }
.hist-badge.sched { background: rgba(55,138,221,.12); color: var(--blue); }
.social-post-btn {
  width: 100%; padding: 14px; background: linear-gradient(135deg, rgba(193,53,132,.15), rgba(253,193,104,.1));
  border: 0.5px solid rgba(193,53,132,.3); border-radius: 12px;
  color: rgba(253,150,80,.9); font-family: 'Quicksand', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s;
}
.social-post-btn:hover { opacity: .8; }
.coming-soon-badge {
  background: rgba(232,170,67,.1); border: 0.5px solid var(--amber-border);
  border-radius: 8px; padding: 3px 8px;
  font-size: 8px; font-family: 'Quicksand', sans-serif; color: var(--amber-dim); letter-spacing: .08em;
}

/* ── COMPTE ── */
.profile-section { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--surface-card); border: 0.5px solid var(--surface-card-border); border-radius: 16px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--amber), #7a4e10); display: flex; align-items: center; justify-content: center; border: 2px solid var(--amber-dim); position: relative; flex-shrink: 0; }
.pro-badge { position: absolute; bottom: -2px; right: -2px; background: var(--amber); color: #3a2100; font-size: 14px; font-weight: 800; padding: 2px 5px; border-radius: 5px; letter-spacing: .06em; border: 1.5px solid var(--bg); font-family: 'Quicksand', sans-serif; }
.settings-card { background: var(--surface-card); border: 1px solid var(--amber-border); border-radius: 14px; overflow: hidden; padding-bottom: 14px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 0.5px solid var(--surface-card-divider); cursor: pointer; }
.setting-row:last-child { border-bottom: none; }
.setting-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(232,170,67,.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.setting-lbl { flex: 1; font-size: 26px; font-weight: 600; color: var(--white); }
.setting-val { font-size: 22px; color: var(--amber-dim); font-family: 'Quicksand', sans-serif; }
.chev { width: 14px; height: 14px; fill: none; stroke: rgba(255,255,255,.2); stroke-width: 1.6; stroke-linecap: round; }
.logout-btn-full { width: 100%; padding: 13px; background: rgba(220,60,60,.07); border: 0.5px solid rgba(220,60,60,.2); border-radius: 12px; color: var(--red); font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: 'DM Sans', sans-serif; }
.btn-feedback-cta { width: 100%; padding: 13px; background: var(--surface-card); border: 1px solid var(--surface-card-border); border-radius: 12px; color: var(--amber); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: 'DM Sans', sans-serif; margin-bottom: 10px; transition: background .2s; }
.btn-feedback-cta:hover { background: rgba(42,62,59,.85); }
.fb-stars { display: flex; gap: 8px; justify-content: center; padding: 8px 0 4px; }
.fb-star { font-size: 30px; cursor: pointer; filter: grayscale(1) brightness(.35); transition: filter .12s, transform .12s; user-select: none; }
.fb-star.lit { filter: none; transform: scale(1.1); }
.fb-rating-lbl { text-align:center; font-family:'Quicksand',sans-serif; font-size:18px; letter-spacing:.12em; color:var(--amber-dim); min-height:14px; margin-bottom:10px; }
.fb-field-lbl { font-family:'Quicksand',sans-serif; font-size:18px; letter-spacing:.13em; text-transform:uppercase; color:var(--white-dim); margin: 10px 0 5px; display:block; }
.fb-textarea { width:100%; background:rgba(255,255,255,.05); border:1px solid var(--amber-border); border-radius:10px; color:var(--white); font-family:'DM Sans',sans-serif; font-size:26px; padding:10px 12px; outline:none; resize:none; min-height:70px; line-height:1.4; -webkit-appearance:none; transition:border-color .2s; }
.fb-textarea:focus { border-color:var(--amber-dim); }
.fb-textarea::placeholder { color:rgba(255,255,255,.18); }
.fb-success { text-align:center; padding:24px 0 8px; display:none; }
.fb-success-icon { font-size:40px; margin-bottom:10px; }
.fb-success-txt { font-family:'Cormorant Garamond',serif; font-size:36px; color:var(--amber); margin-bottom:6px; }
.fb-success-sub { font-size:24px; color:var(--white-dim); }

/* ── BULLE CHAT DA ── */
.da-chat-wrap { display:flex;flex-direction:column;gap:10px;animation:fadeSlideIn .35s ease both; }
@keyframes fadeSlideIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes fadeSlideUp{from{opacity:1;transform:translateY(0);max-height:200px}to{opacity:0;transform:translateY(-12px);max-height:0;margin:0;padding:0;overflow:hidden}}
.da-bubble {
  background: var(--surface-card); border:0.5px solid var(--surface-card-border);
  border-radius:14px 14px 14px 4px;padding:12px 14px;
  display:flex;gap:10px;align-items:flex-start;
}
.da-avatar {
  width:28px;height:28px;border-radius:50%;
  background:linear-gradient(135deg,var(--amber),#7a4e10);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;font-size:12px;color:#fff;font-weight:700;font-family:'DM Sans',sans-serif;
}
.da-bubble-text { font-family:'Cormorant Garamond',serif;font-size:15px;line-height:1.55;color:var(--white);flex:1; }
.da-bubble-text strong { color:var(--amber);font-weight:600; }
.da-input-row { display:flex;gap:8px; }
.da-input {
  flex:1;background:rgba(255,255,255,.05);border:1px solid var(--amber-border);
  border-radius:10px;color:var(--white);font-family:'DM Sans',sans-serif;
  font-size:13px;padding:10px 12px;outline:none;transition:border-color .2s;-webkit-appearance:none;
}
.da-input:focus{border-color:var(--amber-dim);}
.da-input::placeholder{color:var(--white-dim);font-size:12px;}
.da-ok-btn {
  background:var(--amber);color:#1a2625;border:none;border-radius:10px;
  padding:10px 16px;cursor:pointer;font-family:'Quicksand',sans-serif;
  font-size:9px;letter-spacing:.1em;text-transform:uppercase;font-weight:700;
  flex-shrink:0;transition:opacity .2s;
}
.da-ok-btn:hover{opacity:.85;}
.da-ok-btn:disabled{opacity:.5;cursor:not-allowed;}
.da-input:disabled{opacity:.5;cursor:not-allowed;}
.sc-send-spinner{display:inline-block;width:11px;height:11px;border-radius:50%;border:2px solid rgba(26,38,37,.3);border-top-color:#1a2625;animation:brand-spin .7s linear infinite;vertical-align:middle;}
.da-chat-wrap.leaving{animation:fadeSlideUp .3s ease both;pointer-events:none;}

/* ── GEN CARD jauge centrée ── */
.gcg { /* gen-card-gauge */
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  z-index:4;display:flex;flex-direction:column;align-items:center;gap:8px;width:68%;
}
.gcg-bar{width:100%;height:2px;background:rgba(255,255,255,.12);border-radius:2px;overflow:hidden;}
.gcg-fill{height:100%;width:0%;background:linear-gradient(90deg,var(--amber-dim),var(--amber));border-radius:2px;transition:width .8s ease;}
.gcg-txt{font-family:'Quicksand',sans-serif;font-size:12px;letter-spacing:.10em;text-transform:uppercase;color:rgba(232,170,67,.9);text-align:center;}

/* ── ÉCRAN RÉSULTAT ── */
#screen-result{position:absolute;inset:0;display:none;flex-direction:column;background:transparent;padding-top:50px;}
#screen-result.active{display:flex;}
.result-topbar{
  padding:14px 16px 12px;display:flex;justify-content:space-between;align-items:center;
  border-bottom:0.5px solid var(--amber-border);background:rgba(14,10,6,.97);flex-shrink:0;
}
.result-title{font-family:'Cormorant Garamond',serif;font-size:18px;font-weight:400;color:var(--amber);letter-spacing:.06em;}
.result-sub{font-family:'Quicksand',sans-serif;font-size:8px;color:var(--white-dim);letter-spacing:.1em;text-transform:uppercase;margin-top:2px;}
.result-scroll{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px 16px calc(90px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:14px;}
.result-duo{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.result-thumb{position:relative;border-radius:14px;overflow:hidden;border:1px solid var(--surface-card-border);background:var(--surface-card);aspect-ratio:1/1;cursor:zoom-in;}
.result-thumb img,.result-thumb video{width:100%;height:100%;object-fit:cover;display:block;}
.result-thumb-lbl{position:absolute;bottom:0;left:0;right:0;padding:8px 8px 6px;background:linear-gradient(to top,rgba(18,26,25,.92),transparent);font-family:'Quicksand',sans-serif;font-size:7px;letter-spacing:.12em;text-transform:uppercase;color:var(--amber);}
.result-style-tag{background:var(--surface-card);border:0.5px solid var(--surface-card-border);border-radius:20px;padding:6px 14px;font-family:'Quicksand',sans-serif;font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--amber-dim);text-align:center;}
.result-fb-row{display:flex;flex-direction:column;align-items:center;gap:10px;padding:4px 0;}
.result-fb-lbl{font-family:'Quicksand',sans-serif;font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--white-dim);}
.result-fb-btns{display:flex;gap:16px;}
.result-publish-btn{
  width:100%;padding:14px;border-radius:12px;cursor:pointer;
  background:linear-gradient(135deg,rgba(193,53,132,.18),rgba(253,193,104,.1));
  border:0.5px solid rgba(193,53,132,.3);color:rgba(253,150,80,.9);
  font-family:'Quicksand',sans-serif;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  display:flex;align-items:center;justify-content:center;gap:8px;transition:opacity .2s;
}
.result-publish-btn:hover{opacity:.8;}

/* ── LIGHTBOX ── */
#lightbox { position: fixed; inset: 0; z-index: 100010; background: rgba(5,3,1,.96); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
#lightbox.open { opacity: 1; pointer-events: all; }
#lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; display: block; touch-action: none; transform-origin: center; }
.lightbox-bar { display: flex; gap: 12px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); width: 100%; justify-content: center; }
.lb-btn { background: transparent; border: 1px solid var(--amber-border); color: var(--white); font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding: 10px 20px; cursor: pointer; border-radius: 8px; transition: border-color .2s; text-decoration: none; display: flex; align-items: center; }
.lb-btn:hover { border-color: var(--amber); }
.lb-btn.accent { background: var(--amber); color: #1a2625; border-color: var(--amber); }
.lb-ios-hint { font-family: 'Quicksand', sans-serif; font-size: 8px; color: var(--white-dim); letter-spacing: .08em; text-align: center; padding: 0 24px 8px; line-height: 1.6; }

/* ── FEEDBACK ── */
.fb-btn { font-size: 28px; background: transparent; border: 1px solid var(--amber-border); width: 54px; height: 54px; cursor: pointer; transition: border-color .2s, transform .15s; border-radius: 8px; }
.fb-btn:hover { border-color: var(--amber); transform: scale(1.05); }

/* ── RESUME BANNER ── */
#resume-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 400; background: #110d06; border-top: 1px solid var(--amber-dim); padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── DEBUG ── */
#debug-panel { position: fixed; bottom: 0; left: 0; right: 0; z-index: 999; background: rgba(5,3,1,.95); border-top: 1px solid var(--red); font-family: 'Quicksand', sans-serif; font-size: 10px; max-height: 38vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .25s; pointer-events: none; }
#debug-panel.open { transform: translateY(0); pointer-events: all; }
#debug-toggle { position: fixed; bottom: 0; right: 12px; z-index: 1000; background: var(--red); color: #fff; border: none; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; padding: 4px 10px; cursor: pointer; border-radius: 4px 4px 0 0; }
#debug-log { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.dbg-entry { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); line-height: 1.4; word-break: break-all; }
.dbg-entry.req { color: #7ec89e; } .dbg-entry.res-ok { color: #a0c8e0; } .dbg-entry.res-err { color: #e07060; } .dbg-entry.info { color: var(--white-dim); }
#debug-clear { background: transparent; border: none; color: var(--white-dim); font-family: 'Quicksand', sans-serif; font-size: 9px; padding: 4px 10px; cursor: pointer; border-top: 1px solid rgba(255,255,255,.08); text-align: left; }

@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
svg.ic { width: 22px; height: 22px; fill: none; stroke: rgba(232,170,67,.6); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── BULLE DU CHEF ── */
.chef-bulle {
  background: var(--surface-card);
  border: 1px solid var(--surface-card-border); border-radius: 16px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  animation: fadeSlideIn .4s ease both; margin-bottom: 14px;
}
.chef-bulle-header { display: flex; align-items: center; gap: 10px; }
.chef-bulle-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--amber-border);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.chef-bulle-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chef-bulle-label { font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-dim); }
.chef-bulle-refresh {
  margin-left: auto; background: transparent; border: 1px solid var(--amber-border);
  color: var(--amber-dim); width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  transition: border-color .2s, color .2s; flex-shrink: 0;
}
.chef-bulle-refresh:hover { border-color: var(--amber); color: var(--amber); }
.chef-bulle-action { font-family: 'DM Sans', sans-serif; font-size: 16px; font-style: normal; color: rgba(255,255,255,0.92); line-height: 1.65; }
.chef-bulle-hashtags { display: flex; flex-wrap: wrap; gap: 6px; }
.chef-hashtag { font-family: 'Quicksand', sans-serif; font-size: 9px; color: var(--amber); background: rgba(232,170,67,.08); border: 0.5px solid var(--amber-border); border-radius: 20px; padding: 3px 9px; letter-spacing: .04em; }
.chef-bulle-shimmer { height: 96px; border-radius: 16px; margin-bottom: 14px; background: var(--bg2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.chef-bulle-loading-text { font-family: 'Quicksand', sans-serif; font-size: 12px; color: var(--amber-dim); letter-spacing: .06em; text-align: center; }
.chef-bulle-type { align-self: flex-start; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); background: rgba(232,170,67,.08); border: 0.5px solid var(--amber-border); border-radius: 20px; padding: 3px 10px; }
.chef-bulle-type-done { color: #4CAF50; background: rgba(76,175,80,.08); border-color: rgba(76,175,80,.35); }
.badge-actualite { align-self: flex-start; display: inline-block; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .06em; color: var(--teal); background: var(--teal-faint); border: 0.5px solid var(--teal-border); border-radius: 20px; padding: 3px 10px; }
.badge-actualite-center { display: block; width: fit-content; margin: 0 auto 6px; }
.chef-bulle-heure { align-self: flex-start; font-family: 'Quicksand', sans-serif; font-size: 11px; letter-spacing: .04em; color: var(--teal-dim); }
.chef-bulle-tip { font-family: 'DM Sans', sans-serif; font-size: 13px; font-style: italic; line-height: 1.5; color: rgba(255,255,255,0.65); }
.chef-bulle-actions { display: flex; gap: 8px; margin-top: 2px; justify-content: flex-end; flex-wrap: wrap; }
.chef-bulle-skip {
  background: transparent; border: 1px solid var(--teal-border); color: var(--teal-dim);
  font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; transition: border-color .2s, color .2s;
}
.chef-bulle-skip:hover { border-color: var(--teal); color: var(--teal); }

.chef-plate-icon-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; padding: 0;
  border: 1.5px solid var(--amber-border);
  background: radial-gradient(circle at 50% 42%, var(--surface-card) 55%, rgba(0,0,0,.18) 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.02), 0 2px 6px rgba(0,0,0,.22);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s;
}
.chef-plate-icon-btn:hover { border-color: var(--amber); }
.chef-plate-icon-btn svg { width: 15px; height: 15px; fill: none; stroke: var(--amber-dim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chef-plate-icon-btn:hover svg { stroke: var(--amber); }

/* ── ICÔNES RÉSEAUX SOCIAUX (compte) ── */
/* ── Sélecteur de réseau des stats de l'accueil (#home-net-row) ──
   Mêmes tuiles carrées que .social-net-icon des cartes Réseaux Sociaux, en plus petit :
   fond de la couleur de marque, glyphe blanc. Le réseau actif se distingue par le liseré
   ambré de la charte — jamais par la couleur de marque, identique pour tous les états. */
.home-net-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: none; padding: 0; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  color: #fff; opacity: .4;
  /* box-shadow plutôt qu'outline pour l'anneau : il suit le border-radius partout,
     et il ne décale pas la mise en page comme le ferait une bordure. */
  box-shadow: none;
  transition: opacity .2s, box-shadow .2s;
}
.home-net-btn svg { width: 20px; height: 20px; display: block; }
.home-net-btn.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--amber), 0 0 12px rgba(232,170,67,.3);
}
.home-net-instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.home-net-facebook { background: #1877f2; }
.home-net-tiktok   { background: #010101; }

.social-net-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  transition: background .3s, color .3s;
}
.social-net-icon.connected-insta {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  color: #fff;
}
.social-net-icon.connected-fb { background: #1877f2; color: #fff; }
.social-net-icon.connected-tiktok { background: #010101; color: #fff; }
.social-net-label {
  font-family: 'Quicksand', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.18); text-align: center;
  transition: color .3s; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.social-net-label.connected { color: var(--amber-dim); }
.social-net-card {
  flex: 1 1 0; min-width: 0; max-width: 128px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface-card); border: 0.5px solid var(--surface-card-border);
  border-radius: 12px; padding: 12px 6px;
}
.social-net-card-disabled { opacity: .4; }
.social-net-stats {
  display: flex; justify-content: center; gap: 14px;
  margin-top: 6px; padding-top: 8px; width: 100%;
  border-top: 0.5px solid var(--surface-card-border);
}
.social-net-stat { text-align: center; }
.social-net-stat-value { font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--amber); line-height: 1; }
.social-net-stat-label {
  font-family: 'Quicksand', sans-serif; font-size: 8px; color: var(--white-dim);
  letter-spacing: .06em; text-transform: uppercase; margin-top: 3px;
}
.social-net-soon {
  font-family: 'Quicksand', sans-serif; font-size: 7px; color: var(--white-dim);
  letter-spacing: .04em; text-transform: uppercase; text-align: center; margin-top: 2px;
}

/* ── SECTION IDÉES (accueil) ── */
#section-idees { margin-top: 18px; }
.idee-list { display: flex; flex-direction: column; gap: 8px; }
.idee-card {
  display: flex; flex-direction: column; gap: 4px; padding: 11px 14px;
  background: var(--surface-card); border: 0.5px solid var(--surface-card-border);
  border-radius: 12px; cursor: pointer; transition: border-color .15s;
}
.idee-card:hover { border-color: var(--amber-border); }
.idee-card-type { font-family: 'Quicksand', sans-serif; font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-dim); }
.idee-card-titre { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--white); }
.idee-card-draft { background: var(--amber-faint); border-color: var(--amber); }
.idee-card-draft:hover { border-color: var(--amber); }
.idee-card-draft .idee-card-type { color: var(--amber); }
.idee-card-badge-draft { font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-top: 2px; }
.idee-card-badge-date { font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-dim); margin-top: 2px; }
.actualite-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.actualite-card { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; background: var(--surface-card); border: 0.5px solid var(--teal-border); border-radius: 12px; cursor: pointer; transition: opacity .15s ease; }
.actualite-card:active { opacity: .7; }
.actualite-card-date { font-family: 'Quicksand', sans-serif; font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.actualite-card-titre { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--white); font-weight: 600; }
.actualite-card-desc { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--white-dim); line-height: 1.4; }
.actualite-card-adresse { font-family: 'DM Sans', sans-serif; font-size: 11.5px; color: var(--teal); line-height: 1.4; }

/* ── PLANNING 7 JOURS — vue calendrier (jours en colonnes, heures en lignes) ── */
#section-planning { margin-bottom: 18px; }
.plan-week-grid { border-radius: 12px; overflow: hidden; }
.plan-week-loading-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 0; }
.pw-scroll-outer {
  display: flex; align-items: flex-start; overflow-x: auto; overflow-y: auto; max-height: 320px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  background: var(--surface-card); border: 0.5px solid var(--surface-card-border);
  border-radius: 12px; cursor: grab; user-select: none;
  scrollbar-width: none;
}
.pw-scroll-outer::-webkit-scrollbar { display: none; }
.pw-scroll-outer.dragging { cursor: grabbing; scroll-snap-type: none; }
.pw-time-axis { position: sticky; left: 0; z-index: 3; flex: 0 0 32px; background: var(--surface-card); }
.pw-time-axis-header { position: sticky; top: 0; z-index: 5; height: 40px; background: var(--surface-card); border-bottom: 0.5px solid var(--surface-card-border); }
.pw-time-axis-body { position: relative; }
.pw-hour-label {
  position: absolute; left: 0; right: 0; transform: translateY(-50%);
  font-family: 'Quicksand', sans-serif; font-size: 8px; color: var(--white-dim); text-align: center;
}
.pw-day-col { flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; border-left: 0.5px solid var(--surface-card-border); }
.pw-day-col.is-today .pw-day-header { background: rgba(232,170,67,.08); }
.pw-day-header {
  position: sticky; top: 0; z-index: 4; background: var(--surface-card);
  height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Quicksand', sans-serif; letter-spacing: .04em; border-bottom: 0.5px solid var(--surface-card-border);
}
.pw-day-name { font-size: 9px; text-transform: uppercase; color: var(--amber-dim); }
.pw-day-num { font-size: 13px; color: var(--white); font-family: 'Cormorant Garamond', serif; line-height: 1.2; }
.pw-day-body {
  position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--surface-card-border) 0, var(--surface-card-border) 0.5px, transparent 0.5px, transparent 40px);
}
.pw-card {
  position: absolute; left: 3px; right: 3px; min-height: 34px;
  background: var(--surface-card); border: 0.5px solid var(--surface-card-border); border-radius: 6px;
  padding: 3px 5px; cursor: pointer; overflow: hidden;
}
.pw-card-heure { font-family: 'Quicksand', sans-serif; font-size: 7px; color: var(--amber-dim); letter-spacing: .03em; }
.pw-card-titre {
  font-family: 'DM Sans', sans-serif; font-size: 9px; color: var(--white); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Code couleur par origine du post — colore toute la card ; le statut (done/scheduled ci-dessous)
   prend le dessus quand il s'applique, car défini après dans la cascade. */
.pw-card-origine-planning { border-color: var(--amber-border); background: var(--amber-faint); }
.pw-card-origine-evenement { border-color: var(--teal-border); background: var(--teal-faint); }
.pw-card-origine-perso { border-color: var(--blue-border); background: var(--blue-faint); }
.pw-card-origine-idee { border-color: var(--purple-border); background: var(--purple-faint); }

.pw-card.is-done { border-color: rgba(76,175,80,.4); background: rgba(76,175,80,.1); }
.pw-card.is-done .pw-card-heure { color: #4CAF50; }
.pw-card.is-scheduled { border-color: var(--teal-border); background: var(--teal-faint); }
.pw-card.is-scheduled .pw-card-heure { color: var(--teal); }
.pw-card.is-skip { opacity: .4; }
.pw-card-bonus { border-style: dashed; border-color: var(--amber); }

/* Légende du code couleur d'origine */
.pw-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px 8px; font-family: 'Quicksand', sans-serif; font-size: 8px; letter-spacing: .04em; color: var(--white-dim); }
.pw-legend-item { display: flex; align-items: center; gap: 4px; }

/* ── Bascule vue calendrier / liste ── */
.pw-header-left { display: flex; align-items: center; gap: 8px; }
.pw-view-toggle { display: flex; gap: 4px; }
.pw-toggle-btn {
  width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-card); border: 0.5px solid var(--surface-card-border); color: var(--white-dim);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s; padding: 0;
}
.pw-toggle-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle-btn.active { background: var(--amber); color: #3a2100; border-color: var(--amber); }

/* ── PLANNING 7 JOURS — vue liste (alternative à la vue calendrier) ── */
.plan-week-list { display: flex; flex-direction: column; gap: 8px; }
.plan-day-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: var(--surface-card); border: 0.5px solid var(--surface-card-border);
  border-radius: 12px; cursor: pointer; transition: border-color .15s;
}
.plan-day-card:hover { border-color: var(--amber-border); }
.plan-day-card-origine-planning { border-color: var(--amber-border); background: var(--amber-faint); }
.plan-day-card-origine-evenement { border-color: var(--teal-border); background: var(--teal-faint); }
.plan-day-card-origine-perso { border-color: var(--blue-border); background: var(--blue-faint); }
.plan-day-card-origine-idee { border-color: var(--purple-border); background: var(--purple-faint); }
.plan-day-card.is-today { border-color: var(--amber); }
.plan-day-card.is-done { border-color: rgba(76,175,80,.35); background: rgba(76,175,80,.06); }
.plan-day-card.is-scheduled { border-color: var(--teal-border); background: var(--teal-faint); }
.plan-day-card-bonus { border-style: dashed; border-color: var(--amber); }
.pw-legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-planning { background: var(--amber); }
.dot-evenement { background: var(--teal); }
.dot-perso { background: var(--blue); }
.dot-idee { background: var(--purple); }
.plan-day-date { font-family: 'Quicksand', sans-serif; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-dim); width: 38px; flex-shrink: 0; text-align: center; }
.plan-day-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-day-type { font-family: 'Quicksand', sans-serif; font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-dim); }
.plan-day-titre { font-family: 'DM Sans', sans-serif; font-size: 12.5px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-day-status { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.plan-day-status-done { width: auto; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .04em; color: #4CAF50; }
.plan-day-status-scheduled { width: auto; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .04em; color: var(--teal); }

/* ── SHEET DÉTAIL PLANNING ── */
.pd-type { text-align: center; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber-dim); padding: 0 24px 6px; }
.pd-heure { text-align: center; font-family: 'Quicksand', sans-serif; font-size: 11px; letter-spacing: .04em; color: var(--teal-dim); padding: 0 24px 6px; }
.pd-desc { font-family: 'DM Sans', sans-serif; font-size: 13px; line-height: 1.6; color: var(--white); padding: 8px 24px 4px; }
.pd-tip { font-family: 'DM Sans', sans-serif; font-size: 12px; font-style: italic; line-height: 1.5; color: rgba(255,255,255,0.6); padding: 4px 24px 4px; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 14px 24px 4px; }
.pd-btn {
  flex: 1; min-width: 120px; padding: 11px; border-radius: 10px; cursor: pointer;
  font-family: 'Quicksand', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--amber-border); background: transparent; color: var(--amber-dim);
  transition: border-color .2s, color .2s, background .2s;
}
.pd-btn.primary { border-color: var(--amber); background: var(--amber-faint); color: var(--amber); }
.pd-btn:hover { border-color: var(--amber); color: var(--amber); }

/* Lightbox centrée — "aspirée" depuis la card cliquée, avec rebond gélatineux à l'arrivée */
#planningDetailSheet {
  position: fixed; top: 50%; left: 50%; bottom: auto; right: auto;
  width: min(340px, calc(100vw - 48px));
  max-height: 80vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--teal-border); border-radius: 20px;
  padding-bottom: 16px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  --pd-dx: 0px; --pd-dy: 0px; --pd-origin-radius: 12px;
}
#planningDetailSheet.open {
  opacity: 1; pointer-events: all;
  animation: pd-fly-in .48s cubic-bezier(.25,.55,.35,1) forwards;
}
#planningDetailSheet .sheet-handle { display: none; }
#planningDetailSheet .sheet-title { color: var(--teal); }
#planningDetailSheet .pd-type { color: var(--teal-dim); }
#planningDetailSheet .pd-btn { border-color: var(--teal-border); color: var(--teal-dim); }
#planningDetailSheet .pd-btn.primary { border-color: var(--teal); background: var(--teal-faint); color: var(--teal); }
#planningDetailSheet .pd-btn:hover { border-color: var(--teal); color: var(--teal); }
#planningDetailSheet .chef-plate-icon-btn { border-color: var(--teal); background: var(--teal-faint); }
#planningDetailSheet .chef-plate-icon-btn svg { stroke: var(--teal); }
#planningDetailSheet .chef-plate-icon-btn:hover { border-color: var(--teal); }
#planningDetailSheet .chef-plate-icon-btn:hover svg { stroke: var(--teal); }

/* Lightbox détail publication (historique / programmée) — même famille visuelle teal que #planningDetailSheet */
#pubHistDetailSheet {
  position: fixed; top: 50%; left: 50%; bottom: auto; right: auto;
  width: min(340px, calc(100vw - 48px));
  max-height: 80vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--teal-border); border-radius: 20px;
  padding-bottom: 16px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  --pd-dx: 0px; --pd-dy: 0px; --pd-origin-radius: 12px;
}
#pubHistDetailSheet.open {
  opacity: 1; pointer-events: all;
  animation: pd-fly-in .48s cubic-bezier(.25,.55,.35,1) forwards;
}
#pubHistDetailSheet .sheet-handle { display: none; }
#pubHistDetailSheet .sheet-title { color: var(--teal); }
#pubHistDetailSheet .pd-type { color: var(--teal-dim); }
#pubHistDetailSheet .pd-btn { border-color: var(--teal-border); color: var(--teal-dim); }
#pubHistDetailSheet .pd-btn.primary { border-color: var(--teal); background: var(--teal-faint); color: var(--teal); }
#pubHistDetailSheet .pd-btn:hover { border-color: var(--teal); color: var(--teal); }
#pubHistDetailSheet .chef-plate-icon-btn { border-color: var(--teal); background: var(--teal-faint); }
#pubHistDetailSheet .chef-plate-icon-btn svg { stroke: var(--teal); }
#pubHistDetailSheet .chef-plate-icon-btn:hover { border-color: var(--teal); }
#pubHistDetailSheet .chef-plate-icon-btn:hover svg { stroke: var(--teal); }

/* "Aspirée" depuis la card d'origine (rectangle de la liste ou du calendrier, pas un rond) :
   grossit en voyageant vers le centre, s'étire légèrement vers le bas façon liquide,
   puis un rebond simple et rapide (un seul dépassement uniforme, sans écrasement/étirement). */
@keyframes pd-fly-in {
  0%   { transform: translate(calc(-50% + var(--pd-dx)), calc(-50% + var(--pd-dy))) scale(.1, .1); border-radius: var(--pd-origin-radius); filter: blur(4px); opacity: .5; }
  30%  { transform: translate(calc(-50% + var(--pd-dx)*0.4), calc(-50% + var(--pd-dy)*0.4)) scale(.45, .45); border-radius: 16px; filter: blur(2px); opacity: 1; }
  55%  { transform: translate(calc(-50% + var(--pd-dx)*0.05), calc(-50% + var(--pd-dy)*0.05 + 10px)) scale(.92, 1.1); border-radius: 20px; filter: blur(0); }
  78%  { transform: translate(-50%, -50%) scale(1.05, 1.05); border-radius: 20px; }
  100% { transform: translate(-50%, -50%) scale(1, 1); border-radius: 20px; }
}

.biblio-picker-panel { max-width: 420px; }
@media (min-width: 600px) {
  .biblio-picker-panel { max-width: 640px; }
}
.biblio-filter-tab { flex: 1; padding: 8px 4px; border-radius: 8px; border: 1px solid var(--teal-border); background: transparent; color: var(--teal-dim); font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; text-align: center; }
.biblio-filter-tab.active { background: var(--teal-faint); color: var(--teal); border-color: var(--teal); }
.biblio-picker-page { grid-template-columns: repeat(3, 1fr) !important; flex: 0 0 33.3333%; align-content: flex-start; overflow-y: auto; -webkit-user-select: none; user-select: none; }

/* ── BIBLIOTHÈQUE GÉNÉRALE — pagination glissable ── */
.lib-page-viewport { overflow: hidden; position: relative; touch-action: pan-y; }
.lib-page-track { display: flex; width: 300%; transform: translateX(-33.3333%); }
.lib-page-slot { flex: 0 0 33.3333%; -webkit-user-select: none; user-select: none; }

/* ── BOUTON "+ IDÉE PERSO" ── */
.custom-post-btn {
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  font-family: 'Quicksand', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--teal-border); background: var(--teal-faint); color: var(--teal);
  transition: opacity .2s;
}
.custom-post-btn:hover { opacity: .85; }

/* ── SHEET POST PERSONNALISÉ (chat IA) ── */
#customPostSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); max-height: 88vh; overflow-y: auto; }
#customPostSheet .sheet-handle { background: var(--teal-border); }
#customPostSheet .sheet-title { color: var(--teal); }

/* Variante "carte flottante" (ouverte depuis une card actualité) — même famille que #planningDetailSheet/#plateSheet :
   part de la forme de la card cliquée, grossit vers le centre avec un léger rebond à l'arrivée. */
#customPostSheet.cp-popup {
  top: 50%; left: 50%; bottom: auto; right: auto;
  width: min(480px, calc(100vw - 24px));
  max-height: 80vh;
  border: 1px solid var(--teal-border); border-radius: 20px;
  padding-bottom: 16px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  --pd-dx: 0px; --pd-dy: 0px; --pd-origin-radius: 12px;
}
#customPostSheet.cp-popup.open {
  opacity: 1; pointer-events: all;
  animation: pd-fly-in .48s cubic-bezier(.25,.55,.35,1) forwards;
}
#customPostSheet.cp-popup .sheet-handle { display: none; }
.cp-networks-sub { text-align: center; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-dim); padding: 0 24px 10px; }
.cp-networks-row { display: flex; justify-content: center; gap: 10px; padding: 0 24px 8px; }
.cp-network-chip {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; cursor: pointer;
  font-family: 'Quicksand', sans-serif; font-size: 11px; letter-spacing: .04em; color: var(--white-dim);
  border: 1px solid var(--surface-card-border); background: var(--surface-card); transition: border-color .2s, color .2s;
}
.cp-network-chip input { accent-color: var(--teal); }
.cp-network-chip:has(input:checked) { border-color: var(--teal); color: var(--teal); }
#cp-chat-area { display: flex; flex-direction: column; gap: 10px; padding: 8px 24px; max-height: 40vh; overflow-y: auto; }
#cp-chat-area .da-avatar { background: linear-gradient(135deg, var(--teal), #1f5e58); }
#cp-chat-area .da-avatar.fabio-avatar,
#sc-chat-area .da-avatar.fabio-avatar {
  background: none; overflow: hidden; font-size: 0;
}
#cp-chat-area .da-avatar.fabio-avatar img,
#sc-chat-area .da-avatar.fabio-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.cp-user-bubble {
  align-self: flex-end; max-width: 85%; background: var(--teal-faint); border: 0.5px solid var(--teal-border);
  border-radius: 14px 14px 4px 14px; padding: 10px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; line-height: 1.5; color: var(--white);
}
#customPostSheet .da-input-row { padding: 8px 24px; }
#cp-proposal-card { padding-bottom: 4px; }
#customPostSheet .pd-btn { border-color: var(--teal-border); color: var(--teal-dim); }
#customPostSheet .pd-btn.primary { border-color: var(--teal); background: var(--teal-faint); color: var(--teal); }
#customPostSheet .pd-btn:hover { border-color: var(--teal); color: var(--teal); }
#customPostSheet .pd-btn-draft { border-color: var(--amber-border); color: var(--amber-dim); }
#customPostSheet .pd-btn-draft:hover { border-color: var(--amber); color: var(--amber); }
#customPostSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#customPostSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }

/* ── SHEET AFFINAGE STRATÉGIE (chat IA) ── */
#strategieChatSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); max-height: 85vh; overflow-y: auto; }
#strategieChatSheet .sheet-handle { background: var(--teal-border); }
#strategieChatSheet .sheet-title { color: var(--teal); }
#sc-chat-area { display: flex; flex-direction: column; gap: 10px; padding: 8px 24px; max-height: 45vh; overflow-y: auto; }
#sc-chat-area .da-avatar { background: linear-gradient(135deg, var(--teal), #1f5e58); }
#strategieChatSheet .da-input-row { padding: 8px 24px; }
#sc-proposal-card { padding-bottom: 4px; }
.sc-prop-titre { font-family: 'Cormorant Garamond', serif; font-size: 16px; font-weight: 600; color: var(--teal); padding: 12px 24px 4px; }
.sc-prop-objectif { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--white-dim); line-height: 1.5; padding: 0 24px 8px; }
.sc-prop-tone { font-family: 'DM Sans', sans-serif; font-size: 11px; font-style: italic; color: var(--teal-dim); padding: 0 24px 12px; }
#strategieChatSheet .pd-btn { border-color: var(--teal-border); color: var(--teal-dim); }
#strategieChatSheet .pd-btn.primary { border-color: var(--teal); background: var(--teal-faint); color: var(--teal); }
#strategieChatSheet .pd-btn:hover { border-color: var(--teal); color: var(--teal); }
#strategieChatSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#strategieChatSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }

/* ── SHEET BILAN MENSUEL FABIO ── */
#fabioRecapSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#fabioRecapSheet .sheet-handle { background: var(--teal-border); }
#fabioRecapSheet .sheet-title { color: var(--teal); }
#fabioRecapSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#fabioRecapSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }
.sc-chips-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 24px 10px; }
.sc-chip {
  padding: 7px 13px; border-radius: 20px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 12px; line-height: 1.3;
  border: 1px solid var(--teal-border); background: var(--surface-card);
  color: var(--white-dim); transition: border-color .15s, color .15s;
}
.sc-chip:hover { border-color: var(--teal); color: var(--teal); }
.sc-chip.selected { background: var(--teal-faint); border-color: var(--teal); color: var(--teal); }

/* ── ROI — CAFÉ OFFERT ── */
.roi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.roi-card { background: var(--surface-card); border: 0.5px solid var(--surface-card-border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.roi-numero { font-family: 'Cormorant Garamond', serif; font-size: 40px; font-weight: 400; color: var(--amber); line-height: 1; }
.roi-label { font-family: 'Quicksand', sans-serif; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--white-dim); }
.roi-sublabel { font-family: 'Quicksand', sans-serif; font-size: 8px; color: var(--amber-dim); letter-spacing: .06em; }
.cafe-servi-btn { width: 100%; padding: 16px; border-radius: 14px; border: none; cursor: pointer; background: linear-gradient(135deg, var(--amber), #e6a830); color: #1a2625; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; transition: opacity .2s, transform .1s; }
.cafe-servi-btn:active { transform: scale(0.97); opacity: .9; }
.cafe-servi-btn:disabled { opacity: .6; cursor: default; }
.panier-row { background: var(--surface-card); border: 0.5px solid var(--surface-card-border); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.panier-label { flex: 1; font-family: 'Quicksand', sans-serif; font-size: 10px; color: var(--white-dim); letter-spacing: .06em; }
.panier-input { width: 72px; background: rgba(255,255,255,.06); border: 1px solid var(--amber-border); color: var(--amber); font-family: 'Quicksand', sans-serif; font-size: 14px; font-weight: 700; padding: 6px 10px; border-radius: 8px; text-align: center; -webkit-appearance: none; }
.panier-eur { font-family: 'Quicksand', sans-serif; font-size: 12px; color: var(--amber-dim); }

/* ── PLAN & QUOTAS ── */
.plan-badge {
  display: inline-block; font-family: 'Quicksand', sans-serif; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; color: #1a2625;
  background: var(--amber); border-radius: 20px; padding: 3px 10px;
  font-weight: 700; margin-bottom: 14px;
}
.quota-section { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.quota-row { display: flex; flex-direction: column; gap: 4px; width: 70%; margin: 0 auto; }
.quota-info { display: flex; justify-content: space-between; align-items: center;
  font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .07em; }
.quota-lbl { color: var(--white-dim); }
.quota-val { color: var(--amber); }
.quota-bar-track { height: 5px; border-radius: 99px; background: rgba(90,130,125,.2); overflow: hidden; }
.quota-bar-fill  { height: 100%; border-radius: 99px; background: var(--amber);
  transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ── CARROUSEL "DÉJÀ PUBLIÉS" ── */
.pub-carousel { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pub-carousel::-webkit-scrollbar { display: none; }
.pub-carousel-item { flex: 0 0 auto; width: 110px; }
.pub-carousel-thumb { width: 110px; height: 110px; border-radius: 12px; overflow: hidden; background: var(--bg2); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.pub-carousel-thumb img, .pub-carousel-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-carousel-info { padding: 6px 2px 0; }
.pub-carousel-name { font-size: 12px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-carousel-meta { font-family: 'Quicksand', sans-serif; font-size: 8px; color: rgba(255,255,255,.35); letter-spacing: .06em; margin-top: 2px; }

/* ── BOTTOM SHEET PUBLICATION ── */
.pub-network-btn { display: flex; align-items: center; gap: 14px; padding: 14px 28px; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; transition: background .15s; }
.pub-network-btn:active { background: rgba(232,170,67,.05); }
.pub-network-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pub-network-icon.ig { background: linear-gradient(135deg, rgba(193,53,132,.2), rgba(253,193,104,.1)); }
.pub-network-icon.tk { background: rgba(255,255,255,.07); }
.pub-network-icon.fb { background: rgba(24,119,242,.12); }
.pub-network-label { font-size: 14px; font-weight: 700; color: var(--white); }
.pub-network-sub { font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .08em; color: var(--white-dim); text-transform: uppercase; margin-top: 2px; }
.legende-preview { display: block; width: 100%; box-sizing: border-box; margin: 0 16px; padding: 12px 14px; background: rgba(255,255,255,.04); border: 1px solid var(--amber-border); border-radius: 12px; font-size: 13px; line-height: 1.65; color: var(--white); height: 220px; resize: none; overflow-y: scroll; -webkit-overflow-scrolling: touch; font-family: 'DM Sans', sans-serif; white-space: pre-wrap; outline: none; }
.legende-preview.loading { height: 220px; background: linear-gradient(90deg, var(--bg2) 25%, rgba(46,31,10,.6) 50%, var(--bg2) 75%); background-size: 200% 100%; animation: shimmer 2s infinite linear; border: none; pointer-events: none; color: transparent; }
.pub-actions-row { display: flex; gap: 8px; padding: 8px 16px 0; }
.pub-copy-btn { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--amber-border); background: var(--amber-faint); color: var(--amber); font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: border-color .2s; }
.pub-copy-btn:hover { border-color: var(--amber); }
.pub-copy-btn:disabled { opacity: .4; cursor: default; }
.pub-open-btn { flex: 2; padding: 12px; border-radius: 10px; border: none; cursor: pointer; font-family: 'Quicksand', sans-serif; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pub-open-btn:disabled { opacity: .4; cursor: default; }
.pub-open-btn.ig { background: linear-gradient(135deg, rgba(193,53,132,.25), rgba(253,193,104,.15)); color: rgba(253,150,80,.9); }
.pub-open-btn.tk { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.pub-open-btn.fb { background: rgba(24,119,242,.15); color: rgba(100,160,242,.9); }
.cafe-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 0.5px solid var(--amber-border); margin-top: 4px; }
.cafe-toggle-label { font-family: 'Quicksand', sans-serif; font-size: 10px; letter-spacing: .08em; color: var(--white-dim); }
.pub-ios-hint { font-family: 'Quicksand', sans-serif; font-size: 8px; color: var(--white-dim); letter-spacing: .06em; text-align: center; padding: 8px 20px 0; line-height: 1.7; }

#pubSheet { background: var(--bg2); border-top: 1px solid var(--teal-border); }
#pubSheet .sheet-handle { background: var(--teal-border); }
#pubSheet .sheet-title { color: var(--teal); }
#pubSheet .sheet-sep { background: var(--teal-border); }
#pubSheet .pub-network-btn:active { background: var(--teal-faint); }
#pubSheet .sheet-cancel { border-color: var(--teal-border); color: var(--teal-dim); }
#pubSheet .sheet-cancel:hover { color: var(--teal); border-color: var(--teal); }
#pubSheet .legende-preview { border-color: var(--teal-border); }
#pubSheet .pub-copy-btn { border-color: var(--teal-border); background: var(--teal-faint); color: var(--teal); }
#pubSheet .pub-copy-btn:hover { border-color: var(--teal); }

/* ── RESPONSIVE DESKTOP ── */
@media (min-width: 600px) {
  /* Le noir autour de la colonne est habillé par la photo du chef. Cadrée au centre, ses bras
     s'ouvrent de part et d'autre de l'app quelle que soit la taille de la fenêtre ; un voile
     sombre la ramène au rang de décor, et l'ombre portée de #page-main (plus bas) achève de
     détacher la colonne. Sur mobile la colonne occupe tout l'écran : rien à habiller.
     Le fond n'est posé que sur body — le mettre aussi sur html superposerait deux fois le
     voile et assombrirait la photo d'autant. La couleur reste en dernier plan du raccourci,
     donc en repli si l'image ne charge pas. */
  html { background: #030201; }
  body {
    background:
      linear-gradient(rgba(3,2,1,.52), rgba(3,2,1,.52)),
      url('/Images/Fond_Site_web.jpg') center/cover no-repeat #030201;
  }

  /* Tous les éléments fixed contraints à une colonne centrée (max 860px, jamais > viewport) */
  #page-auth,
  #page-main,
  #global-header,
  .bottom-sheet,
  .sheet-overlay,
  #resume-banner {
    width: min(860px, 100vw) !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Lightbox planning : reste une vraie boîte centrée (pas la colonne pleine largeur
     du bottom-sheet ci-dessus), sinon le translate(-50%) part d'un mauvais repère */
  #planningDetailSheet,
  #pubHistDetailSheet {
    width: min(340px, calc(100vw - 48px)) !important;
    max-width: min(340px, calc(100vw - 48px)) !important;
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #customPostSheet.cp-popup {
    width: min(480px, calc(100vw - 24px)) !important;
    max-width: min(480px, calc(100vw - 24px)) !important;
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Debug panel — même centrage mais sans écraser son transform (slide Y) */
  #debug-panel {
    width: min(860px, 100vw) !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Debug toggle — collé au bord droit de la colonne */
  #debug-toggle {
    left: auto !important;
    right: max(0px, calc(50% - min(430px, 50vw))) !important;
    width: auto !important;
  }

  /* Volet de publication : sans ça #insta-scroll-body (flex:1 en style inline) absorbait toute
     la hauteur libre. L'aperçu restant calé en haut, la pastille de conseil d'heure et les
     boutons — qui sont ses frères suivants — se retrouvaient seuls tout en bas de l'écran,
     séparés du post par un grand vide. flex:0 1 auto ramène le corps à la hauteur de son
     contenu et regroupe tout le volet sous l'en-tête ; min-height:0 lui laisse le droit de
     rétrécir et de défiler quand le contenu déborde (panneau TikTok déplié, fenêtre basse).
     Invisible sur mobile, où le corps est de toute façon saturé. */
  #insta-scroll-body { flex: 0 1 auto !important; min-height: 0; }

  /* Bibliothèque : grille 4×3 sur tablette + zone d'import compacte */
  .lib-grid { grid-template-columns: repeat(4, 1fr); }
  .lib-card { aspect-ratio: 4/3; }
  .lib-upload-zone { width: 18.75%; aspect-ratio: 4/3; }
  .lib-upload-zone .upload-icon { width: 45px; height: 45px; }
  .lib-upload-zone .upload-icon svg { width: 22px; height: 22px; }

  /* Délimitation subtile du "téléphone" sur fond sombre */
  #page-main {
    border-left: 0.5px solid rgba(232,170,67,0.08);
    border-right: 0.5px solid rgba(232,170,67,0.08);
    box-shadow: -30px 0 80px rgba(0,0,0,.7), 30px 0 80px rgba(0,0,0,.7);
  }
}

/* ══════════════════════════════════════════
   TUTORIEL SPOTLIGHT
   ══════════════════════════════════════════ */
#tut-overlay {
  position: fixed; inset: 0; z-index: 600;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  transition: opacity .3s;
}
#tut-overlay.active { opacity: 1; }
#tut-overlay.no-spot { background: rgba(5,3,1,.82); }

#tut-spotlight {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(5,3,1,.82);
  transition: top .35s cubic-bezier(.4,0,.2,1),
              left .35s cubic-bezier(.4,0,.2,1),
              width .35s cubic-bezier(.4,0,.2,1),
              height .35s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  outline: 1.5px solid rgba(232,170,67,.4);
  outline-offset: 3px;
}
#tut-overlay.no-spot #tut-spotlight { box-shadow: none; outline: none; }

#tut-bubble {
  position: fixed;
  z-index: 610;
  width: calc(100% - 32px);
  max-width: 360px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--amber-border);
  border-radius: 18px;
  padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  max-height: calc(75vh - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
#tut-bubble.active { opacity: 1; pointer-events: all; }

#tut-step-counter {
  display: flex; align-items: center; justify-content: space-between;
}
#tut-step-dots { display: none; }
.tut-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--amber-border);
  transition: background .2s, transform .2s;
}
.tut-dot.active { background: var(--amber); transform: scale(1.4); }
#tut-step-label {
  font-family: 'Quicksand', sans-serif;
  font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--amber-dim);
}

#tut-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px; font-weight: 400;
  color: var(--white); line-height: 1.25;
}
#tut-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: var(--white-dim); line-height: 1.55;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  flex: 1; min-height: 0;
}

#tut-actions {
  display: flex; gap: 10px;
  align-items: center; justify-content: flex-end;
  margin-top: 4px;
  flex-shrink: 0;
}
#tut-skip {
  background: transparent; border: none;
  font-family: 'Quicksand', sans-serif; font-size: 9px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--white-dim); cursor: pointer; padding: 8px 4px;
}
#tut-next {
  background: var(--amber); color: #1a2625;
  border: none; border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 11px 22px; cursor: pointer;
  min-width: 110px; text-align: center;
  transition: opacity .2s;
}
#tut-next:active { opacity: .8; }

#tut-bubble::before {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  border: 7px solid transparent;
  display: none;
}
#tut-bubble.arrow-down::before {
  display: block; bottom: -14px;
  border-top-color: var(--amber-border);
}
#tut-bubble.arrow-up::before {
  display: block; top: -14px;
  border-bottom-color: var(--amber-border);
}

/* Mode interactif : bulle avec contour ambré */
#tut-bubble.interactive {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-border), 0 8px 32px rgba(0,0,0,.75);
}

/* Dot cliquable (retour arrière) */
#tut-step-dots .tut-dot[title] {
  opacity: .55;
  transition: opacity .2s;
}
#tut-step-dots .tut-dot[title]:hover { opacity: 1; }

/* Pulse sur les éléments cibles interactifs */
.tut-pulse {
  animation: tut-pulse-ring 1.4s ease-out infinite !important;
  position: relative;
}
@keyframes tut-pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(232,170,67,.75); }
  70%  { box-shadow: 0 0 0 14px rgba(232,170,67,0); }
  100% { box-shadow: 0 0 0 0   rgba(232,170,67,0); }
}

/* ── ONBOARDING FABIO ── */
#onb-welcome-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(5,3,1,.88); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
#onb-welcome-overlay.active { display: flex; }
#onb-welcome-card {
  background: var(--bg2); border: 1px solid var(--amber-border);
  border-radius: 22px; padding: 36px 28px 28px;
  max-width: 340px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,.7);
  animation: fadeSlideIn .4s ease both;
}
#onb-welcome-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid var(--amber-border);
  overflow: hidden; flex-shrink: 0;
}
#onb-welcome-avatar img { width: 100%; height: 100%; object-fit: cover; }
#onb-welcome-speech {
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  color: rgba(255,255,255,.9); line-height: 1.65;
}
#onb-welcome-speech strong { color: var(--amber); font-weight: 600; }
#onb-welcome-btn {
  width: 100%; padding: 13px 24px; border-radius: 12px; border: none;
  background: var(--amber); color: #1a2625;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity .2s;
}
#onb-welcome-btn:active { opacity: .8; }

/* Fabio dans la tut-bubble */
#tut-fabio-row {
  display: flex; align-items: center; gap: 9px; margin-bottom: 2px;
}
#tut-fabio-img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--amber-border); flex-shrink: 0;
}
@media (max-width: 768px) {
  #tut-fabio-img { width: 50px; height: 50px; }
  #onb-welcome-avatar { width: 50px; height: 50px; }
  #cmo-fabio-header img { width: 50px; height: 50px; }
}
#tut-fabio-label {
  font-family: 'Quicksand', sans-serif; font-size: 18px;
  letter-spacing: .12em; text-transform: uppercase; color: #ffffff;
}

/* Sur les étapes page compte : l'overlay s'arrête au-dessus du nav */
body.onb-nav-visible #tut-overlay {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* Bouton "Créer ma stratégie réseaux" (onboarding only) */
#onb-create-strategy-btn {
  background: var(--teal); color: #0d2220;
  border: none; border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  padding: 11px 20px; cursor: pointer; transition: opacity .2s;
  width: 100%;
}
#onb-create-strategy-btn:active { opacity: .8; }

