/* Tab "Mails": the three fields on top, the last search under "Wartet auf uns", the ClickUp task on each card. */

ion-segment.mail-fields {
  margin: var(--space-3) var(--space-4) 0;
  width: auto;
}
ion-segment.mail-fields ion-segment-button {
  min-height: 44px;
  font-size: 13px;
}
ion-segment.mail-fields ion-label {
  white-space: normal;
  line-height: 1.2;
}

.mail-run {
  margin: var(--space-4) var(--space-4) 0;
  font-size: 14px;
  color: var(--ion-color-medium);
}
.mail-run.incomplete {
  padding: var(--space-3) var(--space-3);
  border-radius: 8px;
  font-weight: 600;
  color: var(--ion-text-color, #000);
  background: rgba(var(--ion-color-warning-rgb), 0.16);
}

/* The first two lines of the mail, small under the subject. */
ion-card-content p.mail-excerpt {
  margin: var(--space-hair) 0 var(--space-2);
  font-size: 13px;
  color: var(--ion-color-medium);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

ion-card-content p.mail-task {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--ion-text-color, #000);
}
.mail-task-tag {
  padding: var(--space-hair) var(--space-2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

/* The sender on top of each card. The kind colours are calm on purpose: red and orange mean "waits too long" here.
   White on each measures at least 5:1. An unknown domain gets an outlined grey initial. */
.mail-from {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.mail-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--kind, #5f6670);
}
.mail-from[data-kind='spedition'] { --kind: #2f5f8f; }
.mail-from[data-kind='lieferant'] { --kind: #2e6b4c; }
.mail-from[data-kind='cdc'] { --kind: #5b4b9a; }
.mail-from[data-kind='kunde'] { --kind: #1f6670; }
.mail-from[data-kind='intern'] { --kind: #5f6670; }
.mail-from[data-kind='unknown'] .mail-avatar {
  color: var(--ion-color-medium);
  background: transparent;
  border: 1.5px dashed var(--ion-color-medium);
}
.mail-from-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mail-from-text strong {
  font-size: 16px;
  color: var(--ion-text-color, #000);
  overflow-wrap: anywhere;
}
.mail-from-text span {
  font-size: 13px;
  color: var(--ion-color-medium);
  overflow-wrap: anywhere;
}
