/* ─── Reset ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Dark Mode (default) ───────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg: #060b14;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #f0f4ff;
  --text-muted: #7d8ba3;
  --text-dim: #4a5568;
  --th-bg: rgba(99, 102, 241, 0.12);
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.15);
  --red: #f43f5e;
  --red-dim: rgba(244, 63, 94, 0.15);
  --yellow: #f59e0b;
  --orb-opacity: 0.18;
  --header-bg: rgba(6, 11, 20, 0.6);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ─── Light Mode ─────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f0f4ff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-hover: rgba(255, 255, 255, 0.95);
  --border: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.35);
  --text: #1a1f36;
  --text-muted: #4a5568;
  --text-dim: #8492a6;
  --th-bg: rgba(99, 102, 241, 0.08);
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-glow: rgba(79, 70, 229, 0.25);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.12);
  --red: #e11d48;
  --red-dim: rgba(225, 29, 72, 0.1);
  --yellow: #d97706;
  --orb-opacity: 0.08;
  --header-bg: rgba(240, 244, 255, 0.85);
  --shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ─── Background Orbs ───────────────────────────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: var(--orb-opacity);
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
  transition: opacity 0.4s;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-2);
  bottom: 100px;
  left: -150px;
  animation-delay: 4s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: #06b6d4;
  top: 40%;
  left: 40%;
  animation-delay: 8s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1)
  }

  50% {
    transform: translateY(-30px) scale(1.05)
  }
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  transition: background 0.3s, border-color 0.3s;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Theme Toggle Button */
.theme-btn {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
}

.theme-btn svg {
  width: 16px;
  height: 16px;
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 72px 20px 40px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: 0.6;
    transform: scale(0.85)
  }
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

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

.form-card {
  padding: 36px;
  margin-bottom: 24px;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.required {
  color: var(--accent);
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8em;
}

.field-hint {
  font-size: 0.77rem;
  color: var(--text-dim);
  margin-top: 6px;
  display: block;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon svg {
  width: 100%;
  height: 100%;
}

.input-wrapper input {
  width: 100%;
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 13px 16px 13px 44px;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.input-wrapper input::placeholder {
  color: var(--text-dim);
}

.input-wrapper input:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.07);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.btn-submit {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-text,
.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Error Banner ───────────────────────────────────────────────────────── */
.error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--red-dim);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  color: #fca5a5;
  font-size: 0.9rem;
  margin-bottom: 24px;
  animation: slideIn 0.3s ease;
}

.error-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--red);
}

/* ─── Progress ───────────────────────────────────────────────────────────── */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  backdrop-filter: blur(20px);
}

.progress-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.4s;
}

.step.active {
  color: var(--text);
}

.step.done {
  color: var(--green);
}

.step-dot {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s;
}

.step-dot svg {
  width: 16px;
  height: 16px;
}

.step.active .step-dot {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  animation: stepPulse 1.5s ease-in-out infinite;
}

.step.done .step-dot {
  background: var(--green-dim);
  border-color: var(--green);
}

@keyframes stepPulse {

  0%,
  100% {
    box-shadow: 0 0 8px var(--accent-glow)
  }

  50% {
    box-shadow: 0 0 20px var(--accent-glow)
  }
}

/* ─── Stats Bar ──────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  animation: slideIn 0.4s ease;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.stat-chip svg {
  width: 14px;
  height: 14px;
}

.stat-chip.highlight {
  background: var(--green-dim);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-weight: 600;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.tab svg {
  width: 14px;
  height: 14px;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 600;
}

/* ─── Tender Cards ───────────────────────────────────────────────────────── */
#tenders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tender-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  backdrop-filter: blur(20px);
  transition: border-color 0.3s, transform 0.25s, box-shadow 0.25s;
  animation: slideIn 0.4s ease both;
}

.tender-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.tender-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.score-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  border: 2px solid;
}

.score-high {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.score-mid {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(245, 158, 11, 0.12);
}

.score-low {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}

.score-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 3px;
  text-align: center;
}

.tender-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.tender-id {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
  font-family: monospace;
}

.tender-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.meta-pill svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.fit-bars {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.fit-bar-item {
  flex: 1;
}

.fit-bar-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.fit-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.fit-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fit-bar-fill.sector {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.fit-bar-fill.business {
  background: linear-gradient(90deg, var(--green), #34d399);
}

.tender-reason {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tender-reason strong {
  color: var(--text);
  font-weight: 500;
}

/* ─── Profile Panel ──────────────────────────────────────────────────────── */
.profile-card {
  padding: 30px;
}

.profile-section {
  margin-bottom: 24px;
}

.profile-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.profile-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
}

.tag.green {
  background: var(--green-dim);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--green);
}

/* ─── Email Panel ────────────────────────────────────────────────────────── */
.email-card {
  padding: 30px;
}

.email-header {
  margin-bottom: 18px;
}

.email-subject-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.email-subject-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.email-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 18px;
}

.email-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 18px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-copy svg {
  width: 14px;
  height: 14px;
}

.btn-copy:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.btn-copy.copied {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-dim);
}

.btn-copy-rich {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--accent);
}

.btn-copy-rich:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--text);
}

/* Email body rendered HTML */
.email-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.email-body p {
  margin-bottom: 14px;
}

.email-body br {
  line-height: 1;
}

.email-body strong,
.email-body b {
  color: var(--text);
  font-weight: 600;
}

.email-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.87rem;
}

.email-body th,
.email-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  color: var(--text-muted);
}

.email-body th {
  background: var(--th-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.email-body td:first-child {
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--accent);
  white-space: nowrap;
}

/* Plain text fallback */
.email-pre {
  font-family: 'Inter', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Keywords Panel ─────────────────────────────────────────────────────── */
.keywords-card {
  padding: 30px;
}

.keywords-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.keywords-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-chip {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideIn 0.3s ease both;
}

.keyword-chip::before {
  content: '#';
  opacity: 0.5;
}

/* ─── New Search Button ──────────────────────────────────────────────────── */
.new-search-wrap {
  text-align: center;
  margin-top: 36px;
}

.btn-new-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 28px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-new-search svg {
  width: 16px;
  height: 16px;
}

.btn-new-search:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@media (max-width: 600px) {
  .header {
    padding: 16px 20px;
  }

  .nav-badge {
    display: none;
  }

  .form-card {
    padding: 24px 20px;
  }

  .hero {
    padding: 48px 20px 28px;
  }

  .stats-bar {
    gap: 7px;
  }

  .tabs {
    gap: 2px;
  }

  .tab {
    font-size: 0.75rem;
    padding: 8px 10px;
  }

  .fit-bars {
    flex-direction: column;
    gap: 8px;
  }

  .email-actions {
    flex-direction: column;
  }
}

/* ─── Global SVG Icon Safeguard ───────────────────────────────────────────── */
.customizer-title svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  color: var(--accent);
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-toggle-reorder svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-toggle-reorder .chevron {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  transition: transform 0.25s ease;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-toggle-reorder .chevron.open {
  transform: rotate(180deg);
}

/* ─── Email Customizer & Sequence Manager ───────────────────────────────── */
.email-customizer-card {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.customizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.customizer-title-wrap {
  flex: 1;
  min-width: 260px;
}

.customizer-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
}

.customizer-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.btn-toggle-reorder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-reorder:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.count-selector-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.count-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}

.count-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.count-pill {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.count-pill:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.count-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.custom-count-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: auto;
}

.custom-count-wrap input {
  width: 52px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.custom-count-wrap input:focus {
  border-color: var(--accent);
}

/* Collapsible Reorder Section */
.reorder-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  animation: fadeIn 0.25s ease-out;
}

.reorder-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.reorder-hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reorder-hint svg {
  width: 15px !important;
  height: 15px !important;
  color: var(--accent);
}

.btn-reset-order {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-order:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-reset-order svg {
  width: 13px !important;
  height: 13px !important;
}

/* Reorder List Items */
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.reorder-list::-webkit-scrollbar {
  width: 6px;
}

.reorder-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.reorder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s ease;
  user-select: none;
}

.reorder-item.item-included {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.04);
}

.reorder-item.item-excluded {
  opacity: 0.6;
  border-style: dashed;
  background: rgba(0, 0, 0, 0.1);
}

.reorder-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.reorder-item.dragging {
  opacity: 0.35;
  background: var(--surface);
  border-color: var(--accent);
}

.reorder-item.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-2px);
}

.reorder-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 2px;
}

.reorder-drag-handle:active {
  cursor: grabbing;
}

.reorder-drag-handle svg {
  width: 16px !important;
  height: 16px !important;
}

.reorder-rank {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
}

.reorder-rank.rank-active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

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

.reorder-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.reorder-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.reorder-deadline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reorder-deadline svg {
  width: 12px !important;
  height: 12px !important;
}

.score-badge {
  font-weight: 700;
  color: var(--green);
}

.inclusion-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.inclusion-pill.pill-in {
  background: var(--green-dim);
  color: var(--green);
}

.inclusion-pill.pill-out {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.reorder-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-rank-move {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-rank-move:not(:disabled):hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-rank-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-rank-move svg {
  width: 14px !important;
  height: 14px !important;
}

/* Live status pill in email header */
.email-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.email-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}