/* Slim DenFur live-chat (mobile-first, low bandwidth) */
:root {
  --bg: #0b1220;
  --panel: #151d2e;
  --line: rgba(143, 164, 200, .22);
  --ink: #ebe8f2;
  --muted: #a39db8;
  --accent: #3d5f9a;
  --danger: #fca5a5;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body.cl-body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  /* Reserve space for the fixed bottom compose dock (join + compose states) */
  padding-bottom: calc(118px + var(--safe-bottom));
}
a { color: inherit; text-decoration: none; }
.cl-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  border-bottom: 1px solid var(--line);
  background: #101828;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}
.cl-brand img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
}
.cl-top-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.cl-top-meta strong { font-size: .95rem; }
.cl-top-meta span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.cl-watch {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(61, 95, 154, .2);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.cl-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cl-notice {
  margin: 8px 10px 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 252, .25);
  background: rgba(14, 40, 60, .55);
  color: #cde9ff;
  font-size: .82rem;
  font-weight: 650;
}
.cl-notice[hidden] { display: none !important; }
.cl-feed {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-msg {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(143, 164, 200, .12);
}
.cl-msg strong {
  font-size: .78rem;
  color: #7dd3fc;
  font-weight: 850;
}
.cl-msg span {
  font-size: .95rem;
  word-break: break-word;
}
.cl-empty {
  margin: auto;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
}
.cl-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  border-top: 1px solid var(--line);
  background: #101828;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
}
.cl-locked {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}
.cl-locked p {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
  font-weight: 650;
}
.cl-compose[hidden], .cl-locked[hidden] { display: none !important; }
.cl-userline {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.cl-compose-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.cl-compose input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a101c;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}
.cl-btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.cl-btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.cl-send { min-width: 72px; }
.cl-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: .8rem;
  font-weight: 700;
}
.cl-error[hidden] { display: none !important; }
.cl-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(420px, calc(100vw - 24px));
  background: var(--panel);
  color: var(--ink);
}
.cl-dialog::backdrop { background: rgba(0, 0, 0, .62); }
.cl-dialog form { display: grid; gap: 10px; padding: 14px; }
.cl-dialog h2 { margin: 0; font-size: 1.05rem; }
.cl-dialog p { margin: 0; color: var(--muted); font-size: .85rem; }
.cl-dialog label { display: grid; gap: 6px; font-size: .82rem; font-weight: 750; color: var(--muted); }
.cl-dialog input[type=text] {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a101c;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}
.cl-check {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  grid-template-columns: none;
  color: var(--ink) !important;
  font-weight: 700 !important;
}
.cl-check input { width: auto; margin-top: 3px; }
.cl-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (min-width: 720px) {
  .cl-body {
    max-width: 560px;
    margin: 0 auto;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .cl-dock {
    left: 50%;
    right: auto;
    width: 560px;
    max-width: 100vw;
    transform: translateX(-50%);
  }
}
