/* Adjugé! — Assistant support (chatbot de FAQ SANS IA + escalade humaine).
   Écran plein écran (sans tabbar, comme le fil de discussion), bulles de
   conversation bot/utilisateur, rebonds cliquables, escalade « conseiller ».
   Aucun style inline (CSP stricte) ; réutilise les classes partagées
   .sheet-* / .f-input / .cta / .composer-* / .icon-btn. */

/* ---------- Écran (plein écran, colonne, sans tabbar) ---------- */
#screen-support { display: flex; flex-direction: column; height: 100dvh; }
.support-head {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--sat)) 12px 8px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.support-head .icon-btn {
  width: 38px; height: 38px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--ink); background: transparent;
}
.support-head .icon-btn:active { background: var(--chip-bg); }
#support-tickets-btn { font-size: 19px; }
.support-head-title {
  flex: 1; text-align: center; font-size: 16px; font-weight: 900;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.support-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 14px 16px;
}
.support-log { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Bulles (bot gauche / utilisateur droite, façon messagerie) ---------- */
.support-bubble {
  max-width: 84%; padding: 10px 14px; border-radius: 18px;
  font-size: 14.5px; line-height: 1.45; word-break: break-word; white-space: pre-wrap;
}
.support-bubble.bot {
  align-self: flex-start; background: #F1ECE4; color: var(--ink);
  border-bottom-left-radius: 6px;
}
.support-bubble.user {
  align-self: flex-end; background: var(--orange); color: #fff;
  border-bottom-right-radius: 6px;
}
.support-bubble .support-q {
  display: block; font-weight: 800; margin-bottom: 5px; font-size: 14px;
}
/* Indicateur « l'assistant écrit… » (3 points) */
.support-typing {
  align-self: flex-start; display: inline-flex; gap: 4px;
  background: #F1ECE4; padding: 13px 16px; border-radius: 18px;
  border-bottom-left-radius: 6px;
}
.support-typing span {
  width: 7px; height: 7px; border-radius: 999px; background: var(--muted2);
  animation: supBlink 1.2s infinite both;
}
.support-typing span:nth-child(2) { animation-delay: 0.2s; }
.support-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes supBlink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* ---------- Rebonds cliquables (questions proches) ---------- */
.support-sugg { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.support-sugg:empty { display: none; }
.support-chip {
  text-align: left; width: 100%; padding: 11px 14px; border-radius: 14px;
  background: #fff; border: 1.5px solid var(--card-line); color: var(--ink);
  font-size: 14px; font-weight: 600; line-height: 1.35;
  display: flex; align-items: center; gap: 8px; transition: transform 0.1s, border-color 0.12s;
}
.support-chip::before { content: '💡'; flex-shrink: 0; }
.support-chip:active { transform: scale(0.98); border-color: var(--orange); }

/* ---------- Escalade « parler à un conseiller » ---------- */
.support-escalate { margin-top: 18px; text-align: center; }
.support-escalate-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.support-human-btn {
  width: 100%; min-height: 48px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.1s;
}
.support-human-btn:active { transform: scale(0.98); }

/* ---------- Barre de saisie (réutilise .composer-input / .composer-send) ---------- */
.support-composer {
  flex-shrink: 0; display: flex; align-items: flex-end; gap: 8px;
  padding: 9px 12px calc(9px + var(--sab));
  border-top: 1px solid var(--line); background: var(--bg);
}

/* ---------- Feuilles (formulaire conseiller + mes demandes) ---------- */
#support-human-sheet, #support-tickets-sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  background: #FFFFFF; border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(24px + var(--sab));
  animation: sheetUp 0.35s cubic-bezier(0.2,0.9,0.3,1) both;
  max-height: 86dvh; overflow: auto;
}
#support-human-backdrop, #support-tickets-backdrop {
  position: fixed; inset: 0; z-index: 59; background: rgba(24,17,9,0.45);
  animation: fadeIn 0.25s ease both;
}
#support-human-sheet .sheet-cta { margin-top: 18px; }
.support-err {
  margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--red);
}
.support-err:empty { display: none; }

/* ---------- Liste « Mes demandes » (tickets) ---------- */
#support-tickets-list { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.sup-ticket {
  border: 1px solid var(--card-line); border-radius: 16px; padding: 12px 14px;
  background: var(--bg);
}
.sup-ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sup-ticket-ref { font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.sup-ticket-status {
  font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-ink);
}
.sup-ticket-status.answered { background: #DDF3E4; color: #1B7A43; }
.sup-ticket-msg { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.sup-ticket-answer {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: #F1ECE4; font-size: 14px; line-height: 1.45; white-space: pre-wrap;
}
.sup-ticket-answer-head { font-size: 12px; font-weight: 800; color: var(--orange-dark); margin-bottom: 4px; }
.sup-tickets-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 8px; line-height: 1.5; }
