/* =========================================================
   «Commenta» — il coach commenta un esercizio svolto, il cliente risponde (js/commenti.js). Prefisso exc-.
   Aspetto portato dal prototipo che Alex ha approvato (hypervex-commento-prototipi/commento.css, prefisso ec-).
   Tutto usa i colori e i caratteri dell'app (variabili del tema): chiaro e scuro vengono da soli.
   ========================================================= */

/* ---------- foto dell'esercizio (ferma: è il primo fotogramma della GIF disegnato su un canvas) ---------- */
.exc-thumb { width: 54px; height: 54px; border-radius: 15px; background: #fff; flex: none; border: 1px solid var(--line); display: block; object-fit: cover; }
.exc-thumb.ph { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--txt-3); }
.exc-thumb.ph .ic { width: 24px; height: 24px; }
canvas.exc-still:not(.ok) { background: var(--surface-2); }
.exc-thumb.lg { width: 64px; height: 64px; }

/* ---------- testata di un esercizio dentro l'allenamento svolto ---------- */
.exc-ex-h { display: flex; align-items: center; gap: 13px; margin-bottom: 13px; }
.exc-ex-t { flex: 1; min-width: 0; }
.exc-ex-t .h3 { margin: 0 !important; font-size: 19px; line-height: 1.15; }
.exc-ex-s { margin-top: 4px; color: var(--txt-2); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exc-go { color: var(--txt-3); display: flex; align-items: center; flex: none; }
.exc-go .ic { width: 22px; height: 22px; }
.exc-tapc { cursor: pointer; }
.exc-tapc:active { border-color: rgba(255,46,62,.45); }
.exc-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--red-soft); color: var(--red); font: 900 12.5px var(--font); padding: 4px 9px; border-radius: 999px; white-space: nowrap; vertical-align: middle; margin-left: 6px; }
.exc-badge .ic { width: 14px; height: 14px; }
/* nell'elenco «Svolti» del computer le scritte piccole sotto il titolo sono blocchi (css/svolti.css): il numero dei commenti resta una pastiglia accanto al titolo */
.svo-li .tx b .exc-badge { display: inline-flex; font: 900 12.5px var(--font); color: var(--red); margin-left: 8px; }
.exc-hl { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-soft), 0 12px 34px -14px var(--red-glow); transition: box-shadow .4s; }

/* ---------- esercizio aperto (telefono del coach) ---------- */
.exc-hero { padding: 0; overflow: hidden; }
.exc-hero img { display: block; width: 100%; height: 232px; object-fit: contain; background: #fff; }
.exc-tags { display: flex; gap: 8px; flex-wrap: wrap; padding: 13px 14px; }
.exc-tags span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 13.5px; color: var(--txt); }
.exc-tags span b { color: var(--red); }
.exc-cta { position: fixed; left: 0; right: 0; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); padding: 0 16px; z-index: 30; }
.exc-big { width: 100%; height: 60px; border-radius: 19px; font-size: 19.5px !important; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 11px; border: 0; }
.exc-big .ic { width: 24px; height: 24px; }
.exc-pad { height: 96px; }

/* ---------- foglio «Commenta» / «Rispondi» ---------- */
.exc-ref { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 12px; }
.exc-ref b { display: block; font-size: 16.5px; }
.exc-ref span { color: var(--txt-2); font-weight: 700; font-size: 13px; }
.exc-ta { min-height: 150px; font-size: 16.5px; width: 100%; }
.exc-note { display: flex; gap: 9px; color: var(--txt-2); font-weight: 700; font-size: 13.5px; line-height: 1.42; margin: 12px 2px 16px; }
.exc-note .ic { width: 18px; height: 18px; flex: none; color: var(--red); margin-top: 1px; }
.exc-send { width: 100%; height: 56px; border-radius: 17px; font-size: 18px !important; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---------- la scheda nella chat ---------- */
.msg.exc-msg { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; max-width: min(94%, 560px) !important; width: 94%; position: relative; }
.msg.exc-msg.me { margin-left: auto; }
.msg.exc-msg .msg-menu-btn { top: 6px; right: 8px; z-index: 2; color: var(--red); }
.exc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; width: 100%; text-align: left; cursor: pointer; color: var(--txt); }
.exc-card-k { display: flex; align-items: center; gap: 8px; padding: 11px 38px 11px 16px; font: 900 11.5px var(--font); letter-spacing: 1px; text-transform: uppercase; color: var(--red); background: var(--red-soft); }
.exc-card-k .ic { width: 16px; height: 16px; flex: none; }
.exc-card-ex { display: flex; gap: 13px; align-items: center; padding: 14px 16px 4px; }
.exc-card-ex b { display: block; font-size: 18px; line-height: 1.15; }
.exc-card-ex span { display: block; color: var(--txt-2); font-weight: 700; font-size: 13px; margin-top: 2px; }
.exc-card-ex em { display: block; font-style: normal; color: var(--txt); font-weight: 800; font-size: 13.5px; margin-top: 4px; }
.exc-card-t { padding: 10px 16px 14px; font-size: 16.5px; line-height: 1.45; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.exc-card-go { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--line); font-weight: 900; color: var(--red); font-size: 15.5px; }
.exc-card-go .ic { width: 20px; height: 20px; }

/* ---------- commenti dentro l'esercizio: cliente ---------- */
.exc-cm { margin-top: 14px; border-radius: 16px; background: var(--red-soft); border: 1px solid rgba(255,46,62,.28); padding: 14px 14px 13px; }
.exc-cm.me { background: var(--surface-2); border-color: var(--line); }
.exc-cm-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.exc-cm-h .avatar { width: 30px !important; height: 30px !important; border-radius: 10px !important; font-size: 12px !important; }
.exc-cm-h b { font-size: 15px; }
.exc-cm-h span { margin-left: auto; color: var(--txt-3); font-weight: 700; font-size: 12.5px; }
.exc-cm-t { font-size: 16px; line-height: 1.45; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.exc-reply { margin-top: 13px; height: 46px; font-size: 15.5px !important; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.exc-reply .ic { width: 20px; height: 20px; }

/* ---------- commenti dentro l'esercizio: coach (telefono e computer) ---------- */
.exc-thread { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.exc-thread:empty { display: none; }
.exc-bub { border-radius: 16px; padding: 11px 14px; font-size: 15px; line-height: 1.45; font-weight: 600; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.exc-bub small { display: block; color: var(--txt-3); font: 800 11.5px var(--font); margin-bottom: 4px; }
.exc-bub.co { background: var(--red-soft); border: 1px solid rgba(255,46,62,.28); align-self: flex-end; }
.exc-bub.cl { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.exc-th:empty { display: none; }
.exc-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--txt); font: 800 14px var(--font); cursor: pointer; flex: none; }
.exc-btn.pr { background: var(--red); border-color: var(--red); color: #fff; }
.exc-btn .ic { width: 18px; height: 18px; }
.exc-ex-h .exc-btn { margin-left: auto; }
.exc-inline { margin-top: 14px; }
.exc-inline textarea { width: 100%; min-height: 84px; }
.exc-inline .exc-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.exc-inline .exc-row .t { flex: 1; color: var(--txt-2); font-weight: 700; font-size: 13px; display: flex; gap: 7px; align-items: center; }
.exc-inline .exc-row .t .ic { width: 16px; height: 16px; color: var(--red); flex: none; }
.exc-card-pc { margin: 0; }
