/* The conversation (assets/js/ems-thread.js): iMessage-style bubbles, photos,
   file cards, links, receipts and the composer - on the member's mentor tab
   (ems-mentor.js) and the mentor's record (tools/coach.js). Plus the
   self-tracking roadmap and the "Next with <mentor>" card. EMS tokens only. */

.ch-thread { display: flex; flex-direction: column; gap: 2px; }
.cpop-thread.ch-thread { gap: 2px; padding: 4px 2px 8px; }
.ems-s-thread.ch-thread { gap: 2px; max-height: 460px; background: #fff; border: 1px solid var(--ems-line); }
.ch-empty { margin: auto 0; padding: 24px 12px; text-align: center; font-size: 14px; line-height: 1.55; color: var(--ems-mute-2); }

.ch-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.ch-day span { font: 650 11.5px/1 var(--ems-font-ui); color: var(--ems-mute-2); letter-spacing: .02em; }
.ch-sys { align-self: center; max-width: 86%; margin: 8px 0; padding: 6px 12px; border-radius: 999px; background: var(--ems-soft); color: var(--ems-mute); font: 500 12.5px/1.4 var(--ems-font-ui); text-align: center; }

.ch-row { display: flex; flex-direction: column; max-width: 78%; margin-top: 8px; }
.ch-row.cont { margin-top: 2px; }
.ch-row.me { align-self: flex-end; align-items: flex-end; }
.ch-row.them { align-self: flex-start; align-items: flex-start; }
.ch-name { margin: 0 12px 3px; font: 650 11.5px var(--ems-font-ui); color: var(--ems-mute-2); }
.ch-b { padding: 9px 14px; border-radius: 20px; font: 400 15px/1.45 var(--ems-font-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-row.me .ch-b { background: var(--ems-navy-500); color: #fff; }
.ch-row.them .ch-b { background: #e9ecf3; color: var(--ems-ink); }
.ch-row.me.end .ch-b { border-bottom-right-radius: 6px; }
.ch-row.them.end .ch-b { border-bottom-left-radius: 6px; }
.ch-b.cheer { background: #fff6dc; color: #5a4300; }
.ch-b a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.ch-row.them .ch-b a { color: var(--ems-navy-600); }
.ch-meta { margin: 3px 8px 0; font: 500 11.5px var(--ems-font-ui); color: var(--ems-faint); }

/* tapbacks (ems-thread.js reactions): iMessage's badge on the bubble's top
   corner - the far corner from the sender's side - and the bar over it */
.ch-bw { position: relative; display: flex; flex-direction: column; align-items: inherit; max-width: 100%; }
.ch-row.has-rx { margin-top: 20px; }
.ch-rx { position: absolute; top: -17px; z-index: 1; display: inline-flex; gap: 3px; padding: 4px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--ems-line); box-shadow: 0 2px 6px rgba(17, 24, 39, .14); font-size: 15px; line-height: 1; }
.ch-row.them .ch-rx { right: -10px; }
.ch-row.me .ch-rx { left: -10px; }
.ch-rx-i { display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; }
.ch-rx-i.is-mine { background: var(--ems-navy-50); box-shadow: 0 0 0 1.5px var(--ems-navy-300); padding: 1px 3px; margin: -1px 0; }
.ch-rx-i small { font: 700 10.5px var(--ems-font-ui); color: var(--ems-mute); }
.ch-rx-i.is-mine small { color: var(--ems-navy-600); }
.ch-rx-add { position: absolute; top: 50%; width: 28px; height: 28px; margin-top: -14px; border: 0; border-radius: 50%; background: transparent; color: var(--ems-faint); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--ems-dur), background var(--ems-dur), color var(--ems-dur); }
.ch-row.them .ch-rx-add { right: -34px; }
.ch-row.me .ch-rx-add { left: -34px; }
.ch-rx-add svg { width: 18px; height: 18px; }
.ch-row:hover .ch-rx-add, .ch-rx-add:focus-visible { opacity: 1; }
.ch-rx-add:hover { background: var(--ems-soft-2); color: var(--ems-navy-500); }
@media (hover: none) { .ch-rx-add { display: none; } }
.ch-tb { position: absolute; bottom: calc(100% + 8px); z-index: 5; display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: #fff; box-shadow: 0 6px 24px rgba(17, 24, 39, .18), 0 0 0 1px rgba(17, 24, 39, .06); animation: ch-tb-in .16s var(--ems-ease-out, ease-out); }
.ch-row.them .ch-tb { left: 0; }
.ch-row.me .ch-tb { right: 0; }
.ch-tb button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform var(--ems-dur) var(--ems-spring, ease), background var(--ems-dur); }
.ch-tb button:hover, .ch-tb button:focus-visible { transform: scale(1.18); background: var(--ems-soft); outline: none; }
.ch-tb button[aria-checked="true"] { background: var(--ems-navy-50); box-shadow: inset 0 0 0 2px var(--ems-navy-300); }
@keyframes ch-tb-in { from { opacity: 0; transform: translateY(4px) scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ch-tb { animation: none; } }
.ch-st { color: var(--ems-mute-2); font-weight: 650; }

.ch-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ch-row.me .ch-files { justify-content: flex-end; }
.ch-img { display: block; border-radius: 16px; overflow: hidden; line-height: 0; background: var(--ems-soft); }
.ch-img img { display: block; min-width: 72px; min-height: 72px; max-width: 240px; max-height: 240px; object-fit: cover; }
.ch-file { display: flex; align-items: center; gap: 10px; min-width: 210px; max-width: 280px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--ems-line); background: #fff; color: var(--ems-ink); text-decoration: none; transition: border-color var(--ems-dur), box-shadow var(--ems-dur); }
.ch-file:hover { border-color: var(--ems-navy-200); box-shadow: var(--ems-lift); }
.ch-file-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); }
.ch-file-ic svg, .ch-file-dl svg { width: 18px; height: 18px; }
.ch-file-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-file-t b { font: 650 13.5px/1.3 var(--ems-font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-file-t small { font: 500 11.5px var(--ems-font-ui); color: var(--ems-mute-2); }
.ch-file-dl { flex: none; color: var(--ems-faint); }
/* a program or guide a mentor sent from Resources (ems-thread.js resourceHtml) */
.ch-res { display: flex; flex-direction: column; width: 280px; max-width: 100%; margin-top: 4px; border-radius: 16px; border: 1px solid var(--ems-line); background: #fff; color: var(--ems-ink); text-decoration: none; overflow: hidden; transition: border-color var(--ems-dur), box-shadow var(--ems-dur); }
.ch-row.me .ch-res { margin-left: auto; }
.ch-res:hover { border-color: var(--ems-navy-200); box-shadow: var(--ems-lift); }
.ch-res-shot { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid var(--ems-line); }
.ch-res-t { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 11px; }
.ch-res-t b { font: 650 13.5px/1.3 var(--ems-font-ui); }
.ch-res-t small { font: 500 12px/1.4 var(--ems-font-ui); color: var(--ems-mute-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-res-t em { display: flex; align-items: center; gap: 5px; font: 650 11px var(--ems-font-ui); font-style: normal; letter-spacing: .04em; text-transform: uppercase; color: var(--ems-navy-500); }
.ch-res-t em svg { width: 13px; height: 13px; }

/* the composer */
.ch-comp { flex: 0 0 auto; margin-top: 10px; }
.ch-bar { display: flex; align-items: flex-end; gap: 8px; }
.ch-att { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ems-soft-2); color: var(--ems-mute); display: grid; place-items: center; cursor: pointer; transition: background var(--ems-dur), color var(--ems-dur); }
.ch-att:hover { background: var(--ems-navy-50); color: var(--ems-navy-500); }
.ch-att svg { width: 19px; height: 19px; }
.ch-in { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 4px; padding: 3px 4px 3px 14px; border: 1px solid var(--ems-line-2); border-radius: 22px; background: #fff; transition: border-color var(--ems-dur), box-shadow var(--ems-dur); }
.ch-in:focus-within { border-color: var(--ems-navy-400); box-shadow: var(--ems-focus); }
.ch-in textarea, .ch-in textarea:focus { flex: 1; min-width: 0; resize: none; min-height: 22px; max-height: 160px; margin: 0; padding: 7px 0; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; font: 400 15px/1.45 var(--ems-font-body); color: var(--ems-ink); }
.ch-in .cpop-mic { width: 32px; height: 32px; margin: 0 0 2px; }
.ch-send { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ems-navy-500); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform var(--ems-dur) var(--ems-spring), opacity var(--ems-dur), background var(--ems-dur); }
.ch-send svg { width: 19px; height: 19px; stroke-width: 2.6; }
.ch-send:disabled { background: var(--ems-line-2); cursor: default; }
.ch-send:not(:disabled):hover { transform: scale(1.06); }
.ch-err { min-height: 0; margin: 4px 46px 0; font: 600 12.5px var(--ems-font-ui); color: var(--ems-red-600); }
.ch-err:empty { display: none; }
.ch-pend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px 46px; }
.ch-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; padding: 5px 6px 5px 5px; border-radius: 12px; border: 1px solid var(--ems-line); background: #fff; }
.ch-chip img, .ch-chip-ic { flex: none; width: 34px; height: 34px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); }
.ch-chip-ic svg { width: 17px; height: 17px; }
.ch-chip-t { min-width: 0; display: flex; flex-direction: column; font: 600 12.5px/1.25 var(--ems-font-ui); color: var(--ems-ink); }
.ch-chip-t, .ch-chip-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-chip-t small { font-weight: 500; color: var(--ems-mute-2); }
.ch-chip.is-up { opacity: .7; }
.ch-chip.is-err { border-color: var(--ems-red-200); }
.ch-chip.is-err small { color: var(--ems-red-600); }
.ch-chip button { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--ems-faint); display: grid; place-items: center; cursor: pointer; }
.ch-chip button:hover { background: var(--ems-soft); color: var(--ems-ink); }
.ch-chip button svg { width: 14px; height: 14px; }
.ch-drop { outline: 2px dashed var(--ems-navy-300); outline-offset: -6px; border-radius: 16px; }

.ems-s-chat .ch-pend { margin-left: 46px; }
@media (max-width: 760px) { .ch-row { max-width: 86%; } .ch-img img { max-width: 200px; max-height: 200px; } }

/* ── the roadmap that ticks itself (ems-mentor.js road()) ────────────────── */
.cpop-road-bar { height: 6px; margin: 8px 0 10px; border-radius: 999px; background: var(--ems-soft-2); overflow: hidden; }
.cpop-road-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ems-good); transition: width .5s var(--ems-ease-out); }
.cpop-road.is-live .cpop-mile.done b { text-decoration: none; color: var(--ems-ink-2); }
.cpop-road.is-live .cpop-mile.done .cpop-mile-no { background: var(--ems-good); color: #fff; }
.cpop-mile-no svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cpop-mile-when { color: var(--ems-good) !important; font-weight: 650; }
.cpop-mile.is-now { border-color: var(--ems-navy-300); box-shadow: 0 0 0 3px var(--ems-navy-50); }
.cpop-mile.is-now .cpop-mile-no { background: var(--ems-navy-500); color: #fff; }
.cpop-mile.is-later { opacity: .82; }
.cpop-mile .cpop-row { margin-top: 8px; }
.cpop-next .cpop-road-bar { margin-top: 0; }
.cpop-next-t { display: block; margin: 0 0 4px; font: 700 15.5px/1.35 var(--ems-font-display); color: var(--ems-ink); }
.cpop-next .cpop-p { margin: 0 0 10px; }
.cpop-mailrow { display: flex; align-items: center; gap: 8px; }
.cpop-mailrow > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cpop-mailrow .cpop-link { margin-left: auto; }

/* résumé review: the mentor's one tap, and the tag both sides see */
.ch-review { margin-top: 6px; padding: 7px 12px; border: 1px solid var(--ems-navy-300); border-radius: 999px; background: #fff; color: var(--ems-navy-500); font: 700 12.5px var(--ems-font-ui); cursor: pointer; }
.ch-review:hover { background: var(--ems-navy-50); }
.ch-tag { margin-top: 5px; font: 650 12px var(--ems-font-ui); color: var(--ems-mute-2); }
.ch-tag.is-ok { color: var(--ems-good); }

/* roadmap: partial progress, "I did this", "I got one" */
.cpop-mile-part { display: block; margin-top: 4px; font: 650 12.5px/1.4 var(--ems-font-ui) !important; color: var(--ems-warn) !important; }
.cpop-selfmark { margin-left: 8px; font-size: 12.5px; color: var(--ems-mute-2); }
.cpop-intro { display: flex; gap: 6px; margin-top: 8px; }
.cpop-intro input { flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--ems-line-2); border-radius: 10px; font: 500 14px var(--ems-font-body); }
.cpop-intro[hidden] { display: none; }

/* the mentor's record: log a call / an introduction, and their roadmap */
.ems-s-log { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--ems-line); border-radius: var(--ems-r-md); background: var(--ems-soft); }
.ems-s-log[hidden] { display: none; }
.ems-s-log .field { margin: 0; }
.ems-s-log-what { flex: 1 1 280px; }
.ems-s-log .ems-s-ctl { display: flex; align-items: center; gap: 8px; }
.ems-s-road { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 6px; }
.ems-s-road li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--ems-soft); }
.ems-s-road li.is-done { background: var(--ems-good-50); }
.ems-s-road-k { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--ems-line-2); display: grid; place-items: center; color: #fff; box-sizing: border-box; }
.ems-s-road li.is-done .ems-s-road-k { background: var(--ems-good); border-color: var(--ems-good); }
.ems-s-road li span:last-child { display: flex; flex-direction: column; }
.ems-s-road b { font: 650 13.5px/1.35 var(--ems-font-ui); color: var(--ems-ink); }
.ems-s-road small { font: 500 12px/1.4 var(--ems-font-ui); color: var(--ems-mute-2); }
.ems-s-road li.is-part small { color: var(--ems-warn); }
