/* Loaded by Chatwoot's DASHBOARD_SCRIPTS hook. Chatwoot's neutral and semantic
 * tokens are remapped by body.dark, so these rules follow the selected theme. */
.sekta-conversation-workspace {
  gap: 1px;
  min-width: 0;
}

.sekta-conversation-workspace .conversations-list-wrap {
  border-right: 1px solid rgb(var(--slate-4));
  flex: 0 1 23rem;
  min-width: 18rem;
  max-width: 28rem;
  z-index: 2;
}

.sekta-conversation-workspace .conversation-details-wrap {
  flex: 1 1 42rem;
  min-width: 24rem;
  z-index: 1;
}

.sekta-customer-panel {
  border-left-color: rgb(var(--slate-4));
  width: min(22rem, 34vw);
  max-width: 22rem;
}

.sekta-conversation-workspace .conversation.active {
  box-shadow: inset 3px 0 0 rgb(var(--ruby-9));
}

/* Explicit scan order: identity, meaningful customer request, metadata, state. */
.sekta-conversation-workspace .conversation > .border-line {
  display: flex;
  flex-direction: column;
}

.sekta-conversation-workspace .conversation > .border-line > h4 { order: 1; }
.sekta-conversation-workspace .conversation > .border-line > :is(.leading-6, p) { order: 2; }
.sekta-conversation-workspace .conversation > .border-line > .absolute {
  flex-direction: row;
  gap: 0.375rem;
  margin: 0.125rem 0.5rem 0;
  order: 3;
  position: static;
}
.sekta-conversation-workspace .conversation > .border-line > .sekta-response-state { order: 4; }
.sekta-conversation-workspace .conversation > .border-line > :last-child { order: 5; }

.sekta-response-state {
  align-self: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  margin: 0 10px 0 auto;
  padding: 0 6px;
  white-space: nowrap;
}

.sekta-response-state[data-state='problem'] {
  background: rgb(var(--ruby-4));
  border-color: rgb(var(--ruby-7));
  color: rgb(var(--ruby-11));
}

.sekta-response-state[data-state='resolved'] {
  background: rgb(var(--teal-4));
  border-color: rgb(var(--teal-7));
  color: rgb(var(--teal-11));
}

.sekta-response-state[data-state='pending'],
.sekta-response-state[data-state='snoozed'] {
  background: rgb(var(--amber-4));
  border-color: rgb(var(--amber-7));
  color: rgb(var(--amber-11));
}

.sekta-message { border: 1px solid rgb(var(--slate-5)); }
.sekta-message--customer { background: rgb(var(--slate-3)); }
.sekta-message--support {
  border-color: rgb(var(--blue-7));
  box-shadow: inset -3px 0 0 rgb(var(--blue-9));
}
.sekta-message--ai,
.sekta-message--template { border-color: rgb(var(--iris-7)); }
.sekta-message--note { border-color: rgb(var(--amber-7)); }
.sekta-message--system { border-color: rgb(var(--slate-4)); box-shadow: none; }
.sekta-message--error { border-color: rgb(var(--ruby-7)); }

/* Explicit selector documents and tests Chatwoot's user-selected theme contract.
 * Values still come from the design system; OS preference is intentionally unused. */
body.dark .sekta-conversation-workspace,
body.dark .sekta-customer-panel,
body.dark .sekta-message {
  color-scheme: dark;
}

@media (max-width: 1023px) {
  .sekta-conversation-workspace .conversations-list-wrap {
    flex-basis: 20rem;
    min-width: 16rem;
    max-width: 22rem;
  }
  .sekta-conversation-workspace .conversation-details-wrap { min-width: 20rem; }
  .sekta-customer-panel { width: min(20rem, 85vw); }
}

@media (max-width: 767px) {
  .sekta-conversation-workspace { display: block; }
  .sekta-conversation-workspace :is(.conversations-list-wrap, .conversation-details-wrap) {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .sekta-customer-panel { width: min(22rem, 92vw); }
}
