/* Talk it through, as a class: the thread as the projector and the phones
   draw it (vote/talk-class.js). It looks like the lesson's own thread
   (talk.css): Messages on a phone, grey bubbles for them and blue for the
   reply that was sent. Light here; the phone page adds its dark look. */

.cv-chat {
    --cv-bg: #ffffff;
    --cv-them: #e9e9eb;
    --cv-them-ink: #000000;
    --cv-you: #0b84fe;
    --cv-head: #f6f6f8;
    --cv-rule: rgba(0, 0, 0, .08);
    --cv-ink: #18211f;
    --cv-soft: #6b7370;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 22px;
    overflow: hidden;
    background: var(--cv-bg);
    box-shadow: 0 1px 3px rgba(24, 33, 31, .08), 0 0 0 1px rgba(24, 33, 31, .08);
}

.cv-head {
    flex: none;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 9px;
    background: var(--cv-head);
    border-bottom: 1px solid var(--cv-rule);
}
.cv-who {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    line-height: 1.25;
    text-align: center;
}
.cv-avatar {
    width: 40px;
    height: 40px;
    margin-bottom: 3px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #a6abb7, #858a96);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
}
.cv-who strong { font-size: .86rem; font-weight: 600; color: var(--cv-them-ink); }
.cv-role { font-size: .74rem; color: #8e8e93; }

/* How the person is taking it: a word and a dot, from upset to open. */
.cv-mood {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(120, 120, 128, .14);
    font-size: .78rem;
    font-weight: 600;
    color: var(--cv-ink);
    white-space: nowrap;
}
.cv-mood-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa19d; transition: background .4s ease; }
.cv-mood.is-m0 .cv-mood-dot { background: #d9534f; }
.cv-mood.is-m1 .cv-mood-dot { background: #e08a3c; }
.cv-mood.is-m2 .cv-mood-dot { background: #9aa19d; }
.cv-mood.is-m3 .cv-mood-dot { background: #6fae6b; }
.cv-mood.is-m4 .cv-mood-dot { background: #2e9e5b; }

.cv-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 16px;
}
.cv-day { margin: 2px 0 10px; text-align: center; font-size: .72rem; color: #8e8e93; }
.cv-day strong { font-weight: 600; }

.cv-msg {
    position: relative;
    max-width: 78%;
    margin-top: 2px;
    padding: 8px 13px;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.38;
}
.cv-msg p { margin: 0; }
.cv-msg.is-first { margin-top: 10px; }
.cv-msg.is-them { align-self: flex-start; background: var(--cv-them); color: var(--cv-them-ink); }
.cv-msg.is-you { align-self: flex-end; background: var(--cv-you); color: #ffffff; }
.cv-msg.is-them.is-last { border-bottom-left-radius: 5px; }
.cv-msg.is-you.is-last { border-bottom-right-radius: 5px; }

/* The coach note, on the projector only. No edge stripe: the tint and the
   icon carry whether the reply helped. */
.cv-note {
    align-self: stretch;
    margin: 12px 0 4px;
    padding: 11px 14px;
    border-radius: 14px;
    background: #f3f1ea;
    color: var(--cv-ink);
    font-size: .92rem;
    line-height: 1.5;
}
.cv-note p { margin: 0; }
.cv-note-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px !important; font-weight: 700; font-size: .84rem; }
.cv-note.is-up { background: #e8f3ea; }
.cv-note.is-up .cv-note-head { color: #1f7a45; }
.cv-note.is-down { background: #f8e9e6; }
.cv-note.is-down .cv-note-head { color: #a8443a; }
.cv-note.is-flat .cv-note-head { color: #6b6250; }

.cv-ending {
    align-self: stretch;
    display: flex;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
    background: #f3f1ea;
    color: var(--cv-ink);
}
.cv-ending-icon {
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(24, 33, 31, .08);
    font-size: 1.25rem;
}
.cv-ending.is-good { background: #e8f3ea; }
.cv-ending.is-good .cv-ending-icon { background: #cfe8d5; color: #1f7a45; }
.cv-ending.is-poor { background: #f8e9e6; }
.cv-ending.is-poor .cv-ending-icon { background: #f1d3cd; color: #a8443a; }
.cv-ending-label { margin: 0 0 2px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cv-soft); }
.cv-ending h4 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: inherit; }
.cv-ending p { margin: 0; font-size: .92rem; line-height: 1.5; }

/* Lines that have just arrived come in one after the other. */
.cv-log > .is-new { animation: cv-in .36s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cv-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cv-log > .is-new { animation: none; }
}
