/* Bubblle — unified live chat shell */

[hidden] {
  display: none !important;
}

/* --- Icon system --- */
.icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.icon-xs {
  width: 0.9rem;
  height: 0.9rem;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-md {
  width: 1.35rem;
  height: 1.35rem;
}

.icon-brand {
  width: 1.15rem;
  height: 1.15rem;
  color: #5eead4;
}

.icon-send {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.chat-app .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chat-body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0e14;
}

.chat-app {
  display: flex;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: min(300px, 88vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(14, 18, 26, 0.95);
  border-right: 1px solid #243044;
  z-index: 40;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.loc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #8b9bb8;
  transition:
    color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.loc-pill[data-state="loading"] {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.loc-pill[data-state="ok"] {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.25);
}

.loc-pill[data-state="error"] {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
}

@keyframes pulse-dot {
  50% {
    opacity: 0.4;
  }
}

.sidebar-create {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-create input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #243044;
  background: #0b1018;
  color: #e8eefc;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b9bb8;
}

.sidebar-bubbles {
  list-style: none;
  margin: 0;
  padding: 0 8px 12px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.sidebar-bubble-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

.sidebar-bubble-link:hover {
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.2);
}

.sidebar-bubble-link:active {
  transform: scale(0.98);
}

.sidebar-bubble.is-active .sidebar-bubble-link {
  background: rgba(124, 156, 255, 0.12);
  border-color: rgba(124, 156, 255, 0.35);
}

.sidebar-bubble-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.sidebar-bubble-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #8b9bb8;
}

.sidebar-bubble-count {
  color: #5eead4;
}

.sidebar-empty {
  padding: 8px 14px 16px;
  font-size: 0.85rem;
}

/* --- Main chat column --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: radial-gradient(900px 500px at 80% -20%, #1a2540 0%, #0c0f14 50%);
}

.chat-topbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #243044;
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 50;
}

.identity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid #2f6f68;
  background: rgba(94, 234, 212, 0.06);
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

.identity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  flex-shrink: 0;
  animation: identity-pulse 2.5s ease-in-out infinite;
}

@keyframes identity-pulse {
  50% {
    opacity: 0.55;
  }
}

.identity-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #e8eefc;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
}

.identity-input::placeholder {
  color: #8b9bb8;
  font-weight: 400;
}

.identity-input.identity-saved {
  color: #5eead4;
}

.identity-input-error {
  color: #fb7185;
}

.identity-save {
  flex-shrink: 0;
}

.topbar-room {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topbar-room-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-title {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 1.1rem;
  flex-wrap: wrap;
}

.room-stat {
  font-size: 0.75rem;
  color: #8b9bb8;
  line-height: 1.2;
}

.room-stat:empty {
  display: none;
}

.room-stat-accent {
  color: #5eead4;
}

.room-stat:not(:empty) + .room-stat:not(:empty)::before {
  content: "·";
  margin-right: 8px;
  color: #4b5563;
}

.room-stats:not(:has(.room-stat:not(:empty))) {
  display: none;
}

.pill-sm {
  font-size: 0.72rem;
  padding: 3px 8px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a3548;
  background: linear-gradient(180deg, #171e2b 0%, #121824 100%);
  color: #e8eefc;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition:
    transform 0.15s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover:not(:disabled) {
  border-color: #3d4f6a;
  background: linear-gradient(180deg, #1c2536 0%, #151d2c 100%);
}

.btn-icon:active:not(:disabled) {
  transform: scale(0.94);
}

.mobile-only {
  display: none;
}

/* --- Home browse (main page) --- */
.chat-app--home .sidebar {
  display: none !important;
}

.chat-app--home #btn-drawer {
  display: none !important;
}

.chat-app--home .home-browse {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  padding: 12px 16px 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.chat-app--room .home-browse {
  display: none !important;
}

.chat-app--home .chat-panel--idle {
  align-items: stretch;
  justify-content: flex-start;
}

.chat-app--home .conn-dot,
.chat-app--home .room-stats {
  display: none;
}

.home-browse-lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.home-create {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.home-create input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #243044;
  background: #0b1018;
  color: #e8eefc;
  font-size: 0.95rem;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b9bb8;
}

.home-bubbles,
.bubble-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-bubbles .sidebar-bubble-link {
  padding: 14px 16px;
}

.home-empty {
  padding: 12px 4px;
  font-size: 0.9rem;
  text-align: center;
}

.home-empty[hidden] {
  display: none !important;
}

.topbar-loc-pill {
  margin-left: 6px;
}

/* --- Chat panel --- */
.chat-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chat-panel--idle {
  flex: 1;
  align-items: center;
  justify-content: center;
}

.chat-panel:not(.chat-panel--idle) {
  flex: 1;
}

.chat-idle-prompt {
  text-align: center;
  padding: 24px 20px;
  max-width: 360px;
}

.chat-idle-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.chat-thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.thread-banner {
  margin: 8px 12px 0;
  flex-shrink: 0;
}

.chat-app .messages-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.chat-app .messages-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: 12px 14px;
  box-sizing: border-box;
}

.chat-app .messages-placeholder {
  text-align: center;
  color: #8b9bb8;
  padding: 16px;
  margin: auto 0;
}

/* Message bubbles */
.msg-bubble {
  display: flex;
  margin-bottom: 10px;
  animation: msg-in 0.28s ease-out backwards;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.msg-bubble-mine {
  justify-content: flex-end;
}

.msg-bubble-inner {
  max-width: min(85%, 420px);
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #243044;
  background: #141a24;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.msg-bubble:active .msg-bubble-inner {
  filter: brightness(1.08);
}

.msg-bubble-mine .msg-bubble-inner {
  background: linear-gradient(145deg, #1f4f4a, #172a2f);
  border-color: #2f6f68;
  border-bottom-right-radius: 4px;
}

.msg-bubble:not(.msg-bubble-mine) .msg-bubble-inner {
  border-bottom-left-radius: 4px;
}

.msg-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.msg-author {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5eead4;
  margin-bottom: 0;
  min-width: 0;
}

.msg-bubble-mine .msg-bubble-head {
  justify-content: flex-end;
}

.msg-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #8b9bb8;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.msg-reply-btn:hover,
.msg-reply-btn:focus-visible {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.12);
  outline: none;
}

.msg-bubble-mine .msg-reply-btn:hover,
.msg-bubble-mine .msg-reply-btn:focus-visible {
  color: #a5b4fc;
  background: rgba(124, 156, 255, 0.12);
}

.msg-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bubble-has-image .msg-text {
  margin-top: 8px;
}

.msg-image-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  max-width: min(280px, 100%);
}

.msg-image {
  display: block;
  width: 100%;
  min-height: 120px;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  background: #0b1018;
}

.msg-image-pending {
  opacity: 0.72;
  filter: saturate(0.85);
}

.msg-image-broken {
  min-height: 120px;
  object-fit: contain;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.08), rgba(124, 156, 255, 0.08)),
    #0b1018;
}

.msg-bubble-mine .msg-image-link {
  margin-left: auto;
}

.msg-time {
  display: block;
  font-size: 0.68rem;
  color: #8b9bb8;
  margin-top: 6px;
  text-align: right;
}

.msg-reply-quote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 8px 6px 10px;
  border-left: 3px solid #5eead4;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.msg-reply-thumb {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #0b1018;
}

.msg-reply-body {
  min-width: 0;
  flex: 1;
}

.msg-bubble-mine .msg-reply-quote {
  border-left-color: #7c9cff;
}

.msg-reply-author {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #5eead4;
  margin-bottom: 2px;
}

.msg-bubble-mine .msg-reply-author {
  color: #a5b4fc;
}

.msg-reply-text {
  display: block;
  font-size: 0.78rem;
  color: #8b9bb8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-compose {
  margin-bottom: 8px;
}

.reply-compose-inner {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.25);
}

.reply-compose-bar {
  width: 3px;
  border-radius: 2px;
  background: #5eead4;
  flex-shrink: 0;
}

.reply-compose-body {
  flex: 1;
  min-width: 0;
}

.reply-compose-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5eead4;
  margin-bottom: 2px;
}

.reply-compose-preview {
  display: block;
  font-size: 0.82rem;
  color: #c5d0e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-compose-cancel {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #9aa8c4;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.reply-compose-cancel:hover {
  color: #e8eefc;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
}

.reply-compose-cancel:active {
  transform: scale(0.94);
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-create .btn-accent,
.home-create .btn-accent {
  border-color: rgba(94, 234, 212, 0.35);
  background: linear-gradient(180deg, #1f5a52 0%, #16343a 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 8px 20px rgba(31, 90, 82, 0.22);
  font-weight: 600;
}

.sidebar-create .btn-accent:hover:not(:disabled),
.home-create .btn-accent:hover:not(:disabled) {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 10px 24px rgba(94, 234, 212, 0.18);
}

/* Sticky composer */
.chat-composer {
  flex-shrink: 0;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(36, 48, 68, 0.9);
  background: linear-gradient(180deg, rgba(16, 20, 28, 0.96) 0%, rgba(10, 13, 18, 0.98) 100%);
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
}

.chat-app .composer-typing {
  margin: 0 4px 6px;
  min-height: 0;
  font-size: 0.8rem;
  line-height: 1.25;
  color: #8b9bb8;
  font-style: italic;
}

.composer-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.composer-input-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.composer-media-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid #2a3548;
  background: linear-gradient(180deg, #141b28 0%, #0d121c 100%);
  color: #b8c5de;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 4px 14px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.15s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.composer-media-btn--gallery:hover:not(:disabled) {
  border-color: rgba(94, 234, 212, 0.55);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.14) 0%, #101824 100%);
  color: #5eead4;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(94, 234, 212, 0.15),
    0 6px 18px rgba(94, 234, 212, 0.12);
}

.composer-media-btn--camera:hover:not(:disabled) {
  border-color: rgba(124, 156, 255, 0.55);
  background: linear-gradient(180deg, rgba(124, 156, 255, 0.14) 0%, #101824 100%);
  color: #a5b4fc;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(124, 156, 255, 0.15),
    0 6px 18px rgba(124, 156, 255, 0.12);
}

.composer-media-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.composer-media-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.composer-input-row input {
  flex: 1;
  min-width: 0;
}

.composer-form input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #2a3548;
  background: #0b1018;
  color: #e8eefc;
  font-size: 1rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.composer-form input:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 0 0 3px rgba(94, 234, 212, 0.12);
}

.composer-form .btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 52px;
  border-radius: 14px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-color: #3d5080;
  background: linear-gradient(180deg, #3a4f82 0%, #2a3860 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 6px 16px rgba(58, 79, 130, 0.28);
  transition:
    transform 0.12s ease,
    opacity 0.12s ease,
    box-shadow 0.2s ease;
}

.composer-form .btn-send:hover:not(:disabled) {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 8px 20px rgba(124, 156, 255, 0.32);
}

.composer-form .btn-send:active:not(:disabled) {
  transform: scale(0.96);
}

.sidebar-section-head .btn-icon-only,
.home-section-head .btn-icon-only {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #9aa8c4;
}

.sidebar-section-head .btn-icon-only:hover,
.home-section-head .btn-icon-only:hover {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.08);
}

.identity-save.btn-icon-only {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 999px;
  color: #5eead4;
}

.identity-save.btn-icon-only:hover {
  background: rgba(94, 234, 212, 0.12);
}

.composer-hint {
  margin: 6px 0 0;
  min-height: 1rem;
  font-size: 0.78rem;
  text-align: center;
}

.composer-hint-warn {
  color: #fde68a;
}

/* Connection dot (fixed size) */
.conn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #8b9bb8;
}

.conn-dot[data-state="loading"] {
  background: #fbbf24;
  animation: conn-pulse 1.2s ease-in-out infinite;
}

.conn-dot[data-state="ok"] {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.65);
}

.conn-dot[data-state="error"] {
  background: #fb7185;
}

.conn-dot[data-state="idle"] {
  background: #4b5563;
}

@keyframes conn-pulse {
  50% {
    opacity: 0.45;
  }
}

/* Mobile drawer */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 80;
  touch-action: manipulation;
}

body.drawer-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .chat-app--room .mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 51;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .chat-app {
    overflow: visible;
  }

  .chat-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
  }

  .chat-app--room .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 90;
    pointer-events: none;
    visibility: hidden;
  }

  .chat-app--room .sidebar.is-open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .chat-app--room .drawer-backdrop:not([hidden]) {
    display: block;
  }

  .chat-app--room .chat-topbar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "menu room"
      "identity identity";
    gap: 8px 10px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    align-items: start;
  }

  .chat-app--room #btn-drawer {
    grid-area: menu;
    align-self: center;
    width: 40px;
    height: 40px;
  }

  .chat-app--room .topbar-room {
    grid-area: room;
  }

  .chat-app--home .chat-topbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .chat-app--home .topbar-room {
    flex: 1;
    min-width: 0;
    align-items: flex-start;
    text-align: left;
  }

  .chat-app--home .topbar-room-head {
    justify-content: flex-start;
  }

  .chat-app--room .identity {
    grid-area: identity;
    max-width: none;
    width: 100%;
    padding: 6px 10px;
  }

  .chat-app--home .identity {
    flex: 0 1 auto;
    max-width: 42%;
    padding: 6px 10px;
  }

  .identity-dot {
    display: none;
  }

  .identity-input {
    font-size: 0.88rem;
  }

  .room-title {
    font-size: 1.02rem;
  }

  .room-stats {
    gap: 0;
  }

  .room-stat {
    font-size: 0.72rem;
  }

  .composer-form .btn-send {
    min-width: 46px;
    padding: 12px 13px;
  }

  .composer-form .btn-send-label {
    display: none;
  }
}

@media (min-width: 901px) {
  .chat-topbar {
    padding: 12px 18px;
  }

  .identity {
    order: 1;
    flex: 0 1 220px;
  }

  .topbar-room {
    order: 2;
    align-items: flex-end;
    text-align: right;
  }

  .topbar-room-head {
    justify-content: flex-end;
  }

  .room-stats {
    justify-content: flex-end;
  }
}
