.ea-page { background: #f1f5f9; }

.ea-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ea-lang-switch {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 2px;
}

.ea-lang-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
}

.ea-lang-btn.active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.ea-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  opacity: 0.6;
}

.ea-mode-pill.active { opacity: 1; background: #dcfce7; color: #15803d; }
.ea-mode-pill.ea-mode-sim.active { background: #fef3c7; color: #b45309; }

.ea-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.ea-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px 8px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.ea-tab:hover { color: #4f46e5; background: #f8fafc; }
.ea-tab.active { color: #4f46e5; border-bottom-color: #4f46e5; font-weight: 600; }

.ea-panel { display: none; flex-direction: column; height: calc(100vh - 96px); min-height: 0; overflow: hidden; }
.ea-panel.active { display: flex; }

/* Two columns: left rail (nav + list + compose) | reader-only right */
.ea-app {
  display: grid;
  grid-template-columns: var(--ea-left-col-w, minmax(340px, 44%)) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  gap: 0;
  background: #f1f5f9;
}

.ea-left-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}

.ea-left-main {
  display: grid;
  grid-template-columns: var(--ea-folders-w, 168px) minmax(0, 1fr);
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.ea-app.ea-folders-collapsed {
  --ea-folders-w: 0px;
}

.ea-app.ea-folders-collapsed .ea-pane-folders {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border: none;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.ea-app.ea-threads-narrow {
  --ea-left-col-w: minmax(300px, 38%);
}

.ea-app.ea-read-focus {
  --ea-folders-w: 0px;
  --ea-left-col-w: minmax(260px, 30%);
}

.ea-app.ea-read-focus .ea-pane-folders {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border: none;
  opacity: 0;
  pointer-events: none;
}

.ea-col-resizer {
  width: 5px;
  margin: 0 -2px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  grid-column: auto;
  align-self: stretch;
}

.ea-col-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: #e2e8f0;
  transition: background 0.15s, width 0.15s, left 0.15s;
}

.ea-col-resizer:hover::after,
.ea-col-resizer.ea-resizing::after {
  left: 1px;
  width: 3px;
  background: #818cf8;
}

.ea-app.ea-resizing {
  cursor: col-resize;
  user-select: none;
}

.ea-app.ea-resizing * {
  cursor: col-resize !important;
}

.ea-app.ea-compose-hidden .ea-right-stack .ea-compose { display: none; }

.ea-right-stack {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ea-pane-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ea-pane-title-wrap span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ea-pane {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e2e8f0;
}

.ea-pane:last-child {
  border-right: none;
}

.ea-left-col .ea-pane {
  border-right: 1px solid #e2e8f0;
}

.ea-left-col .ea-pane-threads {
  border-right: none;
}

.ea-pane-head {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.ea-folder-list {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.ea-folder-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  color: #334155;
}

.ea-folder-btn:hover {
  background: #f1f5f9;
}

.ea-folder-btn.active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

.ea-folder-count {
  font-size: 0.75rem;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: 999px;
}

.ea-folder-btn.active .ea-folder-count {
  background: #c7d2fe;
}

.ea-label-chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin: 2px 4px 2px 0;
}

.ea-thread-list-head .ea-select-all-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.ea-bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ea-bulk-actions[hidden] {
  display: none !important;
}

.ea-selection-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-right: 4px;
  white-space: nowrap;
}

.ea-thread-check {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
  cursor: pointer;
  flex-shrink: 0;
}

.ea-thread-list {
  overflow-y: auto;
  flex: 1;
}

.ea-thread-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.1s;
}

.ea-thread-row.selected {
  background: #f1f5f9;
}

.ea-thread-row-body {
  flex: 1;
  min-width: 0;
}

.ea-thread-row:hover {
  background: #f8fafc;
}

.ea-thread-row.active {
  background: #eef2ff;
  border-left: 3px solid #4f46e5;
}

.ea-thread-row.unread .ea-thread-subject {
  font-weight: 700;
}

.ea-thread-subject {
  font-size: 0.875rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ea-thread-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ea-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.ea-badge-high { background: #fee2e2; color: #b91c1c; }
.ea-badge-sla { background: #ffedd5; color: #c2410c; }
.ea-badge-payment { background: #dbeafe; color: #1d4ed8; }

.ea-pane-reader {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.ea-pane-reader .ea-pane-head {
  flex-shrink: 0;
}

/* Reader column: only email preview — meta fixed, body scrolls inside viewport */
.ea-pane-reader .ea-reader {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #e8edf2;
}

.ea-reader-shell {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ea-reader-meta {
  padding: 10px 16px 8px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ea-reader-subject {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #0f172a;
  line-height: 1.3;
}

.ea-email-viewport {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #e8edf2;
  -webkit-overflow-scrolling: touch;
}

.ea-email-preview {
  display: block;
  width: 100%;
}

.ea-thread-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.ea-thread-count {
  font-size: 0.75rem;
  color: #64748b;
}

.ea-thread-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 24px;
}

.ea-msg-card {
  background: #fff;
  border: 1px solid #d1d9e6;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.ea-msg-card:hover {
  border-color: #a5b4fc;
}

.ea-msg-card.ea-msg-selected {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.ea-msg-card.ea-msg-unread .ea-msg-card-head {
  border-left: 3px solid #4f46e5;
}

.ea-msg-card-head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}

.ea-msg-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.ea-msg-payment {
  margin-top: 6px;
  font-size: 0.8125rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ea-thread-history .ea-email-iframe-wrap {
  padding: 8px 12px 16px;
  min-height: 0;
}

.ea-msg-card-body .ea-email-iframe-wrap {
  padding: 8px 12px 16px;
  min-height: 0;
}

.ea-email-iframe-wrap {
  padding: 16px 20px 28px;
  min-height: 100%;
  box-sizing: border-box;
}

.ea-email-iframe {
  display: block;
  width: 100%;
  border: 1px solid #d1d9e6;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.ea-left-col .ea-reader-footer {
  flex-shrink: 0;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  max-height: min(28vh, 200px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ea-reader-footer[hidden] {
  display: none !important;
}

.ea-reader-footer.ea-conv-collapsed .ea-conv-list {
  display: none;
}

.ea-conversation {
  background: #fff;
}

.ea-conversation-head {
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  background: #fff;
}

.ea-conversation-head:hover {
  background: #f8fafc;
  color: #4f46e5;
}

.ea-conv-toggle {
  border: none;
  background: transparent;
  font-size: 0.7rem;
  color: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.ea-left-col .ea-conv-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.ea-reader-from {
  font-size: 0.8125rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.ea-reader-date { color: #94a3b8; font-size: 0.75rem; }

.ea-reader-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0 2px;
}

.ea-dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
}
.ea-dir-badge i { width: 13px; height: 13px; }
.ea-dir-in { background: #eef2ff; color: #4f46e5; }
.ea-dir-out { background: #ecfdf5; color: #059669; }

.ea-ds-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.ea-ds-ok { background: #dcfce7; color: #15803d; }
.ea-ds-warn { background: #fef3c7; color: #b45309; }
.ea-ds-err { background: #fee2e2; color: #b91c1c; }

.ea-conv-item {
  padding: 10px 16px;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: background 0.1s;
}

.ea-conv-item:hover { background: #f8fafc; }
.ea-conv-item.active { background: #eef2ff; border-left: 3px solid #4f46e5; }
.ea-conv-item.unread { font-weight: 600; }

.ea-conv-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ea-conv-who {
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.ea-conv-date { color: #94a3b8; font-size: 0.72rem; flex: 0 0 auto; }
.ea-conv-line .ea-ds-pill { flex: 0 0 auto; }

.ea-conv-dir {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #4f46e5;
  flex: 0 0 auto;
}
.ea-conv-dir.outbound { color: #059669; }

.ea-thread-snippet {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ea-thread-row.starred .ea-thread-subject::before {
  content: '★ ';
  color: #f59e0b;
}

.ea-view-toggle {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.ea-view-toggle button {
  border: none;
  background: #fff;
  padding: 4px 10px;
  font-size: 0.7rem;
  cursor: pointer;
  color: #64748b;
}
.ea-view-toggle button.active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

/* Right pane: reader OR full-height compose (toggle) */
.ea-right-stack .ea-compose {
  display: none;
  flex: 1 1 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  padding: 16px 20px 14px;
}

.ea-app:not(.ea-compose-hidden) .ea-right-stack .ea-reader {
  display: none;
}

.ea-app:not(.ea-compose-hidden) .ea-right-stack .ea-compose {
  display: flex;
}

.ea-compose-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ea-compose-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.ea-compose-label .ea-input {
  margin-top: 0;
  font-weight: 400;
  font-size: 0.875rem;
}

.ea-compose-split {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 10px 0 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.ea-compose-reply {
  flex: 0 0 42%;
  min-height: 120px;
  max-height: 48%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.ea-compose-label-reply {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
}

.ea-compose-label-reply textarea {
  flex: 1 1 0;
  min-height: 0;
  margin-top: 6px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.65;
  resize: none;
  overflow-y: auto;
  background: #fafbfc;
  color: #0f172a;
}

.ea-compose-label-reply textarea:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: #fff;
}

.ea-compose-quote {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eef2f6;
}

.ea-compose-quote[hidden] {
  display: none !important;
}

.ea-compose-quote-head {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ea-compose-quote-head::before {
  content: '↳ ';
  color: #64748b;
}

.ea-compose-quote-viewport {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #e8edf2;
}

.ea-compose-quote-viewport .ea-email-iframe-wrap {
  padding: 12px 16px 20px;
}

.ea-compose-quote-viewport .ea-email-iframe {
  border-color: #cbd5e1;
  box-shadow: none;
}

.ea-right-stack .ea-compose-actions {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

.ea-pane-threads {
  position: relative;
}

.ea-pane-threads .ea-col-resizer {
  position: absolute;
  right: -3px;
  top: 0;
  bottom: 0;
  width: 7px;
  z-index: 6;
}

.ea-timeline {
  margin-top: 20px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.ea-timeline-item {
  font-size: 0.75rem;
  color: #64748b;
  padding: 6px 0;
  border-left: 2px solid #e2e8f0;
  padding-left: 10px;
  margin-left: 4px;
}

.ea-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ea-inbox-dash {
  flex-shrink: 0;
  padding: 12px 14px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  animation: ea-inbox-dash-in 0.2s ease-out;
}

.ea-inbox-dash--hidden {
  display: none;
}

@keyframes ea-inbox-dash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ea-inbox-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ea-inbox-dash-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ea-inbox-dash-meta {
  margin-top: 10px;
  padding: 14px 16px;
}

#btnToggleInboxDash.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.ea-search {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8125rem;
}

.ea-summary-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
}

.ea-empty {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

.ea-att-list {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ea-att-chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: #f1f5f9;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  color: #4f46e5;
}

.ea-wrap { padding: 20px; max-width: 1400px; margin: 0 auto; width: 100%; overflow-y: auto; flex: 1; }

.ea-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.ea-dash-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 12px;
}

.ea-dash-section-title + .ea-kpi-row {
  margin-bottom: 16px;
}

.ea-dash-section-title:not(:first-child) {
  margin-top: 24px;
}

.ea-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ea-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.ea-kpi-icon {
  width: 36px; height: 36px;
  margin: 0 auto 8px;
  background: #eef2ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
}

.ea-kpi-lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; font-weight: 600; }
.ea-kpi-val { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin-top: 4px; }
.ea-kpi-ok .ea-kpi-icon { background: #dcfce7; color: #15803d; }
.ea-kpi-accent .ea-kpi-icon { background: #e0e7ff; color: #4338ca; }
.ea-kpi-warn .ea-kpi-icon { background: #fef3c7; color: #b45309; }
.ea-kpi-err .ea-kpi-icon { background: #fee2e2; color: #b91c1c; }

.ea-exec-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.ea-exec-card h3 { margin: 0 0 16px; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.ea-exec-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.ea-exec-stat span { display: block; font-size: 0.75rem; color: #64748b; }
.ea-exec-stat strong { font-size: 1.25rem; color: #0f172a; }

.ea-leads-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 12px;
  padding: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ea-leads-table-wrap { overflow: auto; flex: 1; min-height: 0; }
.ea-lead-detail { overflow-y: auto; }

.ea-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.ea-table th { text-align: left; padding: 10px 12px; background: #f8fafc; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.ea-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.ea-lead-row { cursor: pointer; }
.ea-lead-row:hover { background: #f8fafc; }
.ea-lead-row.active { background: #eef2ff; }

.ea-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  text-transform: capitalize;
}

.ea-lead-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ea-lead-detail-head h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.ea-lead-meta { font-size: 0.8125rem; color: #475569; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ea-lead-meta div { display: flex; align-items: center; gap: 6px; }
.ea-lead-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.ea-timeline-list { display: flex; flex-direction: column; gap: 6px; }
.ea-timeline-entry { display: flex; justify-content: space-between; font-size: 0.75rem; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.ea-tl-type { font-weight: 600; color: #4f46e5; text-transform: capitalize; }

.ea-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.ea-modal.hidden { display: none; }
.ea-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.4); }
.ea-modal-card { position: relative; background: #fff; border-radius: 12px; width: 90%; max-width: 560px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.ea-modal-lg { max-width: 720px; }
.ea-modal-head { padding: 14px 18px; border-bottom: 1px solid #e2e8f0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ea-modal-close { margin-left: auto; border: none; background: none; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }
.ea-modal-body { padding: 18px; overflow-y: auto; }
.ea-modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

.ea-demo-intro { margin: 0 0 12px; font-weight: 500; color: #0f172a; }
.ea-demo-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ea-demo-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; font-size: 0.875rem; }
.ea-demo-steps { margin: 0 0 12px; padding-left: 1.25rem; color: #334155; font-size: 0.875rem; line-height: 1.6; }
.ea-demo-sim-hint { display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
.ea-demo-actions { justify-content: flex-start; flex-wrap: wrap; }

.ea-fulltest-card { border-color: #c7d2fe; background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%); }
.ea-fulltest-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ea-fulltest-step {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.ea-fulltest-step.ok { border-color: #bbf7d0; background: #f0fdf4; }
.ea-fulltest-step.err { border-color: #fecaca; background: #fef2f2; }
.ea-fulltest-step-icon { display: flex; color: #64748b; }
.ea-fulltest-step.ok .ea-fulltest-step-icon { color: #15803d; }
.ea-fulltest-step.err .ea-fulltest-step-icon { color: #b91c1c; }
.ea-fulltest-step-lbl { font-weight: 600; color: #0f172a; }
.ea-fulltest-step-detail { color: #64748b; font-size: 0.8125rem; text-align: right; }
.ea-fulltest-errors { margin: 0 0 12px; padding-left: 1.25rem; font-size: 0.8125rem; color: #b91c1c; }
.ea-fulltest-err { display: flex; align-items: center; gap: 8px; color: #b91c1c; font-weight: 500; }
.ea-fulltest-live-hint { display: flex; align-items: center; gap: 6px; }

.ea-textarea, .ea-input, .ea-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  margin-top: 4px;
}

.ea-label { display: block; margin-bottom: 12px; font-size: 0.8125rem; font-weight: 500; }
.ea-hint { font-size: 0.75rem; color: #64748b; margin-bottom: 8px; }
.ea-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; background: #f1f5f9; margin-right: 6px; }
.ea-chip.ok { background: #dcfce7; color: #15803d; }
.ea-chip.warn { background: #fef3c7; color: #b45309; }
.ea-chip.err { background: #fee2e2; color: #b91c1c; }

.ea-fit-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.ea-fit-high { background: #dcfce7; color: #15803d; }
.ea-fit-medium { background: #dbeafe; color: #1d4ed8; }
.ea-fit-low { background: #fef3c7; color: #b45309; }
.ea-fit-reject { background: #fee2e2; color: #b91c1c; }
.ea-fit-unknown { background: #f1f5f9; color: #64748b; }
.ea-fit-clickable {
  cursor: pointer;
  border: none;
  font: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.ea-fit-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.ea-fit-branch-hint {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  vertical-align: middle;
}
.ea-fit-explain-headline {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: #0f172a;
}
.ea-fit-explain-section { margin: 14px 0; }
.ea-fit-explain-section h5 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.ea-branch-card {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.ea-branch-card.ea-branch-best {
  border-color: #93c5fd;
  background: #eff6ff;
}
.ea-branch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ea-enrichment-block { margin: 12px 0 20px; padding: 12px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.ea-enrichment-score { margin-bottom: 8px; }
.ea-enrichment-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.85rem; margin: 8px 0; }
.ea-enrichment-dl dt { color: #64748b; font-weight: 500; }
.ea-claims-list { margin: 6px 0; padding-left: 18px; font-size: 0.82rem; }
.ea-claim-positive { color: #15803d; }
.ea-claim-negative { color: #b91c1c; }
.ea-claim-neutral { color: #334155; }
.ea-claim-cat { font-size: 0.75rem; color: #64748b; }
.ea-red-flags { margin: 6px 0; padding-left: 18px; color: #b91c1c; font-size: 0.82rem; }
.ea-red-label { color: #b91c1c !important; }
.ea-warn-text { color: #b45309; }
.ea-filter-check { font-size: 0.85rem; display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.ea-reasoning { font-style: italic; }

@keyframes ea-spin {
  to { transform: rotate(360deg); }
}
.ea-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ea-spin 0.65s linear infinite;
  vertical-align: -0.12em;
  flex-shrink: 0;
}
.ea-spinner-lg {
  width: 2.25rem;
  height: 2.25rem;
  border-width: 3px;
}
.ea-btn-loading { pointer-events: none; opacity: 0.88; }
.ea-modal-card { position: relative; }
.ea-modal-busy-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 20;
  border-radius: inherit;
  padding: 24px;
  text-align: center;
}
.ea-modal-busy-text {
  margin: 0;
  font-size: 0.95rem;
  color: #334155;
  max-width: 320px;
  line-height: 1.5;
}
.ea-status-loading { color: #64748b; }

.ea-global-action-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(90deg, #312e81 0%, #4f46e5 50%, #6366f1 100%);
  color: #fff;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.28);
}
.ea-global-action-bar.hidden { display: none; }
.ea-global-action-bar .ea-spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-right-color: transparent;
}

.ea-panel-busy { position: relative; }
.ea-panel-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #475569;
  backdrop-filter: blur(2px);
}
.ea-thread-list.ea-panel-busy,
.ea-reader.ea-panel-busy,
.ea-leads-layout.ea-panel-busy,
.ea-lead-detail.ea-panel-busy,
.ea-setup-grid.ea-panel-busy,
#repliesList.ea-panel-busy,
#dashboardKpis.ea-panel-busy {
  min-height: 80px;
}

.ea-import-summary { margin-bottom: 12px; }
.ea-import-preview { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; font-size: 0.8125rem; }
.ea-import-preview li { padding: 6px 0; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 6px; }

.ea-setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-content: start; }
.ea-setup-card h3 { margin: 0 0 12px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.ea-setup-wide { grid-column: span 1; }
.ea-setup-full { grid-column: 1 / -1; }
.ea-switch-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.875rem; }
.ea-setup-row { display: flex; gap: 8px; margin-top: 12px; }
.ea-setup-save-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding-top: 8px; }

.ea-danger-zone {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
}
.ea-danger-zone h3 { color: #b91c1c; }
.ea-danger-check { color: #991b1b; font-weight: 500; }
.ea-danger-zone code {
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.ea-danger-zone .btn-danger {
  margin-top: 12px;
  background: #dc2626;
  color: #fff;
  border: none;
  font-weight: 600;
}
.ea-danger-zone .btn-danger:hover:not(:disabled) { background: #b91c1c; }
.ea-danger-zone .btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
.ea-tpl-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.ea-tpl-tab { border: 1px solid #e2e8f0; background: #fff; padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 0.75rem; }
.ea-tpl-tab.active { background: #eef2ff; border-color: #4f46e5; color: #4f46e5; }

.ea-reply-card { margin-bottom: 16px; }
.ea-reply-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ea-reply-subject { font-weight: 600; margin-bottom: 8px; }
.ea-reply-body { font-size: 0.875rem; line-height: 1.5; color: #334155; max-height: 200px; overflow-y: auto; }
.ea-reply-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ea-reply-instruction { margin-top: 8px; }

.ea-status-line { font-size: 0.75rem; color: #64748b; margin-left: auto; }
.ea-head-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ea-head-actions .btn-icon.active { background: #eef2ff; color: #4f46e5; }
.btn-icon { padding: 6px 8px; }
.btn-sm { font-size: 0.75rem; padding: 4px 10px; }
.btn-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.ea-compose-actions { display: flex; gap: 8px; margin-top: 8px; }
.ea-email-cell {
  font-size: 0.8125rem;
  word-break: break-all;
}

.ea-email-cell a {
  color: #4f46e5;
  text-decoration: none;
}

.ea-email-cell a:hover {
  text-decoration: underline;
}

.ea-hint-sm {
  font-size: 0.75rem;
  color: #94a3b8;
}

.ea-actions-cell { white-space: nowrap; }
.btn-icon-primary { color: #4f46e5; }
.btn-icon-primary:hover { background: #eef2ff; }
.ea-empty-sm { color: #94a3b8; font-size: 0.75rem; }
.ea-range { width: 100%; }

@media (max-width: 960px) {
  .ea-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 42vh) minmax(50vh, 1fr);
  }
  .ea-left-col {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  .ea-app.ea-folders-collapsed .ea-pane-folders,
  .ea-app.ea-read-focus .ea-pane-folders {
    display: none;
  }
  .ea-pane-threads .ea-col-resizer { display: none; }
  .ea-pane-reader { min-height: 0; }
  .ea-leads-layout { grid-template-columns: 1fr; }
  .ea-panel { height: auto; min-height: calc(100vh - 100px); }
}
