/* =========================================================================
   SPHÈRESAVE v33.4 — SOCLE DE DESIGN (lot 1)
   Fichier : assets/css/socle-v334.css — chargé EN DERNIER par index.html.
   Les réglages communs vivent ici : changer une valeur ici la change partout.
   ========================================================================= */
:root {
 --ss-touch: 48px;          /* taille minimale d'une cible au doigt */
 --ss-text-min: 13px;       /* plus petit texte lisible autorisé */
 --ss-radius: 16px;
 --ss-surface: #0f172a;
 --ss-border: rgba(255, 255, 255, 0.14);
 --ss-muted: #94a3b8;
}

/* Barre basse mobile : les 4 pôles, lisibles et faciles à toucher */
#fs-mobile-bottom-nav { min-height: 62px; gap: 2px; }
/* La barre reste sombre et lisible même sur les pages à fond clair (Organisation, Le Bon Coin Famille) */
#fs-mobile-bottom-nav, body.fs-light-section #fs-mobile-bottom-nav { background: rgba(2, 6, 23, 0.95) !important; border-top-color: rgba(255, 255, 255, 0.15) !important; }
body.fs-light-section #fs-mobile-bottom-nav .fs-mnav-btn:not(.is-active) { color: #cbd5e1 !important; }
#fs-mobile-bottom-nav .fs-mnav-btn {
 min-height: var(--ss-touch);
 font-size: 12px;
 gap: 4px;
 color: #cbd5e1;
}
#fs-mobile-bottom-nav .fs-mnav-btn span { font-size: 12px; line-height: 1.15; }
#fs-mobile-bottom-nav .fs-mnav-btn i { font-size: 19px; }
#fs-mobile-bottom-nav .fs-mnav-btn.is-active {
 color: #fff;
 background: color-mix(in srgb, var(--color-primary, #e13b84) 22%, transparent);
 border-color: color-mix(in srgb, var(--color-primary, #e13b84) 55%, transparent);
}
#fs-mobile-bottom-nav .fs-mnav-btn.is-active i { color: var(--color-primary, #e13b84); }
#fs-mobile-bottom-nav .fs-mnav-btn:focus-visible { outline: 2px solid var(--color-primary, #e13b84); outline-offset: 2px; }

@media (max-width: 767px) {
 #fs-mobile-bottom-nav { display: flex; align-items: center; justify-content: space-around; }
 #fs-mobile-bottom-nav .fs-mnav-btn { flex: 1 1 0; min-width: 0; }
}

/* Bouton « + » au-dessus de la barre basse agrandie */
@media (max-width: 767px) {
 #fs-mobile-fab { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

/* Menu latéral (ordinateur et tiroir mobile) : rubriques faciles à toucher et à lire */
#nav-menu button[data-view] { min-height: 44px; font-size: 14px; }
#nav-menu summary { min-height: 44px; font-size: 13px; }
#nav-menu button[data-view]:focus-visible,
#nav-menu summary:focus-visible { outline: 2px solid var(--color-primary, #e13b84); outline-offset: 1px; }

/* =========================================================================
   LOT 1 — ÉTAPE 3 : INTÉRIEUR DES PAGES (lisibilité et confort au doigt)
   ========================================================================= */

/* 1. Textes trop petits : 9-10 px -> 12 px, 11 px -> 13 px (hors étiquettes dessinées sur les boîtes 3D) */
#main-view :is(.text-\[9px\], .text-\[10px\]):not(:where(.fs-box-3d *, .fs-box-face *)),
.fixed.inset-0 :is(.text-\[9px\], .text-\[10px\]) { font-size: 12px !important; line-height: 1.35; }
#main-view .text-\[11px\]:not(:where(.fs-box-3d *, .fs-box-face *)),
.fixed.inset-0 .text-\[11px\] { font-size: 13px !important; line-height: 1.4; }

/* 2. Écrans tactiles et petits écrans : boutons et champs d'au moins 44 px,
      sauf dans la scène 3D des boîtes (le dessin n'est pas déformé) */
@media (max-width: 1024px), (pointer: coarse) {
 #main-view :is(button, select, [role="tab"], a.inline-flex, a.flex):not(:where(.fs-oak-cabinet-3d-scene *, .fs-box-item *, .fs-stacked-3d-unit *, .fs-box-3d *, .fs-parchment-wrap *)):not([class*="w-5 "], [class*="w-6 "], [class*="w-7 "], [class*="w-8 "], [class*="w-9 "]),
 .fixed.inset-0 :is(button, select):not([class*="w-5 "], [class*="w-6 "], [class*="w-7 "], [class*="w-8 "], [class*="w-9 "]) {
  min-height: 44px;
 }
 #main-view :is(input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="date"], input[type="tel"], input[type="password"]),
 .fixed.inset-0 :is(input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="date"], input[type="tel"], input[type="password"]) {
  min-height: 44px;
 }

 /* 3. Petits boutons ronds/carrés et commandes des boîtes 3D :
       même apparence, mais zone de toucher invisible agrandie autour */
 #main-view :is(button, [role="button"]):is([class*="w-5 "], [class*="w-6 "], [class*="w-7 "], [class*="w-8 "], [class*="w-9 "]):not([class*="absolute"]):not([class*="fixed"]),
 .fs-parchment-wrap button,
 .fs-sticker-pill { position: relative; }
 #main-view :is(button, [role="button"]):is([class*="w-5 "], [class*="w-6 "], [class*="w-7 "], [class*="w-8 "], [class*="w-9 "])::after,
 .fs-parchment-wrap button::after,
 .fs-sticker-pill::after,
 .fs-box-select-check::after {
  content: "";
  position: absolute;
  inset: -9px;
 }
}

/* 4. Bandeau « Mode démo » : une fine barre en haut, qui ne recouvre plus le titre */
@media (max-width: 767px) {
 #fs-demo-banner {
  top: 0 !important; left: 0 !important; right: 0 !important; transform: none !important;
  border-radius: 0 !important; justify-content: space-between; padding: 6px 12px !important;
  font-size: 12px !important; white-space: nowrap;
 }
 #fs-demo-banner > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
 #fs-demo-banner button { min-height: 32px; flex-shrink: 0; }
}

/* =========================================================================
   v33.7 — CORRECTIONS VUES SUR TÉLÉPHONE (captures du 28/11)
   ========================================================================= */

/* A. Pages claires (Organisation, Le Bon Coin Famille) : textes pâles conçus pour le fond sombre -> foncés */
body.fs-light-section #main-view :is(.text-sky-100, .text-sky-200, .text-sky-300, .text-sky-400) { color: #0369a1 !important; }
body.fs-light-section #main-view :is(.text-amber-100, .text-amber-200, .text-amber-300, .text-amber-400) { color: #b45309 !important; }
body.fs-light-section #main-view :is(.text-emerald-100, .text-emerald-200, .text-emerald-300, .text-emerald-400) { color: #047857 !important; }
body.fs-light-section #main-view :is(.text-rose-100, .text-rose-200, .text-rose-300, .text-rose-400) { color: #be123c !important; }
body.fs-light-section #main-view :is(.text-purple-100, .text-purple-200, .text-purple-300, .text-purple-400) { color: #7e22ce !important; }
body.fs-light-section #main-view :is(.text-violet-100, .text-violet-200, .text-violet-300, .text-violet-400) { color: #6d28d9 !important; }
body.fs-light-section #main-view :is(.text-indigo-100, .text-indigo-200, .text-indigo-300, .text-indigo-400) { color: #4338ca !important; }
body.fs-light-section #main-view :is(.text-pink-100, .text-pink-200, .text-pink-300, .text-pink-400) { color: #be185d !important; }
body.fs-light-section #main-view :is(.text-teal-100, .text-teal-200, .text-teal-300, .text-teal-400) { color: #0f766e !important; }
body.fs-light-section #main-view :is(.text-cyan-100, .text-cyan-200, .text-cyan-300, .text-cyan-400) { color: #0e7490 !important; }
body.fs-light-section #main-view :is(.text-blue-100, .text-blue-200, .text-blue-300, .text-blue-400) { color: #1d4ed8 !important; }
body.fs-light-section #main-view :is(.text-green-100, .text-green-200, .text-green-300, .text-green-400) { color: #15803d !important; }
body.fs-light-section #main-view :is(.text-red-100, .text-red-200, .text-red-300, .text-red-400) { color: #b91c1c !important; }
body.fs-light-section #main-view :is(.text-orange-100, .text-orange-200, .text-orange-300, .text-orange-400) { color: #c2410c !important; }
body.fs-light-section #main-view :is(.text-yellow-100, .text-yellow-200, .text-yellow-300, .text-yellow-400) { color: #a16207 !important; }
body.fs-light-section #main-view :is(.text-fuchsia-100, .text-fuchsia-200, .text-fuchsia-300, .text-fuchsia-400) { color: #a21caf !important; }
body.fs-light-section #main-view :is(.text-lime-100, .text-lime-200, .text-lime-300, .text-lime-400) { color: #4d7c0f !important; }
/* Un bouton coloré ou sombre garde son texte blanc (ex. filtre « Toutes », bouton « Publier ») */
body.fs-light-section #main-view .text-white:is([class*="bg-sky-5"], [class*="bg-sky-6"], [class*="bg-sky-7"], [class*="bg-sky-8"], [class*="bg-sky-9"], [class*="bg-amber-5"], [class*="bg-amber-6"], [class*="bg-amber-7"], [class*="bg-amber-8"], [class*="bg-amber-9"], [class*="bg-emerald-5"], [class*="bg-emerald-6"], [class*="bg-emerald-7"], [class*="bg-emerald-8"], [class*="bg-emerald-9"], [class*="bg-rose-5"], [class*="bg-rose-6"], [class*="bg-rose-7"], [class*="bg-rose-8"], [class*="bg-rose-9"], [class*="bg-purple-5"], [class*="bg-purple-6"], [class*="bg-purple-7"], [class*="bg-purple-8"], [class*="bg-purple-9"], [class*="bg-violet-5"], [class*="bg-violet-6"], [class*="bg-violet-7"], [class*="bg-violet-8"], [class*="bg-violet-9"], [class*="bg-indigo-5"], [class*="bg-indigo-6"], [class*="bg-indigo-7"], [class*="bg-indigo-8"], [class*="bg-indigo-9"], [class*="bg-pink-5"], [class*="bg-pink-6"], [class*="bg-pink-7"], [class*="bg-pink-8"], [class*="bg-pink-9"], [class*="bg-teal-5"], [class*="bg-teal-6"], [class*="bg-teal-7"], [class*="bg-teal-8"], [class*="bg-teal-9"], [class*="bg-cyan-5"], [class*="bg-cyan-6"], [class*="bg-cyan-7"], [class*="bg-cyan-8"], [class*="bg-cyan-9"], [class*="bg-blue-5"], [class*="bg-blue-6"], [class*="bg-blue-7"], [class*="bg-blue-8"], [class*="bg-blue-9"], [class*="bg-green-5"], [class*="bg-green-6"], [class*="bg-green-7"], [class*="bg-green-8"], [class*="bg-green-9"], [class*="bg-red-5"], [class*="bg-red-6"], [class*="bg-red-7"], [class*="bg-red-8"], [class*="bg-red-9"], [class*="bg-orange-5"], [class*="bg-orange-6"], [class*="bg-orange-7"], [class*="bg-orange-8"], [class*="bg-orange-9"], [class*="bg-yellow-5"], [class*="bg-yellow-6"], [class*="bg-yellow-7"], [class*="bg-yellow-8"], [class*="bg-yellow-9"], [class*="bg-fuchsia-5"], [class*="bg-fuchsia-6"], [class*="bg-fuchsia-7"], [class*="bg-fuchsia-8"], [class*="bg-fuchsia-9"], [class*="bg-lime-5"], [class*="bg-lime-6"], [class*="bg-lime-7"], [class*="bg-lime-8"], [class*="bg-lime-9"], [class*="bg-slate-9"], [class*="bg-slate-8"], [class*="bg-black"], [class*="bg-gradient"]) { color: #ffffff !important; }
body.fs-light-section #main-view .text-white:is([class*="bg-sky-5"], [class*="bg-sky-6"], [class*="bg-sky-7"], [class*="bg-sky-8"], [class*="bg-sky-9"], [class*="bg-amber-5"], [class*="bg-amber-6"], [class*="bg-amber-7"], [class*="bg-amber-8"], [class*="bg-amber-9"], [class*="bg-emerald-5"], [class*="bg-emerald-6"], [class*="bg-emerald-7"], [class*="bg-emerald-8"], [class*="bg-emerald-9"], [class*="bg-rose-5"], [class*="bg-rose-6"], [class*="bg-rose-7"], [class*="bg-rose-8"], [class*="bg-rose-9"], [class*="bg-purple-5"], [class*="bg-purple-6"], [class*="bg-purple-7"], [class*="bg-purple-8"], [class*="bg-purple-9"], [class*="bg-violet-5"], [class*="bg-violet-6"], [class*="bg-violet-7"], [class*="bg-violet-8"], [class*="bg-violet-9"], [class*="bg-indigo-5"], [class*="bg-indigo-6"], [class*="bg-indigo-7"], [class*="bg-indigo-8"], [class*="bg-indigo-9"], [class*="bg-pink-5"], [class*="bg-pink-6"], [class*="bg-pink-7"], [class*="bg-pink-8"], [class*="bg-pink-9"], [class*="bg-teal-5"], [class*="bg-teal-6"], [class*="bg-teal-7"], [class*="bg-teal-8"], [class*="bg-teal-9"], [class*="bg-cyan-5"], [class*="bg-cyan-6"], [class*="bg-cyan-7"], [class*="bg-cyan-8"], [class*="bg-cyan-9"], [class*="bg-blue-5"], [class*="bg-blue-6"], [class*="bg-blue-7"], [class*="bg-blue-8"], [class*="bg-blue-9"], [class*="bg-green-5"], [class*="bg-green-6"], [class*="bg-green-7"], [class*="bg-green-8"], [class*="bg-green-9"], [class*="bg-red-5"], [class*="bg-red-6"], [class*="bg-red-7"], [class*="bg-red-8"], [class*="bg-red-9"], [class*="bg-orange-5"], [class*="bg-orange-6"], [class*="bg-orange-7"], [class*="bg-orange-8"], [class*="bg-orange-9"], [class*="bg-yellow-5"], [class*="bg-yellow-6"], [class*="bg-yellow-7"], [class*="bg-yellow-8"], [class*="bg-yellow-9"], [class*="bg-fuchsia-5"], [class*="bg-fuchsia-6"], [class*="bg-fuchsia-7"], [class*="bg-fuchsia-8"], [class*="bg-fuchsia-9"], [class*="bg-lime-5"], [class*="bg-lime-6"], [class*="bg-lime-7"], [class*="bg-lime-8"], [class*="bg-lime-9"], [class*="bg-slate-9"], [class*="bg-slate-8"], [class*="bg-black"], [class*="bg-gradient"]) * { color: inherit; }
/* Boutons secondaires, listes et champs lisibles sur fond clair */
body.fs-light-section #main-view .btn-secondary { color: #0f172a !important; background: #ffffff !important; border: 1px solid #cbd5e1 !important; }
body.fs-light-section #main-view :is(select, input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="email"], textarea) {
 background-color: #ffffff !important; color: #0f172a !important; border-color: #94a3b8 !important;
}
body.fs-light-section #main-view select option { color: #0f172a; background: #ffffff; }
body.fs-light-section #main-view ::placeholder { color: #64748b !important; }

/* B. Bouton « ☰ FamilySave » : posé sur une bande sombre, le texte ne passe plus dessous */
@media (max-width: 767px) {
 .md\:hidden.fixed.top-3.left-3 {
  top: 0 !important; left: 0 !important; right: 0;
  padding: 8px 56px 8px 12px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.82));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
 }
 body:has(#fs-demo-banner) .md\:hidden.fixed.top-3.left-3 { top: 46px !important; }
 body:has(#fs-demo-banner) #app-body-shell { padding-top: 46px; }
 #main-view { padding-top: 68px !important; padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* C. Boutons flottants : cachés quand le menu, une fenêtre ou le clavier sont ouverts */
body.ss-drawer-open :is(#ss-page-switcher, #fs-mobile-fab, #ss-charter-icon),
body.ss-modal-open :is(#ss-page-switcher, #fs-mobile-fab, #ss-charter-icon) { display: none !important; }
@media (max-width: 767px) {
 body.ss-typing :is(#ss-page-switcher, #fs-mobile-fab) { display: none !important; }
}

/* D. Studio : les 7 onglets de l'atelier tiennent sur l'écran (2 lignes au lieu d'une ligne coupée) */
@media (max-width: 767px) {
 #atelier-ia-tabs { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
}

/* E. Bouton « Choisir un fichier » harmonisé */
#main-view input[type="file"] { font-size: 13px; color: #cbd5e1; max-width: 100%; }
#main-view input[type="file"]::file-selector-button {
 min-height: 44px; margin-right: 10px; padding: 0 14px; border-radius: 12px; cursor: pointer;
 border: 1px solid color-mix(in srgb, var(--color-primary, #e13b84) 55%, transparent);
 background: color-mix(in srgb, var(--color-primary, #e13b84) 22%, transparent);
 color: #ffffff; font: inherit; font-weight: 700;
}

/* F. Photo introuvable : un cadre neutre au lieu de l'icône cassée et du nom qui déborde */
img.ss-img-missing {
 content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%231e293b'/%3E%3Cpath d='M18 44l9-11 7 8 5-6 7 9z' fill='%23475569'/%3E%3Ccircle cx='40' cy='24' r='4' fill='%23475569'/%3E%3C/svg%3E");
 object-fit: cover; background: #1e293b; color: transparent;
}

/* G. Fiche d'un membre (téléphone) : toute la fiche défile d'un seul bloc,
      au lieu d'une petite fenêtre écrasée en bas de l'écran */
@media (max-width: 767px) {
 #mm-animated-body { min-height: 0; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
 #mm-left-sidebar { flex-shrink: 0; }
 #mm-left-sidebar > div { height: auto !important; }
 #mm-right-panel { flex-shrink: 0 !important; overflow: visible !important; height: auto !important; max-height: none !important; }
 /* Barre du haut de la fiche : icônes seules pour laisser la place */
 #member-modal .text-xs.font-heading.uppercase.truncate { display: none; }
 #mm-visibility-pill > span, #member-modal button[onclick^="openMemberForm"] > span { display: none; }
 #member-modal button[onclick^="openMemberForm"] { min-width: 44px; justify-content: center; }
}

/* H. Organisation : sous-titre « Passerelle… » trop pâle sur fond clair */
body.fs-light-section #main-view :is(.text-slate-100, .text-slate-200, .text-white\/20, .text-white\/30, .text-white\/40):not(:where([class*="bg-slate-9"], [class*="bg-slate-8"], [class*="bg-black"], [class*="bg-gradient"], #main-view [class*="bg-slate-9"] *, #main-view [class*="bg-slate-8"] *, #main-view [class*="bg-black"] *)) { color: #475569 !important; }

/* =========================================================================
   v33.9 — FICHE D'UN MEMBRE : LECTURE CLAIRE (voir app-fiche-v339.js)
   ========================================================================= */
#ss-fiche-age { font-size: 13px; color: #cbd5e1; text-align: center; font-weight: 600; }
#mm-index-counter.ss-hide-one { display: none !important; }
#mm-completion-box[data-ss-cta] { cursor: pointer; }

/* Barre de sections collante */
#ss-fiche-bar {
 position: sticky; top: 0; z-index: 25; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
 margin: -4px -4px 12px; padding: 8px 4px; background: rgba(2, 6, 23, 0.92);
 backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#ss-fiche-bar::-webkit-scrollbar { display: none; }
#ss-fiche-bar button {
 flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 9999px; font-size: 13px; font-weight: 700;
 border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: #cbd5e1; white-space: nowrap;
}
#ss-fiche-bar .ss-fb-name { color: #fff; background: transparent; border-color: transparent; padding-left: 6px; }
#ss-fiche-bar .ss-fb-chip.is-active {
 color: #fff; background: color-mix(in srgb, var(--color-primary, #e13b84) 30%, transparent);
 border-color: color-mix(in srgb, var(--color-primary, #e13b84) 65%, transparent);
}

/* Sections : titres plus calmes, repli, chevron */
#mm-modules-container .mm-drag-handle { cursor: pointer !important; min-height: 48px; }
#mm-modules-container .mm-drag-handle :is(span, div) { text-transform: none; letter-spacing: 0; }
#mm-modules-container .mm-drag-handle > span, #mm-modules-container .mm-drag-handle > div:first-child { font-size: 15px !important; }
#mm-modules-container .mm-drag-handle .fa-grip-vertical { display: none; }
.ss-mod-chev { margin-left: 8px; color: #94a3b8; transition: transform .2s ease; }
.ss-collapsed .ss-mod-chev { transform: rotate(-90deg); }
.mm-draggable-module.ss-collapsed > :not(.mm-drag-handle) { display: none !important; }
.mm-draggable-module.ss-collapsed > .mm-drag-handle { border-bottom: 0; }
body:not(.ss-mm-reorder) #mm-modules-container .mm-move-btn { display: none !important; }
body.ss-mm-reorder #mm-modules-container .mm-move-btn { display: inline-flex !important; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
body.ss-mm-reorder #mm-modules-container .mm-drag-handle .fa-grip-vertical { display: inline-block; }

/* Cases : libellé discret, valeur lisible, une seule couleur de fond */
#mm-modules-container .mm-cell { background: rgba(255, 255, 255, 0.04) !important; border-color: rgba(255, 255, 255, 0.09) !important; }
#mm-modules-container .mm-cell > :first-child { text-transform: none !important; letter-spacing: 0 !important; font-size: 12px !important; font-weight: 600 !important; color: #94a3b8 !important; }
#mm-modules-container .mm-cell > :first-child i { color: inherit; }
#mm-modules-container .mm-cell > :nth-child(n+2) { font-family: inherit !important; font-size: 15px; }
#mm-modules-container .font-mono { font-family: inherit !important; letter-spacing: 0 !important; }

/* Champs vides cachés, bouton pour les compléter */
#mm-modules-container .mm-cell.ss-empty { display: none !important; }
#mm-modules-container .mm-draggable-module.ss-all-empty .mm-flex-cells:empty,
#mm-modules-container .mm-draggable-module.ss-all-empty .mm-flex-cells:not(:has(.mm-cell:not(.ss-empty))) { display: none; }
.ss-fill-more {
 display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 16px); margin: 8px;
 min-height: 44px; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, 0.22); background: transparent;
 color: #cbd5e1; font-size: 13px; font-weight: 700;
}
.ss-fill-more i { color: var(--color-primary, #e13b84); }

/* Téléphone : l'« Infos rapides » fait doublon avec le Résumé ; barre d'actions en bas */
#ss-fiche-actions { display: none; }
@media (max-width: 767px) {
 #member-modal #mm-quick-attrs-list { display: none; }
 #member-modal div:has(> div > #btn-config-quick-attrs) { display: none !important; }
 #mm-sidebar-photo-slot { max-height: 96px; }
 #ss-fiche-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex-shrink: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(0, 0, 0, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
 }
 #ss-fiche-actions button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0; font-size: 12px; font-weight: 700;
 }
 #ss-fiche-actions button i { color: var(--color-primary, #e13b84); font-size: 16px; }
}

/* =========================================================================
   v33.9 — MODES D'AFFICHAGE DE LA BOÎTE (voir app-box-modes-v339.js)
   ========================================================================= */
#ss-box-modes {
 position: absolute; left: 12px; right: 12px; z-index: 35; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
 justify-content: flex-start;
}
#ss-box-modes::-webkit-scrollbar { display: none; }
#ss-box-modes button {
 flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 9999px;
 border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: #cbd5e1; font-size: 13px; font-weight: 700;
}
#ss-box-modes button.is-active { color: #111; background: #f59e0b; border-color: #f59e0b; }
#ss-box-stage { position: absolute; left: 0; right: 0; z-index: 20; overflow: hidden; }
#ss-box-stage[hidden] { display: none; }
.ss-mode-hint { position: absolute; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; font-size: 12px; color: #94a3b8; pointer-events: none; }

/* Ouverture : couvercle + envol */
.ss-box-lid { position: absolute; left: 50%; top: 50%; width: 140px; height: 110px; margin: -55px 0 0 -70px; z-index: 60; pointer-events: none; perspective: 500px; animation: ssLidFade 1s ease forwards; }
.ss-box-lid-body { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; border-radius: 10px; background: linear-gradient(160deg, #7c4a1e, #4a2a10); box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.ss-box-lid-top { position: absolute; left: -6px; right: -6px; top: 18px; height: 26px; border-radius: 8px; background: linear-gradient(160deg, #a0632a, #6b3d16); transform-origin: 50% 100%; animation: ssLidOpen .6s ease-out forwards; z-index: 2; }
@keyframes ssLidOpen { to { transform: rotateX(110deg) translateY(-30px); opacity: .2; } }
@keyframes ssLidFade { 0%, 55% { opacity: 1; } 100% { opacity: 0; transform: scale(.7); } }
.ss-fly { animation: ssFly .55s cubic-bezier(.2,.8,.25,1.15) both; }
@keyframes ssFly { from { opacity: 0; scale: .2; translate: 0 40px; } to { opacity: 1; scale: 1; translate: 0 0; } }
.ss-orbit-pop { animation: ssOrbitPop .55s cubic-bezier(.2,.8,.25,1.15) both; }
@keyframes ssOrbitPop { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .ss-fly, .ss-orbit-pop, .ss-box-lid, .ss-lcard { animation: none !important; } }

/* Mode Table */
.ss-table-surface {
 position: absolute; inset: 0 8px 22px; border-radius: 18px; overflow: hidden; touch-action: none;
 background: radial-gradient(ellipse at 50% 40%, rgba(255,220,170,.18), transparent 65%),
  repeating-linear-gradient(90deg, #5b3a1f 0 3px, #6b4426 3px 46px, #63401f 46px 49px, #70482a 49px 96px), #5f3d21;
 box-shadow: inset 0 0 80px rgba(0,0,0,.55);
}
.ss-tcard { position: absolute; width: clamp(110px, 30vw, 170px); aspect-ratio: 4 / 5; transform: rotate(var(--r)); cursor: grab; touch-action: none; perspective: 900px; }
.ss-tcard.is-dragging { cursor: grabbing; transform: rotate(var(--r)) scale(1.06); }
.ss-tcard-inner { position: relative; width: 100%; height: 100%; transition: transform .5s ease; transform-style: preserve-3d; }
.ss-tcard.is-flipped .ss-tcard-inner { transform: rotateY(180deg); }
.ss-tcard-front, .ss-tcard-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4px; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.ss-tcard-front { background: #f8f7f4; padding: 7px 7px 26px; }
.ss-tcard-front img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.ss-tcard-front span { position: absolute; left: 6px; right: 6px; bottom: 5px; font-size: 11px; color: #334155; text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-tcard-back { transform: rotateY(180deg); background: #efe6d2; padding: 10px; display: flex; flex-direction: column; gap: 6px; overflow: hidden;
 background-image: repeating-linear-gradient(0deg, transparent 0 21px, rgba(90,120,170,.25) 21px 22px); }
.ss-hand { font-family: 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive; color: #1e3a8a; font-size: 13px; line-height: 1.35; }
.ss-hand-title { font-weight: 700; }
.ss-hand-memo { flex: 1; overflow: hidden; font-size: 12px; }
.ss-open-photo { min-height: 34px; border-radius: 8px; background: #1e293b; color: #fff; font-size: 12px; font-weight: 700; border: 0; }

/* Mode Cartes */
.ss-deck { position: absolute; left: 50%; top: 6px; bottom: 120px; width: min(82vw, 380px); transform: translateX(-50%); }
.ss-dcard { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; background: #f8f7f4; padding: 10px 10px 64px; box-shadow: 0 18px 40px rgba(0,0,0,.55);
 transform: translateY(calc(var(--i) * 10px)) scale(calc(1 - var(--i) * .04)); transition: transform .3s ease; touch-action: none; user-select: none; }
.ss-dcard.is-top { cursor: grab; }
.ss-dcard img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; pointer-events: none; }
.ss-dcard-cap { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; color: #0f172a; }
.ss-dcard-cap strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-dcard-cap span { font-size: 12px; color: #475569; }
.ss-stamp { position: absolute; top: 22px; padding: 4px 12px; border: 3px solid; border-radius: 8px; font-weight: 900; font-size: 18px; opacity: 0; transition: opacity .15s; background: rgba(255,255,255,.85); }
.ss-stamp-fav { left: 18px; color: #16a34a; transform: rotate(-12deg); }
.ss-stamp-later { right: 18px; color: #dc2626; transform: rotate(12deg); }
.ss-stamp-ident { left: 50%; translate: -50% 0; color: #2563eb; top: 40%; }
.ss-dcard.show-fav .ss-stamp-fav, .ss-dcard.show-later .ss-stamp-later, .ss-dcard.show-ident .ss-stamp-ident { opacity: 1; }
.ss-deck-count { position: absolute; left: 0; right: 0; bottom: 92px; text-align: center; color: #cbd5e1; font-size: 13px; font-weight: 700; }
.ss-deck-actions { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 14px; }
.ss-deck-actions button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; min-height: 58px; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #e2e8f0; font-size: 11px; font-weight: 700; }
.ss-deck-actions button i { font-size: 20px; }
.ss-deck-actions [data-a="fav"] i { color: #22c55e; } .ss-deck-actions [data-a="later"] i { color: #f43f5e; } .ss-deck-actions [data-a="ident"] i { color: #60a5fa; }
.ss-deck-done { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #e2e8f0; border-radius: 18px; border: 1px dashed rgba(255,255,255,.2); padding: 20px; }
.ss-deck-done i { font-size: 34px; color: #f59e0b; } .ss-deck-done strong { font-size: 18px; } .ss-deck-done span { font-size: 13px; color: #94a3b8; }
.ss-deck-done button { min-height: 44px; padding: 0 18px; border-radius: 12px; background: #f59e0b; color: #111; font-weight: 800; border: 0; }

/* Mode Fil à linge */
.ss-mode-line { overflow-y: auto !important; padding-bottom: 26px; }
.ss-line { position: relative; padding-top: 18px; margin-bottom: 18px; }
.ss-line-rope { position: absolute; left: 0; right: 0; top: 22px; height: 3px; background: linear-gradient(90deg, #a8a29e, #e7e5e4, #a8a29e); border-radius: 3px; box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.ss-line-track { display: flex; gap: 18px; overflow-x: auto; padding: 0 18px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.ss-lcard { position: relative; flex: 0 0 auto; width: clamp(120px, 38vw, 180px); margin-top: 8px; padding: 7px 7px 26px; background: #f8f7f4; border: 0; border-radius: 3px;
 box-shadow: 0 10px 22px rgba(0,0,0,.5); transform-origin: 50% -12px; transform: rotate(var(--r)); animation: ssSway 4s ease-in-out var(--d) infinite alternate; scroll-snap-align: center; cursor: pointer; }
.ss-lcard.ss-fly { animation: ssFly .55s cubic-bezier(.2,.8,.25,1.15) both, ssSway 4s ease-in-out .6s infinite alternate; }
.ss-lcard img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.ss-lcap { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; color: #334155; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-pin { position: absolute; top: -16px; left: 50%; width: 12px; height: 30px; margin-left: -6px; border-radius: 3px; background: linear-gradient(90deg, #c08a4d, #e3b57b, #b47a3c); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
@keyframes ssSway { from { transform: rotate(calc(var(--r) - 2deg)); } to { transform: rotate(calc(var(--r) + 2deg)); } }
