/* Coach Dodo as a messaging app (7 October 2026, Audric: « un chat libre type WhatsApp, avec les codes de Dodo »).
   Full-screen conversation: header, scrolling messages, one-line suggestions and a composer; everything else in « ⋯ ». */
body.chat-mode { overflow: hidden; }
body.chat-mode header.site, body.chat-mode footer.site, body.chat-mode .new-address { display: none; }
body.chat-mode main.coach-app { max-width: none; padding: 0; margin: 0; }

.chat-app { position: fixed; inset: 0; margin: 0 !important; display: flex; flex-direction: column; height: 100dvh; background: var(--surface);
  padding-top: env(safe-area-inset-top, 0px); }
.chat-app[hidden] { display: none !important; }

/* Header */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.chat-back, .chat-menu-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--accent);
  background: none; border: 0; cursor: pointer; flex: none; }
.chat-back svg, .chat-menu-btn svg { width: 22px; height: 22px; }
.chat-menu-btn svg { fill: currentColor; }
.chat-back:hover, .chat-menu-btn:hover { background: var(--soft); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soft) url(img/mark.svg) center / 26px no-repeat; flex: none; }
.chat-who { flex: 1; min-width: 0; }
.chat-who h1 { font-size: 1.05rem; margin: 0; line-height: 1.2; letter-spacing: 0; }
.chat-status { margin: 0; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Messages */
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 8px; -webkit-overflow-scrolling: touch; }
.chat-notice [hidden] { display: none; }
.chat-notice { margin: 4px auto 14px; max-width: 34ch; text-align: center; font-size: .78rem; color: var(--muted);
  background: var(--bg); border-radius: 10px; padding: 6px 10px; }
.chat-pinned { display: block; margin: 0 auto 12px; padding: 10px 16px; border-radius: 999px; border: 0; background: var(--accent);
  color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; }
.chat-pinned[hidden] { display: none; }
.chat-log { display: flex; flex-direction: column; gap: 4px; padding: 0; min-height: 0; }
.chat-log .msg { position: relative; max-width: 82%; padding: 8px 12px 18px; border-radius: 16px; font-size: .97rem; line-height: 1.42;
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; box-shadow: 0 1px 1px rgba(20, 28, 43, .06); }
.chat-log .msg.coach { align-self: flex-start; background: var(--bg); border: 0; border-top-left-radius: 4px; }
.chat-log .msg.parent { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-top-right-radius: 4px; }
.chat-log .msg + .msg.parent, .chat-log .msg.parent + .msg.coach { margin-top: 8px; }
.chat-log .msg time { position: absolute; right: 10px; bottom: 4px; font-size: .68rem; opacity: .6; font-variant-numeric: tabular-nums; }
.chat-log .msg::before { content: none; }
/* Coach message kinds stay distinguishable, but quietly. */
.chat-log .msg.disclosure { font-weight: 600; }
.chat-log .msg.missing, .chat-log .msg.uncertainty, .chat-log .msg.proof { color: var(--muted); font-size: .92rem; }
.chat-log .msg.rule, .chat-log .msg.plan { background: var(--soft); }
.chat-log .msg.plan { max-width: 90%; }
.chat-log .msg.alert strong, .chat-log .msg.urgent { color: var(--glow); }
.chat-log .msg.urgent { font-weight: 600; }
.chat-log .msg.reassurance { font-style: italic; }

/* Typing indicator */
.chat-typing { display: inline-flex; gap: 4px; padding: 12px 14px; margin-top: 6px; background: var(--bg); border-radius: 16px; border-top-left-radius: 4px; }
.chat-typing[hidden] { display: none; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: chat-dot 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; } .chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-typing span { animation: none; opacity: .6; } }

/* Composer: one line of suggestions, then the message field */
.chat-compose { background: var(--bg); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
.chat-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.chat-chips:empty { display: none; }
.chat-chips::-webkit-scrollbar { display: none; }
.chat-chips button, .chat-chips a { flex: none; display: inline-flex; align-items: center; text-decoration: none; max-width: 80vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 14px; min-height: 40px;
  border-radius: 999px; border: 1px solid var(--accent); background: var(--bg); color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; }
.chat-chips button:hover, .chat-chips a:hover { background: var(--soft); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; }
.chat-form[hidden] { display: none; }
.chat-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; padding: 11px 16px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; line-height: 1.35; }
.chat-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat-send { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer; flex: none; }
.chat-send svg { width: 20px; height: 20px; }

/* « ⋯ » options sheet */
.chat-sheet-backdrop { position: fixed; inset: 0; background: rgba(13, 18, 27, .35); z-index: 20; }
.chat-sheet-backdrop[hidden] { display: none; }
.chat-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 85dvh; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgba(13, 18, 27, .18); }
.chat-sheet[hidden] { display: none; }
@media (min-width: 640px) { .chat-sheet { left: 50%; right: auto; width: 420px; transform: translateX(-50%); bottom: 16px; border-radius: 20px; } }
.chat-sheet-title { font-weight: 650; margin: 0 0 6px; }
.chat-sheet-item { display: block; width: 100%; text-align: left; padding: 12px 4px; min-height: 48px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.chat-sheet-item[hidden] { display: none; }
.chat-sheet-item:hover { color: var(--accent); }
.chat-sheet-item:disabled { opacity: .45; cursor: default; }
.chat-sheet-item.danger { color: var(--glow); }
.chat-sheet-sep, .chat-sheet-note { font-size: .85rem; color: var(--muted); margin: 10px 0; }
.chat-sheet-sep[hidden], .chat-sheet-note[hidden] { display: none; }
.chat-sheet-close { width: 100%; margin-top: 12px; }

/* Free trial (essai.html): the plan's steps by their moments, their content for subscribers. */
.trial-unlock { margin: 14px 0 8px; padding: 18px; border-radius: 20px; background: var(--bg); border: 1.5px solid var(--accent); box-shadow: 0 10px 30px rgba(44, 74, 154, .12); }
.trial-unlock h2 { margin: 0 0 10px; font-size: 1.15rem; }
.trial-unlock p { margin: 10px 0 0; }
.trial-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.trial-steps li { line-height: 1.4; }
.trial-blur { filter: blur(5px); user-select: none; }
.trial-plans { display: grid; gap: 8px; margin-top: 14px; }
.trial-plans .btn { text-align: center; }
@media (prefers-reduced-motion: no-preference) { .trial-unlock:not([hidden]) { animation: trial-in 380ms cubic-bezier(.2, .9, .25, 1) both; } }
@keyframes trial-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
