/* =====================================================================
   ПОРАКИ — клиент ↔ тренер
   ===================================================================== */
#msgFab { display: none; }
#msgFab.show {
  display: grid; place-items: center; position: fixed; z-index: 2600;
  top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(23,40,66,.92); border: 1px solid rgba(212,175,95,.35); color: var(--nv-gold, #D4AF5F);
  box-shadow: 0 8px 22px -8px rgba(0,0,0,.6); backdrop-filter: blur(10px); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#msgFab.show.coach { top: calc(env(safe-area-inset-top, 0px) + 4px); right: 62px; width: 42px; height: 42px; }
#msgFab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#msgFab:active { transform: scale(.94); }
.msg-badge { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #FF5A4E; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #0A1424; }
/* на „Денес“ иконата за пораки го зазема местото на ѕвончето */
body:has(#msgFab.show) #v2Today .v2-head .v2-iconbtn { visibility: hidden; }
.msg-row-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #FF5A4E; color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.v2-cav { position: relative; }

/* ---------- разговор / сите пораки ---------- */
#msgSheet, #msgInbox {
  position: fixed; inset: 0; z-index: 3600; display: flex; flex-direction: column;
  background: #0A1424; animation: msgIn .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes msgIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.msg-top { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 12px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(17,31,53,.96); }
.msg-x { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); background: #172842; color: #F3F4F0; display: grid; place-items: center; cursor: pointer; flex: none; }
.msg-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.msg-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #F3F4F0; background: #172842; border: 2px solid #D4AF5F; flex: none; }
.msg-who { flex: 1; min-width: 0; }
.msg-who b { display: block; color: #F3F4F0; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-who small { display: block; color: #8C9AB3; font-size: 12px; }
.msg-inbox { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid rgba(212,175,95,.35); background: transparent; color: #D4AF5F; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.msg-list { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
.msg-empty { margin: auto 10px; text-align: center; color: #8C9AB3; font-size: 13.5px; line-height: 1.55; }
.msg-day { align-self: center; margin: 10px 0 4px; padding: 4px 12px; border-radius: 10px; background: #172842; color: #8C9AB3; font-size: 11px; font-weight: 700; }
.msg-b { max-width: 80%; padding: 9px 12px 6px; border-radius: 18px; position: relative; }
.msg-b p { margin: 0; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; line-height: 1.42; }
.msg-b time { display: block; text-align: right; font-size: 10px; margin-top: 3px; opacity: .65; }
.msg-b.me { align-self: flex-end; background: #D4AF5F; color: #0A1424; border-bottom-right-radius: 6px; }
.msg-b.them { align-self: flex-start; background: #172842; color: #F3F4F0; border: 1px solid rgba(255,255,255,.06); border-bottom-left-radius: 6px; }
.msg-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top: 1px solid rgba(255,255,255,.07); background: rgba(17,31,53,.96); }
.msg-form textarea { flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 12px 14px !important; border-radius: 23px !important; background: #0A1424 !important; border: 1px solid rgba(255,255,255,.1) !important; color: #F3F4F0 !important; font-size: 15px !important; line-height: 1.35; font-family: inherit; outline: none; }
.msg-form textarea:focus { border-color: #D4AF5F !important; }
.msg-send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #D4AF5F; color: #0A1424; display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 8px 20px -8px rgba(212,175,95,.6); }
.msg-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.msg-inbox-list { flex: 1; overflow-y: auto; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.msg-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 18px; border: 1px solid rgba(255,255,255,.07); background: #111F35; cursor: pointer; text-align: left; font-family: inherit; }
.msg-row-tx { flex: 1; min-width: 0; }
.msg-row-tx b { display: block; color: #F3F4F0; font-size: 14.5px; font-weight: 700; }
.msg-row-tx small { display: block; color: #8C9AB3; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row time { font-size: 11px; color: #8C9AB3; flex: none; }
.msg-row-u { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #FF5A4E; color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; flex: none; }
.msg-badge[hidden] { display: none !important; }
