/* =========================================================================
 * messages.css (3.17) — couleurs des conversations, pop-ups de messages, récapitulatif,
 * réglages rangés par catégories repliables
 *   bleu  = discussion entre enfants       (.scope-sib)
 *   jaune = discussion avec les parents    (.scope-parent)
 * ========================================================================= */
.scope-sib { --mc: #2f80ed; --ms: #e3efff; --mt: #fff; }
.scope-parent { --mc: #f2b705; --ms: #fff3bf; --mt: #3d3000; }

/* Fenêtre de conversation et bulles */
.kid-chat.scope-sib .chat-list, .kid-chat.scope-parent .chat-list,
.pm-chat.scope-sib .chat-list, .pm-chat.scope-parent .chat-list { background: var(--ms); border: 3px solid var(--mc); }
.kid-chat[data-scope] .chat-status, .pm-chat[data-scope] .pm-chat-head { background: var(--ms); border: 2px solid var(--mc); }
.pm-chat[data-scope] .pm-chat-head { border-radius: 14px; padding: 8px 12px; }
.scope-sib .bubble-row.mine .bubble, .scope-parent .bubble-row.mine .bubble { background: var(--mc); color: var(--mt); }
.scope-sib .bubble-row.theirs .bubble, .scope-parent .bubble-row.theirs .bubble { background: #fff; border: 2px solid var(--mc); }
.kid-chat[data-scope] .chat-input textarea:focus { border-color: var(--mc); }

/* Liste des conversations : bandeau et pastille de la couleur */
.parent-pick.scope-sib, .parent-pick.scope-parent { border-left-color: var(--mc); background: linear-gradient(90deg, var(--ms), #fff 55%); }
.pm-conv.scope-sib, .pm-conv.scope-parent { border-left: 6px solid var(--mc); }
.pm-conv.scope-sib.on, .pm-conv.scope-parent.on { background: var(--ms); }
.parent-pick .pp-body b::before, .pm-conv-body b::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--mc); margin-right: 8px; vertical-align: baseline; }
.pm-conv.scope-sib:hover, .pm-conv.scope-parent:hover { background: var(--ms); }

/* Pop-up « nouveau message » (dans l'appli) */
#msgPops { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; z-index: 2147483100; width: min(94vw, 640px); pointer-events: none; }
.msg-pop { pointer-events: auto; display: flex; align-items: center; gap: 16px; text-align: left; background: var(--ms); border: 5px solid var(--mc); border-radius: 26px; padding: 20px 24px; font-family: inherit; font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--ink); box-shadow: 0 14px 40px rgba(42, 35, 80, .38); cursor: pointer; animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1), popPulse 1.6s ease-in-out .4s 3; }
.msg-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--mc); box-shadow: 0 0 0 6px var(--ms), 0 0 0 9px var(--mc); }
@media (max-width: 600px) { #msgPops { width: calc(100vw - 20px); } .msg-pop { font-size: 1.25rem; padding: 16px 18px; } }

/* Récapitulatif après un exercice */
.msg-recap-box { border-top: 10px solid var(--mc); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.msg-recap-box h2 { margin: 0; }

/* Boutons photo */
.pm-photo-btn span { font-size: 1rem; font-weight: 700; margin-left: 4px; }
.chat-input .pm-photo-btn { flex-direction: row; gap: 2px; padding: 0 14px; }

/* =========================================================================
 * Réglages : catégories repliables
 * ========================================================================= */
.set-cats { display: flex; flex-direction: column; gap: 12px; }
.set-cat { border-radius: var(--radius, 20px); background: #fff; box-shadow: var(--shadow); overflow: hidden; border: 2px solid transparent; }
.set-cat[open] { border-color: var(--line, #e4e0f5); }
.set-cat > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; min-height: 64px; }
.set-cat > summary::-webkit-details-marker { display: none; }
.set-cat > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.set-cat-icon { font-size: 1.9rem; flex: none; width: 44px; text-align: center; }
.set-cat-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.set-cat-title b { font-size: 1.2rem; }
.set-cat-title small { color: var(--muted); font-size: .92rem; }
.set-cat-chev { flex: none; transition: transform .2s; font-size: 1.2rem; color: var(--muted); }
.set-cat[open] .set-cat-chev { transform: rotate(90deg); }
.set-cat-badge { flex: none; font-size: .78rem; background: #fff3bf; border-radius: 99px; padding: 2px 10px; color: #6b5200; }
.set-cat-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.set-cat-body > .card { box-shadow: none; border: 1px solid var(--line, #e4e0f5); margin: 0; }
.set-cat-empty { color: var(--muted); font-style: italic; }
.quiet-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.quiet-line input[type=time] { width: auto; }
.kid-notif-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
@media (max-width: 600px) { .set-cat > summary { padding: 12px 12px; } .set-cat-body { padding: 4px 10px 14px; } .set-cat-icon { font-size: 1.6rem; width: 36px; } }
.msg-dot-inline { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--mc); vertical-align: baseline; }
.parents-list-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.parents-list-row .kid-level, .parents-list-row select { margin-left: auto; }
.set-form-anchor { display: none; }

.scope-hw { --mc: #16a34a; --ms: #dcfce7; --mt: #fff; }
@keyframes popIn { from { transform: translateY(-40px) scale(.9); opacity: 0; } }
@keyframes popPulse { 0%, 100% { box-shadow: 0 14px 40px rgba(42, 35, 80, .38), 0 0 0 0 var(--mc); } 50% { box-shadow: 0 14px 40px rgba(42, 35, 80, .38), 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .msg-pop { animation: none; } }
/* Les petites bulles d'information (toasts) sont aussi plus grosses */
#toasts .toast { font-size: 1.2rem; padding: 14px 22px; }
