.mdchat-sidebar {
  overflow: hidden;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  padding-top: 65px;
  border-right: 1px solid #ddd;
}
.mdchat-frame {
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  padding-top: 65px;
  border-left: 1px solid #ddd;
  width: 0;
  transition: width 0.3s ease;
}
.mdchat-split .mdchat-frame {
  width: calc(50% - 100px);
}
.mdchat-frame iframe {
  height: 100%;
}
.mdchat-msgpane {
  margin-left: 200px; /* Adjust for sidebar width */
  margin-right: 0;
  transition: margin-right 0.3s ease;
}
.mdchat-split .mdchat-msgpane {
  margin-right: calc(50% - 100px); /* Adjust for sidebar width */
}
@media (max-width: 767.98px) {
  .mdchat-sidebar, .mdchat-frame {
    position: static;
    width: auto;
  }
  .mdchat-msgpane {
    margin-left: 0;
  }
}
iframe {
  border: none;
}
.mdchat-message {
  width: 100%;
  min-height: 40px;
  max-height: 300px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}
.mdchat-message:focus {
  outline: none;
  border-color: #773aa5;
}


[mdchat="threads"] {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
[mdchat="threads"] .nav-item {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
[mdchat="threads"] .nav-link {
  display: flex;
  align-items: center;
  gap: .25rem;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 2.0rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
[mdchat="threads"] .thread-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[mdchat="threads"] .thread-actions {
  position: absolute;
  right: .25rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease-in-out, visibility .12s;
  z-index: 1;
}
[mdchat="threads"] .nav-item:hover .thread-actions,
[mdchat="threads"] .nav-item:focus-within .thread-actions { opacity: 1; visibility: visible; }
[mdchat="threads"] .nav-item:hover .nav-link,
[mdchat="threads"] .nav-item:focus-within .nav-link { padding-right: 2.5rem; }
.thread-ellipsis-btn { line-height: 1; padding: .25rem .4rem; }
[mdchat="threads"] .nav-link.active {
  background-color: rgba(13,110,253,.1);
  color: #0d6efd;
  font-weight: 600;
}
[mdchat="threads"] .nav-item.is-current::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px; background: #0d6efd; border-radius: 2px;
}

.mdchat-sidenav-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mdchat-sidenav-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
  padding-right: 4px; /* keeps text clear of scrollbar */
}

.mdchat-sidebar .position-relative { z-index: 1; }

.breakout-wrap {
  max-width: 40rem;
}

[mdchat-loading="on"] {
  display: none;
}
.mdchat-loading [mdchat-loading="off"] {
  display: none;
}
.mdchat-loading [mdchat-loading="on"] {
  display: block;
}
/* poster container with 2:3 ratio; tweak width as your layout needs */
.cover-thumb {
  width: 80px;              /* or whatever fits your table */
  aspect-ratio: 2 / 3;      /* keeps poster shape */
  overflow: hidden;
  border-radius: .25rem;
  background: #f8f9fa;
}
.cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* crop instead of stretch */
}
