/* =====================================================================
   MEXO FM studio chat (radio page, bottom left).
   Uses the radio's "night broadcast" tokens: ink stage, electric blue, chrome accents.
   The panel is a dark stage in every theme, like the player dial.
   ===================================================================== */
.lc { position: fixed; left: 16px; bottom: calc(var(--safe-bottom) + 16px); z-index: 9500; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; transition: bottom 0.35s var(--ease-out); }
/* lift clear of the mini player while it is showing */
body:has(.mini-player.show:not(.at-end)) .lc { bottom: calc(var(--safe-bottom) + 88px); }

.lc-fab {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 16px; border: 1px solid var(--stage-line); border-radius: 999px; cursor: pointer;
  background: linear-gradient(145deg, var(--brand-primary), var(--brand-dark)); color: #fff; font: 800 15px var(--font-body);
  box-shadow: 0 12px 28px rgba(5,10,28,0.5), 0 0 0 1px rgba(143,211,255,0.12) inset;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}
.lc-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(20,87,230,0.45); }
.lc-fab:focus-visible, .lc-close:focus-visible, .lc-send:focus-visible, .lc-btn:focus-visible { outline: 2px solid var(--chrome); outline-offset: 2px; }
.lc-fab i { font-size: 22px; }
.lc-unread { position: absolute; top: -4px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--signal); color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.lc-unread[hidden] { display: none; }

.lc-panel {
  width: min(350px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 170px)); display: flex; flex-direction: column;
  border-radius: 22px; overflow: hidden; background: var(--ink-2); color: var(--stage-text); border: 1px solid var(--stage-line);
  box-shadow: 0 28px 70px rgba(2,5,16,0.65); transform-origin: bottom left; animation: lcPop 0.28s var(--ease-out);
}
.lc-panel[hidden] { display: none; }
@keyframes lcPop { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lc-panel { animation: none; } .lc, .lc-fab { transition: none; } }

.lc-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: linear-gradient(145deg, var(--brand-dark), #082a7a); color: #fff; flex-shrink: 0; border-bottom: 1px solid var(--stage-line); }
.lc-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-head strong { font-size: 16px; line-height: 1.2; }
.lc-head small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.9; }
.lc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stage-muted); flex-shrink: 0; }
.lc-dot.is-on { background: #2ee6a6; box-shadow: 0 0 0 3px rgba(46,230,166,0.25); }
.lc-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(143,211,255,0.16); color: var(--chrome); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.lc-close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.14); color: #fff; cursor: pointer; flex-shrink: 0; }
.lc-close:hover { background: rgba(255,255,255,0.24); }

.lc-msgs { flex: 1; min-height: 150px; overflow-y: auto; padding: 14px; background: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.lc-bubble { max-width: 84%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 2px rgba(0,0,0,0.3); word-wrap: break-word; overflow-wrap: anywhere; }
.lc-bubble p { margin: 0; white-space: pre-wrap; }
.lc-bubble small { display: block; margin-top: 3px; font-size: 11px; opacity: 0.65; text-align: right; }
.lc-bubble.is-agent { align-self: flex-start; background: var(--ink-3); color: var(--stage-text); border: 1px solid var(--stage-line); border-top-left-radius: 4px; }
.lc-bubble.is-visitor { align-self: flex-end; background: linear-gradient(145deg, var(--brand-primary), var(--brand-dark)); color: #fff; border-top-right-radius: 4px; }
.lc-bubble.is-pending { opacity: 0.6; }
.lc-bubble.is-failed { background: var(--signal-text); }

.lc-intro, .lc-form { padding: 12px; background: var(--ink-2); border-top: 1px solid var(--stage-line); flex-shrink: 0; }
.lc-intro { display: flex; flex-direction: column; gap: 8px; }
.lc-intro[hidden], .lc-form[hidden] { display: none; }
.lc-intro input, .lc-form textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--stage-line); border-radius: 12px; background: var(--ink); color: var(--stage-text); font: 500 15px var(--font-body);
}
.lc-intro input::placeholder, .lc-form textarea::placeholder { color: var(--stage-muted); opacity: 0.85; }
.lc-intro input.is-invalid { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(255,45,74,0.2); }
.lc-intro input:focus, .lc-form textarea:focus { outline: 2px solid var(--azure); outline-offset: 1px; }
.lc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border: 0; border-radius: 12px; cursor: pointer; background: linear-gradient(145deg, var(--brand-primary), var(--brand-dark)); color: #fff; font: 800 15px var(--font-body); }
.lc-btn:hover, .lc-send:hover { filter: brightness(1.12); }
.lc-form { display: flex; align-items: flex-end; gap: 8px; }
.lc-form textarea { flex: 1; resize: none; max-height: 96px; line-height: 1.4; }
.lc-send { width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; flex-shrink: 0; background: linear-gradient(145deg, var(--brand-primary), var(--brand-dark)); color: #fff; font-size: 16px; }
.lc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 650px) {
  .lc-fab-label { display: none; }
  .lc-fab { width: 54px; padding: 0; justify-content: center; }
  .lc { left: 12px; }
}
