/* Chhht! — thème sombre de Liya (fond #0d0d0d, panneaux #1b1b1b, accent vert #34d399), IBM Plex Sans si présente. */
:root {
  --bg: #0d0d0d;
  --pan: #1b1b1b;
  --pan2: #232323;
  --line: #343434;
  --txt: #e5e7eb;
  --mut: #9ca3af;
  --acc: #34d399;
  --acc-soft: #0f2e24;
  --on-acc: #04130d;
  --dang: #ff4d4d;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font:
    15px/1.45 "IBM Plex Sans",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
.ch-app {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.ch-load {
  color: var(--mut);
  text-align: center;
  margin-top: 40vh;
}
.ch-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--pan);
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}
.ch-top h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-sp {
  flex: 1;
}
.ch-ic {
  background: none;
  border: 0;
  color: var(--txt);
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}
.ch-ic:hover {
  background: var(--pan2);
}
.ch-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
}
.ch-brand b {
  letter-spacing: 0.01em;
}
.ch-logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--acc-soft);
  font-size: 17px;
}
.ch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  display: inline-block;
}
.ch-dot.ch-online {
  background: var(--acc);
}
.ch-dot.ch-connexion {
  background: #ffcc00;
}
.ch-dot.ch-licence {
  background: var(--dang);
}
.ch-st {
  color: var(--mut);
  font-size: 12px;
}
.ch-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ch-pad {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--pan2);
  color: var(--txt);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
button.ch-row:hover {
  background: var(--pan);
}
.ch-rt {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ch-rt small {
  color: var(--mut);
  font-size: 12px;
}
.ch-av {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pan2);
  color: var(--acc);
  font-weight: 600;
  flex: none;
}
.ch-av.ch-grp {
  font-size: 17px;
}
.ch-badge {
  background: var(--acc);
  color: var(--on-acc);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.ch-empty {
  color: var(--mut);
  text-align: center;
  padding: 28px 22px;
}
.ch-bar {
  display: flex;
  gap: 6px;
  padding: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--pan);
  border-top: 1px solid var(--line);
}
.ch-bar button {
  flex: 1;
  background: var(--pan2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 4px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ch-bar button:first-child {
  background: var(--acc);
  color: var(--on-acc);
  border-color: var(--acc);
  font-weight: 600;
}
.ch-bar button:disabled {
  opacity: 0.45;
  cursor: default;
}
.ch-onb {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 28px 22px;
}
.ch-onb .ch-brand {
  font-size: 34px;
}
.ch-onb .ch-logo {
  width: 52px;
  height: 52px;
  font-size: 30px;
  border-radius: 14px;
}
.ch-lead {
  font-size: 17px;
  margin: 0 0 8px;
}
.ch-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--acc);
  margin: 6px 0 0;
}
.ch-in {
  width: 100%;
  background: var(--pan);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  resize: none;
}
.ch-in:focus {
  outline: 2px solid var(--acc);
  outline-offset: -1px;
}
.ch-link {
  font-size: 12px;
  word-break: break-all;
}
.ch-btn {
  background: var(--acc);
  color: var(--on-acc);
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ch-btn.ch-sec {
  background: var(--pan2);
  color: var(--txt);
  border: 1px solid var(--line);
}
.ch-btn.ch-dang {
  background: transparent;
  color: var(--dang);
  border: 1px solid var(--dang);
  margin-top: 18px;
}
.ch-act {
  display: flex;
  gap: 8px;
}
.ch-act .ch-btn {
  flex: 1;
}
.ch-note {
  color: var(--mut);
  font-size: 13px;
}
.ch-warn {
  background: #2a2410;
  border: 1px solid #a67c00;
  color: #ffe08a;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}
.ch-flash {
  background: var(--acc-soft);
  color: var(--acc);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px;
  font-size: 13px;
}
.ch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px;
  background: var(--pan);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}
.ch-card .ch-av {
  width: 56px;
  height: 56px;
  font-size: 22px;
}
.ch-card small {
  color: var(--mut);
  font-size: 12px;
  max-width: 300px;
}
.ch-card code,
.ch-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--acc);
  word-break: break-all;
}
.ch-checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 45vh;
  overflow-y: auto;
}
.ch-chk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  cursor: pointer;
}
.ch-chk input {
  width: 18px;
  height: 18px;
  accent-color: var(--acc);
}
.ch-chk .ch-av {
  width: 30px;
  height: 30px;
  font-size: 13px;
}
.ch-band {
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--mut);
  background: var(--bg);
  border-bottom: 1px solid var(--pan2);
  text-align: center;
}
.ch-msgs {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-msg {
  max-width: 82%;
  align-self: flex-start;
  background: var(--pan2);
  border-radius: 14px 14px 14px 4px;
  padding: 7px 11px;
  transition: opacity 0.6s;
}
.ch-msg p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ch-msg small {
  display: block;
  color: var(--mut);
  font-size: 11px;
  margin-top: 2px;
}
.ch-msg.ch-mine {
  align-self: flex-end;
  background: var(--acc-soft);
  border-radius: 14px 14px 4px 14px;
}
.ch-msg.ch-mine small {
  text-align: right;
  color: #7fcfae;
}
.ch-from {
  font-size: 12px;
  color: var(--acc);
}
.ch-fading {
  opacity: 0.62;
}
.ch-compose {
  display: flex;
  gap: 8px;
  padding: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--pan);
  border-top: 1px solid var(--line);
}
.ch-compose textarea {
  flex: 1;
  max-height: 120px;
}
.ch-send {
  width: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--acc);
  color: var(--on-acc);
  font-size: 18px;
  cursor: pointer;
}

/* Lot 2 : QR code, caméra, demandes de contact */
.ch-qr {
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  width: min(260px, 70vw);
  align-self: center;
}
.ch-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.ch-cam {
  width: 100%;
  border-radius: 10px;
  background: #000;
  max-height: 45vh;
  object-fit: cover;
}
.ch-req small {
  color: #ffcc00;
}
.ch-preview {
  padding: 0;
  opacity: 0.7;
}
.ch-dang2 {
  color: var(--dang);
  border-color: var(--dang);
}
.ch-onb .ch-warn {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Installation sur le téléphone (PWA) */
.ch-inst {
  margin: 10px;
  padding: 12px 14px;
  background: var(--acc-soft);
  border: 1px solid var(--acc);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ch-onb .ch-inst {
  margin: 0;
}
.ch-inst p {
  margin: 0;
  font-size: 13px;
  color: var(--txt);
}
.ch-inst .ch-btn {
  padding: 8px 14px;
}
.ch-qr-s {
  width: 150px;
}

/* Lot 3 : appels audio et vidéo */
.ch-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ch-call {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #050505;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.ch-call[hidden] {
  display: none;
}
.ch-call-top {
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ch-call-top b {
  font-size: 17px;
}
.ch-call-top small {
  color: #9ca3af;
  font-size: 13px;
}
.ch-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 6px;
  padding: 6px;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
}
.ch-grid[data-n="2"] {
  grid-template-rows: 1fr 1fr;
}
.ch-grid[data-n="3"] {
  grid-template-columns: 1fr 1fr;
}
.ch-tile {
  position: relative;
  background: #151515;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 0;
}
.ch-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.ch-tile.ch-hasv video {
  opacity: 1;
}
.ch-tile .ch-av {
  width: 72px;
  height: 72px;
  font-size: 30px;
}
.ch-tile.ch-hasv .ch-av {
  visibility: hidden;
}
.ch-tile.ch-talk .ch-av {
  box-shadow: 0 0 0 4px var(--acc);
}
.ch-tile small {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
}
.ch-self {
  position: absolute;
  right: 12px;
  bottom: 96px;
  width: 96px;
  height: 128px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #333;
  transform: scaleX(-1);
  background: #111;
}
.ch-call-ctl {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 14px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.ch-cb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: #2a2a2a;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.ch-cb.ch-off {
  background: #e5e7eb;
  color: #111;
}
.ch-cb.ch-ok {
  background: var(--acc);
  color: var(--on-acc);
}
.ch-cb.ch-no {
  background: var(--dang);
}
.ch-sysmsg {
  align-self: center;
  margin: 4px 0;
  font-size: 12px;
  color: var(--mut);
  background: var(--pan);
  border-radius: 999px;
  padding: 3px 12px;
}

/* Lot 4 : photos et correction des messages */
.ch-attach {
  display: grid;
  place-items: center;
  width: 40px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
}
.ch-attach:hover {
  background: var(--pan2);
}
.ch-msg.ch-hasimg {
  padding: 4px;
  max-width: 75%;
}
.ch-msg.ch-hasimg p,
.ch-msg.ch-hasimg small,
.ch-msg.ch-hasimg .ch-from {
  padding: 0 7px;
}
.ch-imgb {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  width: 100%;
}
.ch-img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  background: #222;
}
.ch-imgerr {
  font-size: 12px;
  color: var(--mut);
  font-style: italic;
}
.ch-edit {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  margin-left: 4px;
  padding: 0 2px;
  opacity: 0.8;
}
.ch-editbar {
  margin: 0;
  padding: 6px 12px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ch-editbar[hidden] {
  display: none;
}
.ch-zoom {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  cursor: zoom-out;
}
.ch-zoom img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.ch-zoom .ch-cb {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Écran du téléphone : clavier, zoom et grande taille de texte (iOS, Android)
   - hauteur = partie visible au-dessus du clavier (--vvh, main.js) : la saisie reste visible, rien n'est caché dessous ;
   - champs à 16 px au moins : Safari ne zoome plus la page quand on touche un champ ;
   - tailles des boutons en em : ils suivent la taille de texte choisie dans le téléphone sans déborder ;
   - écran bas (clavier ouvert, paysage, texte très grand) : bandeaux secondaires masqués, marges réduites. */
html,
body {
  overscroll-behavior: none;
}
body.ch-standalone .ch-app,
body.ch-pwa .ch-app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  height: var(--vvh, 100%);
}
.ch-in,
.ch-app input,
.ch-app textarea {
  font-size: max(16px, 1em);
}
.ch-top {
  flex-wrap: nowrap;
}
.ch-top h1 {
  flex: 1 1 auto;
  min-width: 0;
}
.ch-top .ch-sp {
  display: none;
}
.ch-ic {
  flex: none;
  width: auto;
  min-width: 2.2em;
  height: 2.2em;
  font-size: 1.15em;
  padding: 0 0.2em;
}
.ch-compose textarea {
  max-height: min(30vh, 7.5em);
  overflow-y: auto;
}
.ch-send,
.ch-attach {
  flex: none;
  width: 2.75em;
  min-height: 2.75em;
}
.ch-bar button {
  white-space: normal;
  line-height: 1.2;
}
.ch-kbd .ch-band,
.ch-kbd .ch-bar,
.ch-kbd .ch-inst {
  display: none;
}
@media (max-height: 520px) {
  .ch-band,
  .ch-st {
    display: none;
  }
  .ch-top {
    min-height: 0;
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: 4px;
  }
  .ch-compose,
  .ch-bar {
    padding-top: 4px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
  .ch-call-top {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .ch-cb {
    width: 48px;
    height: 48px;
  }
}
.ch-compose textarea::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Écran étroit (zoom d'écran agrandi) : boutons plus serrés, la zone de saisie garde la place. */
@media (max-width: 340px) {
  .ch-top,
  .ch-compose {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .ch-ic {
    min-width: 1.9em;
    padding: 0;
  }
  .ch-send,
  .ch-attach {
    width: 2.4em;
    min-height: 2.4em;
  }
}
/* Glisser vers la droite pour supprimer une conversation (accueil) */
.ch-swipe {
  position: relative;
  overflow: hidden;
  background: var(--pan2);
}
.ch-swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: 18px;
  color: #fff;
  font-weight: 600;
  background: #8a2a2a;
  opacity: 0;
}
.ch-swiping .ch-swipe-bg {
  opacity: 0.7;
}
.ch-swipe-go .ch-swipe-bg {
  opacity: 1;
  background: #c0392b;
}
.ch-swipe .ch-row {
  position: relative;
  background: var(--bg);
  touch-action: pan-y;
  transition: transform 0.2s;
}
.ch-swiping .ch-row {
  transition: none;
}
/* Durée de validité d'un lien d'invitation */
.ch-dur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--mut, #9a9a9a);
}
.ch-chip {
  padding: 0.35em 0.8em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--txt);
  font: inherit;
  cursor: pointer;
}
.ch-chip.ch-on {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--on-acc);
  font-weight: 600;
}
/* Appel de groupe (lot 5) : vidéo de Jitsi dans la fenêtre d'appel, pseudos de Chhht! dans une rangée défilante */
.ch-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0d0d0d;
}
.ch-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.ch-people {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 10px;
  scrollbar-width: none;
}
.ch-pp {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: #1c1c1c;
  border: 1px solid transparent;
  font-size: 13px;
  white-space: nowrap;
}
.ch-pp .ch-av {
  width: 1.8em;
  height: 1.8em;
  font-size: 12px;
}
.ch-pp.ch-talk {
  border-color: var(--acc);
}
.ch-pp.ch-wait {
  opacity: 0.55;
}
.ch-call.ch-group .ch-self {
  display: none;
}
.ch-grid[hidden],
.ch-stage[hidden],
.ch-people[hidden] {
  display: none;
}
/* « à vérifier » : lien direct vers l'empreinte de sécurité du contact */
.ch-verif {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ch-band-warn {
  color: #f5c46b;
}
/* Favoris : conversations épinglées en tête de liste (glisser vers la gauche, ou « ⓘ ») */
.ch-swipe-pin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 18px;
  color: #0d0d0d;
  font-weight: 600;
  background: var(--acc);
  opacity: 0;
}
.ch-swipe-l .ch-swipe-bg {
  display: none;
}
.ch-swipe-l.ch-swiping .ch-swipe-pin {
  opacity: 0.7;
}
.ch-swipe-l.ch-swipe-go .ch-swipe-pin {
  opacity: 1;
}
.ch-pin {
  font-size: 0.85em;
}
.ch-row.ch-pinned {
  background: #121a16;
}
/* Changement de téléphone : code à comparer sur les deux écrans */
.ch-pair {
  margin: 4px 0 12px;
  font:
    600 2em/1.2 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  color: var(--acc);
  text-align: center;
}
/* Liens cliquables dans les messages */
.ch-msg p .ch-lnk {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
/* Groupe : mise en relation avec un membre */
.ch-memrow .ch-mini {
  flex: none;
  width: auto;
  margin: 0;
  padding: 0.35em 0.7em;
  font-size: 13px;
}
.ch-memrow .ch-rt small {
  color: var(--mut);
}
/* Lot 9 : recherche, numéros, nom pour soi */
.ch-search {
  padding: 8px 12px 4px;
}
.ch-search .ch-in {
  margin: 0;
}
.ch-swipe[hidden] {
  display: none;
}
.ch-telrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ch-telrow .ch-mini,
.ch-act a.ch-btn {
  width: auto;
  margin: 0;
  padding: 0.4em 0.8em;
  text-decoration: none;
  text-align: center;
}
.ch-local {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ch-local summary {
  cursor: pointer;
  font-weight: 600;
}

/* ===== Design arrondi (lot 10) : boutons en pilule, champs et cartes aux angles doux, bulles plus rondes,
   lignes de la liste en cartes, bandeaux en pastilles. Placé en fin de feuille : remplace les angles ci-dessus. ===== */
:root {
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 24px;
}
.ch-btn,
.ch-bar button,
.ch-act a.ch-btn,
.ch-telrow .ch-mini,
.ch-memrow .ch-mini {
  border-radius: 999px;
}
.ch-btn {
  padding: 12px 20px;
}
.ch-in,
select.ch-in {
  border-radius: var(--r-s);
}
.ch-compose textarea {
  border-radius: 22px;
  padding: 10px 16px;
}
.ch-card,
.ch-qr {
  border-radius: var(--r-l);
}
.ch-warn,
.ch-flash,
.ch-local,
.ch-code,
.ch-safety {
  border-radius: var(--r-m);
}
.ch-msg {
  border-radius: 20px 20px 20px 6px;
  padding: 8px 13px;
}
.ch-msg.ch-mine {
  border-radius: 20px 20px 6px 20px;
}
.ch-msg .ch-imgb,
.ch-msg img.ch-img {
  border-radius: 14px;
}
/* Liste : chaque conversation est une carte arrondie */
.ch-main > .ch-swipe {
  margin: 6px 10px;
  border-radius: var(--r-m);
}
.ch-main > .ch-swipe .ch-row {
  border-bottom: 0;
  border-radius: var(--r-m);
  background: var(--pan);
}
.ch-main > .ch-swipe .ch-row.ch-pinned {
  background: #121a16;
}
.ch-memrow,
.ch-checks .ch-chk {
  border-radius: var(--r-s);
}
/* Bandeaux de conversation en pastilles */
.ch-band {
  margin: 6px 10px 0;
  border: 0;
  border-radius: 999px;
  background: var(--pan2);
  padding: 6px 14px;
}
/* En-tête et barres aux angles doux */
.ch-top {
  border-bottom: 0;
  border-radius: 0 0 var(--r-l) var(--r-l);
}
.ch-ic {
  border-radius: 50%;
}
.ch-bar {
  margin: 0 8px 6px;
  border: 0;
  border-radius: var(--r-l);
  padding-bottom: 8px;
  margin-bottom: max(6px, env(safe-area-inset-bottom));
}
.ch-compose {
  border-top: 0;
  border-radius: var(--r-l) var(--r-l) 0 0;
}
.ch-cb {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
/* Messages vocaux (lot 12) */
.ch-vox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  padding: 2px 0;
}
.ch-play {
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border: 0;
  border-radius: 50%;
  background: var(--acc);
  color: var(--on-acc);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ch-play:disabled {
  opacity: 0.5;
}
.ch-voxbar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.ch-voxbar i {
  display: block;
  height: 100%;
  background: var(--acc);
}
.ch-voxt {
  font-size: 12px;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}
.ch-mic {
  flex: none;
  width: 2.6em;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--txt);
  font-size: 1.1em;
  cursor: pointer;
}
.ch-recbar {
  align-items: center;
}
.ch-recbar .ch-rect {
  flex: 1;
  font-variant-numeric: tabular-nums;
}
.ch-recdot {
  width: 12px;
  height: 12px;
  margin-left: 6px;
  border-radius: 50%;
  background: #e5484d;
  animation: ch-blink 1s infinite;
}
@keyframes ch-blink {
  50% {
    opacity: 0.25;
  }
}

/* ===== Thèmes (lot 13) : couleurs par thème sur .ch-app[data-theme], petites animations dans .ch-fx (derrière l'écran) ===== */
.ch-app[data-theme="halloween"] {
  --bg: #140b1f;
  --pan: #24123a;
  --pan2: #2d1a47;
  --line: #4a2d6b;
  --txt: #f4e9ff;
  --mut: #c9a7e8;
  --acc: #ff8c1a;
  --acc-soft: #3a1f08;
  --on-acc: #1a0d00;
}
.ch-app[data-theme="noel"] {
  --bg: #0b1a14;
  --pan: #123326;
  --pan2: #173a2b;
  --line: #2a5a44;
  --txt: #fff6ea;
  --mut: #cfe3d6;
  --acc: #f6d27a;
  --acc-soft: #3a2f10;
  --on-acc: #3a0a10;
}
.ch-app[data-theme="noel"] .ch-top {
  background: #7a1420;
}
.ch-app[data-theme="noel"] .ch-mine {
  background: #7a1420;
}
.ch-app[data-theme="halloween"] .ch-mine {
  background: #5a2a06;
}
.ch-app[data-theme="aurore"] {
  --bg: #071019;
  --pan: #0f2233;
  --pan2: #12283a;
  --line: #1f4058;
  --txt: #e6f7ff;
  --mut: #8fe3ff;
  --acc: #6ee7c8;
  --acc-soft: #0d3029;
  --on-acc: #04211b;
}
.ch-app[data-theme="halloween"] .ch-send {
  font-size: 0;
}
.ch-app[data-theme="halloween"] .ch-send::after {
  content: "🎃";
  font-size: 20px;
  animation: fx-glow 2.2s ease-in-out infinite;
}
.ch-app[data-theme="halloween"] .ch-main > .ch-swipe .ch-row.ch-pinned,
.ch-app[data-theme="noel"] .ch-main > .ch-swipe .ch-row.ch-pinned,
.ch-app[data-theme="aurore"] .ch-main > .ch-swipe .ch-row.ch-pinned {
  background: var(--acc-soft);
}
.ch-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.ch-view {
  position: relative;
  z-index: 1;
}
.ch-fx span {
  position: absolute;
  top: -30px;
}
.ch-fx .fx-pump {
  animation: fx-pump linear infinite;
}
.ch-fx .fx-snow {
  color: #fff;
  animation: fx-fall linear infinite;
}
.ch-fx .fx-web {
  top: 64px;
  right: 6px;
  font-size: 28px;
  opacity: 0.3;
}
.ch-fx .fx-lights {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
}
.ch-fx .fx-lights i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: fx-twinkle 1.2s infinite alternate;
}
.ch-fx .fx-aurora {
  position: absolute;
  inset: -40%;
  opacity: 0.55;
  background:
    radial-gradient(40% 30% at 30% 40%, rgba(110, 231, 200, 0.3), transparent 70%),
    radial-gradient(35% 25% at 70% 30%, rgba(143, 140, 255, 0.25), transparent 70%);
  animation: fx-sway 14s ease-in-out infinite alternate;
}
@keyframes fx-fall {
  to {
    transform: translateY(110vh) rotate(360deg);
  }
}
@keyframes fx-pump {
  0% {
    transform: translate(0, 0) rotate(-15deg);
  }
  25% {
    transform: translate(14px, 28vh) rotate(10deg);
  }
  50% {
    transform: translate(-10px, 56vh) rotate(-10deg);
  }
  75% {
    transform: translate(12px, 84vh) rotate(12deg);
  }
  100% {
    transform: translate(0, 110vh) rotate(-8deg);
  }
}
@keyframes fx-twinkle {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
    box-shadow: 0 0 8px currentColor;
  }
}
@keyframes fx-sway {
  to {
    transform: translate(8%, 6%) rotate(8deg);
  }
}
@keyframes fx-glow {
  50% {
    filter: drop-shadow(0 0 6px #ff9a1f);
  }
}
.ch-app.ch-paused .ch-fx *,
.ch-app.ch-paused .ch-send::after {
  animation-play-state: paused;
}
.ch-app.a11y-still .ch-send::after {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .ch-fx {
    display: none;
  }
  .ch-app .ch-send::after,
  .ch-recdot {
    animation: none;
  }
}
/* Pendant un appel : pas d'animation */
.ch-app:has(.ch-call:not([hidden])) .ch-fx {
  display: none;
}

/* ===== Accessibilité (lot 13), comme dans la suite : taille, gras, contraste, daltonisme ===== */
/* Taille du texte : zoom de l'écran (pas du conteneur fixe, dont la hauteur suit le clavier). La fenêtre d'appel garde sa taille (commandes toujours visibles). */
.ch-app.ch-zoom > .ch-view {
  zoom: var(--z, 1);
  flex: none;
  width: 100%; /* avec zoom, le pourcentage se rapporte déjà au parent divisé par le zoom : l'écran tient tout juste */
  height: 100%;
}
.ch-app.a11y-bold {
  font-weight: 600;
}
.ch-app.a11y-bold b,
.ch-app.a11y-bold h1 {
  font-weight: 800;
}
.ch-app.a11y-contrast {
  --mut: #e5e7eb;
  --line: #9ca3af;
  --txt: #ffffff;
}
.ch-app.a11y-contrast .ch-msg,
.ch-app.a11y-contrast .ch-in,
.ch-app.a11y-contrast .ch-main > .ch-swipe .ch-row {
  outline: 1px solid var(--line);
}
.ch-app.a11y-cvd {
  --acc: #56b4e9;
  --acc-soft: #0d2a3a;
  --on-acc: #04121b;
  --dang: #e69f00;
}
.ch-a11y {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pan2);
  cursor: pointer;
}
.ch-a11y input[type="checkbox"] {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  accent-color: var(--acc);
}
.ch-a11y span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ch-a11y small {
  color: var(--mut);
}
.ch-a11y-size {
  flex-direction: column;
}
.ch-a11y-size input[type="range"] {
  width: 100%;
  accent-color: var(--acc);
}
/* Texte agrandi dans Chhht! : l'écran devient étroit (les règles « écran étroit » ne suivent pas ce zoom) : on resserre */
.ch-app.ch-zoom .ch-top,
.ch-app.ch-zoom .ch-compose {
  gap: 4px;
  padding-left: 6px;
  padding-right: 6px;
}
.ch-app.ch-zoom .ch-ic {
  min-width: 1.9em;
  padding: 0;
}
.ch-app.ch-zoom .ch-send,
.ch-app.ch-zoom .ch-attach,
.ch-app.ch-zoom .ch-mic {
  width: 2.2em;
  min-height: 2.2em;
}
.ch-app.ch-zoom .ch-compose textarea {
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
}
/* Noël : guirlande lumineuse qui scintille sous l'en-tête */
.ch-app[data-theme="noel"] .ch-top {
  position: relative;
  overflow: visible;
}
.ch-app[data-theme="noel"] .ch-top::after,
.ch-app[data-theme="noel"] .ch-top::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -5px;
  height: 10px;
  pointer-events: none;
  background:
    radial-gradient(circle, #ff4d4d 3px, transparent 4px) 0 0 / 56px 10px repeat-x,
    radial-gradient(circle, #4dff88 3px, transparent 4px) 28px 0 / 56px 10px repeat-x;
  animation: fx-garland 1.4s ease-in-out infinite alternate;
}
.ch-app[data-theme="noel"] .ch-top::before {
  background:
    radial-gradient(circle, #ffd34d 3px, transparent 4px) 14px 0 / 56px 10px repeat-x,
    radial-gradient(circle, #4db8ff 3px, transparent 4px) 42px 0 / 56px 10px repeat-x;
  animation-delay: -0.7s;
}
@keyframes fx-garland {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 255, 200, 0.8));
  }
}
.ch-app.a11y-still .ch-top::after,
.ch-app.a11y-still .ch-top::before,
.ch-app.ch-paused .ch-top::after,
.ch-app.ch-paused .ch-top::before {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .ch-app .ch-top::after,
  .ch-app .ch-top::before {
    animation: none;
  }
}

/* Lot 14 — portrait étroit : rien ne doit déborder horizontalement */
.ch-act {
  flex-wrap: wrap;
}
.ch-act .ch-btn,
.ch-act a.ch-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
}
.ch-main {
  overflow-x: hidden;
  min-width: 0;
}
.ch-pad > * {
  min-width: 0;
  max-width: 100%;
  flex-shrink: 0;
}
.ch-pad img,
.ch-pad svg,
.ch-pad canvas {
  max-width: 100%;
  height: auto;
}
.ch-link,
.ch-code,
.ch-pad code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== Lot 14 : thèmes supplémentaires (Clair, Océan, Sakura, Nuit étoilée, Saint-Valentin) ===== */
.ch-app[data-theme="clair"] {
  --bg: #f6f7f9;
  --pan: #ffffff;
  --pan2: #eef0f3;
  --line: #d5d9e0;
  --txt: #15181d;
  --mut: #5b6472;
  --acc: #0f8a5f;
  --acc-soft: #dcf3ea;
  --on-acc: #ffffff;
  --dang: #c62828;
  color-scheme: light;
}
.ch-app[data-theme="clair"] .ch-mine {
  background: #d7f0e5;
  color: #10261d;
}
.ch-app[data-theme="ocean"] {
  --bg: #04182b;
  --pan: #0a2a45;
  --pan2: #0e3352;
  --line: #1d4f78;
  --txt: #e8f6ff;
  --mut: #9cd2f2;
  --acc: #38bdf8;
  --acc-soft: #0b3550;
  --on-acc: #02121f;
}
.ch-app[data-theme="sakura"] {
  --bg: #1c1218;
  --pan: #2b1a24;
  --pan2: #33202b;
  --line: #553447;
  --txt: #fff0f6;
  --mut: #f2b8d0;
  --acc: #f9a8d4;
  --acc-soft: #3f1d2f;
  --on-acc: #2a0b1b;
}
.ch-app[data-theme="etoiles"] {
  --bg: #070a1c;
  --pan: #10163a;
  --pan2: #151c45;
  --line: #2a3270;
  --txt: #eef0ff;
  --mut: #b3b9f0;
  --acc: #fcd34d;
  --acc-soft: #2b2610;
  --on-acc: #1d1600;
}
.ch-app[data-theme="valentin"] {
  --bg: #1d0a10;
  --pan: #2e121b;
  --pan2: #371722;
  --line: #5c2537;
  --txt: #ffeef2;
  --mut: #f5a9bc;
  --acc: #fb7185;
  --acc-soft: #43141f;
  --on-acc: #2a0510;
}
.ch-app[data-theme="sakura"] .ch-mine {
  background: #5a2742;
}
.ch-app[data-theme="valentin"] .ch-mine {
  background: #6b1d2f;
}
.ch-app[data-theme="ocean"] .ch-mine {
  background: #0c4a6e;
}
.ch-app[data-theme="clair"] .ch-main > .ch-swipe .ch-row.ch-pinned,
.ch-app[data-theme="ocean"] .ch-main > .ch-swipe .ch-row.ch-pinned,
.ch-app[data-theme="sakura"] .ch-main > .ch-swipe .ch-row.ch-pinned,
.ch-app[data-theme="etoiles"] .ch-main > .ch-swipe .ch-row.ch-pinned,
.ch-app[data-theme="valentin"] .ch-main > .ch-swipe .ch-row.ch-pinned {
  background: var(--acc-soft);
}
.ch-fx .fx-bub {
  top: auto;
  bottom: -20px;
  border-radius: 50%;
  border: 1px solid rgba(186, 230, 253, 0.55);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.45), rgba(56, 189, 248, 0.08) 60%);
  animation: fx-rise linear infinite;
}
.ch-fx .fx-heart {
  top: auto;
  bottom: -30px;
  color: #fb7185;
  animation: fx-rise linear infinite;
}
.ch-fx .fx-petal {
  animation: fx-pump linear infinite;
}
.ch-fx .fx-star {
  color: #fff7cc;
  animation: fx-twinkle2 ease-in-out infinite alternate;
}
.ch-fx .fx-shoot {
  top: 12%;
  left: 70%;
  width: 90px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), transparent);
  transform: rotate(-25deg);
  opacity: 0;
  animation: fx-shoot 9s ease-in infinite;
}
@keyframes fx-rise {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(12px, -55vh);
  }
  100% {
    transform: translate(-6px, -112vh);
  }
}
@keyframes fx-twinkle2 {
  from {
    opacity: 0.15;
  }
  to {
    opacity: 0.9;
  }
}
@keyframes fx-shoot {
  0%,
  88% {
    opacity: 0;
    transform: translate(0, 0) rotate(-25deg);
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-220px, 100px) rotate(-25deg);
  }
}
/* Le texte suit le thème (le thème Clair inverse les couleurs) */
.ch-app {
  color: var(--txt);
}
.ch-app input,
.ch-app textarea {
  color: var(--txt);
}
/* Supprimer un message : feuille en bas de l'écran */
.ch-sheet {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
}
.ch-sheet-in {
  width: 100%;
  background: var(--pan);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ch-sheet-in p {
  margin: 0;
}
/* Boutons du message (✏️ 🗑 🔊) : zone de toucher plus large sans agrandir la ligne */
.ch-msg small .ch-edit {
  font-size: 13px;
  padding: 6px 7px;
  margin: -6px -2px -6px 2px;
}
/* Photo de profil (lot 16) */
.ch-av {
  overflow: hidden;
}
.ch-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-av.ch-av-l {
  width: 72px;
  height: 72px;
  font-size: 28px;
}
.ch-av.ch-av-s {
  width: 32px;
  height: 32px;
  font-size: 14px;
}
.ch-top h1:has(.ch-av-s) {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ch-top h1 .ch-tt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-mephoto {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ch-mephoto .ch-btn {
  flex: 1 1 120px;
}

/* ===== Lot 17 : thème Liya « à plat » (piste A), clair et sombre — vert émeraude de la suite Liya ===== */
.ch-app[data-theme="liya-clair"] {
  --bg: #f4f5f6;
  --pan: #ffffff;
  --pan2: #eef0f2;
  --line: #e4e6e9;
  --txt: #15181b;
  --mut: #565d66;
  --acc: #047857; /* émeraude de la suite (thème clair) : texte blanc lisible (5,5:1) */
  --acc-soft: #e3f6ee;
  --on-acc: #ffffff;
  --dang: #c62828;
  --mine: #047857;
  --on-mine: #ffffff;
  --mine-mut: #d3f2e5;
  --act: #047857;
  --on-act: #ffffff;
  color-scheme: light;
}
.ch-app[data-theme="liya-sombre"] {
  --bg: #0d0d0d;
  --pan: #1b1b1b;
  --pan2: #232323;
  --line: #343434;
  --txt: #f2f2f2;
  --mut: #a3a3a3;
  --acc: #34d399; /* émeraude de la suite (thème sombre) */
  --acc-soft: #0b1d17;
  --on-acc: #04130d;
  /* lot 48 : bulles envoyées en vert profond, moins éblouissant sur fond noir (texte clair, contraste ≥ 4.5:1) */
  --mine: #1d6f54;
  --on-mine: #f2f2f2;
  --mine-mut: #d2ebe0;
  --act: #34d399;
  --on-act: #04130d;
  color-scheme: dark;
}
/* Écran à plat : grands arrondis, liste en carte, pastilles colorées, bulles pleines */
.ch-app[data-theme^="liya"] .ch-top {
  background: var(--pan);
  border-bottom: 0;
  border-radius: 0 0 22px 22px;
}
.ch-app[data-theme^="liya"] .ch-row {
  border-bottom: 0;
  padding: 12px 18px;
  gap: 14px;
}
.ch-app[data-theme^="liya"] .ch-main > .ch-swipe .ch-row,
.ch-app[data-theme^="liya"] .ch-main > .ch-swipe {
  background: var(--pan);
}
.ch-app[data-theme^="liya"] .ch-main > .ch-swipe:first-of-type {
  border-radius: 22px 22px 0 0;
  overflow: hidden;
}
.ch-app[data-theme^="liya"] .ch-main > .ch-swipe .ch-row.ch-pinned {
  background: var(--acc-soft);
}
.ch-app[data-theme^="liya"] .ch-row .ch-av {
  width: 50px;
  height: 50px;
  font-size: 18px;
}
.ch-app[data-theme^="liya"] .ch-row .ch-rt b {
  font-size: 16px;
}
.ch-app[data-theme="liya-clair"] .ch-av.ch-c0 {
  background: #bdebd8;
  color: #15181b;
}
.ch-app[data-theme="liya-clair"] .ch-av.ch-c1 {
  background: #d6e8fb;
  color: #15181b;
}
.ch-app[data-theme="liya-clair"] .ch-av.ch-c2 {
  background: #d3f2e5;
  color: #15181b;
}
.ch-app[data-theme="liya-clair"] .ch-av.ch-c3 {
  background: #eee6fa;
  color: #15181b;
}
.ch-app[data-theme="liya-clair"] .ch-av.ch-c4 {
  background: #fbe6ef;
  color: #15181b;
}
.ch-app[data-theme="liya-clair"] .ch-av.ch-c5 {
  background: #e0f3f3;
  color: #15181b;
}
.ch-app[data-theme="liya-sombre"] .ch-av.ch-c0 {
  background: #1a4a3a;
  color: #f2f2f2;
}
.ch-app[data-theme="liya-sombre"] .ch-av.ch-c1 {
  background: #14304d;
  color: #f2f2f2;
}
.ch-app[data-theme="liya-sombre"] .ch-av.ch-c2 {
  background: #123a2d;
  color: #f2f2f2;
}
.ch-app[data-theme="liya-sombre"] .ch-av.ch-c3 {
  background: #2b2250;
  color: #f2f2f2;
}
.ch-app[data-theme="liya-sombre"] .ch-av.ch-c4 {
  background: #47182e;
  color: #f2f2f2;
}
.ch-app[data-theme="liya-sombre"] .ch-av.ch-c5 {
  background: #0f3a3a;
  color: #f2f2f2;
}
.ch-app[data-theme^="liya"] .ch-av.ch-grp {
  background: var(--acc-soft);
}
.ch-app[data-theme^="liya"] .ch-badge {
  background: var(--mine);
  color: var(--on-mine);
  font-weight: 700;
}
.ch-app[data-theme^="liya"] .ch-msgs {
  gap: 10px;
  padding: 14px 16px;
}
.ch-app[data-theme^="liya"] .ch-msg {
  background: var(--pan);
  border-radius: 20px 20px 20px 6px;
  padding: 11px 15px;
  font-size: 15px;
}
.ch-app[data-theme="liya-clair"] .ch-msg:not(.ch-mine) {
  background: var(--pan2);
}
.ch-app[data-theme^="liya"] .ch-msg.ch-mine {
  background: var(--mine);
  color: var(--on-mine);
  border-radius: 20px 20px 6px 20px;
}
.ch-app[data-theme^="liya"] .ch-msg.ch-mine small,
.ch-app[data-theme^="liya"] .ch-msg.ch-mine a {
  color: var(--mine-mut);
}
.ch-app[data-theme^="liya"] .ch-msg.ch-mine a {
  color: var(--on-mine);
}
.ch-app[data-theme^="liya"] .ch-compose {
  border-top: 0;
  border-radius: 22px 22px 0 0;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.ch-app[data-theme^="liya"] .ch-compose textarea {
  border-radius: 23px;
  background: var(--pan2);
}
.ch-app[data-theme^="liya"] .ch-send,
.ch-app[data-theme^="liya"] .ch-bar button:first-child {
  background: var(--act);
  color: var(--on-act);
  border-color: var(--act);
}
.ch-app[data-theme^="liya"] .ch-bar {
  border-top: 0;
  border-radius: 22px 22px 0 0;
}
.ch-app[data-theme^="liya"] .ch-bar button {
  border-radius: 22px;
  min-height: 48px;
}
.ch-app[data-theme^="liya"] .ch-band {
  background: var(--acc-soft);
  color: var(--txt);
  border-radius: 16px;
}
/* Icônes au trait (lot 18) : téléphone, caméra, informations */
.ch-svg {
  width: 22px;
  height: 22px;
  display: block;
}
.ch-ic:has(.ch-svg) {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--txt);
}
.ch-ic:has(.ch-svg):hover,
.ch-ic:has(.ch-svg):focus-visible {
  background: var(--pan2);
}
.ch-cb .ch-svg {
  width: 26px;
  height: 26px;
  margin: auto;
}
/* Grande taille de texte : en-tête resserré (la photo laisse la place au nom et aux boutons) */
.ch-app.ch-zoom .ch-ic:has(.ch-svg) {
  width: 34px;
  height: 34px;
}
.ch-app.ch-zoom .ch-top .ch-av-s {
  display: none;
}
.ch-top .ch-ic {
  flex: none;
}
/* Lot 19 : toutes les icônes au trait — centrées dans les boutons icônes, devant le texte dans les boutons à texte */
.ch-send,
.ch-mic,
.ch-attach,
.ch-play,
.ch-cb,
.ch-ic {
  display: inline-grid;
  place-items: center;
}
.ch-send .ch-svg {
  width: 22px;
  height: 22px;
}
.ch-mic,
.ch-attach {
  color: var(--mut);
}
.ch-play .ch-svg {
  width: 18px;
  height: 18px;
}
.ch-msg small .ch-edit .ch-svg {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: -3px;
}
.ch-btn .ch-svg,
.ch-bar button .ch-svg,
a.ch-btn .ch-svg {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  margin-right: 6px;
}
.ch-editbar .ch-ic .ch-svg {
  width: 18px;
  height: 18px;
}
.ch-cb.ch-no .ch-svg {
  width: 30px;
  height: 30px;
}
.ch-band .ch-svg,
.ch-editbar > .ch-svg {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 5px;
}
.ch-av.ch-grp .ch-svg {
  width: 55%;
  height: 55%;
}
/* Marche à suivre pas à pas (invitation sur iPhone) */
.ch-steps {
  background: var(--pan2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.45;
}
.ch-steps p {
  margin: 0;
}
.ch-steps ol {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-steps li::marker {
  color: var(--acc);
  font-weight: 700;
}
/* Lot 21 : répondre à un message (citation) et réactions */
.ch-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  margin: 0 0 6px;
  padding: 6px 10px;
  border: 0;
  border-left: 3px solid var(--acc);
  border-radius: 10px;
  background: color-mix(in srgb, var(--txt) 8%, transparent);
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ch-quote span {
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-mine .ch-quote {
  border-left-color: currentColor;
}
.ch-rx {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.ch-rxb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  color: inherit;
  font-size: 14px;
  cursor: pointer;
}
.ch-rxb span {
  font-size: 12px;
}
.ch-rxb.ch-on {
  border-color: currentColor;
  font-weight: 700;
}
.ch-reacts {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.ch-rxpick {
  flex: 1;
  min-height: 48px;
  font-size: 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--pan2);
  cursor: pointer;
}
.ch-rxpick.ch-on {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.ch-replybar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  background: var(--pan);
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.ch-replybar[hidden] {
  display: none;
}
.ch-replybar > .ch-svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--acc);
}
.ch-replybar span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-msg.ch-hl {
  outline: 3px solid var(--acc);
  outline-offset: 2px;
}
/* Lot 22 : écran verrouillé, au-dessus de tout (appels compris) */
.ch-lock {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}
.ch-lock[hidden] {
  display: none;
}
.ch-lockin {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.ch-lockin h1 {
  margin: 0 0 8px;
  font-size: 22px;
}
.ch-lockic {
  align-self: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--acc-soft);
  color: var(--acc);
}
.ch-lockic .ch-svg {
  width: 30px;
  height: 30px;
}
.ch-lockin input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.4em;
}
.ch-more summary {
  cursor: pointer;
  color: var(--mut);
  font-size: 14px;
  padding: 10px 0;
}
.ch-more[open] {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== Lot 27 : boutons plus fins (demande du 07/11) — moins hauts, texte moins gras, contour fin ; zone de toucher
   gardée à 40 px au moins (recommandation 44 px iPhone, 48 px Android : compromis pour un écran plus léger) ===== */
.ch-btn,
.ch-act a.ch-btn {
  padding: 8px 16px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ch-btn .ch-svg,
.ch-bar button .ch-svg,
a.ch-btn .ch-svg {
  width: 16px;
  height: 16px;
  margin-right: 0;
  vertical-align: 0;
}
.ch-btn.ch-dang {
  margin-top: 12px;
}
.ch-bar {
  padding: 6px 10px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  gap: 8px;
}
.ch-bar button,
.ch-app[data-theme^="liya"] .ch-bar button {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
}
.ch-bar button:first-child {
  font-weight: 600;
}
.ch-chip {
  padding: 0.25em 0.75em;
  font-size: 13px;
}
.ch-rxpick {
  min-height: 42px;
  font-size: 21px;
}
/* Champs de saisie assortis aux boutons fins (la saisie des messages garde sa taille) */
.ch-pad .ch-in:not(textarea),
.ch-lockin .ch-in {
  padding: 8px 12px;
  min-height: 40px;
}

/* Lot 29 : état des messages envoyés (horloge = pas parti, 1 coche grise = au relais, 2 grises = sur le téléphone, 2 bleues = lu) */
.ch-ticks {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  vertical-align: -3px;
  color: var(--tick-wait, #8a9a93);
}
.ch-ticks .ch-svg {
  width: 17px;
  height: 17px;
}
.ch-ticks b {
  font-weight: 600;
  font-size: 10px;
}
.ch-ticks.ch-envoi {
  opacity: 0.75;
}
.ch-ticks.ch-lu {
  color: var(--tick-read, #4fc3f7);
}
.ch-app[data-theme="clair"] {
  --tick-wait: #6b7a74;
  --tick-read: #0277bd;
}
.ch-app[data-theme="liya-clair"] {
  --tick-wait: #9cc9b6;
  --tick-read: #4fc8ff;
}
.ch-app[data-theme="liya-sombre"] {
  --tick-wait: #d2ebe0;
  --tick-read: #7dd3fc;
}
/* Un message envoyé et lu s'estompe moins : les coches bleues restent bien visibles jusqu'à l'effacement */
.ch-msg.ch-mine.ch-fading {
  opacity: 0.85;
}
.ch-ticks.ch-lu .ch-svg {
  stroke-width: 2.6;
}
/* Lot 30 : l'écran d'accueil (invitation, pseudo) défile quand il dépasse la hauteur du téléphone ;
   centré seulement s'il tient (marges automatiques), sans écraser ni couper ses blocs. */
.ch-onb {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  justify-content: flex-start;
}
.ch-onb > * {
  flex-shrink: 0;
}
.ch-onb > :first-child {
  margin-top: auto;
}
.ch-onb > :last-child {
  margin-bottom: auto;
}
/* Lot 32 : délai d'effacement des messages de l'autre, sur sa propre ligne dans le bandeau */
.ch-their {
  display: block;
  margin-top: 2px;
}
.ch-their b {
  font-weight: 650;
}
/* Lot 33 : clavier ouvert (iPhone) — la barre « ⌃ ⌄ ✓ » est celle d'iOS (impossible à retirer depuis une web-app) ;
   on lui rend la place perdue : plus de marge de la barre d'accueil sous la saisie, barre de saisie compacte. */
html.ch-kbd .ch-compose,
html.ch-kbd .ch-app[data-theme] .ch-compose {
  padding-top: 6px;
  padding-bottom: 6px;
}
/* Un seul bouton à droite : micro quand le champ est vide, envoi dès qu'on écrit (plus léger) */
.ch-compose:has(.ch-mic):has(textarea:placeholder-shown) .ch-send,
.ch-compose:has(textarea:not(:placeholder-shown)) .ch-mic {
  display: none;
}
.ch-compose .ch-send {
  width: 2.5em;
  min-height: 2.5em;
  height: 2.5em;
  align-self: flex-end;
}
.ch-compose .ch-send .ch-svg {
  width: 19px;
  height: 19px;
}
/* Lot 35 : accueil aéré (piste A) — rangées sans fond ni carte, fines séparations : le thème se voit derrière
   toute la liste ; en-tête et barre du bas transparents, boutons en pastilles centrées. Accueil seulement. */
[data-view="home"] .ch-top,
.ch-app[data-theme] [data-view="home"] .ch-top {
  background: transparent;
  box-shadow: none;
  border-bottom: 0;
}
.ch-app[data-theme] [data-view="home"] .ch-main {
  background: transparent;
}
.ch-app[data-theme] [data-view="home"] .ch-main > .ch-swipe {
  margin: 0 18px;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}
.ch-app[data-theme] [data-view="home"] .ch-main > .ch-swipe .ch-row,
.ch-app[data-theme] [data-view="home"] .ch-main > .ch-swipe .ch-row.ch-pinned {
  background: transparent;
  border-radius: 0;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  border-bottom: 1px solid color-mix(in srgb, var(--txt) 11%, transparent);
}
.ch-app[data-theme] [data-view="home"] .ch-main > .ch-swipe .ch-row.ch-pinned {
  background: color-mix(in srgb, var(--acc) 9%, transparent);
  border-radius: 12px;
}
/* Glisser : la rangée reprend un fond le temps du geste, pour masquer l'action dessous */
.ch-app[data-theme] [data-view="home"] .ch-swipe:not(.ch-swiping):not(.ch-swipe-go) .ch-swipe-bg,
.ch-app[data-theme] [data-view="home"] .ch-swipe:not(.ch-swiping):not(.ch-swipe-go) .ch-swipe-pin {
  visibility: hidden;
}
.ch-app[data-theme] [data-view="home"] .ch-swiping .ch-row,
.ch-app[data-theme] [data-view="home"] .ch-swipe-go .ch-row {
  background: var(--bg);
}
.ch-app[data-theme] [data-view="home"] .ch-row .ch-av {
  width: 44px;
  height: 44px;
  min-width: 44px;
  font-size: 17px;
}
.ch-app[data-theme] [data-view="home"] .ch-search {
  margin: 4px 18px 8px;
}
.ch-app[data-theme] [data-view="home"] .ch-search input {
  background: color-mix(in srgb, var(--txt) 7%, transparent);
  border-color: transparent;
}
.ch-app[data-theme] [data-view="home"] .ch-bar {
  background: transparent;
  box-shadow: none;
  border: 0;
  justify-content: center;
}
.ch-app[data-theme] [data-view="home"] .ch-bar button {
  flex: 0 0 auto;
  padding: 0 22px;
}
.ch-app.a11y-contrast [data-view="home"] .ch-main > .ch-swipe .ch-row {
  outline: 0;
  border-bottom-color: var(--txt);
}
/* Lot 35 : pastille « Connecté » toujours verte, quel que soit le thème (orange en Halloween, rose en Saint-Valentin…) */
.ch-app .ch-dot.ch-online {
  background: #34d399;
  box-shadow: 0 0 0 2px color-mix(in srgb, #34d399 25%, transparent);
}
/* Lot 36 : signaler un message, compte suspendu */
.ch-report .ch-chip[aria-checked="true"] {
  background: var(--acc);
  color: var(--on-acc, #fff);
  border-color: transparent;
}
.ch-report .ch-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.ch-repb {
  color: var(--dang);
}
.ch-dot.ch-bloque {
  background: var(--dang);
}
/* Lot 38 : « Tout le monde va bien ? » dans un groupe */
.ch-checkcard {
  align-self: stretch;
  margin: 6px 4px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1.5px solid color-mix(in srgb, #38bdf8 55%, transparent);
  background: color-mix(in srgb, #38bdf8 10%, var(--pan));
  color: var(--txt);
}
.ch-checkcard.ch-check-help {
  border-color: color-mix(in srgb, var(--dang) 70%, transparent);
  background: color-mix(in srgb, var(--dang) 12%, var(--pan));
}
.ch-check-t {
  margin: 0;
  font-size: 1.08em;
}
.ch-check-by,
.ch-check-sum {
  margin: 2px 0 6px;
  color: var(--mut);
  font-size: 0.9em;
}
.ch-check-l {
  list-style: none;
  margin: 6px 0;
  padding: 0;
}
.ch-check-l li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}
.ch-check-l li small {
  margin-left: auto;
  color: var(--mut);
}
.ch-check-l li.ch-chk-aide b {
  color: var(--dang);
}
.ch-checkcard .ch-act {
  gap: 8px;
}
.ch-checkcard .ch-act .ch-btn {
  flex: 1 1 140px;
}
.ch-checkcard a {
  color: var(--acc);
  font-weight: 600;
}

/* Annonces de l'équipe Chhht! (lot 41) : bandeau en haut de l'accueil, lisible dans tous les thèmes */
.ch-ann {
  --a: var(--acc);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px;
  padding: 10px 12px;
  border-radius: var(--r-m, 12px);
  background: color-mix(in srgb, var(--a) 14%, var(--pan));
  border: 1px solid color-mix(in srgb, var(--a) 45%, transparent);
  color: var(--txt);
  font-size: 14px;
}
.ch-ann-maintenance {
  --a: #fbbf24;
}
.ch-ann-important {
  --a: var(--dang);
}
.ch-ann-ic {
  font-size: 18px;
  line-height: 1.3;
}
.ch-ann-t {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ch-ann-t p {
  margin: 2px 0 0;
  color: var(--txt);
  opacity: 0.9;
}
.ch-ann-t a {
  display: inline-block;
  margin-top: 4px;
  color: var(--txt);
  font-weight: 600;
}
.ch-ann-x {
  border: 0;
  background: none;
  color: var(--mut);
  font-size: 16px;
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
}
/* Déménagement vers la nouvelle adresse (lot 42) */
.ch-ann-move {
  --a: var(--acc);
}
.ch-ann-move .ch-btn {
  margin-top: 8px;
}
/* Confirmation avant l'envoi d'une photo */
.ch-imgprev {
  display: block;
  max-width: 100%;
  max-height: 45vh;
  margin: 6px auto 4px;
  border-radius: var(--r-m, 12px);
  object-fit: contain;
}

/* Plusieurs photos (lot 44) : choix dans la fiche d'envoi, album en une bulle, galerie une à une */
.ch-imgstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 6px;
  scroll-snap-type: x mandatory;
}
.ch-imgsel {
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.ch-imgsel img {
  display: block;
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: var(--r-s, 10px);
}
.ch-imgdel {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}
.ch-imgdel svg {
  width: 14px;
  height: 14px;
}
.ch-album {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: min(260px, 64vw);
  border-radius: 14px;
  overflow: hidden;
}
.ch-album .ch-imgb {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
}
.ch-msg .ch-album img.ch-img,
.ch-album img.ch-img {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 0;
}
.ch-album-3 .ch-imgb:first-child {
  grid-column: span 2;
  aspect-ratio: 2;
}
.ch-album .ch-albmore {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}
.ch-zprev,
.ch-znext {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
.ch-zprev {
  left: 8px;
}
.ch-znext {
  right: 8px;
}
.ch-zcount {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
}
.ch-zoom {
  touch-action: pan-y;
}
.ch-msg .ch-album .ch-imgb {
  border-radius: 0;
}

/* Bandeau d'expiration (lot 45) : complet à l'ouverture, s'estompe après quelques secondes en un petit résumé
   (« 🔒 Vous 24 h · Lucile 1 h ») qui reste à portée : le toucher rouvre le bandeau complet. */
.ch-band-mini {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--mut);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ch-band-mini .ch-svg {
  width: 12px;
  height: 12px;
}
.ch-band-exp.ch-band-gone {
  padding-top: 2px;
  padding-bottom: 2px;
  background: transparent;
  border-color: transparent;
  text-align: center;
}
.ch-band-exp.ch-band-gone .ch-band-full {
  display: none;
}
.ch-band-exp.ch-band-gone .ch-band-mini {
  display: inline-flex;
  opacity: 0.75;
  animation: ch-band-in 0.6s ease;
}
.ch-band-exp:not(.ch-band-gone) .ch-band-full {
  animation: ch-band-in 0.4s ease;
}
@keyframes ch-band-in {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ch-band-exp * {
    animation: none !important;
  }
}
.ch-app[data-view="conv"] .ch-top h1 {
  cursor: pointer;
}

/* Lot 46 : clavier ouvert, la conversation garde le plus de place possible au-dessus du clavier.
   - champ de saisie : 3 lignes au plus (avant : 30 % de l'écran ENTIER sur iPhone, clavier compris) ;
   - barre du haut compacte (marges, avatar, boutons plus petits) ; bandeaux secondaires masqués (déjà fait). */
html.ch-kbd .ch-compose textarea {
  max-height: min(4.6em, calc(var(--vvh, 100vh) * 0.22));
}
html.ch-kbd .ch-top,
html.ch-kbd .ch-app[data-theme] .ch-top {
  min-height: 0;
  padding-top: max(4px, env(safe-area-inset-top));
  padding-bottom: 4px;
}
html.ch-kbd .ch-top .ch-ic {
  min-height: 36px;
  min-width: 36px;
  padding: 4px;
}
html.ch-kbd .ch-top .ch-av-s {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
html.ch-kbd .ch-top h1 {
  font-size: 16px;
}
html.ch-kbd .ch-replybar,
html.ch-kbd .ch-editbar {
  padding-top: 2px;
  padding-bottom: 2px;
}
