/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Video panel — slides in from top when active */
.video-panel {
  display: none;
  flex-direction: column;
  background: #0d0e10;
  border-bottom: 2px solid var(--rule);
  overflow: hidden;
  flex-shrink: 0;
  transition: height 0.3s ease;
}
.video-panel.open {
  display: flex;
  height: 240px;
}
.video-panel.has-screen { height: 340px; }

.video-grid {
  flex: 1;
  display: flex;
  gap: 6px;
  padding: 10px;
  overflow-x: auto;
  align-items: stretch;
}

.v-tile {
  position: relative;
  background: #2a2820;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}
.v-tile.is-screen {
  flex: 1;
  min-width: 360px;
  border-color: rgba(212,116,42,0.4);
}
.v-tile.speaking { border-color: rgba(58,122,90,0.7); }

.v-tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.v-tile-av {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: white;
  font-family: 'DM Serif Display', serif;
}
.v-tile-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-size: 11px; color: rgba(255,255,255,0.85);
  font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.v-tile-label .muted-icon { font-size: 11px; margin-left: auto; opacity: 0.7; }
.screen-tag {
  position: absolute;
  top: 7px; left: 7px;
  font-size: 9px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--amber);
  color: white;
  padding: 2px 6px; border-radius: 3px;
}

/* ===== CHAT ===== */
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Vertical layout: video panel above chat */
.chat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

/* Date divider */
.date-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 8px;
  color: var(--ink4);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
}
.date-divider::before, .date-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}

/* Message */
.msg-row {
  display: flex;
  gap: 12px;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background 0.1s;
}
.msg-row:hover { background: var(--paper2); }
.msg-row.continuation { padding-top: 1px; }
.msg-row.continuation .msg-meta { display: none; }

.msg-av {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
  font-family: 'DM Serif Display', serif;
  margin-top: 1px;
}
.msg-av.placeholder { background: transparent; }

.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-author {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.msg-time {
  font-size: 10.5px;
  color: var(--ink4);
  font-family: 'DM Mono', monospace;
}
.msg-text {
  font-size: 13.5px;
  color: var(--ink2);
  line-height: 1.55;
  word-break: break-word;
}

/* System message */
.sys-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px;
  font-size: 11.5px;
  color: var(--ink4);
  font-family: 'DM Mono', monospace;
}
.sys-row::before { content:''; flex:1; height:1px; background:var(--rule); }
.sys-row::after { content:''; flex:1; height:1px; background:var(--rule); }

/* Input */
.input-area {
  padding: 10px 20px 16px;
  flex-shrink: 0;
}
.input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  padding: 6px 10px 6px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-shell:focus-within {
  border-color: var(--ink3);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.chat-input {
  flex: 1;
  background: none; border: none; outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  resize: none;
  padding: 6px 0;
  max-height: 120px;
  line-height: 1.5;
}
.chat-input::placeholder { color: var(--ink4); }
.send-btn {
  width: 32px; height: 32px;
  background: var(--accent);
  border: none; border-radius: 7px;
  color: white;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.send-btn:hover { opacity: 0.82; }

.quick-emojis {
  display: flex; gap: 2px; align-items: center;
  padding: 0 0 4px;
}
.qe-btn {
  background: none; border: none;
  font-size: 17px; cursor: pointer;
  padding: 3px 5px; border-radius: 5px;
  transition: background 0.12s; line-height: 1;
}
.qe-btn:hover { background: var(--paper2); }

/* ===== RIGHT PANEL ===== */
.right-panel {
  width: 220px;
  background: var(--paper);
  border-left: 1.5px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.rp-section { display: flex; flex-direction: column; }
.rp-section.in-channel { flex-shrink: 0; border-bottom: 1.5px solid var(--rule); }
.rp-section.members-sect { flex: 1; overflow-y: auto; min-height: 0; }
.rp-section.members-sect::-webkit-scrollbar { width: 0; }

.rp-header {
  display: flex; align-items: center;
  padding: 12px 14px 8px; gap: 6px; flex-shrink: 0;
}
.rp-header-label {
  font-size: 10px; font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink3); flex: 1;
}
.rp-collapse-btn {
  background: none; border: none; color: var(--ink4);
  cursor: pointer; font-size: 11px; line-height: 1;
  padding: 2px 5px; border-radius: 3px; transition: all 0.15s;
  font-family: 'DM Mono', monospace; font-weight: 500;
}
.rp-collapse-btn:hover { color: var(--ink); background: var(--paper2); }

/* In-channel row */
.ic-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 5px; margin: 1px 6px;
  transition: background 0.12s;
}
.ic-row:hover { background: var(--paper2); }
.ic-av {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white; flex-shrink: 0;
  font-family: 'DM Serif Display', serif;
}
.ic-name {
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
/* Activity icons */
.ic-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.act-icon {
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; opacity: 0.18; transition: all 0.22s;
  position: relative;
}
.act-icon.lit-voice  { opacity:1; color: var(--green);  background: rgba(58,122,90,0.12); }
.act-icon.lit-muted  { opacity:1; color: var(--red);    background: rgba(192,57,43,0.09); }
.act-icon.lit-cam    { opacity:1; color: var(--blue);   background: rgba(42,90,138,0.11); }
.act-icon.lit-screen { opacity:1; color: var(--amber);  background: rgba(212,116,42,0.11); }
.act-icon.lit-text   { opacity:1; color: var(--ink2);   background: rgba(74,70,64,0.1); }

@keyframes voicePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(58,122,90,0.45); }
  50%      { box-shadow: 0 0 0 3px rgba(58,122,90,0); }
}
.act-icon.lit-voice { animation: voicePulse 1.6s ease infinite; }

/* Typing animation inside text icon */
.type-dots { display:flex; gap:1.5px; align-items:center; }
.type-dots span { display:block; width:2px; height:6px; background:currentColor; border-radius:1px; animation: tdot 1.1s ease infinite; }
.type-dots span:nth-child(2){ animation-delay:.18s; }
.type-dots span:nth-child(3){ animation-delay:.36s; }
@keyframes tdot{ 0%,80%,100%{opacity:.25;transform:scaleY(.5)} 40%{opacity:1;transform:scaleY(1)} }

/* Members section */
.members-body { overflow: hidden; }
.members-body.collapsed { display: none; }
.rp-sub-label {
  font-size: 10px; font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink4); padding: 8px 14px 4px;
}
.m-row {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 14px; border-radius: 5px; margin: 1px 6px;
  transition: background 0.12s;
}
.m-row:hover { background: var(--paper2); }
.m-av {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white; flex-shrink: 0;
  font-family: 'DM Serif Display', serif; position: relative;
}
.m-av::after {
  content:''; position:absolute; bottom:-1px; right:-1px;
  width:8px; height:8px; border-radius:50%; border:2px solid var(--paper);
}
.m-av.online::after  { background: var(--green); }
.m-av.idle::after    { background: #e8a020; }
.m-av.dnd::after     { background: var(--red); }
.m-av.offline::after { background: var(--ink4); }
.m-info { flex:1; min-width:0; }
.m-name { font-size:12.5px; font-weight:500; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.m-sub  { font-size:10px; color:var(--ink4); font-family:'DM Mono',monospace; }
.m-row.offline-row .m-name { color: var(--ink3); }

