/* ----- timeline: notes, emails, texts and events on a record (org/shared/_timeline) */

.timeline-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.timeline-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  cursor: pointer;
}

.timeline-channel:has(input:checked) {
  border-color: var(--carbon);
  background: var(--carbon-wash);
  color: var(--carbon-dark);
  font-weight: 600;
}

.timeline-channel.is-off {
  color: var(--ink-3);
  cursor: not-allowed;
  opacity: 0.7;
}

.timeline-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}

.timeline-fields {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

/* A team note looks like a sticky note; a customer message looks like mail. */
.timeline-compose .timeline-body {
  background: #fffbe0;
}

.timeline-compose .when-email,
.timeline-compose .when-text {
  display: none;
}

.timeline-compose:has(input[value="email"]:checked) .only-email,
.timeline-compose:has(input[value="text"]:checked) .only-text {
  display: grid;
}

.timeline-compose:has(input[value="email"]:checked) .when-email,
.timeline-compose:has(input[value="text"]:checked) .when-text {
  display: inline;
}

.timeline-compose:has(input[value="email"]:checked) p.when-email,
.timeline-compose:has(input[value="text"]:checked) p.when-text {
  display: flex;
}

.timeline-compose:has(input[value="email"]:checked) .when-note,
.timeline-compose:has(input[value="text"]:checked) .when-note {
  display: none;
}

.timeline-compose:has(input[value="email"]:checked) .timeline-body,
.timeline-compose:has(input[value="text"]:checked) .timeline-body {
  background: var(--paper);
}

.timeline {
  display: flex;
  flex-direction: column;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  padding: 10px 12px;
  border-top: 1px solid var(--steel-2);
}

.timeline-note {
  border-left: 3px solid var(--canary-deep);
  background: #fffdf0;
}

.timeline-in {
  border-left: 3px solid var(--carbon);
  background: var(--carbon-wash);
}

.timeline-out {
  border-left: 3px solid var(--line-2);
}

.timeline-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 12px;
  color: var(--ink-3);
  font-size: 13px;
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 13.5px;
}

.timeline-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.timeline-when {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12.5px;
  white-space: nowrap;
}

.timeline-on {
  color: var(--ink-3);
  font-size: 12.5px;
}

.timeline-text,
.timeline-subject {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.timeline-mail summary {
  margin-top: 6px;
  cursor: pointer;
  font-weight: 600;
}

.timeline-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
}

.timeline-files a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-foot {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 12.5px;
}

.timeline-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.timeline-empty,
.timeline-more {
  margin: 12px 0 0;
}

/* ----- inbox of customer messages that couldn't be matched */

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inbox-file {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.inbox-file .field {
  flex: 1 1 260px;
  margin: 0;
}
