:root {
  --atlas-blue: #0756a8;
  --atlas-blue-dark: #063e79;
  --atlas-green: #16803a;
  --atlas-orange: #c85a00;
  --ink: #0f1e33;
  --muted: #5f6f86;
  --line: #dbe3ee;
  --panel: #ffffff;
  --surface: #f4f7fb;
  --soft-blue: #eaf3ff;
  --soft-green: #eaf8ef;
  --shadow: 0 18px 45px rgba(12, 31, 56, 0.11);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
  background:
    linear-gradient(135deg, rgba(7, 86, 168, 0.06), rgba(22, 128, 58, 0.04)),
    #f8fafc;
}

.login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1fr minmax(360px, 470px);
  gap: 56px;
  align-items: center;
}

.login-hero {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 52px;
}

.hero-brand img {
  width: 210px;
  height: auto;
}

.hero-brand span {
  width: 1px;
  height: 62px;
  background: var(--line);
}

.hero-brand p,
.hero-copy p,
.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy h1 {
  max-width: 560px;
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.18;
}

.hero-copy p {
  max-width: 520px;
  font-size: 17px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 42px;
}

.login-logo {
  display: block;
  width: 180px;
  margin: 0 auto 22px;
}

.login-card h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 32px;
}

.login-card > p {
  text-align: center;
  margin-bottom: 32px;
}

.login-card form {
  display: grid;
  gap: 18px;
}

.login-card label,
.message-input-label {
  display: grid;
  gap: 8px;
  color: #26374d;
  font-size: 14px;
}

.field-shell {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 16px;
  background: #fff;
}

.field-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.field-icon,
.nav-icon,
.metric-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.field-icon.mail::before {
  content: "";
  position: absolute;
  inset: 4px 2px;
  border: 2px solid #526071;
  border-radius: 3px;
}

.field-icon.mail::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 7px;
  height: 10px;
  border-bottom: 2px solid #526071;
  transform: skewY(-28deg);
}

.field-icon.lock::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 12px;
  border: 2px solid #526071;
  border-radius: 3px;
}

.field-icon.lock::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 8px;
  height: 9px;
  border: 2px solid #526071;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.login-options a {
  color: var(--atlas-blue);
  text-decoration: none;
}

.check-row {
  display: inline-flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 8px !important;
}

.primary-action,
.ghost-button,
.icon-button,
.mini-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
}

.primary-action {
  color: #fff;
  background: var(--atlas-blue);
  border-color: var(--atlas-blue);
  box-shadow: 0 10px 22px rgba(7, 86, 168, 0.2);
}

.primary-action:hover {
  background: var(--atlas-blue-dark);
}

.ghost-button,
.icon-button,
.mini-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.login-submit {
  min-height: 52px;
}

.form-message {
  min-height: 20px;
  color: #b42318;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--atlas-blue);
  text-decoration: none;
  font-weight: 800;
}

.app-view {
  min-height: 100vh;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar-brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-brand img {
  width: 140px;
  height: auto;
}

.topbar-brand span {
  width: 1px;
  height: 34px;
  background: var(--line);
}

.topbar-brand button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.session-pill,
.connection-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--soft-blue);
  color: var(--atlas-blue-dark);
  font-weight: 700;
  font-size: 13px;
}

.connection-pill.ok {
  background: var(--soft-green);
  color: var(--atlas-green);
}

.connection-pill.error {
  background: #fff1f1;
  color: #b42318;
}

.app-shell {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 196px 1fr;
}

.side-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 24px 16px;
}

.side-nav nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-radius: 6px;
  color: #26374d;
  text-decoration: none;
  font-weight: 650;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--atlas-blue);
  background: #edf5ff;
}

.nav-icon.folder::before,
.nav-icon.layers::before,
.nav-icon.lab::before,
.nav-icon.gear::before,
.nav-icon.chat::before,
.nav-icon.chart::before,
.nav-icon.mobile::before,
.nav-icon.database::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-icon.folder::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 10px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.nav-icon.layers::before {
  transform: rotate(45deg) scale(0.72);
}

.nav-icon.lab::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 1px;
  width: 4px;
  height: 12px;
  background: currentColor;
}

.nav-icon.gear::before {
  border-radius: 50%;
}

.nav-icon.chat::before {
  border-radius: 6px;
}

.nav-icon.chat::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skewX(-25deg);
}

.nav-icon.chart::after {
  content: "K";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 850;
}

.nav-icon.mobile::after {
  content: "MV";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 850;
}

.db-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.db-status small,
.version-note {
  color: var(--muted);
}

.content-area {
  min-width: 0;
  padding: 24px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.chat-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--atlas-blue);
  border-radius: 8px;
  margin-bottom: 18px;
}

.chat-hero h1,
.panel-title h2,
.messages-head h2 {
  margin: 0;
}

.chat-hero p,
.messages-head p,
.status-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.hero-status,
.status-card {
  min-width: 170px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-status small,
.status-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
}

.chat-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  gap: 18px;
  height: calc(100vh - 224px);
  min-height: 560px;
}

.rooms-panel,
.messages-panel,
.chat-side-panel {
  min-height: 0;
}

.rooms-panel,
.messages-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rooms-panel {
  padding: 16px;
}

.panel-title,
.messages-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.room-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.room-button {
  width: 100%;
  min-height: 74px;
  text-align: left;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.room-button.active,
.room-button:hover {
  border-color: var(--atlas-blue);
  background: #f0f7ff;
}

.room-button strong {
  display: block;
  margin-bottom: 5px;
}

.room-button small {
  color: var(--muted);
}

.messages-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.messages-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.message-list {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.94)),
    repeating-linear-gradient(0deg, transparent 0, transparent 28px, rgba(7, 86, 168, 0.035) 29px);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 78%;
}

.message-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--atlas-blue);
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.message-bubble {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(12, 31, 56, 0.06);
}

.message-row.mine .message-bubble {
  color: #fff;
  background: var(--atlas-blue);
  border-color: var(--atlas-blue);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-row.mine .message-meta {
  color: rgba(255, 255, 255, 0.78);
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.message-attachments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.image-attachment {
  display: block;
  width: min(260px, 62vw);
  overflow: hidden;
  border: 1px solid rgba(15, 30, 51, 0.1);
  border-radius: 8px;
  background: #eef4fb;
}

.image-attachment img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.file-attachment {
  width: min(300px, 70vw);
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
  text-decoration: none;
}

.file-attachment strong,
.file-attachment small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-attachment small {
  color: var(--muted);
}

.file-symbol {
  width: 34px;
  height: 38px;
  position: relative;
  border: 2px solid var(--atlas-blue);
  border-radius: 5px;
  background: #fff;
}

.file-symbol::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 12px;
  height: 12px;
  border-left: 2px solid var(--atlas-blue);
  border-bottom: 2px solid var(--atlas-blue);
  background: #eaf3ff;
}

.message-row.mine .file-attachment {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.message-row.mine .file-attachment small {
  color: rgba(255, 255, 255, 0.78);
}

.message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.message-compose {
  display: grid;
  gap: 10px;
}

.message-form textarea {
  width: 100%;
  min-height: 56px;
  max-height: 130px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  outline-color: var(--atlas-blue);
}

.message-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.message-tools small {
  color: var(--muted);
}

.attachment-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  max-width: 240px;
  min-height: 34px;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #f8fafc;
}

.attachment-chip span,
.attachment-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip small {
  color: var(--muted);
}

.attachment-chip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--atlas-blue);
  font-weight: 800;
}

.chat-side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.status-card {
  background: #fff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--atlas-blue);
  box-shadow: var(--shadow);
  z-index: 30;
}

.toast.error {
  background: #b42318;
}

@media (max-width: 1160px) {
  .chat-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .chat-side-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-shell,
  .app-shell,
  .chat-workspace {
    grid-template-columns: 1fr;
  }

  .login-view {
    padding: 20px;
  }

  .login-hero {
    min-height: auto;
  }

  .hero-brand {
    margin-bottom: 28px;
  }

  .hero-brand img {
    width: 170px;
  }

  .topbar,
  .chat-hero,
  .messages-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    padding: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .side-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .content-area {
    padding: 16px;
  }

  .chat-workspace {
    height: auto;
    min-height: 0;
  }

  .message-list {
    max-height: 58vh;
  }

  .message-form,
  .chat-side-panel {
    grid-template-columns: 1fr;
  }

  .message-row {
    max-width: 100%;
  }
}

/* Chat unificado v2 */
.chat-workspace {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  min-height: 590px;
}

.rooms-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.panel-title {
  align-items: center;
}

.panel-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mini-button.primary {
  color: #fff;
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
}

.icon-action {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--atlas-blue);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
}

.icon-action.primary {
  color: #fff;
  border-color: var(--atlas-blue);
  background: var(--atlas-blue);
}

.symbol-icon {
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
}

.refresh-icon::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-20deg);
}

.refresh-icon::after {
  content: "";
  position: absolute;
  margin: -12px 0 0 13px;
  border-width: 4px 0 4px 6px;
  border-style: solid;
  border-color: transparent transparent transparent currentColor;
  transform: rotate(28deg);
}

.refresh-icon {
  position: relative;
}

.search-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.search-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  outline-color: var(--atlas-blue);
}

.new-chat-panel {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: 250px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9fd;
}

.desktop-user-list {
  display: grid;
  gap: 6px;
  overflow-y: auto;
}

.user-button {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.user-button:hover {
  border-color: var(--atlas-blue);
  background: #eef6ff;
}

.user-button strong,
.user-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-button small {
  margin-top: 2px;
  color: var(--muted);
}

.room-list {
  min-height: 0;
  margin-top: 0;
  overflow-y: auto;
  align-content: start;
  padding-right: 2px;
}

.room-button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.room-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--atlas-blue);
  font-size: 12px;
  font-weight: 850;
}

.room-avatar.large {
  width: 44px;
  height: 44px;
  font-size: 13px;
}

.room-copy,
.room-title-line,
.messages-head-copy {
  min-width: 0;
}

.room-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-title-line strong,
.room-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-title-line strong {
  margin: 0;
}

.room-title-line time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.room-copy small {
  margin-top: 5px;
  color: var(--muted);
}

.room-count {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--atlas-blue);
  background: #eaf3ff;
  font-size: 10px;
  font-weight: 850;
}

.room-button.active .room-count {
  color: #fff;
  background: var(--atlas-blue);
}

.chat-status-summary {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chat-status-summary strong {
  color: var(--atlas-blue);
  font-size: 12px;
}

.chat-status-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-panel {
  position: relative;
}

.messages-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.new-messages-button {
  position: absolute;
  left: 50%;
  bottom: 118px;
  z-index: 8;
  transform: translateX(-50%);
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--atlas-blue);
  box-shadow: 0 8px 22px rgba(0, 87, 173, 0.25);
  cursor: pointer;
  font-weight: 800;
}

.empty-state.compact {
  min-height: 74px;
  padding: 12px;
}

.empty-state small {
  display: block;
  margin-top: 6px;
}

.chat-attachment-action {
  appearance: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.image-attachment {
  position: relative;
  padding: 0;
}

.image-attachment img:not([src]) {
  min-height: 96px;
}

.attachment-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  background: #eef4fb;
  font-size: 12px;
}

.image-attachment.loaded .attachment-loading {
  display: none;
}

.image-attachment.failed .attachment-loading {
  color: #b42318;
}

.file-attachment {
  font: inherit;
  cursor: pointer;
  text-align: left;
}

@media (max-width: 1180px) {
  .chat-workspace {
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .chat-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .rooms-panel {
    grid-template-rows: auto auto auto auto auto;
  }

  .room-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .room-button {
    flex: 0 0 min(330px, 86vw);
  }

  .messages-panel {
    min-height: 68vh;
  }

  .messages-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .messages-head .count-pill {
    grid-column: 2;
    justify-self: start;
  }
}
