.yal-chat-mount {
  min-height: calc(100vh - 53px);
  display: flex;
  flex-direction: column;
}

.yal-chat-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr);
  flex: 1;
  min-height: calc(100vh - 53px);
}

.yal-chat-list {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.yal-chat-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  gap: 8px;
}

.yal-chat-list-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.yal-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.yal-chat-filter {
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.yal-chat-filter:hover,
.yal-chat-icon-btn:hover {
  background: rgba(231, 233, 234, 0.08);
}

.yal-chat-icon-btn {
  border: none;
  background: transparent;
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.yal-chat-icon-btn svg {
  width: 18px;
  height: 18px;
}

.yal-chat-search-wrap {
  padding: 0 12px 10px;
}

.yal-chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  background: #000;
}

.yal-chat-search svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.yal-chat-search input {
  border: none;
  background: transparent;
  padding: 0;
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.yal-chat-search input:focus {
  outline: none;
}

.yal-chat-list-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.yal-chat-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #16181c;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 0;
}

.yal-chat-row:hover {
  background: rgba(231, 233, 234, 0.04);
}

.yal-chat-row.active {
  background: rgba(29, 155, 240, 0.08);
}

.yal-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #243447;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.yal-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yal-chat-row-main {
  min-width: 0;
}

.yal-chat-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.yal-chat-row-top strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yal-chat-time {
  color: var(--muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.yal-chat-preview {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yal-chat-row-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.yal-chat-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.yal-chat-pin,
.yal-chat-muted {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1;
}

.yal-chat-shield {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.yal-chat-empty-list {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.yal-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.yal-chat-empty-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 10px;
}

.yal-chat-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #16181c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.yal-chat-empty-icon svg {
  width: 34px;
  height: 34px;
  color: var(--text);
}

.yal-chat-empty-main h3 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
}

.yal-chat-empty-main p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 320px;
}

.yal-chat-new-btn {
  background: #fff;
  color: #000;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
}

.yal-chat-new-btn:hover {
  filter: brightness(0.95);
}

.yal-chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.yal-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yal-chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 0.92rem;
  word-break: break-word;
}

.yal-chat-bubble.out {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.yal-chat-bubble.in {
  align-self: flex-start;
  background: #16181c;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.yal-chat-compose.is-restricted {
  display: block;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: #16181c;
}

.yal-chat-compose-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.yal-chat-thread.has-restricted-compose .yal-chat-messages {
  flex: 1;
}

.yal-chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

.yal-chat-compose input {
  flex: 1;
  border-radius: 999px;
  padding: 10px 16px;
}

.yal-chat-compose button {
  background: var(--blue);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
}

.yal-chat-compose button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.yal-chat-gate {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}

.yal-chat-restricted {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 280px;
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
}

.yal-chat-restricted h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.yal-chat-restricted p {
  margin: 0;
  max-width: 360px;
  line-height: 1.45;
}

.yal-chat-restricted-icon {
  font-size: 2rem;
  line-height: 1;
}

.yal-chat-user-row.is-restricted {
  opacity: 0.72;
}

.yal-chat-user-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #f4212e;
}

.yal-chat-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.yal-chat-modal {
  width: min(480px, 100%);
  background: #000;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.yal-chat-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.yal-chat-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.yal-chat-modal-close {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.yal-chat-modal-body {
  padding: 12px 16px 16px;
}

.yal-chat-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
}

.yal-chat-user-row:hover {
  background: rgba(231, 233, 234, 0.04);
}

.yal-chat-user-row strong {
  display: block;
  font-size: 0.92rem;
}

.yal-chat-user-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.yal-chat-filter-menu {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 5;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.yal-chat-filter-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
}

.yal-chat-filter-menu button.active,
.yal-chat-filter-menu button:hover {
  background: rgba(231, 233, 234, 0.06);
}

@media (max-width: 860px) {
  .yal-chat-grid {
    grid-template-columns: 1fr;
  }

  .yal-chat-main {
    min-height: 50vh;
  }
}
