/* ==========================================================================
   TempMail — UI Components & Widgets (With Dual Personal/Business System)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Dual-Category Switcher: Personal Mail vs. Education & Business Mail
   -------------------------------------------------------------------------- */
.mail-category-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 14px;
}

.section-toggle-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  text-align: left;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.section-toggle-btn:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.section-toggle-btn .section-icon {
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-surface-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: var(--transition);
}

.section-toggle-btn .section-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.section-toggle-btn .section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-toggle-btn .section-tagline {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Personal Active State */
.section-toggle-btn[data-section="personal"].active {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.25);
}

.section-toggle-btn[data-section="personal"].active .section-icon {
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border-color: #818cf8;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.section-toggle-btn[data-section="personal"].active .section-title {
  color: #818cf8;
}

/* Education & Business Active State */
.section-toggle-btn[data-section="education_business"].active {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.08) 100%);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
}

.section-toggle-btn[data-section="education_business"].active .section-icon {
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  border-color: #34d399;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.section-toggle-btn[data-section="education_business"].active .section-title {
  color: #10b981;
}

/* Active Section Badge inside address card */
.section-badge {
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-badge.section-personal {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.section-badge.section-business {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* --------------------------------------------------------------------------
   Address Hero Box & Action Toolbar
   -------------------------------------------------------------------------- */
.address-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: var(--transition);
}

.address-card:hover {
  border-color: var(--border-color-hover);
}

.address-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.address-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-dot-active {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
}

.lifespan-badge {
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.lifespan-badge.expiring-soon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger);
  animation: pulseUrgent 1s infinite alternate;
}

@keyframes pulseUrgent {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

.btn-extend-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-extend-badge:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.05);
}

.address-display-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  position: relative;
}

.email-address-text {
  flex: 1;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
  cursor: pointer;
}

.email-address-text.loading {
  color: var(--text-muted);
  font-style: italic;
  font-weight: normal;
  animation: pulseOpacity 1.5s infinite;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Button Variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-color-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-color-hover);
}

.btn-danger-outline {
  background: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-danger-outline:hover {
  background: var(--color-danger-bg);
}

.btn-copied {
  background-color: var(--color-success) !important;
  color: #ffffff !important;
  border-color: var(--color-success) !important;
}

.address-actions-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Folder Tabs Bar
   -------------------------------------------------------------------------- */
.folder-tabs-bar {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 8px;
  gap: 4px;
  overflow-x: auto;
}

.folder-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.folder-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.folder-tab-btn.active {
  color: var(--accent-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

/* Filter Chips */
.filter-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-top: 4px;
}

.filter-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.filter-chip.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Batch Action Bar */
.batch-action-bar {
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: toastSlideIn 0.2s ease;
}

.batch-count-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
}

.batch-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inbox-card-checkbox {
  cursor: pointer;
  accent-color: var(--accent-primary);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Inbox Column Header & Message List
   -------------------------------------------------------------------------- */
.inbox-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inbox-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 12px;
  color: var(--text-secondary);
}

.badge-count.has-unread {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.refresh-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-timer-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.icon-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.refresh-progress-track {
  height: 2px;
  background: var(--border-color);
  width: 100%;
  overflow: hidden;
}

.refresh-progress-bar {
  height: 100%;
  background: var(--accent-primary);
  transition: width 1s linear;
}

.search-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--border-color-focus);
  background: var(--bg-surface);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Messages List */
.inbox-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Empty Inbox State */
.empty-inbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 14px;
  margin: auto;
}

.radar-ping {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ping-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0;
  animation: radarWave 2.4s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.ping-2 {
  animation-delay: 1.2s;
}

@keyframes radarWave {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.radar-center {
  width: 46px;
  height: 46px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  z-index: 2;
  box-shadow: 0 0 16px var(--accent-glow);
}

.empty-inbox h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-inbox p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.5;
}

/* Message Card in List */
.inbox-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: var(--transition);
  position: relative;
}

.inbox-card:hover {
  background: var(--bg-surface-hover);
}

.inbox-card.selected {
  background: var(--bg-surface-elevated);
  border-left: 3px solid var(--accent-primary);
}

.card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.inbox-card.unread .card-avatar {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
}

.card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-card.unread .card-sender {
  font-weight: 700;
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-star-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.card-star-btn:hover {
  color: #f59e0b;
}

.card-star-btn.starred {
  color: #f59e0b;
}

.card-subject {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-card.unread .card-subject {
  color: var(--text-primary);
  font-weight: 600;
}

.card-snippet {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.inbox-card-otp {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-warning);
}

.attachment-pill {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Email Viewer Pane
   -------------------------------------------------------------------------- */
.empty-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.empty-viewer-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-viewer h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-viewer p {
  font-size: 14px;
  max-width: 360px;
  line-height: 1.5;
}

.email-viewer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.viewer-toolbar {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.viewer-actions-left, .viewer-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.viewer-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.viewer-btn.starred {
  color: #f59e0b;
  border-color: #f59e0b;
}

.viewer-btn.btn-danger:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* Export Dropdown */
.export-dropdown-wrapper {
  position: relative;
}

.export-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  z-index: 50;
  min-width: 170px;
  overflow: hidden;
}

.export-dropdown-menu.show {
  display: flex;
}

.export-menu-item {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.export-menu-item:hover {
  background: var(--bg-surface-hover);
  color: var(--accent-primary);
}

/* Viewer Header */
.viewer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.viewer-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.viewer-subject {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.viewer-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-score-pill {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.word-count-badge {
  font-size: 11px;
  color: var(--text-muted);
}

.viewer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sender-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.sender-info {
  flex: 1;
  min-width: 0;
}

.sender-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sender-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sender-email {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.recipient-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.message-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Security Alert */
.security-warning-banner {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  color: var(--color-warning);
  padding: 10px 16px;
  margin: 12px 20px 0 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

/* OTP Detection Banner */
.otp-banner {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  margin: 12px 20px 0 20px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.otp-badge-icon {
  color: var(--accent-primary);
  display: flex;
}

.otp-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.otp-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.otp-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text-primary);
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-primary);
}

.copy-otp-btn {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  font-weight: 600;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.copy-otp-btn:hover {
  background: var(--accent-primary-hover);
}

/* Extracted Links Card */
.extracted-links-card {
  margin: 12px 20px 0 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.extracted-links-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.extracted-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.extracted-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.link-url-text {
  font-size: 12px;
  color: var(--accent-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-url-text:hover {
  text-decoration: underline;
}

/* Viewer Tabs */
.viewer-tabs {
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.viewer-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.viewer-tab:hover {
  color: var(--text-primary);
}

.viewer-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Viewer Body */
.viewer-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  background-color: #ffffff;
}

.tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.tab-pane.active {
  display: block;
}

.email-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.plain-text-content, .raw-headers-content {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #1e293b;
  background: #ffffff;
}

/* Attachments */
.email-attachments {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 10px 20px;
  flex-shrink: 0;
}

.attachments-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.attachment-name {
  font-weight: 600;
  color: var(--text-primary);
}

.attachment-size {
  color: var(--text-muted);
}

.attachment-download-btn {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Modals & Forms
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-card.modal-lg {
  max-width: 640px;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  font-family: var(--font-sans);
}

.form-textarea {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  font-family: var(--font-sans);
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-color-focus);
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* Plus Addressing & Aliases */
.custom-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alias-prefix, .alias-domain {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.alias-presets-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 12px;
  color: var(--text-muted);
}

.tag-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
}

.tag-chip:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.alias-result-box {
  margin-top: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}

/* Developer Snippets */
.api-snippet-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.snippet-header {
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.copy-snippet-btn {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.snippet-code {
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  overflow-x: auto;
  line-height: 1.5;
}

/* QR Code Modal Content */
.qr-canvas-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 0 auto 16px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-address-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  display: inline-block;
}

.text-center {
  text-align: center;
}

/* Test Email Simulator Grid */
.test-templates-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-template-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.test-template-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.test-template-icon {
  font-size: 26px;
}

.test-template-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.test-template-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.history-item.active {
  border-color: var(--accent-primary);
}

.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item-address {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.history-item-date {
  font-size: 10px;
  color: var(--text-muted);
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-active {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-success);
  background: var(--color-success-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Keyboard Shortcuts Grid */
.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

kbd {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  color: var(--text-primary);
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast-hiding {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-success .toast-icon { color: var(--color-success); }

.toast-error { border-left: 4px solid var(--color-danger); }
.toast-error .toast-icon { color: var(--color-danger); }

.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-warning .toast-icon { color: var(--color-warning); }

.toast-info { border-left: 4px solid var(--accent-primary); }
.toast-info .toast-icon { color: var(--accent-primary); }

.toast-message {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.toast-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Pro Tools Quick Access Bar
   -------------------------------------------------------------------------- */
.pro-tools-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

.pro-tools-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 4px;
}

.pro-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pro-tool-pill:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px var(--accent-glow);
}

.pro-tool-icon {
  font-size: 13px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Dual-Mailbox Multi-Grid Dashboard View
   -------------------------------------------------------------------------- */
.dual-toggle-btn {
  border-style: dashed;
}

.dual-toggle-btn.active {
  border-style: solid;
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
}

.dual-dashboard-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
  margin-bottom: 24px;
}

.dual-column-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: calc(100vh - 270px);
  min-height: 520px;
}

.dual-personal-column {
  border-top: 3px solid #3b82f6;
}

.dual-business-column {
  border-top: 3px solid #8b5cf6;
}

.dual-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dual-column-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dual-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dual-address-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 10px;
}

.dual-address-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dual-column-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.icon-btn-sm {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn-sm:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.dual-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dual-msg-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dual-msg-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dual-msg-card.unread {
  border-left: 3px solid var(--accent-primary);
}

.dual-msg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dual-msg-from {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.dual-msg-date {
  font-size: 11px;
  color: var(--text-muted);
}

.dual-msg-subject {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.dual-msg-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dual-msg-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.dual-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}

.dual-empty-state svg {
  opacity: 0.4;
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   Creator Portfolio Badge & Header Link
   -------------------------------------------------------------------------- */
.creator-portfolio-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 5px 12px 5px 6px;
  border-radius: 9999px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.creator-portfolio-badge:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
  color: var(--accent-primary);
}

.creator-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.creator-name {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Instant Hero OTP Alert Banner
   -------------------------------------------------------------------------- */
.quick-otp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 185, 129, 0.06));
  border: 1.5px solid var(--color-success);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-top: 10px;
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.15);
  animation: otpPulseSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes otpPulseSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-otp-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-otp-badge-pulse {
  display: inline-flex;
  align-items: center;
  background: var(--color-success);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
  50% { transform: scale(1.04); box-shadow: 0 0 16px rgba(34, 197, 94, 0.85); }
  100% { transform: scale(1); box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
}

.quick-otp-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px dashed var(--color-success);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.quick-otp-source {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

.quick-otp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Domain Quick Selector & Quick Rate Dropdown
   -------------------------------------------------------------------------- */
.domain-quick-selector {
  display: flex;
  align-items: center;
}

.inline-domain-dropdown {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.inline-domain-dropdown:hover,
.inline-domain-dropdown:focus {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.quick-rate-dropdown {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.quick-rate-dropdown:hover,
.quick-rate-dropdown:focus {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Application Footer
   -------------------------------------------------------------------------- */
.app-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 14px 24px;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-wrap {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-brand {
  color: var(--text-primary);
  font-size: 13px;
}

.footer-sep {
  color: var(--border-color);
}

.footer-cf-badge {
  background: rgba(246, 130, 31, 0.12);
  color: #f6821f;
  border: 1px solid rgba(246, 130, 31, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.footer-author-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-author-link:hover {
  text-decoration: underline;
}

.footer-portfolio-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 9999px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  transition: var(--transition);
}

.footer-portfolio-pill:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-hover);
  color: var(--accent-primary);
}


