.header-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.connection-chip,
.connect-button {
  padding: 9px 12px;
  border: 1px solid #ccdade;
  border-radius: 11px;
  color: #496b75;
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 750;
}

.connect-button {
  color: white;
  border-color: #297f94;
  background: #297f94;
}

.inbox-grid {
  grid-template-columns: minmax(285px, 340px) minmax(0, 1fr);
  height: calc(100vh - 142px);
  min-height: 660px;
  background: rgba(255, 255, 255, .31);
  box-shadow: 0 22px 55px rgba(45, 79, 87, .1), inset 0 1px 0 rgba(255, 255, 255, .85);
}

.thread-list {
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid rgba(151, 177, 183, .22);
  background: rgba(255, 255, 255, .18);
}

.inbox-list-heading {
  display: flex;
  min-height: 88px;
  padding: 19px 18px 13px;
  align-items: center;
  justify-content: space-between;
}

.inbox-list-heading .eyebrow { margin-bottom: 3px; font-size: 9px; }
.inbox-list-heading h2 { margin: 0; color: #29434e; font-size: 20px; letter-spacing: -.03em; }
.inbox-list-heading > span {
  display: grid;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 9px;
  color: #4c6d77;
  background: rgba(255, 255, 255, .54);
  font-size: 10px;
  font-weight: 850;
}

.inbox-filters {
  display: flex;
  gap: 5px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.inbox-filters::-webkit-scrollbar { display: none; }

.inbox-filters button {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 9px;
  color: #697f87;
  background: rgba(255, 255, 255, .24);
  font-size: 9.5px;
  font-weight: 750;
  white-space: nowrap;
}

.inbox-filters button.active {
  color: #176c70;
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 5px 14px rgba(45, 86, 96, .07), inset 0 1px 0 white;
}

.inbox-search {
  display: flex;
  height: 34px;
  margin: 0 14px 12px;
  padding: 0 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  color: #789097;
  background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76);
}

.inbox-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: #304e58;
  background: transparent;
  font-size: 11px;
}

#threads {
  height: calc(100% - 172px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(11, 115, 114, .3) transparent;
  scrollbar-width: thin;
}

.thread {
  margin: 0 9px 6px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
}

.thread:hover,
.thread.selected {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .57);
  box-shadow: 0 9px 22px -18px rgba(31, 74, 91, .42), inset 0 1px 0 rgba(255, 255, 255, .82);
}

.thread-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.thread-avatar {
  display: grid !important;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 11px;
  color: #176c70 !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(194, 235, 228, .62));
  font-size: 10px !important;
  font-weight: 850;
  box-shadow: inset 0 1px 0 white;
}

.thread-copy {
  display: grid !important;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.thread-copy strong,
.thread-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-copy strong { color: #29434e; font-size: 12px; }
.thread-copy small { color: #7c8d94; font-size: 9.5px; }

.thread-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #a4adb4;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .48);
}

.thread-status-dot.waiting { background: #ed9d27; }
.thread-status-dot.scheduled { background: #629bd4; }

.thread-preview {
  display: -webkit-box !important;
  margin: 7px 0 0 43px !important;
  overflow: hidden !important;
  color: #71808a !important;
  font-size: 10.5px !important;
  line-height: 1.4;
  white-space: normal !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.thread-state {
  margin: 7px 0 0 43px !important;
  padding: 3px 6px !important;
  color: #256f80 !important;
  background: #dceff1 !important;
  font-size: 8.5px !important;
}

.thread-list-empty {
  display: grid;
  min-height: 180px;
  padding: 24px;
  place-items: center;
  color: #71858c;
  font-size: 11px;
  text-align: center;
}

.detail {
  min-width: 0;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(11, 115, 114, .3) transparent;
  scrollbar-width: thin;
}

.message,
.draft-card,
.activity {
  width: min(900px, 100%);
  margin-right: auto;
  margin-left: auto;
  border-color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 12px 30px rgba(45, 79, 87, .06), inset 0 1px 0 rgba(255, 255, 255, .88);
  backdrop-filter: blur(20px) saturate(140%);
}

.message { border-top-left-radius: 7px; }
.message h2 { color: #29434e; font-size: 18px; letter-spacing: -.025em; }
.message .body { color: #405c67; font-size: 13px; }

.draft-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, .58);
}

.draft-card::before {
  content: '';
  position: absolute;
  top: -110px;
  right: -60px;
  width: 240px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179, 240, 216, .72), transparent 68%);
  filter: blur(9px);
  pointer-events: none;
}

.draft-card > * { position: relative; }
.draft-card h3 { color: #29434e; font-size: 18px; }
.draft-card > strong { display: block; margin-top: 15px; color: #304e58; font-size: 13px; }
.draft-body { padding: 14px; border: 1px solid rgba(92, 139, 137, .22); border-radius: 14px; color: #405b66; background: rgba(255, 255, 255, .47); font-size: 12.5px; }

@media (max-width: 800px) {
  .inbox-grid { height: auto; min-height: 0; overflow: visible; }
  .thread-list { max-height: none; overflow: visible; border: 0; }
  #threads { height: auto; max-height: 380px; }
  .detail { min-height: 0; padding: 12px 9px 16px; }
}
