:root {
  --inbox-border: #334155;
  --inbox-muted: #aebdd0;
}
#connect a {
  justify-self: start;
  color: #5eead4;
}
#intake-panel {
  margin-bottom: 1rem;
}
#intake-panel summary {
  cursor: pointer;
  font-weight: 650;
}
#intake-form {
  margin-top: .75rem;
}
#intake-form .inbox-row {
  justify-content: flex-start;
}
.inbox-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 0.85fr) minmax(0, 1.65fr);
  gap: 1rem;
  align-items: start;
}
.inbox-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}
.thread-filters {
  display: grid;
  gap: .65rem;
  margin-top: .75rem;
}
.thread-filter {
  display: grid;
  gap: .25rem;
  min-width: 0;
}
.thread-filter label {
  color: var(--inbox-muted);
  font-size: .85rem;
}
.thread-filter-options {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(6.75rem,1fr));
  gap: .5rem;
}
.thread-filter select {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem;
  background: #0f172a;
  color: inherit;
  border: 1px solid #64748b;
  border-radius: .5rem;
  font: inherit;
  font-size: .9rem;
}
.thread-filter-actions,
.thread-queue {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.thread-filter-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}
.thread-queue {
  min-height: 2.75rem;
  color: var(--inbox-muted);
  font-size: .9rem;
  cursor: pointer;
}
.thread-queue input {
  width: 1.1rem;
  min-height: 1.1rem;
  margin: 0;
  padding: 0;
  accent-color: #14b8a6;
}
#threads-status:empty {
  display: none;
}
.thread-list {
  margin-block: .75rem;
}
.thread-list li {
  display: block;
  padding: 0;
  border: 0;
}
.thread-list button {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .2rem .65rem;
  width: 100%;
  min-height: 3.25rem;
  margin-block-end: .3rem;
  text-align: left;
  background: transparent;
  color: #f8fafc;
  overflow-wrap: anywhere;
}
.thread-list button:hover {
  background: #29394e;
}
.thread-list button[aria-current="true"] {
  background: #0f2933;
  border-color: #14b8a6;
}
.thread-list small {
  grid-column: 1 / -1;
  color: var(--inbox-muted);
  font-weight: 400;
}
.thread-list .badge {
  align-self: start;
  padding: .08rem .45rem;
}
.thread-list .badge[data-state="open"] {
  color: #99f6e4;
}
.thread-list .badge[data-state="needs-reply"] {
  color: #fcd34d;
  text-transform: none;
}
.thread-panel {
  display: grid;
  gap: .75rem;
}
.thread-panel h2,
#thread-title,
#contact-title {
  overflow-wrap: anywhere;
}
.mobile-back {
  display: none;
}
.thread-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: .65rem;
}
.thread-controls details {
  flex-basis: 100%;
}
.thread-controls summary {
  cursor: pointer;
  width: fit-content;
  padding: .35rem .1rem;
  color: #99f6e4;
}
.link-controls {
  display: grid;
  gap: .55rem;
  padding: .75rem;
  background: #0f172a;
  border: 1px solid var(--inbox-border);
  border-radius: .5rem;
}
.link-controls .inbox-row {
  justify-content: flex-start;
}
.message-pane {
  display: grid;
  gap: .7rem;
}
.message-pane > button,
.compose > button {
  justify-self: start;
}
.empty-state {
  margin-block: .75rem;
}
.chat-history {
  display: grid;
  gap: .75rem;
  max-height: min(54vh, 36rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .15rem .2rem .15rem 0;
  margin: 0;
  list-style: none;
}
.chat-history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .3rem;
  max-width: min(36rem, 93%);
  width: fit-content;
  padding: .65rem .8rem;
  border: 1px solid var(--inbox-border);
  border-radius: .65rem;
  background: #0f172a;
}
.chat-history li[data-self="true"] {
  justify-self: end;
  border-color: #2a6b71;
  background: #102d36;
}
.message-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .55rem;
  font-size: .82rem;
}
.message-body {
  margin: 0;
  color: #f8fafc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.compose {
  display: grid;
  gap: .6rem;
}
.compose textarea {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
  font: inherit;
  color: inherit;
  background: #0f172a;
  border: 1px solid #64748b;
  border-radius: .5rem;
  padding: .65rem .75rem;
}
.compose small {
  color: var(--inbox-muted);
  font-weight: 400;
}
.compose p:empty,
#message-status:empty,
#link-status:empty {
  display: none;
}
.visitor-wrap {
  max-width: 46rem;
}
.mailbox-address {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.mailbox-notice,
#mailbox-recipient,
#mailbox-reply-help {
  margin: 0;
  color: var(--inbox-muted);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.mailbox-notice:empty,
#mailbox-status:empty {
  display: none;
}
.mailbox-pane .chat-history {
  max-height: min(52vh, 40rem);
}
.mailbox-source {
  justify-self: start;
  font-size: .82rem;
}
.mailbox-delivery {
  color: #99f6e4;
}
.mailbox-delivery[data-state="unknown"],
.mailbox-delivery[data-state="bounced"],
.mailbox-delivery[data-state="failed"],
.mailbox-delivery[data-state="rejected"] {
  color: #fcd34d;
}
@media (max-width: 45rem) {
  .inbox-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #workspace:not([data-thread-open="true"]) #thread-panel,
  #workspace[data-thread-open="true"] #threads-panel {
    display: none;
  }
  .mobile-back {
    display: block;
    justify-self: start;
  }
}
@media (max-width: 26rem) {
  .bar {
    padding-block: .6rem;
    align-items: flex-start;
  }
  .brand small {
    display: none;
  }
  .channel-nav {
    gap: .45rem;
  }
}
