.bo-chat-page {
  height: calc(100dvh - var(--bo-desktop-sticky-offset) - 28px);
  min-height: 620px;
  max-height: calc(100dvh - var(--bo-desktop-sticky-offset) - 28px);
  overflow: hidden;
}

.bo-chat-app {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(227, 231, 242, 0.8);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(22px);
}

.bo-chat-sidebar,
.bo-chat-stage,
.bo-chat-stage__thread {
  min-height: 0;
  height: 100%;
}

.bo-chat-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid rgba(227, 231, 242, 0.84);
  background: rgba(255, 255, 255, 0.26);
  overflow: hidden;
}

.bo-chat-sidebar__header {
  padding: 12px 12px 6px;
  border-bottom: 0;
}

.bo-chat-sidebar__header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.bo-chat-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px 4px 6px;
  overflow: auto;
  min-height: 0;
}

.bo-chat-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.16s ease, box-shadow 0.16s ease;
  position: relative;
}

.bo-chat-item::after {
  content: '';
  position: absolute;
  left: 52px;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: rgba(15, 23, 42, 0.06);
}

.bo-chat-item:last-child::after {
  display: none;
}

.bo-chat-item:hover {
  background: rgba(91, 124, 250, 0.03);
}

.bo-chat-item.is-active {
  background: rgba(91, 124, 250, 0.06);
  box-shadow: none;
}

.bo-chat-item__avatar,
.bo-chat-thread__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(91, 124, 250, 0.14), rgba(91, 124, 250, 0.06));
  color: var(--bo-accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.bo-chat-item__copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.bo-chat-item__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bo-chat-item__title {
  font-size: 14px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bo-chat-item__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.bo-chat-item__time {
  color: var(--bo-muted);
  font-size: 10px;
  white-space: nowrap;
  padding-top: 1px;
}

.bo-chat-item__preview {
  color: rgba(15, 23, 42, 0.66);
  font-size: 12px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bo-chat-item__unread {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--bo-accent);
  flex: 0 0 auto;
}

.bo-chat-stage {
  display: grid;
  background:
    linear-gradient(180deg, rgba(251, 252, 255, 0.82), rgba(247, 249, 255, 0.78));
  overflow: hidden;
}

.bo-chat-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
}

.bo-chat-thread__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(227, 231, 242, 0.84);
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(18px);
}

.bo-chat-thread__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bo-chat-thread__identity-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bo-chat-thread__title {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 620;
}

.bo-chat-thread__line {
  color: rgba(15, 23, 42, 0.78);
  font-size: 13px;
  line-height: 1.4;
}

.bo-chat-thread__line--muted {
  color: var(--bo-muted);
}

.bo-chat-thread__line--status {
  color: rgba(91, 124, 250, 0.92);
  font-size: 12px;
}

.bo-chat-thread__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bo-chat-thread__request {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(227, 231, 242, 0.9);
  background: rgba(255, 255, 255, 0.82);
  color: var(--bo-ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.bo-chat-thread__request--quiet {
  background: rgba(245, 247, 252, 0.9);
  color: rgba(15, 23, 42, 0.76);
}

.bo-chat-thread__body {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 14px;
  overflow: auto;
  min-height: 0;
}

.bo-chat-thread__messages {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.bo-chat-thread__composer-wrap {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(227, 231, 242, 0.6);
  background: rgba(251, 252, 255, 0.42);
  backdrop-filter: blur(12px);
}

.bo-chat-bubble {
  max-width: min(72%, 560px);
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(227, 231, 242, 0.9);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
}

.bo-chat-bubble--outgoing {
  margin-left: auto;
  border-radius: 18px 18px 10px 18px;
  background: linear-gradient(180deg, rgba(91, 124, 250, 0.12), rgba(91, 124, 250, 0.05));
  border-color: rgba(91, 124, 250, 0.12);
}

.bo-chat-bubble__sender {
  color: var(--bo-muted);
  font-size: 11px;
  font-weight: 700;
}

.bo-chat-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.bo-chat-bubble__meta {
  color: var(--bo-muted);
  font-size: 11px;
}

.bo-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.bo-chat-composer--closed {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--bo-muted);
  font-size: 13px;
}

.bo-chat-composer__input {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  padding: 11px 14px;
  border: 1px solid rgba(227, 231, 242, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--bo-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
}

.bo-chat-composer__input:focus {
  outline: none;
  border-color: rgba(91, 124, 250, 0.28);
  box-shadow: 0 0 0 4px rgba(91, 124, 250, 0.05);
}

.bo-chat-composer__input::placeholder {
  color: var(--bo-muted);
}

.bo-chat-composer__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #11151d;
  color: #fff;
  font-size: 0;
  font-weight: 700;
  position: relative;
}

.bo-chat-composer__send:hover {
  background: #1a1f29;
}

.bo-chat-composer__send::before {
  content: '';
  width: 16px;
  height: 16px;
  display: block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.5 3.5 10.9 14.1'/%3E%3Cpath d='M21.5 3.5 14.8 20.5l-3.9-6.5-6.4-3.8Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.bo-chat-empty {
  display: grid;
  gap: 4px;
  padding: 20px;
  color: var(--bo-muted);
  font-size: 13px;
}

.bo-chat-empty strong {
  color: var(--bo-ink);
  font-size: 15px;
}

.bo-chat-empty--thread {
  align-content: center;
  justify-items: center;
  min-height: 100%;
  text-align: center;
}

@media (max-width: 1180px) {
  .bo-chat-page {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .bo-chat-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .bo-chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(227, 231, 242, 0.84);
  }

  .bo-chat-list {
    max-height: 320px;
  }

  .bo-chat-stage {
    min-height: 560px;
  }
}

@media (max-width: 780px) {
  .bo-chat-app {
    border-radius: 24px;
  }

  .bo-chat-sidebar__header,
  .bo-chat-thread__header,
  .bo-chat-thread__body,
  .bo-chat-thread__composer-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .bo-chat-thread__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .bo-chat-thread__request {
    min-width: 0;
  }

  .bo-chat-bubble {
    max-width: 100%;
  }

  .bo-chat-composer {
    grid-template-columns: 1fr;
  }

  .bo-chat-composer__send {
    width: 42px;
    min-width: 42px;
    justify-self: end;
  }
}
