.email-page {
  --email-navy: var(--color-accent);
  --email-border: var(--color-border);
  --email-surface: var(--color-surface);
  --email-chrome: var(--color-panel);
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 218px 390px minmax(0, 1fr);
  overflow: hidden;
  background: var(--email-chrome);
  color: var(--color-text-primary);
}

.email-page *, .email-page *::before, .email-page *::after { box-sizing: border-box; }
.email-page button, .email-page input, .email-page select, .email-page textarea { font-family: inherit; }
.email-page button { color: inherit; }
.email-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.email-queue-rail {
  min-width: 0;
  min-height: 0;
  border-right: 0;
  background: var(--email-chrome);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.email-page.has-selection .email-queue-rail {
  border-right: 1px solid var(--color-border-subtle);
}

.email-queue-head { flex: 0 0 auto; padding: 24px 18px 18px; }
.email-queue-head > div { display: grid; gap: 2px; margin-bottom: 18px; }
.email-queue-head > div span,
.email-list-title span,
.email-compose-dialog > header span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.email-queue-head > div strong {
  color: var(--color-text-primary);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.035em;
}

.email-compose-button {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--email-navy);
  border-radius: 10px;
  background: var(--email-navy);
  color: var(--color-on-accent) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.email-compose-button:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.email-compose-button svg { width: 16px; height: 16px; }

.email-queue-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  overflow-y: auto;
  padding: 2px 10px 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) transparent;
}
.email-queue-nav::-webkit-scrollbar,
.email-thread::-webkit-scrollbar { width: 6px; }
.email-queue-nav::-webkit-scrollbar-track,
.email-thread::-webkit-scrollbar-track { background: transparent; }
.email-queue-nav::-webkit-scrollbar-thumb,
.email-thread::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--color-scrollbar-thumb);
}
.email-queue-nav::-webkit-scrollbar-thumb:hover,
.email-thread::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-thumb);
}
.email-queue-group { display: grid; gap: 3px; }
.email-queue-group h3 {
  margin: 0;
  padding: 0 9px 6px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.email-queue-item {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-secondary);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.email-queue-item:hover { background: var(--color-hover); color: var(--color-text-primary); }
.email-queue-item.is-active { border-color: var(--color-accent-border); background: var(--color-surface); color: var(--email-navy); }
.email-queue-item svg { width: 15px; height: 15px; stroke-width: 1.8; }
.email-queue-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}
.email-queue-count {
  min-width: 1.5ch;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1;
  opacity: .78;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.email-queue-item.is-active .email-queue-count {
  color: var(--color-text-secondary);
  opacity: 1;
}
.email-ticket-list-column {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--email-border);
  background: var(--email-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.email-list-head { flex: 0 0 auto; display: grid; gap: 13px; padding: 20px 18px 14px; border-bottom: 1px solid var(--email-border); }
.email-list-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.email-list-title > div { min-width: 0; }
.email-list-title span { display: block; margin-bottom: 2px; font-size: 9px; }
.email-list-title h1 {
  margin: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.025em;
}
.email-list-title > strong {
  min-width: 28px;
  height: 24px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.email-search-field {
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.email-search-field:focus-within { border-color: var(--color-focus-border); background: var(--color-surface); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.email-search-field > svg { width: 15px; height: 15px; color: var(--color-text-muted); flex: 0 0 auto; }
.email-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--color-text-primary); font-size: 12px; font-weight: 650; }
.email-search-field input[type="search"]::-webkit-search-cancel-button {
  display: none;
  appearance: none;
  -webkit-appearance: none;
}
.email-search-field input[type="search"]::-ms-clear { display: none; }
.email-search-field button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.email-search-field button svg { width: 12px; height: 12px; }

.email-list-filters {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.email-filter-dropdown { position: relative; min-width: 0; }
.email-mailbox-filter { width: 220px; }
.email-sort-filter { width: 120px; }
.email-filter-trigger {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.email-filter-trigger:hover { border-color: var(--color-accent-border); background: var(--color-selected-strong); }
.email-filter-trigger[aria-expanded="true"] {
  border-color: var(--color-accent-border);
  box-shadow: 0 0 0 2px var(--color-focus-ring);
  color: var(--email-navy);
}
.email-filter-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-filter-trigger svg { width: 15px; height: 15px; flex: 0 0 auto; }
.email-filter-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  max-height: 360px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--color-surface);
  padding: 0;
  box-shadow: var(--shadow-tight);
  overflow: hidden;
}
.email-mailbox-menu { width: min(300px, calc(100vw - 28px)); display: flex; flex-direction: column; }
.email-sort-menu { width: 170px; }
.email-filter-search {
  flex: 0 0 auto;
  display: block;
  min-height: auto;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--color-surface);
  padding: 8px;
}
.email-filter-search input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font: inherit;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 180ms ease, background 180ms ease;
}
.email-filter-search input:focus { border-color: var(--color-accent-border); background: var(--color-surface-translucent); }
.email-filter-search input::placeholder { color: var(--color-text-muted); }
.email-filter-search input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}
.email-filter-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.email-mailbox-menu-actions {
  min-height: 40px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 6px 12px;
}
.email-mailbox-menu-actions > span {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}
.email-mailbox-menu-actions > button {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-accent);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}
.email-mailbox-menu-actions > button:hover:not(:disabled) { background: var(--color-hover); }
.email-mailbox-menu-actions > button:disabled { color: var(--color-text-muted); cursor: default; opacity: .48; }
.email-filter-options {
  max-height: 304px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) transparent;
}
.email-mailbox-menu .email-filter-options { min-height: 0; max-height: 260px; }
.email-filter-option {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 9px 12px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}
.email-filter-option:last-child { border-bottom: 0; }
.email-filter-option:hover,
.email-filter-option.is-selected { background: var(--color-accent-soft); color: var(--navy); }
.email-filter-option.is-selected { font-weight: 650; }
.email-filter-option > span { min-width: 0; display: grid; gap: 2px; }
.email-filter-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}
.email-filter-option small {
  overflow: hidden;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}
.email-mailbox-option { gap: 10px; }
.email-mailbox-option .email-mailbox-option-check {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border-strong);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: transparent;
}
.email-mailbox-option .email-mailbox-option-check svg { width: 11px; height: 11px; stroke-width: 2.6; }
.email-mailbox-option.is-selected .email-mailbox-option-check {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.email-mailbox-option .email-mailbox-option-copy { flex: 1; }
.email-filter-empty { padding: 14px 12px; color: var(--ink-soft); font-size: 13px; }

.email-ticket-list { min-height: 0; flex: 1; overflow-y: auto; }
.email-ticket-row {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 18px 36px minmax(0, 1fr) 26px;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  padding: 14px 13px;
  cursor: pointer;
  outline: 0;
  transition: background 120ms ease;
}
.email-ticket-row:hover { background: var(--color-hover); }
.email-ticket-row.is-active, .email-ticket-row.is-checked {
  background: var(--color-selected);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.email-ticket-check { position: relative; z-index: 2; width: 16px; height: 16px; margin-top: 9px; cursor: pointer; }
.email-ticket-check::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(50% - 2px);
  width: 48px;
  height: 68px;
  transform: translate(-50%, -50%);
}
.email-ticket-check input { position: absolute; opacity: 0; pointer-events: none; }
.email-ticket-check span { width: 15px; height: 15px; border: 1px solid var(--color-border-emphasis); border-radius: 4px; background: var(--color-surface); display: block; }
.email-ticket-check input:checked + span { border-color: var(--email-navy); background: var(--email-navy); box-shadow: inset 0 0 0 3px var(--color-on-accent); }
.email-customer-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--color-surface-muted); color: var(--color-text-secondary); display: grid; place-items: center; font-size: 10px; font-weight: 900; }
.email-ticket-row.is-unread .email-customer-avatar { background: var(--color-selected); color: var(--email-navy); }
.email-ticket-copy { min-width: 0; }
.email-ticket-line { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.email-ticket-line strong { min-width: 0; overflow: hidden; color: var(--color-text-primary); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 780; }
.email-ticket-row.is-unread .email-ticket-line strong { font-weight: 900; }
.email-ticket-line time { color: var(--color-text-muted); flex: 0 0 auto; font-size: 9px; font-weight: 750; }
.email-ticket-row.is-unread .email-ticket-line time { color: var(--email-navy); font-weight: 850; }
.email-ticket-subject { min-width: 0; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.email-ticket-subject > span:last-child { min-width: 0; overflow: hidden; color: var(--color-text-primary); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 760; }
.email-ticket-row.is-unread .email-ticket-subject > span:last-child { font-weight: 900; }
.email-ticket-copy > p { margin: 4px 0 9px; overflow: hidden; color: var(--color-text-muted); display: -webkit-box; font-size: 10px; font-weight: 620; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.email-ticket-meta { min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; }
.email-mailbox-chip, .email-priority-chip, .email-ai-chip, .email-draft-chip, .email-unassigned-label {
  min-width: 0;
  min-height: 20px;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
  font-weight: 850;
}
.email-mailbox-chip { max-width: 118px; }
.email-priority-chip { background: var(--color-danger-soft); color: var(--color-danger); }
.email-ai-chip { background: var(--color-success-soft); color: var(--color-success); }
.email-draft-chip { background: var(--color-warning-soft); color: var(--color-warning); }
.email-priority-chip svg, .email-ai-chip svg { width: 10px; height: 10px; }
.email-assignee-mini { width: 20px; height: 20px; margin-left: auto; border-radius: 999px; background: var(--color-avatar); color: var(--color-avatar-text); display: grid; place-items: center; flex: 0 0 auto; font-size: 7px; font-weight: 900; }
.email-unassigned-label { margin-left: auto; }
.email-star-button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--color-text-muted); display: grid; place-items: center; cursor: pointer; }
.email-star-button:hover { background: var(--color-hover); color: var(--color-text-secondary); }
.email-star-button.is-active { color: var(--color-warning); }
.email-star-button.is-active svg { fill: currentColor; }
.email-star-button svg { width: 14px; height: 14px; }

.email-list-empty, .email-reader-empty { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 6px; padding: 32px; color: var(--color-text-muted); text-align: center; }
.email-list-empty svg, .email-reader-empty svg { width: 30px; height: 30px; color: var(--color-text-muted); }
.email-list-empty strong, .email-reader-empty strong { color: var(--color-text-primary); font-size: 13px; font-weight: 850; }
.email-list-empty span, .email-reader-empty span { font-size: 10px; font-weight: 650; }

.email-ticket-stage { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--email-details-width, 286px); overflow: hidden; position: relative; }
.email-reader { min-width: 0; min-height: 0; position: relative; background: var(--color-surface-soft); display: flex; flex-direction: column; overflow: hidden; }
.email-reader::after {
  content: "";
  position: absolute;
  z-index: 6;
  top: 58px;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(8, 22, 43, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.email-reader.has-assignee-overlay::after { opacity: 1; }
.email-reader-head { min-height: 92px; flex: 0 0 auto; border-bottom: 1px solid var(--email-border); background: var(--color-surface); display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.email-mobile-back { display: none; }
.email-reader-title { min-width: 0; flex: 1; }
.email-reader-title > div { min-width: 0; display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.email-reader-title > div > span { color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.email-reader-title > div > span.is-priority { color: var(--color-danger); }
.email-reader-title > div > span.is-ai { color: var(--color-success); }
.email-reader-title > div svg { width: 10px; height: 10px; }
.email-reader-title h2 { margin: 0; overflow: hidden; color: var(--color-text-primary); text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 900; letter-spacing: -.025em; }
.email-reader-title p { margin: 4px 0 0; overflow: hidden; color: var(--color-text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 650; }
.email-reader-title p strong { color: var(--color-text-secondary); font-weight: 800; }
.email-reader-actions { display: flex; align-items: center; gap: 5px; }
.email-reader-actions > button, .email-mobile-back { width: 33px; height: 33px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text-secondary); place-items: center; cursor: pointer; }
.email-reader-actions > button { display: grid; }
.email-reader-actions > button:hover, .email-mobile-back:hover { border-color: var(--color-accent-border); background: var(--color-hover); color: var(--email-navy); }
.email-reader-actions svg, .email-mobile-back svg { width: 14px; height: 14px; }
.email-assignee-select { min-height: 33px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text-secondary); display: flex; align-items: center; gap: 5px; padding: 0 8px; }
.email-assignee-select svg { width: 13px; height: 13px; }
.email-assignee-select select { max-width: 108px; border: 0; outline: 0; background: transparent; color: inherit; font-size: 9px; font-weight: 800; }

.email-thread {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px clamp(16px,3vw,36px) 26px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) transparent;
}
.email-skeleton-line,
.email-skeleton-avatar {
  position: relative;
  display: block;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-border) 72%, var(--color-surface-soft));
  overflow: hidden;
}
.email-skeleton-line::after,
.email-skeleton-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--color-surface) 76%, transparent) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: email-skeleton-shimmer 1.15s ease-in-out infinite;
}
.email-skeleton-line { width: 58%; height: 10px; }
.email-skeleton-line.is-tiny { width: 48px; height: 9px; }
.email-skeleton-line.is-short { width: 34%; }
.email-skeleton-line.is-medium { width: 58%; }
.email-skeleton-line.is-long { width: 78%; }
.email-skeleton-line.is-wide { width: 92%; }
.email-skeleton-avatar { width: 30px; height: 30px; border-radius: 9px; }
.email-thread-loading { min-height: 100%; }
.email-message-skeleton { pointer-events: none; }
.email-message-skeleton > header {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}
.email-message-skeleton > header > div { gap: 7px; }
.email-message-skeleton-body {
  display: grid;
  gap: 13px;
  min-height: 112px;
  align-content: start;
  padding: 22px 20px;
}
.email-skeleton-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.email-ticket-details.is-loading-skeleton { background: var(--color-surface); }
.email-ticket-details.is-loading-skeleton .agents-right-tab { cursor: default; opacity: 1; }
.email-ticket-details.is-loading-skeleton .agents-right-section-toggle { cursor: default; }
.email-details-skeleton-summary .agents-right-quick-copy { width: 100%; gap: 9px; }
.email-details-skeleton-field .email-skeleton-line { margin-top: 8px; }
.email-reply-launcher.is-loading button { cursor: default; opacity: .58; }
@keyframes email-skeleton-shimmer {
  to { transform: translateX(100%); }
}
.email-thread-start { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--color-text-muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.email-thread-start::before, .email-thread-start::after { content: ""; height: 1px; background: var(--color-border-subtle); flex: 1; }
.email-message { width: 100%; max-width: none; margin: 0 0 12px; border: 1px solid var(--email-border); border-radius: 12px; background: var(--color-surface); overflow: hidden; }
.email-message.is-inbound {
  width: calc(100% - clamp(18px, 3vw, 38px));
  margin-right: auto;
}
.email-message.is-outbound {
  width: calc(100% - clamp(18px, 3vw, 38px));
  margin-left: auto;
  border-color: var(--color-accent-soft);
}
.email-message.is-note {
  width: calc(100% - clamp(36px, 7vw, 92px));
  margin-inline: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.email-message > header { min-height: 54px; border-bottom: 1px solid var(--color-border-subtle); display: grid; grid-template-columns: 30px minmax(0,1fr) auto auto 26px; align-items: center; gap: 9px; padding: 10px 12px; }
.email-message-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--color-avatar); color: var(--color-avatar-text); display: grid; place-items: center; font-size: 10px; font-weight: 900; }
.email-message.is-outbound .email-message-avatar { background: var(--color-selected); color: var(--email-navy); }
.email-message-avatar.is-note { background: var(--color-note-soft); color: var(--color-note); }
.email-message-avatar svg { width: 14px; height: 14px; }
.email-message > header > div { min-width: 0; display: grid; gap: 2px; }
.email-message > header strong { overflow: hidden; color: var(--color-text-primary); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 850; }
.email-message > header div > span { overflow: hidden; color: var(--color-text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 650; }
.email-message-ai { border-radius: 999px; background: var(--color-success-soft); color: var(--color-success); display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.email-message-ai svg { width: 9px; height: 9px; }
.email-message > header time { color: var(--color-text-muted); font-size: 8px; font-weight: 700; white-space: nowrap; }
.email-message > header > button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--color-text-muted); display: grid; place-items: center; cursor: pointer; }
.email-message > header > button:hover { background: var(--color-surface-muted); color: var(--color-text-secondary); }
.email-message > header > button svg { width: 13px; height: 13px; }
.email-message > header.email-message-note-header {
  min-height: 36px;
  border-bottom: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 6px 4px 2px;
}
.email-message > header.email-message-note-header > strong {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}
.email-message.is-note .email-message-body {
  margin: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 7px 4px 16px;
}
.email-message-body { padding: 18px 20px; color: var(--color-text-primary); font-size: 11px; font-weight: 620; line-height: 1.7; white-space: pre-line; }

.email-message-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }
.email-message-attachments button { min-width: 0; max-width: 260px; min-height: 46px; border: 1px solid var(--color-border); border-radius: 9px; background: var(--color-surface-soft); display: grid; grid-template-columns: 24px minmax(0,1fr) 16px; align-items: center; gap: 8px; padding: 7px 10px; text-align: left; cursor: pointer; }
.email-message-attachments button:hover { border-color: var(--color-accent-border); background: var(--color-hover); }
.email-message-attachments button > svg:first-child { width: 16px; height: 16px; color: var(--email-navy); }
.email-message-attachments button > svg:last-child { width: 13px; height: 13px; color: var(--color-text-muted); }
.email-message-attachments button span { min-width: 0; display: grid; }
.email-message-attachments button strong { overflow: hidden; color: var(--color-text-primary); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 800; }
.email-message-attachments button small { color: var(--color-text-muted); font-size: 8px; font-weight: 650; }

.email-reply-launcher {
  flex: 0 0 auto;
  padding: 0 clamp(16px,3vw,36px) 18px;
}
.email-reply-launcher > button {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--email-navy);
  border-radius: 11px;
  background: var(--email-navy);
  color: var(--color-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 5px 18px var(--color-border-subtle),
    inset 0 1px 0 color-mix(in srgb, var(--color-on-accent) 55%, transparent);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.email-reply-launcher > button:hover {
  border-color: var(--color-accent-hover);
  background: var(--color-accent-hover);
  box-shadow:
    0 7px 20px var(--color-border),
    inset 0 1px 0 color-mix(in srgb, var(--color-on-accent) 48%, transparent);
}
.email-reply-launcher svg { width: 16px; height: 16px; }
.email-reply-composer {
  position: relative;
  min-height: min(300px, calc(100% - 70px));
  max-height: calc(100% - 70px);
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid var(--color-accent-border);
  border-width: 1px 0 0;
  border-radius: 12px 12px 0 0;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 -12px 30px var(--color-border),
    inset 0 1px 0 color-mix(in srgb, var(--color-on-accent) 78%, transparent);
}
.email-reply-composer.is-resizing { transition: none; user-select: none; }
.email-reply-resize-handle {
  position: absolute;
  z-index: 4;
  top: -1px;
  left: 0;
  width: 100%;
  height: 13px;
  border: 0;
  background: transparent;
  cursor: ns-resize;
  touch-action: none;
}
.email-reply-resize-handle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: var(--color-border-strong);
  transform: translateX(-50%);
  transition: width 140ms ease, background 140ms ease;
}
.email-reply-resize-handle:hover::after,
.email-reply-composer.is-resizing .email-reply-resize-handle::after {
  width: 54px;
  background: var(--color-accent-border);
}
html.is-resizing-email-reply,
html.is-resizing-email-reply * { cursor: ns-resize !important; user-select: none !important; }
.email-reply-composer.is-note { border-color: var(--color-note-border); background: var(--color-note-soft); }
.email-composer-tabs { min-height: 41px; flex: 0 0 auto; border-bottom: 1px solid var(--color-border-subtle); display: flex; align-items: end; gap: 3px; padding: 0 10px; }
.email-composer-tabs button { min-height: 36px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; font-size: 9px; font-weight: 850; cursor: pointer; }
.email-composer-tabs button.is-active { border-bottom-color: var(--email-navy); color: var(--email-navy); }
.email-reply-composer.is-note .email-composer-tabs button.is-active { border-bottom-color: var(--color-warning); color: var(--color-warning); }
.email-composer-tabs svg { width: 12px; height: 12px; }
.email-composer-tabs .email-composer-collapse {
  width: 30px;
  min-height: 30px;
  margin: 0 0 5px auto;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  padding: 0;
}
.email-composer-tabs .email-composer-collapse:hover { background: var(--color-surface-muted); color: var(--color-text-secondary); }
.email-composer-tabs .email-composer-collapse svg { width: 15px; height: 15px; }
.email-reply-routing { min-height: 56px; flex: 0 0 auto; border-bottom: 1px solid var(--color-border-subtle); display: grid; grid-template-columns: minmax(200px,.85fr) minmax(0,1fr); }
.email-reply-routing > div { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; column-gap: 7px; padding: 7px 12px; }
.email-reply-routing > .email-reply-from { border-right: 1px solid var(--color-border-subtle); }
.email-reply-routing > div > span { color: var(--color-text-muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.email-sender-access-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-warning) 8%, var(--color-surface));
  color: var(--color-text-secondary);
  font-size: 9px;
  font-weight: 650;
}
.email-sender-access-note svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--color-warning); }
.email-editor-copilot {
  width: auto;
  height: 38px;
  border: 1px solid var(--color-accent-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-accent-soft) 72%, var(--color-surface));
  color: var(--email-navy);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.email-editor-copilot:hover { background: var(--color-accent-soft); transform: translateY(-1px); }
.email-editor-copilot svg { width: 16px; height: 16px; }
.email-copilot-slot:empty { display: none; }
.email-copilot-slot:not(:empty) { display: block; width: 100%; }
.email-composer-footer-standard { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.email-composer-primary-actions { display: flex; align-items: center; gap: 7px; }
.email-composer-footer.is-copilot-active { min-height: 0; padding: 0; align-items: stretch; }
.email-composer-footer.is-copilot-active .email-composer-footer-standard { display: none; }
.email-copilot-panel {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 15px 12px;
  border-bottom: 1px solid var(--color-accent-border);
  background: color-mix(in srgb, var(--color-accent-soft) 34%, var(--color-surface));
}
.email-compose-dialog .email-copilot-panel { padding-inline: clamp(20px,3vw,42px); }
.email-copilot-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-accent-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--email-navy);
  display: grid;
  place-items: center;
}
.email-copilot-mark svg { width: 18px; height: 18px; }
.email-copilot-panel label { min-width: 0; display: grid; gap: 7px; }
.email-copilot-panel label > span { color: var(--color-text-secondary); font-size: 12px; font-weight: 800; }
.email-copilot-panel input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: 0;
  background: var(--color-input);
  color: var(--color-text-primary);
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
}
.email-copilot-panel input:focus { border-color: var(--color-accent-border); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.email-copilot-actions { display: flex; align-items: center; gap: 8px; }
.email-copilot-actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.email-copilot-cancel { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); }
.email-copilot-generate { border: 1px solid var(--email-navy); background: var(--email-navy); color: var(--color-on-accent); display: inline-flex; align-items: center; gap: 7px; }
.email-copilot-generate:disabled { cursor: wait; opacity: .78; }
.email-copilot-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: email-copilot-spin 700ms linear infinite; }
@keyframes email-copilot-spin { to { transform: rotate(360deg); } }
.email-reply-to > strong, .email-reply-to > small { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-reply-to > strong { align-self: end; color: var(--color-text-secondary); font-size: 9px; font-weight: 850; }
.email-reply-to > small { align-self: start; color: var(--color-text-muted); font-size: 8px; font-weight: 650; }

.email-identity-dropdown {
  position: relative;
  min-width: 0;
}
.email-identity-trigger {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 9px;
  background: var(--color-surface-soft);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px 7px 12px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.email-identity-trigger:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-muted);
}
.email-identity-trigger:focus-visible,
.email-identity-dropdown.is-open .email-identity-trigger {
  border-color: var(--color-accent-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  outline: 0;
}
.email-identity-trigger > span,
.email-identity-option > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.email-identity-trigger strong,
.email-identity-trigger small,
.email-identity-option strong,
.email-identity-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-identity-trigger strong {
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 800;
}
.email-identity-trigger small {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 650;
}
.email-identity-trigger > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--color-text-muted);
  transition: transform 140ms ease;
}
.email-identity-dropdown.is-open .email-identity-trigger > svg { transform: rotate(180deg); }
.email-identity-menu {
  display: none;
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  left: 0;
  width: min(340px, calc(100vw - 48px));
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-surface-raised);
  padding: 6px;
  box-shadow: 0 16px 36px var(--color-shadow);
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) transparent;
}
.email-identity-dropdown.is-open .email-identity-menu { display: block; }
.email-identity-group + .email-identity-group {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--color-border-subtle);
}
.email-identity-group > span {
  display: block;
  padding: 5px 8px 4px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.email-identity-option {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  text-align: left;
}
.email-identity-option:hover { background: var(--color-hover); }
.email-identity-option.is-selected { background: var(--color-selected); }
.email-identity-option strong {
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 780;
}
.email-identity-option small {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 620;
}
.email-identity-option > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--color-accent);
}
.email-reply-editor, .email-note-editor { min-height: 0; flex: 1; display: flex; }
.email-reply-editor {
  background: color-mix(in srgb, var(--color-surface-soft) 40%, var(--color-surface));
}
.email-reply-editor textarea, .email-note-editor textarea,
.email-reply-editor .email-rich-editor { width: 100%; min-height: 0; height: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--color-text-secondary); padding: 16px; font-size: 11px; font-weight: 520; line-height: 1.55; overflow-y: auto; }
.email-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
  pointer-events: none;
}
.email-rich-editor :is(ul, ol) { margin: .45em 0; padding-left: 1.5em; }
.email-rich-editor a,
.email-message-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.email-rich-editor :is(b, strong),
.email-message-body :is(b, strong) {
  color: var(--color-text-primary);
  font-weight: 900;
}
.email-rich-editor :is(i, em),
.email-message-body :is(i, em) {
  font-style: oblique 13deg;
  font-synthesis: style;
}
.email-reply-composer > footer { min-height: 46px; flex: 0 0 auto; border-top: 1px solid var(--color-border-subtle); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 9px 7px 12px; }
.email-reply-composer.is-note > footer > span { color: var(--color-warning); display: inline-flex; align-items: center; gap: 6px; font-size: 8px; font-weight: 750; }
.email-reply-composer.is-note > footer > span svg { width: 11px; height: 11px; }
.email-editor-tools { position: relative; display: flex; align-items: center; gap: 3px; }
.email-editor-tools button { width: 29px; height: 29px; border: 0; border-radius: 7px; background: transparent; color: var(--color-text-muted); display: grid; place-items: center; cursor: pointer; }
.email-editor-tools button:hover { background: var(--color-surface-muted); color: var(--color-text-secondary); }
.email-editor-tools button.is-active,
.email-editor-tools button[aria-pressed="true"],
.email-editor-tools [data-email-shortcuts-toggle][aria-expanded="true"] {
  background: var(--color-selected);
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent-border);
}
.email-editor-tools button > :is(strong, em, u) { color: inherit; font-size: 13px; line-height: 1; }
.email-editor-tools button > strong { font-weight: 900; }
.email-editor-tools button > em { font-style: oblique 14deg; font-weight: 750; }
.email-editor-tools-divider { width: 1px; height: 18px; margin: 0 3px; background: var(--color-border-subtle); }
.email-editor-tools svg { width: 13px; height: 13px; }
.email-shortcuts-wrapper { position: relative; }
.email-shortcuts-menu {
  position: absolute;
  z-index: 18;
  left: 0;
  bottom: calc(100% + 8px);
  display: none;
  width: min(340px, calc(100vw - 40px));
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-raised);
  box-shadow: 0 14px 34px var(--color-shadow);
}
.email-shortcuts-menu.is-open { display: block; }
.email-shortcuts-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.email-shortcuts-menu-head strong {
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 850;
}
.email-editor-tools .email-shortcuts-new {
  width: auto;
  min-width: 0;
  height: 30px;
  display: inline-flex;
  grid-auto-flow: column;
  gap: 6px;
  padding: 0 10px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 800;
}
.email-shortcuts-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}
.email-reply-composer .email-shortcuts-menu-list { max-height: 160px; }
.email-shortcut-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
}
.email-editor-tools .email-shortcut-fill {
  width: 100%;
  height: 36px;
  display: block;
  overflow: hidden;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-editor-tools .email-shortcut-delete {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-muted);
}
.email-editor-tools .email-shortcut-delete:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.email-shortcuts-empty {
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: 9px;
  color: var(--color-text-muted);
  font-size: 11px;
  text-align: center;
}
.email-shortcut-modal {
  position: absolute;
  z-index: 80;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
}
.email-shortcut-modal.is-open { display: grid; }
.email-shortcut-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}
.email-shortcut-modal-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-raised);
  box-shadow: 0 20px 52px var(--color-shadow);
}
.email-shortcut-modal-dialog > header,
.email-shortcut-modal-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.email-shortcut-modal-dialog h3 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 16px;
}
.email-shortcut-modal-dialog p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
}
.email-shortcut-modal-dialog > header > button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.email-shortcut-modal-dialog > header svg { width: 14px; height: 14px; }
.email-shortcut-modal-dialog textarea {
  width: 100%;
  min-height: 160px;
  margin: 14px 0;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  outline: 0;
  background: var(--color-input);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.email-shortcut-modal-dialog textarea:focus {
  border-color: var(--color-accent-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}
.email-shortcut-modal-dialog > footer { justify-content: flex-end; }
.email-shortcut-modal-dialog > footer button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.email-shortcut-cancel {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
}
.email-shortcut-save {
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent) !important;
}
.email-link-popover {
  position: absolute;
  z-index: 14;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(320px, calc(100vw - 40px));
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
  padding: 9px;
  box-shadow: 0 14px 34px var(--color-shadow);
}
.email-link-popover.is-open { display: grid; }
.email-link-popover label { min-width: 0; display: grid; gap: 4px; }
.email-link-popover label span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 750;
}
.email-link-popover input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  outline: 0;
  background: var(--color-input);
  color: var(--color-text-primary);
  padding: 0 9px;
  font-size: 11px;
}
.email-link-popover input:focus { border-color: var(--color-accent-border); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.email-link-popover > button {
  width: auto;
  min-width: 58px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0 10px;
  font-size: 10px;
  font-weight: 750;
}
.email-link-popover > button:hover { background: var(--color-accent-hover); color: var(--color-on-accent); }
.email-send-button { min-height: 34px; border: 1px solid var(--email-navy); border-radius: 8px; background: var(--email-navy); color: var(--color-on-accent) !important; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; font-size: 9px; font-weight: 850; cursor: pointer; }
.email-send-button:hover { background: var(--color-accent-hover); }
.email-send-button.is-note { border-color: var(--color-warning); background: var(--color-warning); }
.email-send-button svg { width: 12px; height: 12px; }
.email-send-button:disabled,
.email-compose-save:disabled,
.email-toolbar-icon:disabled,
.email-editor-tools button:disabled {
  cursor: wait;
  opacity: .78;
  transform: none;
}
.email-button-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: email-button-spin .65s linear infinite;
}
.email-toolbar-icon .email-button-spinner,
.email-editor-tools .email-button-spinner { width: 15px; height: 15px; }
@keyframes email-button-spin { to { transform: rotate(360deg); } }

.email-spam-action { flex: 0 0 auto; margin: 0 24px 18px; border: 1px solid var(--color-danger-border); border-radius: 10px; background: var(--color-danger-soft); color: var(--color-danger); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 10px; font-weight: 750; }
.email-spam-action button { min-height: 30px; border: 1px solid var(--color-danger-border); border-radius: 7px; background: var(--color-surface); color: var(--color-danger); padding: 0 10px; font-size: 9px; font-weight: 850; cursor: pointer; }

.email-ticket-details { min-width: 0; min-height: 0; border-left: 1px solid var(--email-border); background: var(--color-surface); display: flex; flex-direction: column; overflow: hidden; }
.email-ticket-details .agents-right-panel { min-width: 0; min-height: 0; width: 100%; }
.email-ticket-details .agents-right-tabs {
  min-height: 52px;
  align-items: flex-end;
  padding: 10px 14px 0;
}
.email-ticket-details .agents-right-quick-card {
  padding: 16px 18px 18px;
}
.email-details-resizer {
  position: absolute;
  z-index: 12;
  top: 0;
  bottom: 0;
  left: calc(100% - var(--email-details-width, 286px));
  width: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  transform: translateX(-50%);
  touch-action: none;
}
.email-details-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: transparent;
  transform: translateX(-50%);
  transition: background 160ms ease, box-shadow 160ms ease;
}
.email-details-resizer:hover::before,
html.is-resizing-email-details .email-details-resizer::before {
  background: color-mix(in srgb, var(--color-accent) 48%, transparent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}
html.is-resizing-email-details,
html.is-resizing-email-details * {
  cursor: col-resize !important;
  user-select: none !important;
}
.email-contact-card { display: grid; justify-items: center; padding: 24px 16px 20px; border-bottom: 1px solid var(--email-border); text-align: center; }
.email-contact-avatar { width: 48px; height: 48px; margin-bottom: 10px; border-radius: 14px; background: var(--color-surface-muted); color: var(--color-text-secondary); display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.email-contact-card > strong { color: var(--color-text-primary); font-size: 12px; font-weight: 900; }
.email-contact-card > a { max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--color-text-secondary); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 650; text-decoration: none; }
.email-contact-card > span:not(.email-contact-avatar) { margin-top: 5px; color: var(--color-text-muted); font-size: 9px; font-weight: 700; }
.email-contact-card > button { width: 100%; min-height: 32px; margin-top: 14px; border: 1px solid var(--color-accent-border); border-radius: 8px; background: var(--color-accent-soft); color: var(--email-navy); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 9px; font-weight: 850; cursor: pointer; }
.email-contact-card > button svg { width: 12px; height: 12px; }
.email-detail-section { padding: 17px 16px; border-bottom: 1px solid var(--email-border); }
.email-detail-section > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.email-detail-section > header strong { color: var(--color-text-secondary); font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.email-detail-section > header button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--color-text-muted); display: grid; place-items: center; cursor: pointer; }
.email-detail-section > header button:hover { background: var(--color-surface-muted); }
.email-detail-section > header svg { width: 11px; height: 11px; }
.email-detail-section dl { display: grid; gap: 11px; margin: 0; }
.email-detail-section dl > div { min-width: 0; display: grid; gap: 3px; }
.email-detail-section dt { color: var(--color-text-muted); font-size: 8px; font-weight: 750; }
.email-detail-section dd { margin: 0; overflow-wrap: anywhere; color: var(--color-text-secondary); font-size: 9px; font-weight: 750; line-height: 1.4; }
.email-detail-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.email-detail-tags span { border: 1px solid var(--color-border-subtle); border-radius: 999px; background: var(--color-surface-soft); color: var(--color-text-secondary); padding: 4px 7px; font-size: 8px; font-weight: 800; }
.email-detail-tags small { color: var(--color-text-muted); font-size: 9px; }

.email-compose-dialog { width: 100%; min-width: 0; min-height: 0; height: 100%; border: 0; border-left: 1px solid var(--color-border-subtle); border-radius: 0; background: var(--color-surface); color: var(--color-text-primary); display: flex; flex-direction: column; overflow: hidden; box-shadow: none; animation: email-compose-in 220ms cubic-bezier(.22,.8,.28,1) both; }
@keyframes email-compose-in { from { opacity: .72; transform: translate3d(10px,0,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
.email-compose-dialog > header { min-height: 68px; flex: 0 0 auto; border-bottom: 1px solid var(--email-border); background: color-mix(in srgb, var(--color-surface-raised) 82%, var(--color-panel)); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(20px,3vw,42px); }
.email-compose-dialog > header > div { display: grid; gap: 2px; }
.email-compose-dialog > header span { font-size: 8px; }
.email-compose-dialog > header h2 { margin: 0; font-size: 19px; font-weight: 900; letter-spacing: -.025em; }
.email-compose-dialog > header button { width: 32px; height: 32px; border: 1px solid var(--email-border); border-radius: 999px; background: var(--color-surface); color: var(--color-text-secondary); display: grid; place-items: center; cursor: pointer; }
.email-compose-dialog > header button:hover { background: var(--color-hover); }
.email-compose-dialog > header svg { width: 14px; height: 14px; }
.email-compose-error { margin: 12px clamp(20px,3vw,42px) 0; border: 1px solid var(--color-danger-border); border-radius: 8px; background: var(--color-danger-soft); color: var(--color-danger); padding: 9px 11px; font-size: 9px; font-weight: 750; }
.email-compose-fields { display: grid; flex: 0 0 auto; padding: 10px clamp(20px,3vw,42px) 0; }
.email-compose-fields > label,
.email-compose-fields > .email-compose-field { position: relative; min-height: 58px; border-bottom: 1px solid var(--color-border-subtle); display: grid; grid-template-columns: 64px minmax(0, 860px) auto; justify-content: start; align-items: center; gap: 10px; }
.email-compose-fields > label > span,
.email-compose-fields > .email-compose-field > span { color: var(--color-text-muted); font-size: 12px; font-weight: 850; }
.email-compose-from-field .email-identity-trigger { background: var(--color-input); }
.email-compose-fields input, .email-compose-fields select { min-width: 0; min-height: 46px; border: 0; outline: 0; background: transparent; color: var(--color-text-secondary); font-size: 14px; font-weight: 700; }
.email-compose-fields > label > button { border: 0; background: transparent; color: var(--email-navy); padding: 5px 0 5px 8px; font-size: 12px; font-weight: 850; cursor: pointer; }
.email-compose-editor {
  min-height: 260px;
  flex: 1;
  display: flex;
  background: color-mix(in srgb, var(--color-surface-soft) 44%, var(--color-surface));
  padding: 12px clamp(20px,3vw,42px);
}
.email-compose-editor textarea,
.email-compose-editor .email-rich-editor { width: 100%; min-height: 240px; border: 0; outline: 0; resize: none; background: transparent; color: var(--color-text-secondary); padding: 12px 0; font-size: 11px; font-weight: 520; line-height: 1.65; overflow-y: auto; }
.email-compose-dialog > footer { min-height: 64px; flex: 0 0 auto; border-top: 1px solid var(--email-border); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px clamp(20px,3vw,42px); }
.email-compose-save { min-height: 34px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text-secondary); padding: 0 12px; font-size: 9px; font-weight: 850; cursor: pointer; }
.email-compose-save:hover { background: var(--color-surface-soft); }
.email-toast { position: absolute; z-index: 500; left: 50%; bottom: 22px; min-height: 38px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-text-primary); color: var(--color-text-inverse); display: flex; align-items: center; gap: 8px; padding: 8px 13px; box-shadow: 0 12px 30px var(--color-shadow); font-size: 9px; font-weight: 800; transform: translateX(-50%); animation: email-toast-in 160ms ease-out both; }
.email-toast svg { width: 13px; height: 13px; color: var(--color-success); }
.email-toast > span { min-width: 0; }
.email-undo-toast button { border: 0; border-left: 1px solid rgb(255 255 255 / 24%); background: transparent; color: inherit; margin-left: 3px; padding: 2px 0 2px 11px; font: inherit; font-weight: 900; cursor: pointer; }
.email-undo-toast button:hover { text-decoration: underline; }
.email-undo-toast button:disabled { opacity: .65; cursor: wait; text-decoration: none; }
@keyframes email-toast-in { from { opacity: 0; transform: translate(-50%,5px); } to { opacity: 1; transform: translate(-50%,0); } }

html[data-theme="dark"] .email-toast {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

/* Keep the Email workspace at the same readable scale as the rest of the portal. */
.email-queue-head > div span,
.email-list-title span { font-size: 11px; }
.email-queue-group h3 { font-size: 11px; }
.email-queue-item { min-height: 40px; }
.email-queue-item > span { font-size: 13px; }

.email-list-title > strong,
.email-list-selection-count,
.email-bulk-inline-action { font-size: 12px; }
.email-search-field { min-height: 44px; }
.email-search-field input { font-size: 13px; }
.email-ticket-row {
  grid-template-columns: 18px 40px minmax(0, 1fr) 28px;
  padding: 16px 14px;
}
.email-customer-avatar { width: 40px; height: 40px; font-size: 12px; }
.email-ticket-line strong { font-size: 13px; }
.email-ticket-line time { font-size: 11px; }
.email-ticket-subject > span:last-child { font-size: 14px; }
.email-ticket-copy > p { font-size: 12px; line-height: 1.45; }
.email-mailbox-chip,
.email-priority-chip,
.email-ai-chip,
.email-draft-chip,
.email-unassigned-label { font-size: 10px; }
.email-assignee-mini { font-size: 9px; }
.email-list-empty strong, .email-reader-empty strong { font-size: 15px; }
.email-list-empty span, .email-reader-empty span { font-size: 12px; }

.email-reader-title > div > span,
.email-thread-start { font-size: 10px; }
.email-reader-title h2 { font-size: 20px; }
.email-reader-title p { font-size: 12px; }
.email-assignee-select select { font-size: 11px; }
.email-message > header { min-height: 60px; grid-template-columns: 34px minmax(0,1fr) auto auto 28px; }
.email-message-avatar { width: 34px; height: 34px; font-size: 11px; }
.email-message > header strong { font-size: 12px; }
.email-message > header div > span,
.email-message > header time { font-size: 10px; }
.email-message-ai { font-size: 9px; }
.email-message-body { font-size: 14px; line-height: 1.65; }
.email-message-attachments button strong { font-size: 11px; }
.email-message-attachments button small { font-size: 10px; }

.email-composer-tabs { min-height: 41px; }
.email-composer-tabs button { min-height: 40px; font-size: 12px; }
.email-reply-routing { min-height: 56px; }
.email-reply-routing > div > span { font-size: 10px; }
.email-reply-to > strong { font-size: 12px; }
.email-reply-to > small { font-size: 10px; }
.email-reply-editor textarea, .email-note-editor textarea,
.email-reply-editor .email-rich-editor {
  min-height: 108px;
  font-size: 14px;
  line-height: 1.6;
}
.email-reply-composer.is-note > footer > span { font-size: 11px; }
.email-send-button { min-height: 38px; font-size: 12px; }
.email-spam-action { font-size: 12px; }
.email-spam-action button { font-size: 11px; }

.email-contact-avatar { font-size: 14px; }
.email-contact-card > strong { font-size: 14px; }
.email-contact-card > a,
.email-contact-card > span:not(.email-contact-avatar),
.email-contact-card > button { font-size: 11px; }
.email-detail-section > header strong { font-size: 11px; }
.email-detail-section dt,
.email-detail-tags span { font-size: 10px; }
.email-detail-section dd,
.email-detail-tags small { font-size: 11px; }

.email-compose-dialog > header span { font-size: 10px; }
.email-compose-dialog > header h2 { font-size: 21px; }
.email-compose-error { font-size: 12px; }
.email-compose-fields > label,
.email-compose-fields > .email-compose-field { min-height: 54px; }
.email-compose-fields > label > span,
.email-compose-fields > .email-compose-field > span,
.email-compose-fields > label > button { font-size: 12px; }
.email-compose-fields input, .email-compose-fields select { font-size: 14px; }
.email-compose-editor textarea,
.email-compose-editor .email-rich-editor { font-size: 14px; }
.email-compose-save { min-height: 38px; font-size: 12px; }
.email-toast { font-size: 12px; }

/* Full-width inbox: the list and opened conversation replace one another. */
.email-page { grid-template-columns: 218px minmax(0, 1fr); }
.email-ticket-list-column {
  border-right: 0;
  background: var(--email-chrome);
}
.email-list-head {
  grid-template-columns: minmax(280px, 520px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 0;
  background: var(--email-chrome);
}
.email-list-title { align-items: center; }
.email-list-title h1 { font-size: 22px; }
.email-list-filters { min-width: 348px; }
.email-search-field {
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
}
.email-ticket-surface {
  min-height: 0;
  flex: 1;
  border-radius: 18px 0 0 0;
  background: var(--color-surface);
  box-shadow:
    0 2px 12px var(--color-shadow-tight),
    inset 1px 1px 0 var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.email-list-toolbar {
  min-height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 15px 5px 18px;
  background: var(--color-surface);
}
.email-list-toolbar-left,
.email-list-toolbar-right,
.email-bulk-inline-actions,
.email-pagination {
  display: flex;
  align-items: center;
}
.email-list-toolbar-left { gap: 12px; }
.email-list-toolbar-right { min-width: 0; gap: 14px; }
.email-list-selection-count {
  color: var(--email-navy);
  font-weight: 850;
  white-space: nowrap;
}
.email-bulk-inline-actions { gap: 2px; }
.email-bulk-inline-action {
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.email-bulk-inline-action:hover { background: var(--color-hover); color: var(--email-navy); }
.email-bulk-inline-action.is-clear { width: 28px; justify-content: center; padding: 0; }
.email-bulk-inline-action svg { width: 13px; height: 13px; }
.email-pagination { gap: 8px; }
.email-assign-categorized {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--color-accent) 34%, var(--color-border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-surface));
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.email-assign-categorized:hover { background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface)); }
.email-assign-categorized svg { width: 14px; height: 14px; }
.email-assign-categorized strong {
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-size: 9px;
}
.email-pagination > span {
  margin: 0 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.email-page-check {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  cursor: pointer;
}
.email-page-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.email-page-check > span {
  width: 16px;
  height: 16px;
  border: 1px solid var(--color-border-emphasis);
  border-radius: 4px;
  background: var(--color-surface);
  display: block;
}
.email-page-check input:checked + span {
  border-color: var(--email-navy);
  background: var(--email-navy);
  box-shadow: inset 0 0 0 3px var(--color-on-accent);
}
.email-page-check > span.is-partial {
  border-color: var(--email-navy);
  background: var(--email-navy);
  box-shadow: inset 0 0 0 5px var(--color-on-accent);
}
.email-page-check input:disabled + span {
  opacity: .42;
  cursor: default;
}
.email-toolbar-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.email-toolbar-icon:hover { color: var(--email-navy); }
.email-toolbar-icon:disabled {
  color: var(--color-text-disabled);
  cursor: default;
  opacity: .55;
}
.email-toolbar-icon svg { width: 16px; height: 16px; }
.email-ticket-list {
  border-radius: 0;
  background: var(--color-surface);
  box-shadow: none;
}
.email-ticket-row {
  grid-template-columns:
    18px
    minmax(190px, 240px)
    minmax(260px, 1fr)
    minmax(140px, 190px)
    minmax(190px, 240px)
    74px;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 10px 18px;
}
.email-ticket-row-skeleton {
  cursor: default;
  pointer-events: none;
}
.email-ticket-row-skeleton .email-skeleton-line { width: 72%; }
.email-ticket-row-skeleton .email-skeleton-line.is-tiny { width: 54px; }
.email-ticket-row-skeleton .email-skeleton-line.is-short { width: 42%; }
.email-ticket-row-skeleton .email-skeleton-line.is-medium { width: 62%; }
.email-ticket-row-skeleton .email-skeleton-line.is-long { width: 82%; }
.email-ticket-row-skeleton .email-skeleton-line.is-wide { width: 94%; }
.email-ticket-skeleton-check {
  width: 15px;
  height: 15px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface-muted);
}
.email-ticket-skeleton-customer { min-width: 0; display: grid; gap: 8px; }
.email-ticket-check { margin-top: 0; }
.email-ticket-customer {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.email-ticket-customer strong,
.email-ticket-customer small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-ticket-customer strong {
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 780;
}
.email-ticket-customer small {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 620;
}
.email-ticket-row.is-unread .email-ticket-customer strong {
  font-weight: 900;
}
.email-ticket-subject-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.email-ticket-subject-cell strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-ticket-row.is-unread .email-ticket-subject-cell strong { font-weight: 900; }
.email-ticket-assignee,
.email-ticket-origin {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-ticket-assignee.is-unassigned {
  color: var(--color-text-muted);
  font-weight: 650;
}
.email-ticket-origin {
  color: var(--color-text-muted);
  font-weight: 650;
}
.email-ticket-time {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.email-ticket-stage {
  grid-template-columns: minmax(0, 1fr) var(--email-details-width, 286px);
  animation: email-ticket-stage-in 240ms cubic-bezier(.22, .8, .28, 1) both;
}
@keyframes email-ticket-stage-in {
  from {
    opacity: 0;
    transform: translate3d(10px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.email-reader-head {
  position: relative;
  min-height: 58px;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-surface-raised) 82%, var(--color-panel));
  box-shadow: 0 1px 0 var(--color-border-subtle);
}
.email-mobile-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  flex: 0 0 auto;
}
.email-reader-title {
  display: grid;
  align-content: center;
  gap: 1px;
}
.email-reader-title > strong {
  min-width: 0;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-ticket-header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.email-ticket-assign-wrap {
  position: static;
  flex: 0 0 auto;
}
.email-ticket-assign {
  min-width: 132px;
  height: 36px;
  border: 1px solid var(--color-accent-border);
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--email-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}
.email-ticket-assign:hover,
.email-ticket-assign[aria-expanded="true"] {
  border-color: var(--color-focus-border);
  background: var(--color-selected-strong);
}
.email-ticket-assign svg { width: 16px; height: 16px; }
.email-ticket-assign svg:last-of-type { width: 14px; height: 14px; margin-left: auto; }
.email-category-auto-assign {
  border-color: color-mix(in srgb, var(--color-accent) 36%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
  color: var(--color-accent);
}
.email-category-auto-assign:hover {
  background: color-mix(in srgb, var(--color-accent) 13%, var(--color-surface));
}
.email-ticket-icon-action {
  width: 38px;
  min-width: 38px;
  height: 36px;
  flex: 0 0 38px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: var(--color-text-secondary);
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.email-ticket-icon-action:hover {
  border-color: var(--color-border-strong);
  background: var(--color-hover);
  color: var(--color-text-primary);
}
.email-ticket-icon-action:focus-visible {
  outline: 0;
  border-color: var(--color-focus-border);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}
.email-ticket-icon-action svg { width: 16px; height: 16px; }
.email-assignee-menu {
  top: calc(100% + 6px);
  right: auto;
  left: 0;
  width: min(820px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 88px));
  display: flex;
  flex-direction: column;
}
.email-assignee-menu.is-reopen { width: min(380px, calc(100vw - 32px)); }
.email-assignee-menu.is-assignment {
  top: calc(100% + 10px);
  right: 14px;
  left: 14px;
  width: auto;
  height: min(440px, calc(100dvh - 150px));
  max-height: min(560px, calc(100dvh - 150px));
  box-shadow:
    0 22px 52px rgba(3, 13, 28, .28),
    0 5px 14px rgba(3, 13, 28, .18),
    0 0 0 1px color-mix(in srgb, var(--color-border-strong) 68%, transparent);
}
.email-assignee-menu.is-assignment .email-filter-search input {
  height: 36px;
  font-size: 15px;
}
.email-assignee-menu .email-filter-search { flex: 0 0 auto; }
.email-assignee-menu.is-assignment .email-filter-options {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow: hidden;
}
.email-assignee-columns {
  min-height: 300px;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.email-assignee-column {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.email-assignee-column + .email-assignee-column { border-left: 1px solid var(--color-border-subtle); }
.email-assignee-column-head {
  min-height: 38px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.email-assignee-column-head svg { width: 13px; height: 13px; }
.email-assignee-column-scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 7px; }
.email-assignee-card {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}
.email-assignee-card:hover { background: var(--color-hover); }
.email-assignee-card.is-selected {
  border-color: var(--color-accent-border);
  background: var(--color-accent-soft);
}
.email-assignee-card > span:last-child { min-width: 0; display: grid; gap: 2px; }
.email-assignee-card strong, .email-assignee-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-assignee-card strong { font-size: 14px; }
.email-assignee-card small { color: var(--color-text-muted); font-size: 12px; }
.email-assignee-card-icon,
.email-assignee-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--color-surface-muted);
  color: var(--color-accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 850;
}
.email-assignee-card-icon svg { width: 14px; height: 14px; }
.email-ai-assignee-option.email-assignee-card { display: flex; }
.email-ai-assignee-option.email-assignee-card > span:first-child { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.email-ai-assignee-option.email-assignee-card > span:first-child > svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--color-accent); }
.email-ai-assignee-option.email-assignee-card > span:first-child > span { min-width: 0; display: grid; gap: 2px; }
.email-ai-assignee-actions { display: flex !important; gap: 4px; }
.email-ai-assignee-actions button {
  min-height: 27px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  padding: 0 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.email-ai-assignee-actions button:last-child {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.email-ticket-reopen-trigger + .email-assignee-menu {
  right: 0;
  left: auto;
}
.email-assignee-menu .email-filter-options { min-height: 0; overflow-x: hidden; }
.email-assignee-menu.is-pending {
  isolation: isolate;
  cursor: wait;
}
.email-assignee-menu.is-pending > .email-filter-search,
.email-assignee-menu.is-pending > .email-filter-options {
  opacity: .34;
  filter: saturate(.55);
  transition: opacity 140ms ease, filter 140ms ease;
}
.email-assignee-pending-overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--color-surface-translucent);
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
  color: var(--color-text-primary);
  cursor: wait;
}
.email-assignee-pending-overlay strong {
  font-size: 13px;
  font-weight: 750;
}
.email-filter-group-label {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  padding: 8px 12px 6px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.email-ticket-resolve {
  width: clamp(140px, 18vw, 220px);
  height: 36px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: var(--color-danger);
  color: var(--color-on-accent) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, box-shadow 180ms ease;
}
.email-ticket-resolve::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-hover) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms ease;
}
.email-ticket-resolve:hover,
.email-ticket-resolve:focus-visible {
  box-shadow: var(--shadow-tight);
}
.email-ticket-resolve:hover::before,
.email-ticket-resolve:focus-visible::before {
  transform: scaleX(1);
}
.email-ticket-resolve svg { width: 17px; height: 17px; }
.email-ticket-reopen-trigger svg:last-child {
  width: 14px;
  height: 14px;
  margin-left: 3px;
}
.email-reopen-option { justify-content: space-between; gap: 10px; }
.email-reopen-option > i,
.email-reopen-option > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--color-text-muted);
}

/* Match the scale and rhythm of the Inbox navigation rail. */
.email-page {
  grid-template-columns: 320px minmax(0, 1fr);
  font-size: 15px;
}
.email-queue-head > div strong {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: 0;
}
.email-compose-button {
  min-height: 48px;
  font-size: 16px;
}
.email-queue-nav { padding-left: 14px; padding-right: 14px; }
.email-queue-item {
  min-height: 46px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
}
.email-queue-item svg {
  width: 20px;
  height: 20px;
}
.email-queue-item > span { font-size: 16px; }
.email-queue-item:not(.is-active) {
  color: var(--ink-soft);
}
.email-queue-item:not(.is-active):hover {
  color: var(--color-text-primary);
}

@media (max-width: 1500px) {
  .email-page { grid-template-columns: 320px minmax(0,1fr); }
  .email-ticket-stage { grid-template-columns: minmax(0,1fr) var(--email-details-width, 270px); }
}
@media (max-width: 1180px) {
  .email-page { grid-template-columns: 320px minmax(0,1fr); }
  .email-queue-head { padding-left: 14px; padding-right: 14px; }
  .email-reader-head { min-height: 58px; padding: 8px 10px; }
  .email-reader-actions > button:nth-of-type(1), .email-reader-actions > button:nth-of-type(4) { display: none; }
  .email-assignee-select { max-width: 112px; }
  .email-list-head { grid-template-columns: minmax(240px,520px) auto; }
  .email-list-filters { grid-column: auto; }
  .email-ticket-row {
    grid-template-columns:
      18px
      minmax(160px, 220px)
      minmax(220px, 1fr)
      minmax(120px, 160px)
      70px;
  }
  .email-ticket-origin { display: none; }
  .email-ticket-stage { grid-template-columns: minmax(0,1fr) var(--email-details-width, 244px); }
}
@media (max-width: 920px) {
  .email-page { grid-template-columns: minmax(0,1fr); min-height: 100dvh; }
  .email-queue-rail { display: none; }
  .email-ticket-list-column { border-right: 0; }
  .email-ticket-stage, .email-reader-empty { display: none; }
  .email-page.has-selection .email-ticket-list-column { display: none; }
  .email-page.has-selection .email-ticket-stage { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
  .email-mobile-back { display: grid; flex: 0 0 auto; }
  .email-ticket-details { display: none; }
  .email-details-resizer { display: none; }
  .email-reader-head { position: sticky; top: 0; z-index: 4; }
  .email-reader-actions .email-assignee-select { display: none; }
  .email-compose-dialog { height: 100%; max-height: none; border-left: 0; }
}
@media (max-width: 620px) {
  .email-list-head { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 15px 12px 12px; }
  .email-list-filters { grid-column: auto; min-width: 0; width: 100%; }
  .email-mailbox-filter { width: auto; flex: 1; }
  .email-sort-filter { width: 120px; flex: 0 0 120px; }
  .email-list-toolbar { gap: 8px; padding-left: 10px; padding-right: 8px; }
  .email-list-toolbar-left { gap: 8px; }
  .email-list-toolbar-right { gap: 5px; }
  .email-assign-categorized > span { display: none; }
  .email-assignee-menu {
    position: fixed;
    inset: 72px 10px auto;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 84px);
  }
  .email-assignee-columns { grid-template-columns: 1fr; overflow-y: auto; }
  .email-assignee-column + .email-assignee-column { border-left: 0; border-top: 1px solid var(--color-border-subtle); }
  .email-assignee-column-scroll { overflow: visible; }
  .email-ticket-row {
    grid-template-columns: 18px minmax(132px, 180px) minmax(0,1fr) 62px;
    gap: 8px;
    min-height: 64px;
    padding: 9px 10px;
  }
  .email-ticket-check::before {
    left: 50%;
    width: 36px;
    height: 64px;
  }
  .email-ticket-assignee,
  .email-ticket-origin { display: none; }
  .email-reader-head { min-height: 58px; gap: 6px; padding: 8px; }
  .email-reader-title { display: grid; gap: 1px; }
  .email-reader-title > strong { font-size: 15px; }
  .email-ticket-header-actions { gap: 4px; }
  .email-ticket-assign,
  .email-ticket-resolve {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }
  .email-ticket-assign > span,
  .email-ticket-assign > svg:last-of-type,
  .email-ticket-resolve > span { display: none; }
  .email-ticket-reopen-trigger > svg:last-child { display: none; }
  .email-thread { padding: 15px 10px 20px; }
  .email-message > header { grid-template-columns: 30px minmax(0,1fr) auto 24px; }
  .email-message-ai, .email-message > header time { display: none; }
  .email-message > header.email-message-note-header {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 34px;
    padding: 6px 14px;
  }
  .email-message > header.email-message-note-header time { display: block; }
  .email-message-body { padding: 15px; }
  .email-reply-composer { margin: 0; }
  .email-reply-launcher { padding: 0 10px 10px; }
  .email-reply-routing { grid-template-columns: 1fr; }
  .email-reply-routing > .email-reply-from { border-right: 0; border-bottom: 1px solid var(--color-border-subtle); }
  .email-compose-dialog > header, .email-compose-fields, .email-compose-editor { padding-left: 14px; padding-right: 14px; }
  .email-compose-dialog .email-copilot-panel { padding-left: 14px; padding-right: 14px; }
  .email-copilot-panel { grid-template-columns: 38px minmax(0,1fr); align-items: center; }
  .email-copilot-mark { width: 38px; height: 38px; }
  .email-copilot-actions { grid-column: 2; justify-content: flex-end; }
  .email-compose-dialog > footer { align-items: flex-end; }
  .email-editor-tools { max-width: calc(100vw - 190px); overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 480px) {
  .email-bulk-inline-action > span { display: none; }
  .email-bulk-inline-action:not(.is-clear) { width: 28px; justify-content: center; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .email-ticket-stage, .email-compose-dialog, .email-toast, .email-button-spinner, .email-copilot-spinner,
  .email-skeleton-line::after, .email-skeleton-avatar::after { animation: none; }
}

/* Shared palette contract: all email workspace colors come from app tokens. */
html[data-theme="dark"] .email-page {
  --email-border: var(--color-border);
  --email-surface: var(--color-surface);
  --email-navy: var(--color-accent);
  --email-chrome: var(--color-panel);
  background: var(--color-canvas);
  color: var(--color-text-primary);
}

html[data-theme="dark"] :is(
  .email-queue-rail,
  .email-list-head,
  .email-ticket-list-column,
  .email-ticket-details,
  .email-compose-dialog
) {
  background: var(--color-panel);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .email-reader-head {
  background: color-mix(in srgb, var(--color-surface-raised) 82%, var(--color-panel));
  border-color: var(--color-border-subtle);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .email-compose-dialog {
  background: var(--color-surface);
  box-shadow: none;
}

html[data-theme="dark"] :is(
  .email-ticket-surface,
  .email-list-toolbar,
  .email-ticket-list
) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .email-ticket-surface {
  box-shadow:
    0 3px 18px var(--color-shadow-tight),
    inset 1px 1px 0 var(--color-border-subtle);
}

html[data-theme="dark"] :is(
  .email-queue-head > div strong,
  .email-list-title h1,
  .email-reader-title h2,
  .email-reader-title > strong,
  .email-compose-dialog > header h2,
  .email-ticket-line strong,
  .email-ticket-subject > span:last-child,
  .email-message > header strong,
  .email-message-body,
  .email-reply-editor textarea,
  .email-reply-editor .email-rich-editor,
  .email-note-editor textarea,
  .email-reply-to > strong,
  .email-contact-card > strong,
  .email-detail-section > header strong,
  .email-detail-section dd,
  .email-compose-fields input,
  .email-compose-fields select,
  .email-compose-editor textarea,
  .email-compose-editor .email-rich-editor
) {
  color: var(--color-text-primary);
}

html[data-theme="dark"] :is(
  .email-queue-item,
  .email-bulk-inline-action,
  .email-toolbar-icon,
  .email-pagination > span,
  .email-filter-option,
  .email-filter-option small,
  .email-filter-empty
) {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] :is(
  .email-search-field,
  .email-assignee-select,
  .email-reader-actions > button,
  .email-mobile-back,
  .email-filter-trigger,
  .email-filter-menu,
  .email-filter-search,
  .email-filter-search input,
  .email-message-attachments button,
  .email-contact-card > button,
  .email-compose-save
) {
  background: var(--color-input);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] :is(
  .email-search-field input,
  .email-assignee-select select,
  .email-filter-search input
) {
  color: var(--color-text-primary);
}

/* Keep the primary inbox controls visible against the patterned email
   chrome without introducing palette-specific colors. */
html[data-theme="dark"] :is(.email-search-field, .email-filter-trigger) {
  background: color-mix(
    in srgb,
    var(--color-input) 88%,
    var(--color-text-primary) 12%
  );
}

html[data-theme="dark"] .email-search-field:focus-within {
  background: color-mix(
    in srgb,
    var(--color-input) 82%,
    var(--color-text-primary) 18%
  );
}

html[data-theme="dark"] .email-filter-trigger:is(:hover, [aria-expanded="true"]) {
  background: color-mix(
    in srgb,
    var(--color-input) 82%,
    var(--color-text-primary) 18%
  );
}

html[data-theme="dark"] :is(
  .email-filter-search input:focus,
  .email-filter-option:hover,
  .email-filter-option.is-selected,
  .email-bulk-inline-action:hover
) {
  background: var(--color-hover);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

html[data-theme="dark"] :is(
  .email-queue-item:hover,
  .email-queue-item.is-active,
  .email-ticket-row.is-active,
  .email-ticket-row.is-checked
) {
  background: var(--color-selected);
  border-color: var(--color-accent-border);
  color: var(--color-text-primary);
  box-shadow: none;
}

html[data-theme="dark"] .email-ticket-row {
  background: var(--color-surface-raised);
  border-bottom-color: var(--color-border-subtle);
}

html[data-theme="dark"] .email-ticket-row:hover {
  background: var(--color-hover);
}

html[data-theme="dark"] :is(
  .email-customer-avatar,
  .email-contact-avatar,
  .email-message-avatar,
  .email-mailbox-chip,
  .email-unassigned-label,
  .email-detail-tags span
) {
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .email-reader {
  background: var(--color-canvas);
}

html[data-theme="dark"] .email-message {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme="dark"] .email-reply-composer {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  box-shadow:
    0 -12px 30px var(--color-shadow-tight),
    inset 0 1px 0 var(--color-border-subtle);
}

html[data-theme="dark"] .email-reply-editor {
  background: color-mix(in srgb, var(--color-surface-raised) 30%, var(--color-surface));
}

html[data-theme="dark"] .email-compose-editor {
  background: color-mix(in srgb, var(--color-surface-raised) 34%, var(--color-surface));
}

html[data-theme="dark"] .email-copilot-panel {
  background: color-mix(in srgb, var(--color-accent-soft) 22%, var(--color-surface));
  border-color: var(--color-border-strong);
}

html[data-theme="dark"] :is(.email-editor-copilot, .email-copilot-mark) {
  background: var(--color-input);
  border-color: var(--color-accent-border);
  color: var(--color-text-primary);
}

html[data-theme="dark"] .email-copilot-cancel {
  background: var(--color-input);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] .email-compose-fields input {
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .email-compose-from-field .email-identity-trigger {
  background: transparent;
}

html[data-theme="dark"] .email-reply-launcher > button {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
  color: var(--color-text-primary);
  box-shadow: 0 6px 18px var(--color-shadow-tight);
}

html[data-theme="dark"] .email-reply-launcher > button:hover {
  background: var(--color-selected-strong);
  border-color: var(--color-accent-border);
}

html[data-theme="dark"] :is(
  .email-compose-button,
  .email-reply-launcher > button,
  .email-send-button
) {
  background: var(--color-accent-pressed);
  border-color: var(--color-accent-pressed);
  color: var(--color-on-accent-pressed) !important;
}

html[data-theme="dark"] :is(
  .email-compose-button:hover,
  .email-reply-launcher > button:hover,
  .email-send-button:hover
) {
  background: var(--color-accent-hover);
  color: var(--color-on-accent-hover) !important;
}

html[data-theme="dark"] .email-reply-composer.is-note {
  background: var(--color-warning-soft);
  border-color: color-mix(in srgb, var(--color-warning) 28%, transparent);
}

html[data-theme="dark"] .email-message.is-note {
  border-color: transparent;
  background: transparent;
}

html[data-theme="dark"] .email-message > header.email-message-note-header > strong {
  color: var(--color-text-muted);
}

html[data-theme="dark"] .email-page-check > span {
  background: var(--color-input);
  border-color: var(--color-border-strong);
}

html[data-theme="dark"] .email-page-check input:checked + span,
html[data-theme="dark"] .email-page-check > span.is-partial {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 3px var(--color-panel);
}

html[data-theme="dark"] .email-reader::after {
  background: rgba(1, 7, 16, .42);
}

html[data-theme="dark"] .email-assignee-menu.is-assignment {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .62),
    0 6px 18px rgba(0, 0, 0, .42),
    0 0 0 1px color-mix(in srgb, var(--color-accent) 18%, var(--color-border-strong));
}

html[data-theme="dark"] .email-queue-nav,
html[data-theme="dark"] .email-thread {
  scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);
}

html[data-theme="dark"] .email-queue-nav::-webkit-scrollbar-thumb,
html[data-theme="dark"] .email-thread::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
}
.email-filter-group-label {
  padding: 10px 12px 5px;
  color: var(--muted, #64748b);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.email-resolution-schedule {
  position: sticky;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 12px auto;
  padding: 8px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  color: var(--color-text-secondary);
  background: color-mix(in srgb, var(--color-surface-raised) 94%, var(--color-accent) 6%);
  box-shadow: 0 4px 14px var(--color-shadow-tight);
  font-size: 12px;
}
.email-resolution-schedule strong { color: var(--color-text-primary); }
.email-resolution-schedule svg { width: 14px; height: 14px; color: var(--color-accent); }

.email-ai-assignee-option {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
}

.email-ai-assignee-option > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}

.email-ai-assignee-option > span svg { width: 15px; height: 15px; }
.email-ai-assignee-option > button {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f2742;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.email-ai-assignee-option > button:last-child { background: #0a4a88; border-color: #0a4a88; color: #fff; }
.email-ai-assignee-option.is-selected { background: rgba(10, 74, 136, 0.08); }
.email-ai-assignee-option > .email-ai-assignee-current {
  justify-self: end;
  color: #52708f;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 700px) {
  .email-ai-assignee-option { grid-template-columns: 1fr 1fr; }
  .email-ai-assignee-option > span { grid-column: 1 / -1; }
}
