/* ============================================
   UNIFIED MESSAGE CENTER
   Telegram-inspired conversations + system notices
   ============================================ */

.message-center-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 84% 10%, rgba(200, 255, 0, 0.045), transparent 28%),
    radial-gradient(ellipse at 8% 78%, rgba(6, 182, 212, 0.045), transparent 28%),
    var(--bg-primary);
}

.inbox-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 82px 24px 28px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
}

.inbox-sidebar,
.inbox-stage {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  box-shadow: var(--shadow-card);
}

.inbox-sidebar {
  min-height: calc(100vh - 110px);
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  backdrop-filter: blur(22px);
}

.inbox-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 20px 16px;
}

.inbox-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--acid);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.inbox-eyebrow [data-lucide] {
  width: 13px;
  height: 13px;
}

.inbox-sidebar h1,
.notification-header h2 {
  margin-top: 5px;
  color: var(--text-primary);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.inbox-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-active);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--bg-glass);
  transition: var(--transition);
}

.inbox-help:hover {
  border-color: var(--acid);
  color: var(--acid);
  transform: translateY(-1px);
}

.inbox-help [data-lucide] {
  width: 17px;
  height: 17px;
}

.inbox-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 16px 14px;
  padding: 0 11px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-input) 90%, transparent);
  transition: var(--transition);
}

.inbox-search:focus-within {
  border-color: var(--acid-border);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--acid-bg);
}

.inbox-search [data-lucide] {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.inbox-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.inbox-search input::placeholder { color: var(--text-muted); }

.inbox-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 0 16px 12px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, .018);
}

.inbox-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 29px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  transition: var(--transition);
}

.inbox-tab:hover { color: var(--text-secondary); }

.inbox-tab.active {
  color: var(--acid);
  background: var(--acid-bg);
}

.inbox-tab b,
.system-folder-meta b,
.thread-unread,
.system-folder-link em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 20px;
  color: var(--acid);
  background: rgba(200, 255, 0, .13);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.inbox-tab:not(.active) b:empty,
.system-folder-meta b:empty { display: none; }

.system-folder {
  margin: 0 10px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, .015);
}

.system-folder.is-open {
  border-color: var(--border);
}

.system-folder-toggle,
.system-folder-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--text-secondary);
  text-align: left;
}

.system-folder-toggle {
  padding: 10px 10px 8px;
  font-size: 12px;
  font-weight: 750;
}

.system-folder-toggle:hover,
.system-folder-link:hover { color: var(--text-primary); }

.system-folder-label,
.system-folder-meta,
.system-folder-link span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.system-folder [data-lucide] {
  width: 15px;
  height: 15px;
}

.system-folder-meta { gap: 6px; }

.folder-chevron {
  color: var(--text-muted);
  transition: transform .2s ease;
}

.system-folder:not(.is-open) .folder-chevron { transform: rotate(-90deg); }

.system-folder-body {
  display: grid;
  gap: 2px;
  overflow: hidden;
  max-height: 100px;
  padding: 0 7px 7px;
  opacity: 1;
  transition: max-height .22s ease, opacity .18s ease, padding .22s ease;
}

.system-folder:not(.is-open) .system-folder-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.system-folder-link {
  min-height: 30px;
  padding: 0 5px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

.system-folder-link.active {
  color: var(--acid);
  background: var(--acid-bg);
}

.system-folder-link [data-lucide] {
  width: 13px;
  height: 13px;
}

.system-folder-link em {
  min-width: 15px;
  height: 15px;
  color: var(--text-muted);
  background: rgba(255,255,255,.06);
}

.conversation-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 18px 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.conversation-list-head span:last-child {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 9px 12px;
}

.thread-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 2px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text-primary);
  text-align: left;
  transition: var(--transition);
}

.thread-item:hover { background: rgba(255,255,255,.035); }

.thread-item.active {
  border-color: var(--acid-border);
  background: linear-gradient(90deg, rgba(200,255,0,.095), rgba(200,255,0,.025));
}

.thread-avatar,
.chat-peer-avatar,
.message-peer-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #050505;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
  user-select: none;
}

.thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.thread-copy { min-width: 0; }

.thread-top,
.thread-preview-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.thread-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-role {
  overflow: hidden;
  color: var(--acid);
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-preview {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  align-self: stretch;
}

.thread-time {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.thread-item.unread .thread-name,
.thread-item.unread .thread-preview { color: var(--text-primary); }

.thread-unread {
  min-width: 16px;
  height: 16px;
  color: #101500;
  background: var(--acid);
}

.list-empty,
.notification-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.list-empty [data-lucide],
.notification-empty [data-lucide] {
  width: 22px;
  height: 22px;
  color: var(--acid);
  opacity: .8;
}

.inbox-stage {
  position: relative;
  min-height: calc(100vh - 110px);
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--bg-secondary) 84%, transparent), var(--bg-card));
  backdrop-filter: blur(22px);
}

.chat-view,
.notification-view {
  min-height: calc(100vh - 112px);
}

.chat-view {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

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

.chat-peer-avatar {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

.chat-peer-copy { min-width: 0; }

.chat-peer-name-row,
.chat-peer-subline,
.chat-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.chat-peer-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-role-pill {
  padding: 2px 6px;
  border: 1px solid var(--acid-border);
  border-radius: 4px;
  color: var(--acid);
  background: var(--acid-bg);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.chat-peer-subline {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16,208,97,.1);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.02);
}

.chat-header-action:hover { color: var(--acid); border-color: var(--acid-border); }
.chat-header-action [data-lucide] { width: 16px; height: 16px; }

.chat-context {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 33px;
  padding: 7px 22px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.012);
  font-size: 10px;
}

.chat-context [data-lucide] { width: 13px; height: 13px; color: var(--acid); }
.chat-context a { color: var(--acid); font-weight: 700; }
.chat-context a:hover { color: var(--cyan); }

.chat-stream {
  min-height: 0;
  overflow-y: auto;
  padding: 20px clamp(16px, 4vw, 52px);
  scroll-behavior: smooth;
}

.chat-day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 10px;
}

.chat-day-divider span {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: min(82%, 650px);
  margin: 0 0 12px;
}

.message-row.self {
  flex-direction: row-reverse;
  margin-left: auto;
}

.message-peer-avatar {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  font-size: 10px;
}

.message-col { min-width: 0; }

.message-row.self .message-col { display: grid; justify-items: end; }

.message-bubble {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px 13px 13px 13px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.045);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-row.self .message-bubble {
  border-color: rgba(200,255,0,.22);
  border-radius: 13px 4px 13px 13px;
  color: var(--text-on-primary);
  background: linear-gradient(135deg, var(--acid), #a8d800);
}

.message-meta {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.system-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 15px auto;
  padding: 5px 8px;
  width: fit-content;
  max-width: 90%;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  background: rgba(255,255,255,.018);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.system-message [data-lucide] { width: 12px; height: 12px; color: var(--acid); }

.typing-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}

.typing-bubble {
  display: flex;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 4px 13px 13px 13px;
  background: rgba(255,255,255,.04);
}

.typing-bubble span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: messageTyping .9s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: .13s; }
.typing-bubble span:nth-child(3) { animation-delay: .26s; }

@keyframes messageTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.quick-replies {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 9px 22px;
  border-top: 1px solid var(--border);
  scrollbar-width: none;
}
.quick-replies::-webkit-scrollbar { display: none; }

.quick-reply {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.018);
  font-size: 10px;
  transition: var(--transition);
}
.quick-reply:hover { border-color: var(--acid-border); color: var(--acid); background: var(--acid-bg); }

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.08);
}

.chat-composer textarea {
  flex: 1;
  min-height: 39px;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: var(--text-primary);
  background: var(--bg-input);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  transition: var(--transition);
}
.chat-composer textarea::placeholder { color: var(--text-muted); }
.chat-composer textarea:focus { border-color: var(--acid-border); box-shadow: 0 0 0 3px var(--acid-bg); }

.chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--acid);
  border-radius: 10px;
  color: var(--text-on-primary);
  background: var(--acid);
  transition: var(--transition);
}
.chat-send:hover { background: var(--text-primary); border-color: var(--text-primary); transform: translateY(-1px); }
.chat-send [data-lucide] { width: 16px; height: 16px; }

.chat-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px 13px;
  color: var(--text-muted);
  background: rgba(0,0,0,.08);
  font-size: 9px;
  text-align: center;
}
.chat-footnote [data-lucide] { width: 11px; height: 11px; color: var(--acid); }

.notification-view {
  padding: 26px clamp(18px, 4vw, 42px);
  overflow-y: auto;
}

.notification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--border);
}

.notification-header h2 { font-size: 22px; }

.notification-header p:not(.inbox-eyebrow) {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.notification-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.02);
  font-size: 10px;
  font-weight: 700;
  transition: var(--transition);
}

.text-action:hover:not(:disabled) { border-color: var(--acid-border); color: var(--acid); background: var(--acid-bg); }
.text-action:disabled { opacity: .4; cursor: not-allowed; }
.text-action [data-lucide] { width: 13px; height: 13px; }

.notification-filters {
  display: flex;
  gap: 6px;
  margin: 16px 0 11px;
}

.notification-filter {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
}
.notification-filter.active { border-color: var(--acid-border); color: var(--acid); background: var(--acid-bg); }

.notification-list { display: grid; gap: 8px; }

.notification-card {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  transition: var(--transition);
}
.notification-card:hover { border-color: var(--border-active); background: rgba(255,255,255,.035); }
.notification-card.unread { border-color: rgba(200,255,0,.19); background: linear-gradient(90deg, rgba(200,255,0,.055), rgba(255,255,255,.018)); }
.notification-card.urgent { border-left: 2px solid var(--orange); }

.notification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--acid);
  background: var(--acid-bg);
}
.notification-icon.type-deadline { color: var(--orange); background: rgba(249,115,22,.08); }
.notification-icon.type-system { color: var(--cyan); background: rgba(6,182,212,.08); }
.notification-icon.type-bid { color: var(--violet); background: rgba(124,58,237,.1); }
.notification-icon.type-order { color: var(--acid); }
.notification-icon.type-finance { color: var(--yellow); background: rgba(245,158,11,.08); }
.notification-icon [data-lucide] { width: 18px; height: 18px; }

.notification-copy { min-width: 0; }

.notification-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.notification-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-chip {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(255,255,255,.06);
  font-size: 9px;
  font-weight: 700;
}
.notification-card.unread .notification-chip { color: var(--acid); background: var(--acid-bg); }

.notification-body {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 9px;
}
.notification-link { color: var(--acid); font-weight: 750; }
.notification-link:hover { color: var(--cyan); }

.notification-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.notification-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
}
.notification-icon-button:hover { border-color: var(--border); color: var(--text-primary); background: rgba(255,255,255,.04); }
.notification-icon-button [data-lucide] { width: 14px; height: 14px; }

@media (max-width: 920px) {
  .inbox-shell { grid-template-columns: 275px minmax(0, 1fr); padding-left: 16px; padding-right: 16px; }
  .chat-stream { padding-left: 22px; padding-right: 22px; }
  .message-row { max-width: 88%; }
  .notification-header { flex-direction: column; }
  .notification-header-actions { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .inbox-shell {
    display: block;
    padding: 68px 12px 18px;
  }
  .inbox-sidebar,
  .inbox-stage {
    min-height: unset;
    max-height: none;
    border-radius: 13px;
  }
  .inbox-sidebar { margin-bottom: 12px; }
  .inbox-sidebar-head { padding: 16px 15px 12px; }
  .inbox-sidebar h1 { font-size: 21px; }
  .inbox-search { margin-left: 12px; margin-right: 12px; }
  .inbox-tabs { margin-left: 12px; margin-right: 12px; }
  .conversation-list {
    display: flex;
    gap: 4px;
    max-height: 96px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 10px 10px;
  }
  .thread-item {
    flex: 0 0 176px;
    grid-template-columns: 37px minmax(0, 1fr) auto;
    min-height: 66px;
    margin: 0;
  }
  .thread-avatar { width: 37px; height: 37px; border-radius: 11px; }
  .thread-role { display: none; }
  .conversation-list-head { margin-top: 0; }
  .chat-view,
  .notification-view { min-height: calc(100vh - 366px); }
  .chat-header { min-height: 68px; padding: 12px 14px; }
  .chat-context { padding-left: 14px; padding-right: 14px; }
  .chat-stream { min-height: 360px; padding: 16px 14px; }
  .quick-replies,
  .chat-composer { padding-left: 14px; padding-right: 14px; }
  .notification-view { padding: 18px 14px; }
  .notification-card { grid-template-columns: 35px minmax(0, 1fr) auto; padding: 11px; gap: 9px; }
  .notification-icon { width: 35px; height: 35px; border-radius: 10px; }
}

@media (max-width: 460px) {
  .chat-peer-subline { font-size: 9px; }
  .chat-peer-name { max-width: 140px; }
  .message-row { max-width: 94%; }
  .notification-title { white-space: normal; }
  .notification-meta { flex-wrap: wrap; }
  .notification-header-actions { width: 100%; }
  .text-action { flex: 1; justify-content: center; }
}

/* Light theme keeps the structural contrast without hard-coded dark colors. */
[data-theme="light"] .inbox-sidebar,
[data-theme="light"] .inbox-stage {
  background: rgba(255,255,255,.9);
}
[data-theme="light"] .chat-composer,
[data-theme="light"] .chat-footnote { background: rgba(0,0,0,.012); }
[data-theme="light"] .message-bubble { background: rgba(0,0,0,.025); }
[data-theme="light"] .thread-item:hover,
[data-theme="light"] .notification-card:hover { background: rgba(0,0,0,.018); }
[data-theme="light"] .thread-item.active,
[data-theme="light"] .notification-card.unread { background: linear-gradient(90deg, rgba(106,148,0,.08), rgba(0,0,0,.008)); }

/* ==========================================================================
   新美缪斯 MESSAGE CENTER — ADVANCED AESTHETICS & ACTIONS
   ========================================================================== */

/* 1. 一体化玻璃背板与阴影的科技美化 */
.inbox-sidebar,
.inbox-stage {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(20, 20, 20, 0.6) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

[data-theme="light"] .inbox-sidebar,
[data-theme="light"] .inbox-stage {
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  background: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
}

/* 2. 会话列表项 (Thread Item) 样式提升 */
.thread-item {
  position: relative;
  border-radius: 12px !important;
  margin-bottom: 4px !important;
  padding: 11px 12px !important; /* 调整内边距，让排列更大气 */
  border: 1px solid transparent !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.thread-item:hover {
  background: rgba(255, 255, 255, 0.045) !important;
}

.thread-item.active {
  border-color: rgba(200, 255, 0, 0.22) !important;
  background: linear-gradient(90deg, rgba(200, 255, 0, 0.08), rgba(200, 255, 0, 0.01)) !important;
}

.thread-copy {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.thread-preview {
  display: block !important;
  width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 3. 悬浮单条删除按钮的精美动画 */
.thread-delete-btn {
  position: absolute;
  right: 10px;
  bottom: 8px;
  background: rgba(26, 26, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

[data-theme="light"] .thread-delete-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.thread-item:hover .thread-delete-btn {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.thread-delete-btn:hover {
  color: var(--red) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

.thread-delete-btn [data-lucide] {
  width: 13px;
  height: 13px;
}

/* 4. 会话标题栏的一键动作按钮样式 */
.conversation-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-action-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-action-btn:hover {
  color: var(--acid);
  border-color: var(--acid-border);
  background: var(--acid-bg);
}

.icon-action-btn.text-danger:hover {
  color: var(--red) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.icon-action-btn [data-lucide] {
  width: 14px;
  height: 14px;
}

/* 5. 气泡美化与投射 */
.message-bubble {
  border-radius: 6px 14px 14px 14px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-row.self .message-bubble {
  border-radius: 14px 6px 14px 14px !important;
  box-shadow: 0 4px 12px rgba(200, 255, 0, 0.12);
}

/* 6. 单条通知删除按钮微调 */
.notification-icon-button.btn-delete:hover {
  color: var(--red) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* 7. 红色危险按钮统一定制 */
.text-action.text-danger {
  color: var(--red) !important;
}
.text-action.text-danger:hover:not(:disabled) {
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

/* 彻底解决 [hidden] 被 css 类中的 display 规则覆盖的 HTML 规范 Bug */
[hidden] {
  display: none !important;
}

/* 彻底隐藏顶部导航栏消息入口的“消息”文字，只保留精美的 icon 与角标 */
.nav-message-entry span {
  display: none !important;
}

