.mxcr-page-wrap {
  min-height: 100vh;
}

.mxcr-page-grid {
  align-items: stretch;
}

.mxcr-page-main {
  min-height: 100vh;
}

.mxcr-page-center,
.mxcr-page-content {
  min-height: 100%;
}

.mxcr-page-content {
  padding: 0 0 24px;
}

.mxcr-page-topbar .mx-tab {
  text-decoration: none;
}

.mxcr-app {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.mxcr-head {
  gap: 16px;
}

.mxcr-title,
.mxcr-room-name {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.mxcr-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 180px);
}

.mxcr-sidebar {
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.mxcr-panel,
.mxcr-room-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.mxcr-create-panel {
  border-top: 1px solid var(--border);
}

.mxcr-rooms {
  padding: 0;
}

.mxcr-room-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.mxcr-room-item:hover,
.mxcr-room-item.is-active {
  background: color-mix(in srgb, var(--accent) 9%, white);
}

.mxcr-room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mxcr-room-title {
  font-weight: 900;
  font-size: 15px;
}

.mxcr-room-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mxcr-room-meta,
.mxcr-room-desc {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.mxcr-room-desc {
  margin-top: 5px;
}

.mxcr-main {
  min-width: 0;
}

.mxcr-room-head {
  min-height: 78px;
}

.mxcr-thread {
  height: calc(100vh - 310px);
  min-height: 420px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(29,155,240,.04), rgba(29,155,240,0));
}

.mxcr-message-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.mxcr-message-row.is-me {
  flex-direction: row-reverse;
}

.mxcr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--card);
  flex: 0 0 auto;
}

.mxcr-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--text);
}

.mxcr-bubble-wrap {
  max-width: min(82%, 720px);
}

.mxcr-message-row.is-me .mxcr-bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

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

.mxcr-meta strong {
  color: var(--text);
  font-size: 13px;
}

.mxcr-bubble {
  display: inline-block;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.mxcr-message-row.is-me .mxcr-bubble {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.mxcr-compose-wrap {
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.mxcr-inputrow {
  align-items: flex-end;
  gap: 12px;
}

.mxcr-message-input,
.mxcr-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  padding: 12px 14px;
  resize: vertical;
  min-height: 54px;
  font: inherit;
  outline: none;
}

.mxcr-message-input::placeholder,
.mxcr-textarea::placeholder {
  color: var(--muted);
}

.mxcr-field {
  display: block;
  margin-bottom: 12px;
}

.mxcr-field .mx-small {
  display: block;
  margin-bottom: 6px;
}

.mxcr-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.mxcr-empty,
.mxcr-loading,
.mxcr-system {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  background: var(--panel);
}

.mxcr-login-card {
  max-width: 560px;
  margin: 24px auto;
}

.mxcr-login-copy {
  margin: 0 0 14px;
  font-size: 14px;
}

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

@media (max-width: 920px) {
  .mxcr-page-grid {
    grid-template-columns: 88px minmax(0, 1fr);
  }

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

  .mxcr-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .mxcr-thread {
    height: 52vh;
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .mxcr-thread {
    height: 50vh;
    min-height: 320px;
    padding-inline: 12px;
  }

  .mxcr-message-input,
  .mxcr-textarea {
    min-height: 48px;
  }

  .mxcr-bubble-wrap {
    max-width: 100%;
  }
}


/* Expand the rooms page into the wide chat layout so the main panel uses the empty right-side space. */
.mxcr-page-grid.mx-grid-chat {
  grid-template-columns: 275px minmax(0, 950px);
}

@media (max-width: 1120px) {
  .mxcr-page-grid.mx-grid-chat {
    grid-template-columns: 80px minmax(0, 950px);
  }
}

@media (max-width: 720px) {
  .mxcr-page-grid.mx-grid-chat {
    grid-template-columns: 1fr;
  }
}

.mxcr-front-admin {
  padding: 16px 0 28px;
}

.mxcr-admin-card {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.mxcr-admin-form {
  display: grid;
  gap: 16px;
}

.mxcr-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.mxcr-admin-row:last-of-type {
  border-bottom: 0;
}

.mxcr-admin-copy {
  display: grid;
  gap: 6px;
}

.mxcr-admin-toggle input {
  width: 22px;
  height: 22px;
}

.mxcr-admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.mxcr-admin-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, white);
}

@media (max-width: 720px) {
  .mxcr-admin-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
