:root {
  --bg: #090b0e;
  --panel: #11151a;
  --panel2: #171c22;
  --panel3: #202730;
  --line: #29313a;
  --text: #f3f5f7;
  --muted: #929eaa;
  --dim: #687581;
  --accent: #ff7a36;
  --accent2: #ffad72;
  --green: #42c995;
  --red: #ef626c;
  --blue: #73a9ff;
  --radius: 16px;
  --shadow: 0 18px 55px #0007;
  --stream-card-height: 110px;
  --stream-gap: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 80% -15%, #63301533, transparent 38%), var(--bg);
  color: var(--text);
  font: 14px Inter, Segoe UI, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #1b100a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: .16s;
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:disabled {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

button.secondary {
  background: #242c35;
  border-color: #36414c;
  color: #e7edf2;
}

button.ghost {
  background: transparent;
  border-color: var(--line);
  color: #d9e0e6;
}

button.danger {
  background: #482328;
  border-color: #74343c;
  color: #ffdfe1;
}

button.small {
  padding: 7px 10px;
  font-size: 11px;
}

input,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #35404b;
  border-radius: 10px;
  background: #0b0f13;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #ff7a361a;
}

label {
  display: block;
  margin: 15px 0 7px;
  color: #b9c3cc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ===== TOPBAR ===== */
.topbar {
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid #ffffff12;
  background: #0b0e12eF;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.brand-mark {
  width: 9px;
  height: 25px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 20px #ff7a3688;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .7px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.pulse {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  box-shadow: 0 0 10px #42c99577;
}

/* ===== SHELL / LAYOUT ===== */
.shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px;
  display: grid;
  grid-template-columns: clamp(220px, 12vw, 300px) minmax(0, 1fr);
  gap: 17px;
  min-height: calc(100vh - 66px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  height: max-content;
  position: sticky;
  top: 84px;
  padding: 12px;
  background: #101419;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
}

.nav-caption {
  padding: 9px 10px 7px;
  color: #687582;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 2px 0;
  padding: 12px 11px;
  background: transparent;
  color: #9ba7b2;
  border: 1px solid transparent;
  font-size: 12px;
}

.nav-btn:hover {
  background: #1a2027;
  color: white;
  transform: none;
}

.nav-btn.active {
  background: #332116;
  border-color: #754222;
  color: #ffb17e;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.sidebar-foot {
  margin: 14px 8px 4px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--dim);
  line-height: 1.6;
}

/* ===== MAIN ===== */
.main {
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 3px 0 17px;
  padding: 0 3px 14px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-size: 9px;
  color: var(--accent2);
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 5px 0 0;
  font-size: 22px;
  letter-spacing: -.4px;
}

.page-meta {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}

/* ===== PANELS ===== */
.panel {
  display: none;
  min-height: calc(100vh - 130px);
}

.panel.active {
  display: block;
}

.intro {
  margin: 0 0 16px;
  max-width: 850px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ===== GRID / CARDS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  min-height: calc(100vh - 180px);
}

.card {
  min-width: 0;
  padding: 18px;
  background: linear-gradient(155deg, #151a20, #11151a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px #0002;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
  min-height: 420px;
}

.span-7 {
  grid-column: span 7;
  min-height: 420px;
}

.span-6 {
  grid-column: span 6;
}

.span-5 {
  grid-column: span 5;
  min-height: 420px;
}

.span-4 {
  grid-column: span 4;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.card h2 {
  font-size: 13px;
  margin: 0;
  font-weight: 850;
}

.card-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 7px 0 13px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.status {
  padding: 11px 13px;
  background: #0c1116;
  border: 1px solid #29333d;
  border-radius: 10px;
  color: #bac5ce;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 12px;
}

.status.good {
  border-color: #28634d;
  color: #a9e9ce;
}

.status.bad {
  border-color: #70343b;
  color: #ffc2c6;
}

.status.warn {
  border-color: #71502d;
  color: #ffd7a7;
}

/* ===== STATS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  padding: 13px 14px;
  background: #0e1318;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.stat small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 21px;
  letter-spacing: -.5px;
}

/* ===== TAGS ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #39434d;
  border-radius: 99px;
  color: #aeb9c3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
}

.tag.live {
  border-color: #6c3824;
  background: #321e15;
  color: #ffb184;
}

/* ===== STREAM TOOLBAR ===== */
.stream-toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.stream-toolbar input {
  flex: 1;
  min-width: 180px;
}

/* ===== STREAM LIST ===== */
.stream-list {
  display: flex;
  flex-direction: column;
  gap: var(--stream-gap);
  max-height: calc(100vh - 400px);
  min-height: 300px;
  overflow-y: auto;
  margin-top: 14px;
}

.stream-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #303a44;
  border-radius: 13px;
  background: #11171d;
  cursor: pointer;
  transition: .16s;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--stream-card-height);
  padding: 10px;
}

.stream-card:hover {
  border-color: #9a5935;
  transform: translateY(-2px);
}

.stream-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px #ff7a3655;
}

.stream-cover {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  background: #0b1014;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #77838e;
  font-size: 25px;
  overflow: hidden;
  flex: 0 0 70px;
}

.stream-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stream-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stream-info strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-info small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.stream-id {
  color: #66737f !important;
  font-size: 9px !important;
}

/* ===== MANUAL STREAM INPUT ===== */
.manual-stream-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.manual-stream-row input {
  min-width: 220px;
}

.manual-stream-row button {
  min-width: 180px;
}

/* ===== PLAYER ===== */
.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-height: calc(100vh - 220px);
}

.player-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 220px);
}

.player-card .player-screen {
  flex: 1;
  min-height: 320px;
  max-height: calc(100vh - 220px);
  height: auto;
}

.player-card .player-controls {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.player-screen {
  position: relative;
  width: 100%;
  min-height: 320px;
  max-height: calc(100vh - 220px);
  height: auto;
  background: #050709;
  border: 1px solid #2c343c;
  border-radius: 13px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.player-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.player-inner video,
.player-inner canvas,
.player-inner img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

.player-placeholder {
  max-width: 300px;
  padding: 20px;
  text-align: center;
  color: #71808c;
  font-size: 12px;
  line-height: 1.7;
}

.player-placeholder b {
  display: block;
  color: #c6d0d9;
  margin-bottom: 5px;
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

/* ===== FULLSCREEN PLAYER ===== */
.fullscreen-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #33424e;
  background: #0f1419;
  color: #e7f1f8;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}

.fullscreen-toggle:hover {
  background: #18232b;
}

.fullscreen-toggle[aria-pressed="true"] {
  background: #ff7a36;
  color: #1b100a;
}

.player-screen:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: #000;
  z-index: 999;
  border-radius: 0;
  border: 0;
}

.player-screen:fullscreen .player-inner {
  inset: 0;
}

.player-screen:fullscreen .player-inner video,
.player-screen:fullscreen .player-inner canvas {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

.player-screen:fullscreen .fullscreen-toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 9999;
  min-height: 44px;
}

.player-screen.fullscreen-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: #000;
  z-index: 9999;
  border-radius: 0;
  border: 0;
}

.player-screen.fullscreen-overlay .player-inner {
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.player-screen.fullscreen-overlay .player-inner video,
.player-screen.fullscreen-overlay .player-inner canvas {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

.player-screen.fullscreen-overlay .fullscreen-toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 10000;
  min-height: 44px;
  touch-action: manipulation;
}

body.player-fullscreen-active {
  overflow: hidden;
  overscroll-behavior: none;
  min-height: 100vh;
}

/* ===== CONVERSATIONS / INBOX ===== */
.inbox-layout {
  display: grid;
  grid-template-columns: minmax(250px, 350px) minmax(0, 1fr);
  gap: 14px;
}

.inbox-list {
  height: clamp(350px, 65vh, 720px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.conversation {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #1a2026;
  cursor: pointer;
}

.conversation:hover,
.conversation.selected {
  background: #302016;
  border-color: #81502f;
}

.avatar {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  object-fit: cover;
  background: #303943;
  flex: none;
}

.convo-meta {
  min-width: 0;
  flex: 1;
}

.convo-meta b,
.convo-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convo-meta b {
  font-size: 11px;
}

.convo-meta small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
}

.message-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.message-list {
  height: clamp(380px, 65vh, 760px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  background: #0b1015;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 12px;
}

.message {
  max-width: min(84%, 760px);
  padding: 11px 13px;
  border: 1px solid #303a44;
  border-radius: 13px;
  background: #1b2229;
  align-self: flex-start;
  overflow-wrap: anywhere;
}

.message.mine {
  align-self: flex-end;
  background: #352218;
  border-color: #744326;
}

.message.unknown-sender {
  border-style: dashed;
}

.message-text {
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message-meta {
  font-size: 9px;
  color: #87939e;
  margin-top: 8px;
}

.message-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.message-media img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #050709;
  border-radius: 8px;
  cursor: zoom-in;
}

.message-media video {
  width: 100%;
  max-height: 400px;
  border-radius: 8px;
  background: #000;
}

.empty {
  padding: 24px;
  text-align: center;
  color: #788590;
  font-size: 11px;
  line-height: 1.7;
}

details {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151a;
}

summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  color: #d1d9df;
}

pre {
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #b8c4ce;
  font: 10px/1.55 Consolas, monospace;
}

/* ===== LOG ===== */
.log {
  height: 260px;
  overflow: auto;
  padding: 12px;
  background: #080c10;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #c0cbd4;
  font: 10px/1.7 Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ===== TOAST ===== */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(390px, calc(100vw - 36px));
}

.toast {
  padding: 12px 15px;
  border: 1px solid #3b4854;
  border-radius: 11px;
  background: #172029;
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.5;
}

.toast.error {
  border-color: #85414a;
}

.toast.success {
  border-color: #347b5d;
}

/* ===== IMAGE VIEWER MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #000e;
  align-items: center;
  justify-content: center;
  padding: 25px;
}

.modal.open {
  display: flex;
}

.modal img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 15px;
}

/* ===== VIDEO MODAL ===== */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  overflow: hidden;
}

.video-modal.open {
  display: block;
}

.video-modal-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 9999;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid #33424e;
  border-radius: 8px;
  background: #0f1419;
  color: #e7f1f8;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}

.video-modal-close:hover {
  background: #18232b;
}

.video-modal-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-modal-title {
  position: absolute;
  top: 10px;
  left: 12px;
  color: #d1d9df;
  font-size: 11px;
  font-weight: 700;
  z-index: 9998;
  opacity: 0.6;
}

.video-modal-player {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-modal-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ===== MESSAGE VIDEO WRAPPER ===== */
.message-video-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.message-video-wrap video {
  width: 100%;
  max-height: 320px;
  border-radius: 8px;
  background: #000;
  cursor: pointer;
}

.message-video-fs-btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #33424e;
  border-radius: 6px;
  background: #0f1419;
  color: #d1d9df;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.message-video-fs-btn:hover {
  background: #18232b;
  color: #fff;
}

/* ===== MESSAGE FILTER BAR ===== */
.message-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg, #080c11);
}

.message-filter-bar button.active {
  background: var(--panel3, #1d2430);
  border-color: #8ee2bf;
  color: #8ee2bf;
}

/* ===== CONVERSATION CONTROLS ===== */
.conversation-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.conversation-controls select {
  min-width: 0;
}

.media-tools {
  margin-top: 12px;
}

.media-tools summary {
  padding: 4px 0;
}

.media-tools button {
  width: 100%;
  margin-top: 12px;
}

.conversation-pagination button {
  flex: 1;
}

/* ===== MOBILE FRIENDLINESS ===== */
button,
input,
select {
  min-height: 42px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: clamp(200px, 10vw, 260px) minmax(0, 1fr);
    padding: 14px;
  }

  .span-8,
  .span-7,
  .span-5 {
    grid-column: span 12;
  }

  .span-4 {
    grid-column: span 6;
  }

  .player-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .inbox-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .inbox-layout > .card {
    min-width: 0;
  }

  .inbox-list {
    height: auto;
    max-height: 38vh;
    min-height: 180px;
  }

  .message-list {
    height: 55vh;
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .top-actions {
    display: none;
  }

  .shell {
    display: block;
    padding: 10px;
    width: 100%;
  }

  .sidebar {
    position: static;
    display: flex;
    gap: 5px;
    padding: 6px;
    margin-bottom: 12px;
    overflow: auto;
    width: 100%;
  }

  .nav-caption,
  .sidebar-foot {
    display: none;
  }

  .nav-btn {
    width: auto;
    min-width: 75px;
    flex: 1;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 8px 5px;
    font-size: 9px;
  }

  .nav-icon {
    font-size: 15px;
  }

  .page-head h1 {
    font-size: 19px;
  }

  .page-meta {
    display: none;
  }

  .card {
    padding: 14px;
  }

  .span-6,
  .span-4 {
    grid-column: span 12;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .inbox-list {
    height: 260px;
  }

  .message {
    max-width: 96%;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .manual-stream-row {
    grid-template-columns: 1fr;
  }

  .manual-stream-row button {
    width: 100%;
  }

  .player-card {
    min-height: calc(100vh - 160px);
  }

  .player-screen {
    min-height: 260px;
    max-height: calc(100vh - 160px);
  }

  .stream-list {
    max-height: calc(100vh - 350px);
    min-height: 220px;
  }

  .message-media {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .message-media img {
    max-height: 240px;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding: 0 10px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .conversation-pagination {
    grid-template-columns: 1fr;
  }

  .message-media {
    grid-template-columns: 1fr;
  }
}

#mobileMenu {
  display: none;
}