
.email-list {
  width: 360px;
  border-right: 0.5px solid var(--sk-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--sk-bg-surface);
  position: relative;
  z-index: 1;
}

.email-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 0.5px solid var(--sk-border);
  flex-shrink: 0;
  min-height: 40px;
  background: var(--sk-bg-surface);
}

.email-list-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text);
  margin: 0;
  letter-spacing: -0.1px;
}

.email-list-count {
  font-size: var(--font-size-sm);
  color: var(--sk-text-tertiary);
}


.email-list-items {
  flex: 1;
  overflow-y: auto;
}

/* Urgent signal uses the calm warm-rust family, not saturated error red.
   Text/background pairs are picked for WCAG AA (>=4.5:1) in both themes. */
.email-message-item.urgent.unread::before {
  background: #A6594B;
}

.email-priority-badge {
  font-size: var(--font-size-sm);
  color: #8F4A3E;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  margin-left: 4px;
  background: rgba(166, 89, 75, 0.14);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.email-list-section-header {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text-secondary);
  padding: 8px 16px;
  background: var(--sk-bg-subtle);
  border-bottom: 0.5px solid var(--sk-border);
}

.email-list-time-group {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text-secondary);
  padding: 4px 16px;
  background: var(--sk-bg-subtle);
  border-bottom: 0.5px solid var(--sk-border);
}

.email-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  min-height: 200px;
  animation: email-fade-in 300ms ease;
}

.email-list-empty-icon {
  font-size: var(--font-size-8xl);
  margin-bottom: 12px;
  opacity: 0.3;
}

.email-list-empty-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text-secondary);
  margin: 0 0 4px;
}

.email-list-empty-sub {
  font-size: var(--font-size-base);
  color: var(--sk-text-secondary);
  margin: 0;
}

.email-message-item {
  --email-row-bg: var(--sk-bg-surface);
  --email-row-hover-bg: var(--email-soft-highlight);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  cursor: default;
  box-sizing: border-box;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  border-left: var(--email-indicator-width, 3px) solid transparent;
  background: var(--email-row-bg);
  transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  min-height: 64px;
  position: relative;
  touch-action: manipulation;
}

.email-message-item:hover {
  background: var(--email-row-hover-bg);
}

.email-message-item.selected {
  --email-row-bg: rgba(168, 197, 184, 0.12);
  --email-row-hover-bg: rgba(168, 197, 184, 0.14);
  border-left: none;
  box-shadow: none;
}

.email-message-item.selected:hover {
  background: var(--email-row-hover-bg);
}

.email-message-item.unread {
  --email-row-bg: var(--sk-accent-3, rgba(var(--color-primary-rgb), 0.03));
  --email-row-hover-bg: var(--sk-accent-6, rgba(var(--color-primary-rgb), 0.06));
}

.email-message-item.selected.unread {
  --email-row-bg: var(--sk-accent-bg, rgba(var(--color-primary-rgb), 0.08));
  --email-row-hover-bg: var(--sk-accent-bg-medium, var(--email-soft-highlight-strong));
}

.email-message-item:not(.unread) .email-message-sender,
.email-message-item:not(.unread) .email-message-subject {
  color: var(--sk-text-secondary);
}

.email-message-item.unread .email-message-sender {
  font-weight: var(--font-weight-bold);
  color: var(--sk-text);
}

.email-message-item.unread .email-message-subject {
  font-weight: var(--font-weight-bold);
  color: var(--sk-text);
}

.email-message-item.unread .email-message-snippet {
  color: var(--sk-text-secondary);
  font-weight: var(--font-weight-medium);
}

.email-message-item.unread::before {
  content: none;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sk-accent);
  border-radius: 0 2px 2px 0;
}

.email-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sk-text-on-accent);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  cursor: pointer;
}

.email-message-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.email-message-sender {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--sk-text);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 1px;
  letter-spacing: 0;
}

.email-message-subject {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--sk-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  line-height: 1.3;
}

.email-message-snippet {
  font-size: var(--font-size-sm);
  color: var(--sk-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .email-list .email-message-item {
    min-height: 58px;
    padding: 4px 10px 4px 12px;
    gap: 8px;
  }

  .email-list .email-message-avatar,
  .email-list .email-avatar-stack {
    width: 32px;
    height: 32px;
  }

  .email-list .email-message-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .email-list .email-message-sender {
    font-size: var(--font-size-sm);
    line-height: 1.12;
    margin-bottom: 0;
  }

  .email-list .email-message-subject {
    font-size: var(--font-size-sm);
    line-height: 1.16;
    margin-bottom: 0;
  }

  .email-list .email-message-snippet {
    line-height: 1.15;
    margin-top: 0;
  }

  .email-list .email-message-meta {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 88px;
    max-width: 132px;
    min-height: 32px;
  }

  .email-list .email-message-time {
    flex: 0 0 auto;
    max-width: 64px;
  }

  .email-list .email-sent-badge {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 56px;
  }

  .email-list .email-message-icons {
    flex: 0 0 auto;
    gap: 2px;
  }

  .email-list .email-message-star {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
  }

  .email-list .email-label-pills {
    max-height: 16px;
    margin-top: 2px;
  }

  .email-list .email-label-pill {
    height: 16px;
    padding: 0 5px;
    line-height: 16px;
  }

  .email-list .email-provider-label-pill {
    height: 16px;
    padding: 0 5px;
    line-height: 16px;
  }
}

.email-label-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
}

.email-label-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: min(120px, 45%);
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}

.email-label-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex: 0 0 6px;
}

.email-label-pill-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-provider-label-pills {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.email-provider-label-pill {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(100px, 40%);
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  opacity: 0.85;
}

.email-provider-label-pill-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-provider-label-pill-more {
  background: var(--bb-warm-100, #F0E8DE);
  color: var(--bb-warm-text, #6B5B4F);
  opacity: 1;
}

.email-reader-provider-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}

.email-reader-provider-labels .email-provider-label-pill {
  max-width: 200px;
  opacity: 1;
}

.email-message-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 52px;
  max-width: 74px;
  overflow: hidden;
  position: relative;
}

.email-message-time {
  font-size: var(--font-size-xs);
  color: var(--sk-text-muted);
  white-space: nowrap;
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  transition: opacity 120ms ease;
}

.email-sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 74px;
  color: var(--sk-text-secondary);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-sent-badge svg {
  flex: 0 0 auto;
}

.email-replied-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 74px;
  color: var(--sk-accent, #079aa2);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-replied-badge svg {
  flex: 0 0 auto;
}

.email-message-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}

.email-message-star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--sk-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: color 180ms ease;
}

.email-message-star svg {
  pointer-events: none;
}

.email-message-star:hover {
  color: var(--sk-m3-on-surface, var(--color-text-primary));
}

.email-message-star.starred {
  color: var(--sk-m3-on-surface, var(--color-text-primary));
}

.email-message-star:focus-visible {
  outline: none;
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.email-message-attach-icon {
  color: var(--sk-text-secondary);
  flex-shrink: 0;
}

/* .email-new-mail-banner removed per Stefan */

@keyframes email-banner-slide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.email-thread-count { font-size: var(--font-size-sm); color: var(--sk-text-secondary); font-weight: normal; margin-left: 4px; }

.email-thread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  color: var(--sk-text-secondary);
  background: var(--sk-border);
  border-radius: var(--radius-md);
  vertical-align: middle;
  letter-spacing: 0;
  flex-shrink: 0;
}

.email-message-item.unread .email-thread-badge {
  color: var(--sk-text);
  background: var(--email-soft-highlight-strong);
}

.email-avatar-stack {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  cursor: pointer;
}

.email-avatar-stack-back,
.email-avatar-stack-front {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sk-text-on-accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  border: 2px solid var(--sk-text-on-accent);
}

.email-avatar-stack-back {
  top: 0;
  right: 0;
  z-index: 1;
}

.email-avatar-stack-front {
  bottom: 0;
  left: 0;
  z-index: 2;
}

.email-message-item.threaded {
  
}

.email-thread-view { display: flex; flex-direction: column; gap: 1px; }
.email-thread-message { border-bottom: 0.5px solid var(--sk-border); }
.email-thread-message.collapsed { cursor: pointer; }
.email-thread-message.collapsed:hover { background: var(--sk-bg-subtle); }
.email-thread-msg-header { padding: 12px 16px; display: flex; align-items: center; gap: 8px; }
.email-thread-msg-date { color: var(--sk-text-secondary); font-size: var(--font-size-sm); }
.email-thread-msg-snippet { color: var(--sk-text-secondary); font-size: var(--font-size-sm); margin-left: auto; }
.email-thread-msg-body { padding: 0 16px 16px; }
.email-thread-message.collapsed .email-thread-msg-body { display: none; }

.email-message-hover-actions {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 0.5px solid var(--sk-border);
  border-radius: var(--radius-md, 8px);
  background: var(--sk-bg-surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-50%);
  transition: opacity 120ms ease, visibility 0s linear 120ms;
}

.email-hover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sk-text-secondary);
  cursor: pointer;
  padding: 0;
}

.email-hover-btn:hover,
.email-hover-btn:focus-visible {
  background: rgba(92, 77, 67, 0.06);
  color: var(--sk-m3-on-surface, var(--color-text-primary));
}

.email-hover-btn:focus-visible {
  outline: none;
  outline-offset: 2px;
}

.email-bulk-cb {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 -4px 0 -8px;
  flex-shrink: 0;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.email-bulk-cb::before {
  content: '';
  position: absolute;
  inset: 13px;
  border: 2px solid var(--sk-border);
  border-radius: 50%;
  background: var(--sk-bg-surface);
  transition: background 180ms, border-color 180ms, box-shadow 180ms;
}

.email-bulk-cb:checked {
  background: transparent;
}

.email-bulk-cb:checked::before {
  background: var(--sk-text);
  border-color: var(--sk-text);
}

.email-bulk-cb:checked::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 14px;
  width: 7px;
  height: 12px;
  border: solid var(--sk-bg-surface);
  border-width: 0 2px 2px 0;
  pointer-events: none;
  transform: rotate(45deg);
}

.email-bulk-cb:focus-visible::before {
  border-color: var(--color-primary);
}

.bulk-mode .email-bulk-cb {
  display: block;
}

.bulk-mode .email-message-avatar {
  display: none;
}

.bulk-mode .email-avatar-stack {
  display: none;
}

.bulk-mode .email-message-item {
  align-items: center;
}

.email-list.bulk-mode-active .email-list-header {
  background: rgba(168, 197, 184, 0.08);
  border-bottom-color: rgba(168, 197, 184, 0.28);
  box-shadow: none;
}

.email-list .email-list-items.bulk-mode .email-message-item.bulk-selected {
  --email-row-bg: rgba(168, 197, 184, 0.10);
  --email-row-hover-bg: rgba(168, 197, 184, 0.14);
  background: var(--email-row-bg);
  box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.38);
}

.email-list .email-list-items.bulk-mode .email-message-item.bulk-selected:hover {
  background: var(--email-row-hover-bg);
}

.email-list .email-list-items.bulk-mode .email-message-item.selected.bulk-selected {
  box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.44);
}

[data-theme="dark"] .email-list.bulk-mode-active .email-list-header {
  background: rgba(168, 197, 184, 0.12);
  border-bottom-color: rgba(168, 197, 184, 0.32);
  box-shadow: none;
}

[data-theme="dark"] .email-list .email-list-items.bulk-mode .email-message-item.bulk-selected {
  --email-row-bg: rgba(168, 197, 184, 0.14);
  --email-row-hover-bg: rgba(168, 197, 184, 0.18);
  box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.42);
}

[data-theme="dark"] .email-list .email-list-items.bulk-mode .email-message-item.selected.bulk-selected {
  box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.48);
}

@media (min-width: 1200px) {
  .email-app.is-reader-split .email-list .email-list-items.bulk-mode .email-message-item.bulk-selected:not(.selected) {
    background: rgba(168, 197, 184, 0.10) !important;
    box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.36) !important;
  }

  .email-app.is-reader-split .email-list .email-list-items.bulk-mode .email-message-item.bulk-selected:not(.selected):hover {
    background: rgba(168, 197, 184, 0.14) !important;
  }

  .email-app.is-reader-split .email-list .email-list-items.bulk-mode .email-message-item.selected.bulk-selected {
    background: var(--sk-m3-surface-tint-level1, var(--sk-bg-selected)) !important;
    box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.42) !important;
  }

  [data-theme="dark"] .email-app.is-reader-split .email-list .email-list-items.bulk-mode .email-message-item.bulk-selected:not(.selected) {
    background: rgba(168, 197, 184, 0.14) !important;
    box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.40) !important;
  }

  [data-theme="dark"] .email-app.is-reader-split .email-list .email-list-items.bulk-mode .email-message-item.selected.bulk-selected {
    box-shadow: inset 0 0 0 2px rgba(168, 197, 184, 0.46) !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  .email-message-item:hover .email-message-hover-actions,
  .email-message-item:focus-within .email-message-hover-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 120ms ease, visibility 0s;
  }

  .email-message-item:hover .email-message-time,
  .email-message-item:focus-within .email-message-time {
    opacity: 0;
  }

  .email-message-item:hover .email-bulk-cb,
  .email-message-item:focus-within .email-bulk-cb {
    display: block;
  }

  .email-message-item:hover .email-message-avatar,
  .email-message-item:focus-within .email-message-avatar,
  .email-message-item:hover .email-avatar-stack,
  .email-message-item:focus-within .email-avatar-stack {
    display: none;
  }
}

.email-bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--sk-text);
  font-size: var(--font-size-base);
  border-radius: var(--radius-sm);
  margin: 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
  min-height: 32px;
  animation: bulkBarFadeIn 0.15s ease;
}

@keyframes bulkBarFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.email-list > .email-bulk-bar.email-bulk-bar {
  gap: 6px 8px;
  min-height: 48px;
  padding: 6px 10px 6px 14px;
  border-radius: 0;
  border-bottom: 1px solid rgba(168, 197, 184, 0.28);
  background: rgba(168, 197, 184, 0.08);
  box-shadow: none;
  box-sizing: border-box;
}

[data-theme="dark"] .email-list > .email-bulk-bar.email-bulk-bar {
  background: rgba(168, 197, 184, 0.12);
  border-bottom-color: rgba(168, 197, 184, 0.32);
  box-shadow: none;
}

.email-bulk-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  flex: 0 0 auto;
}
.email-bulk-toggle input {
  appearance: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.email-list > .email-bulk-bar .email-bulk-toggle input,
.email-list > .email-bulk-bar .email-bulk-toggle input:checked {
  border: 0;
  background: transparent;
}
.email-bulk-toggle input::before {
  content: '';
  position: absolute;
  inset: 13px;
  border: 2px solid var(--sk-text);
  border-radius: 50%;
  background: transparent;
}
.email-bulk-toggle input:checked::before {
  background: var(--sk-text);
  border-color: var(--sk-text);
}
.email-bulk-toggle input:checked::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 14px;
  width: 7px;
  height: 12px;
  border: solid var(--email-control-on-fill);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.email-bulk-toggle input:focus-visible::before {
  border-color: var(--color-primary);
}

.email-bulk-toggle-text {
  color: var(--sk-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  white-space: nowrap;
}

.email-bulk-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sk-text-secondary);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  padding: 0;
  flex-shrink: 0;
}
.email-bulk-close svg {
  width: 16px;
  height: 16px;
}
.email-bulk-close:hover,
.email-bulk-close:focus-visible {
  background: rgba(0, 0, 0, 0.07);
  color: var(--sk-text);
}

.email-bulk-count {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text);
  white-space: nowrap;
}

.email-bulk-spacer { flex: 1; }

.email-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.email-bulk-overflow-wrapper {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.email-bulk-overflow-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 200px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 4px;
  border: 1px solid var(--sk-border);
  border-radius: var(--radius-sm);
  background: var(--sk-bg-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.email-bulk-overflow-menu[hidden] {
  display: none;
}

.email-bulk-overflow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sk-text);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-align: left;
}

.email-bulk-overflow-item:hover,
.email-bulk-overflow-item:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

.email-bulk-overflow-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--sk-text-secondary);
}

.email-bulk-overflow-item:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.email-bulk-label-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 190px;
  max-width: min(240px, calc(100vw - 24px));
  max-height: min(320px, calc(100vh - 140px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--sk-border);
  border-radius: var(--radius-sm);
  background: var(--sk-bg-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 40;
}

.email-bulk-label-menu[hidden] {
  display: none;
}

.email-bulk-label-title {
  padding: 4px 8px 6px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--sk-text-secondary);
  letter-spacing: 0;
}

.email-bulk-label-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.email-bulk-label-item {
  display: grid;
  grid-template-columns: 22px 12px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--sk-text);
  cursor: pointer;
}

.email-bulk-label-item:hover,
.email-bulk-label-item:focus-within {
  background: rgba(var(--color-primary-rgb), 0.10);
}

.email-bulk-label-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--sk-text);
  cursor: pointer;
}

.email-bulk-label-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--email-bulk-label-color, var(--sk-accent));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.email-bulk-label-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
}

.email-bulk-label-checkbox:disabled,
.email-bulk-label-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

[data-theme="dark"] .email-bulk-label-menu,
[data-theme="dark"] .email-bulk-overflow-menu {
  background: var(--color-card, var(--sk-bg-surface));
  border-color: var(--color-border, var(--sk-border));
  box-shadow: 0 14px 34px rgba(20, 18, 15, 0.38);
}

[data-theme="dark"] .email-bulk-label-item:hover,
[data-theme="dark"] .email-bulk-label-item:focus-within {
  background: rgba(var(--color-primary-rgb), 0.14);
}

[data-theme="dark"] .email-bulk-overflow-item:hover,
[data-theme="dark"] .email-bulk-overflow-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px) {
  .email-bulk-label-menu {
    right: 0;
    min-width: 178px;
    max-width: calc(100vw - 24px);
  }
}

.email-bulk-toggle input:focus-visible,
.email-bulk-close:focus-visible {
  outline: none;
  outline-offset: 2px;
}

.email-bulk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sk-text-secondary);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  padding: 0;
  flex-shrink: 0;
  min-height: 44px;
}
.email-bulk-icon:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--sk-text);
}
.email-bulk-icon-danger:hover {
  background: rgba(194,75,96,0.10);
  color: var(--color-danger);
}

.email-bulk-icon:disabled,
.email-bulk-icon[disabled] {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.email-bulk-progress {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--sk-surface);
  color: var(--sk-text);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  z-index: 9999;
  animation: bulkProgressIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bulkProgressIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.email-bulk-progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--sk-border-medium);
  border-top-color: var(--sk-text);
  border-radius: var(--radius-full);
  animation: bulkSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes bulkSpin {
  to { transform: rotate(360deg); }
}

.email-bulk-progress-text {
  white-space: nowrap;
}

.email-blocked-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-danger);
  background: rgba(194,75,96,0.08);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
  vertical-align: middle;
}

.email-blocked-badge svg {
  width: 10px;
  height: 10px;
}

.reply-later-row .email-message-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.reply-later-wait {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--sk-warning);
  background: rgba(245,158,11,0.08);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.reply-later-remove-btn {
  padding: 3px 10px;
  border: 0.5px solid var(--sk-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sk-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  white-space: nowrap;
  min-height: 44px;
}

.reply-later-remove-btn:hover {
  background: rgba(194,75,96,0.08);
  color: var(--sk-danger);
  border-color: rgba(194,75,96,0.2);
}

/* Waiting-time badge: a calm sage pill, clock glyph + the elapsed count SIDE BY SIDE
   (how long the mail has been waiting since it arrived). Self-contained so it can't
   break under the row meta's `align-items: baseline !important` (email-calm-preview):
   `align-self: center` pins it; flat side-by-side layout, not a fragile overlay.
   Exact "X siden" + arrival on hover. */
.senere-wait {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-pill, 999px);
  background: var(--sk-accent-bg, rgba(110, 138, 126, 0.14));
  color: var(--sk-accent, #4A7A68);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: -0.2px;
  white-space: nowrap;
  flex: none;
}

.senere-wait svg {
  flex: none;
  opacity: 0.9;
}

.senere-wait-num {
  line-height: 1;
}

/* "Bring back to inbox" (un-snooze): a real, filled button — calm sage tint at rest
   so it reads as tappable (not a flat outline), white-on-sage on hover. It RESTORES
   mail, so never the destructive red used for delete. `align-self: center` pins it
   against the meta's baseline alignment. */
.snooze-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0.5px solid var(--sk-accent, rgba(110, 138, 126, 0.4));
  border-radius: var(--radius-md);
  background: var(--sk-accent-bg, rgba(110, 138, 126, 0.14));
  color: var(--sk-accent, #4A7A68);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  flex: none;
}

.snooze-remove-btn svg {
  flex: none;
}

.snooze-remove-btn:hover,
.snooze-remove-btn:focus-visible {
  background: var(--sk-accent, #6E8A7E);
  color: #fff;
  border-color: var(--sk-accent, #6E8A7E);
  outline: none;
}

/* email-calm-preview.css clamps EVERY `.email-dense-row .email-message-meta svg` to
   12px warm-grey #9A8E82 !important (for generic meta icons). Our Senere clock + bring-back
   arrow are intentional sage / white-on-hover glyphs, so re-assert them at beating
   specificity (.senere-row + the control class) + !important. Without this the arrow stays
   grey and drops to ~1.2:1 — disappearing — on the solid-sage hover. */
.email-page .email-list .email-list-items .senere-row.email-message-item.email-dense-row .email-message-meta .senere-wait svg {
  width: 13px !important;
  height: 13px !important;
  stroke: var(--sk-accent, #6E8A7E) !important;
  stroke-width: 2 !important;
  opacity: 0.9 !important;
  flex: none !important;
}
.email-page .email-list .email-list-items .senere-row.email-message-item.email-dense-row .email-message-meta .snooze-remove-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: var(--sk-accent, #6E8A7E) !important;
  stroke-width: 2 !important;
  opacity: 1 !important;
  flex: none !important;
}
.email-page .email-list .email-list-items .senere-row.email-message-item.email-dense-row .email-message-meta .snooze-remove-btn:hover svg,
.email-page .email-list .email-list-items .senere-row.email-message-item.email-dense-row .email-message-meta .snooze-remove-btn:focus-visible svg {
  stroke: #fff !important;
}

/* Senere rows ARE Indbakke rows (renderMessageRow): identical structure, controls,
   spacing and hover — no bespoke avatar, no jump. The only Senere touches are the
   waiting-time pill + the bring-back button, added into the meta. The standard
   archive/delete/unread hover cluster is removed from the DOM in renderSnoozedView
   (CSS can't hide it reliably — email-calm-preview.css wins on specificity — and it
   would overlap/steal the bring-back click). The bulk-select checkbox stays for
   100% Indbakke parity. Pin the meta to its (narrow) content + a gap so the
   subject/snippet clamps cleanly instead of touching the controls. The children use
   `align-self: center` because the base meta forces `align-items: baseline`. */
.senere-row .email-message-meta {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: none;
  overflow: visible;
  margin-left: 12px;
}

/* The sent/replied flag badge lives in the same meta and is NOT removed in
   renderSnoozedView; pin it centre too (the meta forces align-items:baseline) so it
   lines up with the centred pill + bring-back button. */
.senere-row .email-message-meta .email-message-flags {
  align-self: center !important;
}

.email-analytics {
  padding: 16px;
  overflow-y: auto;
  height: 100%;
}

.email-analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.email-stat-card {
  background: var(--sk-bg-subtle);
  border: 0.5px solid var(--sk-border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  text-align: center;
}

.email-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--sk-text);
  line-height: 1.2;
}

.email-stat-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--sk-text-secondary);
  margin-top: 4px;
}

.email-analytics-section {
  margin-bottom: 20px;
}

.email-analytics-heading {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text-secondary);
  letter-spacing: 0.04em;
  margin: 0 0 10px 0;
}

.email-analytics-hours {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  padding-bottom: 18px;
  position: relative;
}

.email-hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.email-hour-bar {
  width: 100%;
  min-height: 2px;
  background: var(--sk-text);
  border-radius: 2px 2px 0 0;
  transition: height 300ms ease;
  opacity: 0.7;
}

.email-hour-col:hover .email-hour-bar {
  opacity: 1;
}

.email-hour-label {
  font-size: var(--font-size-xs);
  color: var(--sk-text-tertiary);
  position: absolute;
  bottom: -16px;
  white-space: nowrap;
}

.email-stat-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.email-stat-bar-label {
  flex: 0 0 120px;
  font-size: var(--font-size-base);
  color: var(--sk-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-stat-bar-track {
  flex: 1;
  height: 8px;
  background: var(--sk-bg-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.email-stat-bar {
  height: 100%;
  background: var(--sk-text);
  border-radius: var(--radius-sm);
  transition: width 300ms ease;
  min-width: 2px;
}

.email-stat-bar-unread {
  background: var(--sk-warning);
}

.email-stat-bar-value {
  flex: 0 0 auto;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text-secondary);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.email-cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.email-demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--sk-warning-bg);
  color: var(--sk-warning-text);
  font-size: var(--font-size-base);
  border-bottom: 0.5px solid var(--sk-border);
}

.email-demo-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--sk-warning-bg);
  color: var(--sk-warning-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.email-toolbar-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0.5px solid var(--sk-text);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sk-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background 120ms, color 120ms;
  min-height: 44px;
}

.email-toolbar-connect-btn:hover {
  background: var(--sk-text);
  color: var(--email-control-on-fill);
}

.email-ptr-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  min-height: 0;
  opacity: 0;
  transition: max-height 180ms ease, opacity 180ms ease, padding 180ms ease;
}

.email-ptr-spinner.visible {
  max-height: 48px;
  padding: 12px;
  opacity: 1;
}

.email-ptr-spinner svg {
  width: 24px;
  height: 24px;
  color: var(--sk-text);
  animation: email-spin 0.8s linear infinite;
}

[data-theme="dark"] .email-ptr-spinner {
  background: var(--sk-bg-surface);
}

.email-swipe-wrapper {
  position: relative;
  overflow: hidden;
}

.email-swipe-reveal {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--sk-text-on-accent);
  padding: 0 20px;
  pointer-events: none;
  user-select: none;
}

.email-swipe-reveal.swipe-right {
  left: 0;
  justify-content: flex-start;
  background: var(--sk-success);
}

.email-swipe-reveal.swipe-left {
  right: 0;
  justify-content: flex-end;
  background: var(--sk-danger);
}

.email-swipe-wrapper > .email-message-item {
  position: relative;
  z-index: 1;
  background: var(--email-row-bg, var(--sk-bg-surface));
  transition: transform 180ms ease;
}

.email-swipe-wrapper > .email-message-item.selected {
  background: var(--email-row-bg, var(--sk-accent-bg, rgba(var(--color-primary-rgb), 0.08)));
}

.email-sender-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}

@keyframes email-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 3-way view switcher: Indbakke / Svarfokus / Senere ──────────────── */
.email-view-switcher {
  display: inline-flex;
  background: #FBF8F2;
  border: 1px solid rgba(58, 47, 38, 0.08);
  border-radius: 12px;
  padding: 3px;
}
.email-view-switcher__btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 9px;
  font-family: var(--font-family, inherit);
  font-size: var(--font-size-base);
  /* 600 in BOTH states: weight is not transitionable, so a 500→600 swap made the
     label width kick mid-crossfade — the colour shift alone carries the emphasis */
  font-weight: 600;
  color: #9A8E82;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.email-view-switcher__icon { display: inline-flex; align-items: center; }
.email-view-switcher__icon svg { display: block; }
/* Fokus triage pill — sits where the row time would, in .email-message-meta.
   'Svar nu' (sage, confident) vs 'Måske' (muted, AI-resolved). Calm canon. */
.email-fokus-pill {
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.email-fokus-pill--now { color: #4A7A68; background: rgba(110, 138, 126, 0.14); }
.email-fokus-pill--maybe { color: #9A8E82; background: rgba(154, 142, 130, 0.12); }
[data-theme="dark"] .email-fokus-pill--now { color: #8FB7A6; background: rgba(110, 138, 126, 0.22); }
[data-theme="dark"] .email-fokus-pill--maybe { color: #B5A99D; background: rgba(255, 255, 255, 0.07); }
.email-view-switcher__btn:hover:not(.is-active) {
  background: rgba(228, 220, 212, 0.35);
  color: #5C4D43;
}
.email-view-switcher__btn.is-active {
  background: #6E8A7E;
  color: #FFFEFB;
  font-weight: 600;
}
.email-view-switcher__btn:active:not(.is-active) {
  background: rgba(228, 220, 212, 0.55);
}
/* Keyboard focus in the house language (Morten: no focus line — the global
   [role="tab"] reset suppresses outlines anyway): unselected tabs show the
   deepened hover tint; the active pill shows a quiet inner ivory hairline. */
.email-view-switcher__btn:focus-visible:not(.is-active) {
  background: rgba(228, 220, 212, 0.55);
  color: #5C4D43;
}
.email-view-switcher__btn.is-active:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 254, 251, 0.55);
}
/* Calm list-loading skeleton (Fokus / Senere): a reassuring caption above the
   inbox's pulsing ghost rows (.email-skeleton-row in email-base.css). Replaces
   the old hard .email-svarfokus-loading spinner so these views load like the
   inbox. */
.email-list-loading__caption {
  margin: 0;
  padding: 16px 20px 12px;
  color: var(--sk-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}
@media (prefers-reduced-motion: reduce) {
  /* Base selectors (NOT scoped to .email-list-loading) so the inbox's boot
     skeleton from ui.js showSkeletonLoading() — which renders .email-skeleton-row
     WITHOUT a .email-list-loading wrapper — is calmed too. The base pulse
     animation lives in email-base.css; this is its reduced-motion guard. */
  .email-skeleton-avatar,
  .email-skeleton-line {
    animation: none;
    opacity: 0.7;
  }
}
@media (max-width: 480px) {
  .email-view-switcher__btn { padding: 6px 12px; font-size: var(--font-size-sm); }
}
[data-theme="dark"] .email-view-switcher {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .email-view-switcher__btn {
  color: var(--color-text-tertiary, #9A8E82);
}
[data-theme="dark"] .email-view-switcher__btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary, #ccc);
}
[data-theme="dark"] .email-view-switcher__btn.is-active {
  /* Mortens dom 17/7: aktiv-pillen er HVID tekst på sage — samme identitet som
     alle fyldte primærkontroller (compose/Svar/bulk), også i dark. Panelets
     #90B4A4+mørk-ink-forslag revertet på hans ordre. */
  background: #6E8A7E;
  color: #fff;
}

/* ============================================================================
   Calm "all-clear" empty scene for Fokus + Senere.
   Ports the approved /chat/ "Ro i indbakken" meadow card (calm-brief2--done):
   a warm dawn surface with a single botanical focal point, a soft glow, distant
   flora and a full-width meadow. Fokus (all replied) shows an open bloom; Senere
   (nothing parked) shows a closed bud. Calm canon only (sage + warm + the gold
   flower-core); the card keeps its warm palette in dark mode — it never inverts.
   Everything visual is decorative (aria-hidden in markup, pointer-events:none).
   ========================================================================== */
/* Center the empty scene in the middle of the list instead of a full-width banner
   pinned to the top. Scoped via :has so it only triggers when the calm scene IS the
   list content — message rows and the other empty/loading states are unaffected. */
#email-list-items:has(> .email-calm-empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

/* The empty scene is FLAT — no filled card, border, or raised shadow. An empty
   state should read as "nothing to do here, rest", and a raised card reads as the
   opposite ("act on me"). So the bloom + text sit directly on the list background. */
.email-calm-empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 28px 24px;
  animation: email-fade-in 300ms ease;
}

.email-calm-empty__glow {
  position: absolute;
  left: 50%;
  top: 34px;
  transform: translateX(-50%);
  width: 240px;
  height: 150px;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(245, 206, 130, 0.34), rgba(245, 206, 130, 0) 72%);
  filter: blur(10px);
  opacity: 0.42;
}

.email-calm-empty__art {
  position: relative;
  z-index: 2;
  width: 76px;
  height: 100px;
  margin: 0 0 18px;
  transform-origin: 50% 100%;
  animation: emailCalmSway 6.5s ease-in-out infinite;
}

.email-calm-empty__art svg { display: block; width: 100%; height: 100%; }

.email-calm-empty__title {
  position: relative;
  z-index: 2;
  margin: 0 0 8px;
  font-size: var(--email-fs-heading);
  font-weight: 600;
  color: #3A2F26;
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.email-calm-empty__sub {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 380px;
  font-size: var(--email-fs-body-tight);
  line-height: 1.55;
  color: #6E5D50;
}

/* Meadow + distant flora belonged to the card "scene"; with the card gone the
   empty state is just the bloom + words, so the ground furniture is hidden. */
.email-calm-empty__meadow {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  line-height: 0;
  pointer-events: none;
}

.email-calm-empty__meadow svg { display: block; width: 100%; height: 50px; }

.email-calm-far { display: none; position: absolute; bottom: 32px; z-index: 1; pointer-events: none; line-height: 0; }
.email-calm-far--a { right: 15%; opacity: 0.34; }
.email-calm-far--b { right: 8.5%; opacity: 0.30; }
.email-calm-far--c { right: 24%; opacity: 0.22; }

@keyframes emailCalmSway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .email-calm-empty__art { animation: none; }
}

/* Dark mode: the scene is flat in both themes, so there is no dark card slab —
   only the title/sub/glow re-tune for the dark page; the bloom keeps its sage palette. */
[data-theme="dark"] .email-calm-empty__title { color: #FAF5EF; }
[data-theme="dark"] .email-calm-empty__sub { color: #A89B91; }
[data-theme="dark"] .email-calm-empty__glow { opacity: 0.45; }
[data-theme="dark"] .email-calm-empty .ec-meadow-back { fill: rgba(143, 165, 147, 0.10); }
[data-theme="dark"] .email-calm-empty .ec-meadow-front { fill: rgba(143, 165, 147, 0.16); }
[data-theme="dark"] .email-calm-empty .ec-hill { fill: rgba(143, 165, 147, 0.18); }
