/* public/css/chat-panel.css -- the one chat room (public/js/chat-panel.js). */

#chat-panel { position: fixed; z-index: 90; display: flex; flex-direction: column;
  background: var(--bg-secondary); border-left: 1px solid var(--border); }
#chat-panel[hidden] { display: none; }

/* Wide screens: a column on the right, full height (there is no top bar). */
@media (min-width: 900px) {
  #chat-panel { top: 0; right: 0; bottom: 0; width: 300px; }
  html.cp-docked #page-root { margin-right: 300px; }
}
/* Phones: the room opens over the page from the bottom. */
@media (max-width: 899px) {
  #chat-panel { left: 0; right: 0; bottom: 0; top: 12vh; border-left: 0; border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); }
}

.cp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.cp-close { background: none; border: 0; color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.cp-close:hover { color: var(--text-primary); }

.cp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.cp-line { margin: 0 0 6px; overflow-wrap: anywhere; }
.cp-name { font-weight: 700; color: var(--accent-text); margin-right: 6px; }
.cp-me .cp-name { color: var(--win); }
.cp-text { color: var(--text-primary); }
.cp-sys { background: rgba(240, 185, 11, .08); border: 1px solid rgba(240, 185, 11, .25); border-radius: 8px;
  padding: 6px 8px; font-size: 12px; }
.cp-sys .cp-text { color: #f0d77a; }

.cp-err { color: var(--loss); font-size: 12px; padding: 0 12px; }
.cp-err:not(:empty) { padding-bottom: 6px; }
.cp-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.cp-input { flex: 1; min-width: 0; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-primary); padding: 8px 10px; font-size: 13px; outline: none; }
.cp-input:focus { border-color: var(--accent); }
.cp-send { background: var(--accent); color: #04121a; border: 0; border-radius: 7px; padding: 8px 12px;
  font-weight: 700; font-size: 13px; cursor: pointer; }

#chat-fab { position: fixed; z-index: 91; right: 16px; bottom: 16px; background: var(--accent); color: #04121a;
  border: 0; border-radius: 22px; padding: 10px 16px; font-weight: 800; font-size: 14px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
#chat-fab[hidden] { display: none; }
.cp-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px; border-radius: 9px;
  background: var(--loss); color: #fff; font-size: 11px; text-align: center; }
.cp-badge:empty { display: none; }
/* Room below the last row so the floating Chat button never sits on it for good. */
html.cp-fab #page-root { padding-bottom: 80px; }
