

.conv-list {
  display: flex;
  flex-direction: column;
}
.conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  margin: 2px -10px;
  border-radius: var(--radius);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.conv-row:last-child {
  border-bottom: none;
}
.conv-row {
  --story-gap: var(--ink);
}
.conv-row:hover,
.conv-row.is-active,
.conv-row.is-pinned {
  --story-gap: var(--ink-raised);
}
.conv-row:hover {
  background: var(--ink-raised);
  border-bottom-color: transparent;
}
.conv-row.unread .conv-name {
  font-weight: 700;
}
.conv-row.unread .conv-preview {
  color: var(--paper);
}

.conv-row.is-active {
  background: var(--ink-raised);
  border-bottom-color: transparent;
}
.conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.conv-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
}

.conv-avatar-wrap .active-dot {
  width: 14px;
  height: 14px;
  right: 0;
  bottom: 0;
}
.conv-info {
  min-width: 0;
  flex: 1;
}
.conv-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-preview {
  font-size: 13px;
  color: var(--grey-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-time {
  font-size: 12px;
  color: var(--grey-dim);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.conv-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--safelight);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.conv-dot--plain {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
}

.conv-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.conv-muted-icon {
  display: none;
  font-size: 15px;
  color: var(--grey-dim);
}
.conv-row[data-muted="1"] .conv-muted-icon {
  display: inline-flex;
}
.conv-pinned-icon {
  display: none;
  font-size: 13px;
  color: var(--grey-dim);
}
.conv-row[data-pinned="1"] .conv-pinned-icon {
  display: inline-flex;
}

.conv-row.is-pinned {
  background: var(--ink-raised);
}
.conv-row.is-pinned:hover {
  background: var(--ink-raised);
  filter: brightness(1.08);
}
.conv-row-menu {

  width: 16px;
  display: flex;
  justify-content: flex-end;
}

.conv-row-menu-toggle {
  opacity: 0;
  transition: opacity 0.12s ease;
}
.conv-row:hover .conv-row-menu-toggle,
.conv-row-menu-toggle:focus-visible,
.conv-row-menu-toggle[aria-expanded="true"] {
  opacity: 1;
}
.conv-row-menu-panel {
  text-align: left;
}
@media (pointer: coarse) {

  .conv-row-menu {
    display: none;
  }
}

.conv-row[data-conv-row] {
  -webkit-touch-callout: none;
  user-select: none;
}
.conv-row.conv-long-press-active {
  opacity: 0.6;
  transition: opacity 0.1s;
}
.conv-context-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.conv-context-modal[hidden] {
  display: none;
}
.conv-context-modal.closing .message-actions-backdrop {
  animation: confirm-backdrop-out 0.15s ease forwards;
}
.conv-context-modal.closing .message-actions-card {
  animation: confirm-card-out 0.15s ease forwards;
}
.conv-context-name {
  padding: 14px 16px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--grey);
  text-align: center;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}

.msg-tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}
.msg-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  color: var(--grey-dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease;
}
.msg-tab:hover {
  color: var(--grey);
}
.msg-tab.active {
  color: var(--paper);
  border-bottom-color: var(--paper);
}
.msg-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--safelight);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 800;
}

.conv-list {
  margin-top: 6px;
}
.request-row {
  align-items: center;
  justify-content: space-between;
}
.request-row.leaving,
.conv-row.leaving {
  opacity: 0;
  transition: opacity 0.18s ease;
}
.conv-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  color: inherit;
}
.request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 10px;
}

.request-banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--ink-raised);
}
.request-banner p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--grey);
  line-height: 1.4;
}
.request-banner p i {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--grey-dim);
}
.request-banner-actions {
  display: flex;
  gap: 8px;
}
.request-banner-actions .btn {
  flex: 1;
}
.request-banner--sent {
  background: none;
}

.thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.thread-head .back {
  color: var(--grey);
  font-size: 16px;
  display: flex;
}
.thread-head .back:hover {
  color: var(--paper);
}
.thread-head-avatar {
  position: relative;
  display: flex;
  flex-shrink: 0;
}
.thread-head-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.thread-head .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
}
.thread-head-status {
  font-size: 12px;
  color: var(--grey-dim);
}
.active-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 3; 
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--strength-strong);
  border: 2.5px solid var(--story-gap, var(--ink));
}
.thread-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.thread-search-toggle i{
  font-size: 18px;
  padding-right: 16px;
}

@media (max-width: 721px) {
  .thread-search-toggle {
    display: none;
  }
}

.thread-search-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform 0.22s ease;
}
.thread-search-panel[hidden] {
  display: none;
}
.thread-search-panel.is-open {
  transform: translateY(0);
}
.thread-search-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  width: 100%;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.thread-search-back {
  flex-shrink: 0;
  display: flex;
  padding: 4px;
  background: none;
  border: none;
  color: var(--grey);
  font-size: 18px;
  cursor: pointer;
}
.thread-search-back:hover {
  color: var(--paper);
}
.thread-search-bar {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.thread-search-results {
  flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 10px 24px;
}
.thread-search-empty {
  padding-top: 60px;
}

.thread-search-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  background: none;
  border: none;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.thread-search-row:hover {
  background: var(--ink-raised);
}
.thread-search-row .avatar-sm,
.thread-search-row .avatar-fallback--row {
  flex-shrink: 0;
}
.thread-search-body {
  min-width: 0;
  flex: 1;
}
.thread-search-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}
.thread-search-sender {
  font-weight: 600;
  font-size: 13px;
  color: var(--paper);
}
.thread-search-time {
  font-size: 11px;
  color: var(--grey-dim);
}
.thread-search-snippet {
  font-size: 13px;
  line-height: 1.4;
  color: var(--grey-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-search-attach-icon {
  margin-right: 4px;
  color: var(--grey-dim);
}
.thread-search-snippet mark.search-hit {
  background: color-mix(in srgb, var(--safelight) 35%, transparent);
  color: var(--paper);
  border-radius: 3px;
  padding: 0 1px;
}

@media (min-width: 1280px) {

  :root {
    --thread-search-w: 360px;
  }
  .thread-search-panel {
    position: static;
    inset: auto;
    flex: 0 0 auto;
    width: 0;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-left: 1px solid transparent;
    transform: none;
    transition: width 0.22s ease, border-color 0.22s ease;
  }
  .thread-search-panel.is-open {
    width: var(--thread-search-w);
    border-left-color: var(--line);
  }

  .thread-search-panel-head,
  .thread-search-results {
    width: var(--thread-search-w);
  }
  .thread-search-panel-head {
    padding: 20px 18px 14px;
    border-bottom: 1px solid var(--line);
  }
}

.thread-info-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform 0.22s ease;
}
.thread-info-panel[hidden] {
  display: none;
}
.thread-info-panel.is-open {
  transform: translateY(0);
}
.thread-info-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  width: 100%;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.thread-info-panel-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--paper);
}
.thread-info-body {
  flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px 18px 28px;
}

.thread-info-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding-bottom: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.thread-info-avatar-link {
  display: flex;
  margin-bottom: 6px;
}
.thread-info-avatar,
.avatar-fallback--thread-info {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}
.avatar-fallback--thread-info {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 88px;
  color: var(--grey-dim);
}
.thread-info-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--paper);
}
.thread-info-username {
  font-size: 13px;
  color: var(--grey-dim);
}
.thread-info-view-profile {
  margin-top: 10px;
}

.thread-info-facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.thread-info-fact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--grey-dim);
}
.thread-info-fact i {
  width: 16px;
  text-align: center;
  color: var(--grey-dim);
}

.thread-info-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.thread-info-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  margin: 0 0 12px;
}
.thread-info-empty {
  font-size: 13px;
  color: var(--grey-dim);
}
.thread-info-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.thread-info-media-item {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--ink-raised);
}
.thread-info-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thread-info-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.thread-info-link-list:first-child {
  margin-top: 0;
}
.thread-info-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  transition: background 0.12s ease;
}
.thread-info-link-row:hover {
  background: var(--ink-raised);
}
.thread-info-link-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--ink-raised);
}
.thread-info-link-thumb--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-dim);
  font-size: 16px;
}
.thread-info-link-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.thread-info-link-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-info-link-host {
  font-size: 11px;
  color: var(--grey-dim);
}

.thread-info-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thread-info-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  background: none;
  border: none;
  border-radius: var(--radius);
  text-align: left;
  font-size: 14px;
  color: var(--paper);
  cursor: pointer;
  transition: background 0.12s ease;
}
.thread-info-action:hover {
  background: var(--ink-raised);
}
.thread-info-action i {
  width: 14px;
  text-align: center;
  color: var(--grey-dim);
}
.thread-info-action--danger {
  color: var(--danger-text);
}
.thread-info-action--danger i {
  color: var(--danger-text);
}

@media (min-width: 1280px) {
  :root {
    --thread-info-w: 360px;
  }
  .thread-info-panel {
    position: static;
    inset: auto;
    flex: 0 0 auto;
    width: 0;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-left: 1px solid transparent;
    transform: none;
    transition: width 0.22s ease, border-color 0.22s ease;
  }
  .thread-info-panel.is-open {
    width: var(--thread-info-w);
    border-left-color: var(--line);
  }
  .thread-info-panel-head,
  .thread-info-body {
    width: var(--thread-info-w);
  }
  .thread-info-panel-head {
    padding: 28px 18px 26px;
    border-bottom: 1px solid var(--line);
  }
}

.pinned-bar {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-raised);
}
.pinned-bar-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  cursor: pointer;
}
.pinned-bar-toggle i:first-child {
  color: var(--safelight);
}
.pinned-bar-text {
  flex: 1;
  text-align: left;
}
.pinned-bar-toggle[aria-expanded="true"] i:last-child {
  transform: rotate(180deg);
}
.pinned-bar-list {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: -1px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--ink-raised);
  max-height: min(500px, calc(100vh - 160px));
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 20;
}
.pinned-bar-list[hidden] {
  display: none;
}
.pinned-bar-item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-top: 1px solid var(--line);
}
.pinned-bar-list .pinned-bar-item:first-child {
  border-top: none;
}
.pinned-bar-item-jump {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  font-size: 13px;
  color: var(--grey-dim);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pinned-bar-item-jump:hover {
  color: var(--paper);
  background: var(--line-soft);
}
.pinned-bar-item-unpin {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--grey-dim);
  font-size: 13px;
  cursor: pointer;
}
.pinned-bar-item-unpin:hover {
  color: var(--paper);
  background: var(--line-soft);
}
.pinned-bar-item-unpin:disabled {
  opacity: 0.5;
  cursor: default;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.bubble-row.mine {
  justify-content: flex-end;
}
.bubble-row.mine .bubble-wrap {
  align-items: flex-end;
}
.bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}
.bubble {
  padding: 9px 13px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.45;
  background: var(--ink-raised);
  color: var(--paper);
  border-bottom-left-radius: 4px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  line-clamp: 10;
  overflow: hidden;
}
.bubble.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}
.bubble-row.mine .bubble {
  background: var(--safelight);
  color: #fff;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: 4px;
}
.bubble-more-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  margin-top: 3px;
  font: inherit;
  font-size: 12px;
  color: var(--grey);
  cursor: pointer;
  
}
.bubble-row.mine .bubble-more-toggle {
  align-self: flex-end;
}
.bubble-more-toggle:hover {
  color: var(--paper);
}
.bubble-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.bubble-row.mine .bubble-meta {
  justify-content: flex-end;
}
.bubble-time {
  font-size: 11px;
  color: var(--grey-dim);
}
.bubble-edited {
  font-size: 11px;
  color: var(--grey-dim);
  font-style: italic;
}
.bubble-like-badge {

  display: none !important;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: none;
  border: none;
  font-size: 12px;
  line-height: 1;
  color: var(--grey-dim);
  cursor: pointer;
}
.bubble-like-badge.is-liked {
  color: #ef4444;
}
.bubble-status {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: var(--grey-dim);
  line-height: 1;
}
.bubble-status[data-status="read"] {
  color: var(--safelight);
}
.bubble-deleted {
  display: flex;
  align-items: center;
  gap: 6px;
  font-style: italic;
  background: var(--ink-raised) !important;
  color: var(--grey-dim) !important;
}

.bubble-reply-quote {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  max-width: 260px;
  padding: 6px 9px;
  margin-bottom: 4px;
  border: none;
  border-radius: var(--radius);
  background: var(--ink-raised);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.bubble-row.mine .bubble-reply-quote {
  align-self: flex-end;
  background: rgba(200, 57, 31, 0.1);
}
.bubble-reply-quote-bar {
  flex-shrink: 0;
  align-self: stretch;
  width: 3px;
  border-radius: 2px;
  background: var(--safelight);
}
.bubble-reply-quote-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bubble-reply-quote-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--safelight);
}

.bubble-reply-quote-snippet {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--grey-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-reply-quote.is-deleted {
  cursor: default;
  font-style: italic;
}
.bubble-reply-quote.is-deleted:hover {
  background: rgba(255, 255, 255, 0.08);
}
.bubble-row.mine .bubble-reply-quote.is-deleted:hover {
  background: rgba(200, 57, 31, 0.1);
}

.msg-link-preview {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 260px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-raised);
  text-decoration: none;
  color: inherit;
}
.msg-link-preview:hover {
  border-color: var(--safelight);
}
.bubble-row.mine .msg-link-preview {
  align-self: flex-end;
  background: rgba(200, 57, 31, 0.06);
  border-color: rgba(200, 57, 31, 0.35);
}
.msg-link-preview-img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  display: block;
  background: var(--line);
}
.msg-link-preview-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  min-width: 0;
}
.msg-link-preview-site {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--grey-dim);
}
.msg-link-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.msg-link-preview-desc {
  font-size: 12px;
  color: var(--grey-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.bubble-pin-flag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-dim);
  margin-bottom: 3px;
}
.bubble-row.mine .bubble-pin-flag {
  align-self: flex-end;
}
.bubble-menu {
  align-self: flex-end;
  margin-bottom: 22px; 
  opacity: 0;
  transition: opacity 0.12s ease;
}

.bubble-row.mine .bubble-menu {
  order: -1;
}
.bubble-row:hover .bubble-menu,
.bubble-menu:focus-within,
.bubble-menu-toggle.menu-open {
  opacity: 1;
}
@media (pointer: coarse) {

  .bubble-menu-toggle {
    display: none;
  }
}
.bubble-menu-toggle {
  color: var(--grey-dim);
}
.bubble-menu-toggle:hover {
  color: var(--paper);
}
.bubble-row.entering {
  animation: row-in 0.2s ease;
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.bubble-row.flash-highlight .bubble {
  animation: bubble-flash 1.2s ease;
}

.bubble-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 11px 14px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grey-dim);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@keyframes bubble-flash {
  0%, 100% {
    box-shadow: none;
  }
  25% {
    box-shadow: 0 0 0 3px var(--safelight);
  }
}

.bubble-image-link {
  display: block;

  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.bubble-image {
  display: block;
  max-width: 300px;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  object-fit: cover;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.bubble-row.mine .bubble-image {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: 4px;
}
.bubble-wrap:has(.bubble-image):has(.bubble) .bubble-image {
  margin-bottom: 4px;
}

.reply-compose-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-raised);
  animation: row-in 0.15s ease;
}
.reply-compose-bar-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.reply-compose-bar-icon {
  flex-shrink: 0;
  color: var(--safelight);
  font-size: 15px;
}
.reply-compose-bar-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.reply-compose-bar-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--safelight);
}
.reply-compose-bar-snippet {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--grey-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-compose-bar-cancel {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--grey-dim);
  font-size: 13px;
  cursor: pointer;
}
.reply-compose-bar-cancel:hover {
  color: var(--paper);
  background: var(--line-soft);
}

.message-form {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 6px 6px 8px;

}
.message-form:focus-within {
  border-color: var(--safelight);
}
.message-form textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--paper);
  font: inherit;
  font-size: 14.5px;
  resize: none;
  overflow-y: hidden;
  max-height: 120px;

  line-height: 20px;
  padding: 5px 0;
  margin: 0;
}
.message-form textarea.scrolling {
  overflow-y: auto;
}
.message-form textarea::placeholder {
  color: var(--grey-dim);
}
.message-form textarea:focus {
  outline: none;
}
.message-form button[type="submit"] {
  background: var(--safelight);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  transition:
    filter 0.15s ease,
    opacity 0.15s ease;
}
.message-form button[type="submit"]:hover:not(:disabled) {
  filter: brightness(1.08);
}
.message-form button[type="submit"]:disabled {
  opacity: 0.5;
}
.composer-attach {
  position: relative;
  flex-shrink: 0;
}
.attach-btn, .emoji-btn{
  background: none;
  border: none;
  color: var(--grey-dim);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.12s ease;
}
.emoji-btn {
  font-size: 22px;
}
.attach-btn:hover, .emoji-btn:hover {
  color: var(--paper);
}
.attach-btn[aria-expanded="true"] {
  transform: rotate(45deg);
}

.attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 35;
  min-width: 150px;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 6px;
}
.attach-menu[hidden] {
  display: none;
}
.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: var(--paper);
  font-size: 14px;
}
.attach-menu-item i {
  color: var(--grey-dim);
  font-size: 17px;
}
.attach-menu-item:hover {
  background: var(--ink);
}

.emoji-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 35;
  max-width: 350px;
  height: 260px;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.emoji-picker[hidden] {
  display: none;
}
.emoji-picker-tabs {
  display: flex;
  flex: none;
  overflow-x: auto;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.emoji-picker-tabs::-webkit-scrollbar {
  display: none;
}
.emoji-picker-tab {
  flex: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 6px 9px 8px;
  opacity: 0.55;
}
.emoji-picker-tab:hover {
  opacity: 0.85;
  background: var(--ink);
}
.emoji-picker-tab.active {
  opacity: 1;
  border-bottom-color: var(--safelight);
}
.emoji-picker-panels {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.emoji-picker-panel {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.emoji-picker-panel[hidden] {
  display: none;
}
.emoji-picker-item {
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-picker-item:hover {
  background: var(--ink);
}

.attach-preview {
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.attach-preview:not([hidden]) {
  display: flex;
}
.attach-preview[hidden] {
  display: none;
}
.attach-preview-thumb-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--ink-raised);
}
.attach-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.attach-preview-overlay {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.55);
}
.attach-preview-overlay:not([hidden]) {
  display: flex;
}
.attach-preview-overlay[hidden] {
  display: none;
}
.attach-preview-name {
  flex: 1;
  font-size: 13px;
  color: var(--grey-dim);
}
.attach-preview-remove {
  background: none;
  border: none;
  color: var(--grey-dim);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.attach-preview-remove:hover {
  background: var(--line);
  color: var(--paper);
}

[data-msg-thread-content] {
  position: relative;
}
.thread-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  background: rgba(var(--safelight-rgb), 0.12);
  backdrop-filter: blur(2px);
  pointer-events: none;
  margin-top: 80px;
  margin-bottom: 80px;
  border-radius: var(--radius);
  border: 1px dashed var(--safelight);
}
.thread-drop-overlay:not([hidden]) {
  display: flex;
}
.thread-drop-overlay[hidden] {
  display: none;
}
.thread-drop-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 36px;
  border: 2px dashed var(--safelight);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
}
.thread-drop-overlay-inner i {
  font-size: 28px;
  color: var(--safelight);
}

:root {
  --msg-list-w: 320px;
}
@media (min-width: 900px) {
  :root {
    --msg-list-w: 380px;
  }
}

.messages-shell {
  width: var(--wide-xl-max-w);
}

.msg-list-panel {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px var(--page-bottom-gutter);
}
.msg-list-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.msg-list-title {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 4px 0;
}

[data-msg-thread-content] {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  opacity: 1;
  transition: opacity 0.1s ease;
}
.msg-thread-panel.is-loading [data-msg-thread-content],
[data-msg-thread-content].is-loading {
  opacity: 0.5;
}

.msg-thread-placeholder {
  display: none;
}
.msg-thread-placeholder-icon {
  width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.msg-thread-placeholder-icon i {
  font-size: 34px;
}
.msg-thread-placeholder h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}
.msg-thread-placeholder p {
  font-size: 14px;
  color: var(--grey-dim);
  margin: 0 0 20px;
}
.msg-thread-placeholder .btn {
  width: auto;
  padding: 8px 20px;
}

@media (max-width: 721px) {
  .msg-thread-panel {
    display: none;
  }

  body.messages-page.thread-open {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.messages-page.thread-open .sidenav {
    display: none;
  }
  body.messages-page.thread-open .msg-list-panel {
    display: none;
  }
  body.messages-page.thread-open .messages-shell {
    flex: 1 1 auto;
    height: 100dvh;
    min-height: 0;
  }
  body.messages-page.thread-open .msg-thread-panel {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    padding: 20px 16px var(--bottomnav-clearance);
  }
  body.messages-page.thread-open .thread-head {
    flex: 0 0 auto;
  }
  body.messages-page.thread-open .thread,
  body.messages-page.thread-open .empty {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  body.messages-page.thread-open .empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  body.messages-page.thread-open .message-form,
  body.messages-page.thread-open .attach-preview {
    flex: 0 0 auto;
  }
  body.messages-page.thread-open .message-form {
    margin-top: 10px;
  }
  .attach-preview {
    margin-top: 10px;
  }
}

@media (min-width: 721px) {
  body.messages-page {
    height: 100vh;
    overflow: hidden;
  }
  .messages-shell {
    display: flex;
    align-items: stretch;
    height: 100%;
  }

  .msg-list-panel {
    flex: 0 0 var(--msg-list-w);
    width: var(--msg-list-w);
    max-width: none;
    margin: 0;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 20px 24px;
    border-right: 1px solid var(--line);
  }

  .msg-thread-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 0 32px;
  }
  .msg-thread-panel .thread-head {
    flex: 0 0 auto;
    padding-top: 22px;
  }
  .msg-thread-panel .thread,
  .msg-thread-panel .empty {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .msg-thread-panel .empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .msg-thread-panel .message-form,
  .msg-thread-panel .attach-preview {
    flex: 0 0 auto;
  }
  .msg-thread-panel .message-form {
    margin: 10px 0 24px;
  }
  .msg-thread-panel .bubble-wrap {
    max-width: 480px;
  }

  .msg-thread-panel .msg-thread-placeholder {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 0;
  }
}

.msg-thread-panel .thread,
body.messages-page.thread-open .thread {
  scrollbar-width: none; 
  padding-right: 4px;
  padding-left: 4px;
}
.msg-thread-panel .thread::-webkit-scrollbar,
body.messages-page.thread-open .thread::-webkit-scrollbar {
  width: 0; 
  display: none;
}

