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

/* ─── Dark Mode (default: Business-Class Slate Navy) ─────────────────────── */
:root,
[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-subtle: #131926;
  --surface: #131926;
  --surface-hover: #1a2233;
  --border: rgba(255, 255, 255, 0.09);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --th-bg: rgba(37, 99, 235, 0.08);
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.22);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #f59e0b;
  --orb-opacity: 0.04;
  --header-bg: rgba(11, 15, 23, 0.88);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* ─── Light Mode (Crisp Executive SaaS) ──────────────────────────────────── */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-subtle: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --th-bg: rgba(37, 99, 235, 0.06);
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.1);
  --red: #e11d48;
  --red-dim: rgba(225, 29, 72, 0.08);
  --yellow: #d97706;
  --orb-opacity: 0.02;
  --header-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* ─── 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 48px;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  transition: background 0.3s, border-color 0.3s;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease;
}

.logo:hover {
  transform: translateY(-1px);
}

.logo-icon {
  position: relative;
  width: 44px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
  animation: logoEmblemPulse 3s infinite ease-in-out;
}

.logo:hover .logo-icon {
  transform: translateY(-1px) scale(1.05);
}

.tendrax-logo-svg {
  width: 44px;
  height: 38px;
  display: block;
  overflow: visible;
}

.tendrax-emblem-wing,
.tendrax-emblem-stem {
  fill: #2563eb;
  transition: fill 0.25s ease;
}

.tendrax-emblem-corner {
  fill: #93c5fd;
  transition: fill 0.25s ease;
}

[data-theme="dark"] .tendrax-emblem-wing,
[data-theme="dark"] .tendrax-emblem-stem {
  fill: #3b82f6;
}

[data-theme="dark"] .tendrax-emblem-corner {
  fill: #93c5fd;
}

[data-theme="light"] .tendrax-emblem-wing,
[data-theme="light"] .tendrax-emblem-stem {
  fill: #1d4ed8;
}

[data-theme="light"] .tendrax-emblem-corner {
  fill: #60a5fa;
}

@keyframes logoEmblemPulse {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(37, 99, 235, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 9px rgba(37, 99, 235, 0.65)) drop-shadow(0 0 18px rgba(96, 165, 250, 0.35));
  }
}

[data-theme="light"] .logo-icon {
  animation: logoEmblemPulseLight 3s infinite ease-in-out;
}

@keyframes logoEmblemPulseLight {
  0%, 100% {
    filter: drop-shadow(0 1px 3px rgba(29, 78, 216, 0.15));
  }
  50% {
    filter: drop-shadow(0 2px 10px rgba(29, 78, 216, 0.4)) drop-shadow(0 4px 14px rgba(37, 99, 235, 0.22));
  }
}

.logo-brand-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.logo-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  font-size: 1.58rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.05;
  color: var(--text);
  font-family: inherit;
  transition: color 0.25s ease;
}

[data-theme="dark"] .logo-text {
  color: #ffffff;
}

[data-theme="light"] .logo-text {
  color: #0a2540;
}

.logo-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #38bdf8;
  text-transform: uppercase;
  line-height: 1.2;
  animation: logoAiPulse 3s infinite ease-in-out;
  transition: all 0.25s ease;
  user-select: none;
}

@keyframes logoAiPulse {
  0%, 100% {
    border-color: rgba(37, 99, 235, 0.3);
    color: #38bdf8;
    filter: drop-shadow(0 0 2px rgba(37, 99, 235, 0.2));
    box-shadow: 0 0 4px rgba(37, 99, 235, 0.15);
    transform: scale(1);
  }
  50% {
    border-color: rgba(56, 189, 248, 0.85);
    color: #7dd3fc;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.75)) drop-shadow(0 0 16px rgba(37, 99, 235, 0.4));
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5), inset 0 0 6px rgba(56, 189, 248, 0.25);
    transform: scale(1.06);
  }
}

[data-theme="light"] .logo-ai-badge {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
  animation: logoAiPulseLight 3s infinite ease-in-out;
}

@keyframes logoAiPulseLight {
  0%, 100% {
    border-color: rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
    filter: drop-shadow(0 1px 2px rgba(29, 78, 216, 0.15));
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.1);
    transform: scale(1);
  }
  50% {
    border-color: rgba(29, 78, 216, 0.75);
    color: #0284c7;
    filter: drop-shadow(0 2px 8px rgba(29, 78, 216, 0.45)) drop-shadow(0 3px 12px rgba(37, 99, 235, 0.25));
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.35), inset 0 0 4px rgba(37, 99, 235, 0.15);
    transform: scale(1.06);
  }
}

.logo-by-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  letter-spacing: 0.2px;
}

.logo-by {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
  transition: color 0.25s ease;
}

[data-theme="dark"] .logo-by {
  color: #94a3b8;
}

[data-theme="light"] .logo-by {
  color: #64748b;
}

.logo-partner {
  color: #3b82f6;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.3px;
  transition: color 0.25s ease;
}

[data-theme="light"] .logo-partner {
  color: #1d4ed8;
}

.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, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 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: 880px;
  margin: 0 auto;
  padding: 0 24px 80px;
  transition: max-width 0.35s ease;
}

/* Expanded container in results mode to accommodate right-side history sidebar */
.main-content.results-mode {
  max-width: 1400px;
  padding-top: 40px;
}

#results-section {
  margin-top: 16px;
  width: 100%;
}

/* ─── Results 2-Column Grid Layout ────────────────────────────────────────── */
.results-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 28px;
  align-items: start;
  width: 100%;
}

.results-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.results-sidebar-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 4px;
}

@media (max-width: 1080px) {
  .results-layout-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .results-sidebar-col {
    position: static;
  }
}

/* ─── Right Sidebar: User Profile Card ────────────────────────────────────── */
.user-profile-sidebar-card {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.25s, box-shadow 0.25s;
}

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

.sidebar-user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0891B2 0%, #0F2D3D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.25);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.sidebar-user-avatar svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.user-live-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2DD4BF;
  border: 2px solid var(--surface);
  box-shadow: 0 0 8px #2DD4BF;
  animation: pulseLive 2s infinite ease-in-out;
}

@keyframes pulseLive {
  0%, 100% {
    transform: scale(0.9);
    box-shadow: 0 0 4px #2DD4BF;
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 10px #2DD4BF;
  }
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.sidebar-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.2;
}

.sidebar-active-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(45, 212, 191, 0.12);
  color: #2DD4BF;
  border: 1px solid rgba(45, 212, 191, 0.3);
  flex-shrink: 0;
}

.sidebar-user-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.77rem;
  color: var(--text-dim);
}

.sidebar-user-id {
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.2);
  border-radius: 6px;
  font-weight: 600;
  color: #0891B2;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ─── Right Sidebar: Search History Card ─────────────────────────────────── */
.search-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.history-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 145, 178, 0.03);
}

.history-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-title-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-title-icon-wrap svg {
  width: 17px;
  height: 17px;
}

.history-card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.history-card-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
}

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

.history-badge-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  border: 1px solid rgba(8, 145, 178, 0.25);
}

.btn-history-refresh {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-history-refresh:hover {
  background: var(--surface-hover);
  color: #0891B2;
  border-color: #0891B2;
  transform: rotate(45deg);
}

.btn-history-refresh.spinning svg {
  animation: spin 0.6s linear infinite;
}

.btn-toggle-history-minimize {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-history-minimize:hover {
  background: var(--surface-hover);
  color: #0891B2;
  border-color: #0891B2;
}

#sidebar-history-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Minimized State for Sidebar Search History */
.search-history-card.history-minimized .search-history-collapsible-body {
  display: none;
}

.search-history-card.history-minimized #sidebar-history-chevron {
  transform: rotate(-90deg);
}

.search-history-card.history-minimized .history-card-header {
  border-bottom: none;
}

/* History Search Filter Bar */
.history-search-bar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.history-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.history-search-svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

#history-filter-input {
  width: 100%;
  font-size: 0.82rem;
  padding: 7px 28px 7px 32px;
  background: rgba(8, 145, 178, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#history-filter-input:focus {
  border-color: #0891B2;
  background: rgba(8, 145, 178, 0.08);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15);
}

.history-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 4px;
}

.history-clear-btn:hover {
  color: #F97360;
}

/* History Items List Container */
.history-list-wrapper {
  max-height: 520px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(8, 145, 178, 0.3) transparent;
}

.history-list-wrapper::-webkit-scrollbar {
  width: 5px;
}

.history-list-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.history-list-wrapper::-webkit-scrollbar-thumb {
  background: rgba(8, 145, 178, 0.25);
  border-radius: 10px;
}

.history-list-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(8, 145, 178, 0.5);
}

.history-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.history-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.history-empty-state svg {
  width: 32px;
  height: 32px;
  color: var(--text-dim);
  opacity: 0.6;
}

.history-empty-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.history-empty-sub {
  font-size: 0.77rem;
  color: var(--text-dim);
  margin: 0;
  max-width: 240px;
  line-height: 1.4;
}

/* ─── Result Tabs Empty State (Dark/Light Mode Compatible) ──────────────── */
.tab-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}

.tab-empty-state-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.12);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

[data-theme="light"] .tab-empty-state-icon {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.tab-empty-state-icon svg {
  width: 22px;
  height: 22px;
}

.tab-empty-state-title {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  margin: 0;
}

.tab-empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Individual History Item Card */
.history-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item-card:hover {
  border-color: rgba(8, 145, 178, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  background: var(--surface-hover);
}

.history-item-card.active-history-card {
  border-color: #0891B2;
  background: rgba(8, 145, 178, 0.06);
  box-shadow: 0 0 0 1px #0891B2, 0 4px 20px rgba(8, 145, 178, 0.2);
}

.history-item-card.active-history-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #0891B2;
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-domain-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.history-globe-icon {
  width: 14px;
  height: 14px;
  color: #0891B2;
  flex-shrink: 0;
}

.history-domain-text {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time-ago {
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 500;
}

.history-focus-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.history-focus-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-focus-tag svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.history-date-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.history-cal-icon {
  width: 12px;
  height: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.history-date-text {
  white-space: nowrap;
}

.history-rating-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 6px;
  border-radius: 100px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.history-status-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 100px;
}

.history-status-pill.status-complete {
  background: rgba(45, 212, 191, 0.12);
  color: #2DD4BF;
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.history-status-pill.status-partial {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.history-item-actions {
  margin-top: 2px;
}

.btn-history-view {
  width: 100%;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid rgba(8, 145, 178, 0.35);
  background: rgba(8, 145, 178, 0.08);
  color: #0891B2;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-history-view .view-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-history-view:hover {
  background: #0891B2;
  color: #ffffff;
  border-color: #0891B2;
  box-shadow: 0 2px 10px rgba(8, 145, 178, 0.35);
  transform: translateY(-1px);
}

.btn-history-view.loading-view {
  opacity: 0.7;
  pointer-events: none;
}

.results-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.results-kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 4px;
}

.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: 32px;
  margin-bottom: 24px;
}

/* ─── Form Step Slider Wizard ─────────────────────────────────────────── */
.form-wizard-header {
  margin-bottom: 24px;
}

.wizard-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.wizard-stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.2px;
}

.wizard-pct-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.25);
  font-family: monospace;
}

.wizard-progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface-hover);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 6px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.wizard-progress-glow {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: #ffffff;
  opacity: 0.7;
  filter: blur(3px);
}

.wizard-steps-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.wizard-step-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.wizard-step-node:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.wizard-step-node.active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.wizard-step-node.completed {
  color: var(--green);
}

.wizard-node-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: inherit;
  transition: all 0.2s ease;
  background: var(--surface);
}

.wizard-step-node.active .wizard-node-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.wizard-step-node.completed .wizard-node-circle {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.wizard-step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 12px;
  transition: background 0.25s ease;
}

.wizard-step-connector.completed {
  background: var(--green);
}

.wizard-node-label {
  white-space: nowrap;
}

/* Slider Track and Slides */
.form-slider-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: 4px 0;
  scroll-behavior: auto;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-slider-track {
  display: flex;
  align-items: flex-start;
  width: 400%;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.form-slide {
  width: 25%;
  min-width: 25%;
  max-width: 25%;
  flex-basis: 25%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 4px 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.form-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hidden-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─── Custom Searchable Country & Region Dropdown ────────────────────────── */
.country-select-form-group {
  position: relative;
}

.searchable-dropdown-wrap {
  position: relative;
  width: 100%;
}

.dropdown-trigger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dropdown-trigger-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.dropdown-trigger-btn.dropdown-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-trigger-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.dropdown-trigger-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-trigger-icon svg {
  width: 18px;
  height: 18px;
}

.dropdown-trigger-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropdown-selected-label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-iso-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  background: var(--bg-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
}

.dropdown-option-item:hover .dropdown-iso-badge,
.dropdown-option-item.active .dropdown-iso-badge {
  background: rgba(8, 145, 178, 0.15);
  color: #0891B2;
  border-color: rgba(8, 145, 178, 0.3);
}

.country-quick-pill .pill-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-right: 4px;
  text-transform: uppercase;
}

.country-quick-pill.active .pill-code {
  background: rgba(8, 145, 178, 0.2);
  color: #0891B2;
  border-color: rgba(8, 145, 178, 0.35);
}

#state-group {
  margin-top: 12px;
  animation: fadeIn 0.2s ease-out;
}

/* ─── Region Member Countries Nested Checkboxes ─────────────────────────── */
.dropdown-option-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-region-inline-toggle {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(8, 145, 178, 0.1);
  color: #0891b2;
  border: 1px solid rgba(8, 145, 178, 0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-region-inline-toggle:hover {
  background: rgba(8, 145, 178, 0.2);
  border-color: rgba(8, 145, 178, 0.4);
}

.region-member-sublist {
  background: rgba(8, 145, 178, 0.03);
  border-left: 2px solid rgba(8, 145, 178, 0.35);
  margin: 1px 0 4px 16px;
  border-radius: 0 4px 4px 0;
  padding: 2px 0;
}

.dropdown-option-item.region-member-item {
  padding: 6px 12px 6px 20px;
  font-size: 0.82rem;
}

.dropdown-option-item.region-member-item:hover {
  background: rgba(8, 145, 178, 0.08);
}

.dropdown-option-item.region-member-item.is-excluded .dropdown-option-label {
  text-decoration: line-through;
  opacity: 0.55;
}

.dropdown-option-item.region-member-item.is-excluded .dropdown-option-checkbox {
  border-color: rgba(239, 68, 68, 0.4);
  background: transparent;
}

.dropdown-selected-sub {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.dropdown-trigger-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dropdown-tag-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.dropdown-chevron-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.dropdown-trigger-btn.dropdown-open .dropdown-chevron-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

/* ─── Searchable Dropdown Popover ────────────────────────────────────────── */
.dropdown-popover-menu {
  position: relative;
  width: 100%;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

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

.dropdown-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.dropdown-search-icon {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.dropdown-search-input {
  width: 100%;
  padding: 9px 32px 9px 34px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dropdown-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.dropdown-search-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 4px;
}

.dropdown-search-clear:hover {
  color: var(--text);
}

/* Quick Filter Pills */
.dropdown-quick-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  padding-top: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dropdown-quick-pills::-webkit-scrollbar {
  display: none;
}

.quick-pills-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-right: 2px;
  flex-shrink: 0;
}

.country-quick-pill,
.state-quick-pill {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.country-quick-pill:hover,
.state-quick-pill:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-hover);
}

.country-quick-pill.active,
.state-quick-pill.active {
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  border-color: rgba(8, 145, 178, 0.35);
  font-weight: 600;
}

.state-quick-pill .pill-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-right: 4px;
  text-transform: uppercase;
}

.state-quick-pill.active .pill-code {
  background: rgba(8, 145, 178, 0.2);
  color: #0891B2;
  border-color: rgba(8, 145, 178, 0.35);
}

/* Options Scroll List */
.dropdown-options-scroll {
  max-height: 310px;
  min-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.dropdown-group-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  padding: 6px 8px 3px 8px;
  margin-top: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 4px;
}

.dropdown-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}

.dropdown-option-item:hover, .dropdown-option-item.highlighted {
  background: var(--surface-hover);
  color: var(--text);
}

.dropdown-option-item.active {
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  font-weight: 600;
}

.dropdown-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dropdown-option-icon {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.dropdown-option-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-option-badge {
  font-size: 0.66rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.dropdown-empty-search {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Multi-Select Country Chips & Checkboxes */
.dropdown-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  max-width: 100%;
}

.dropdown-country-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(8, 145, 178, 0.12);
  border: 1px solid rgba(8, 145, 178, 0.3);
  border-radius: 5px;
  color: #0891B2;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.dropdown-country-chip .chip-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.65rem;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(8, 145, 178, 0.2);
}

.chip-remove-btn {
  background: transparent;
  border: none;
  color: #0891B2;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.75;
  transition: all 0.12s ease;
  border-radius: 2px;
}

.chip-remove-btn:hover {
  opacity: 1;
  color: #ef4444;
  transform: scale(1.15);
}

.dropdown-option-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  transition: all 0.12s ease;
}

.dropdown-option-checkbox svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-option-item.active .dropdown-option-checkbox {
  background: #0891B2;
  border-color: #0891B2;
  color: #ffffff;
}

.dropdown-option-item.active .dropdown-option-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

.dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

.dropdown-footer-left {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.dropdown-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-dropdown-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.btn-dropdown-clear:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.btn-dropdown-done {
  background: #0891B2;
  color: #ffffff;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 5px;
  transition: all 0.15s ease;
}

.btn-dropdown-done:hover {
  background: #0e7490;
}

/* ─── Executive Status Dropdown ────────────────────────────────────────── */
.status-dropdown-wrap {
  position: relative;
  width: 100%;
}

.status-trigger-icon {
  transition: all 0.2s ease;
}

.status-popover-menu {
  position: relative;
  width: 100%;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}

.status-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  min-height: 48px;
  max-height: 56px;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 9px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.status-option-card svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex-shrink: 0 !important;
}

.status-option-icon {
  display: none !important;
}

.status-option-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateX(2px);
}

.status-option-card.active {
  background: rgba(8, 145, 178, 0.09);
  border-color: rgba(8, 145, 178, 0.45);
  box-shadow: inset 3px 0 0 #0891b2, 0 2px 8px rgba(8, 145, 178, 0.1);
}

.status-option-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* Status Badge Themes (Subtle & Executive) */
.status-badge-active {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
}

.status-badge-near {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
}

.status-badge-archive {
  background: rgba(168, 85, 247, 0.12) !important;
  color: #a855f7 !important;
  border: 1px solid rgba(168, 85, 247, 0.28) !important;
}

.status-badge-both {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #0284c7 !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
}

[data-theme="dark"] .status-badge-both {
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
}

.status-option-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-option-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.status-option-card.active .status-option-title {
  color: var(--text);
  font-weight: 700;
}

.status-option-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.status-option-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.3;
}

.status-option-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(8, 145, 178, 0.18);
  color: #0891b2;
}

.status-option-check svg {
  width: 13px;
  height: 13px;
}

.status-option-card.active .status-option-check {
  opacity: 1;
  transform: scale(1);
}

/* ─── Location Notice Banner ──────────────────────────────────────────────── */
.location-notice-banner {
  margin-bottom: 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.08) 0%, rgba(2, 132, 199, 0.05) 100%);
  border: 1px solid rgba(8, 145, 178, 0.25);
  border-left: 4px solid #0891B2;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

.location-notice-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(8, 145, 178, 0.15);
  color: #0891B2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.location-notice-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.location-notice-content {
  flex: 1;
  min-width: 0;
}

.location-notice-heading {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #0891B2;
  margin-bottom: 2px;
}

.location-notice-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

/* ─── Commercial Fit Match Highlight Banner ─────────────────────────────────── */
.match-summary-banner {
  margin: 16px 0 20px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 5px solid #10b981;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
  animation: fadeIn 0.35s ease;
}

[data-theme="light"] .match-summary-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 5px solid #059669;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.08);
}

.match-summary-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .match-summary-icon {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
}

.match-summary-icon svg {
  width: 22px;
  height: 22px;
}

.match-summary-content {
  flex: 1;
  min-width: 0;
}

.match-summary-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.match-summary-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  padding: 2px 8px;
  border-radius: 6px;
}

[data-theme="light"] .match-summary-badge {
  color: #059669;
  background: rgba(5, 150, 105, 0.12);
}

.match-summary-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

.match-summary-text {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.recs-match-summary-banner {
  margin-bottom: 18px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 4px solid #10b981;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  animation: fadeIn 0.3s ease;
}

[data-theme="light"] .recs-match-summary-banner {
  border-left-color: #059669;
  background: rgba(5, 150, 105, 0.08);
}

.recs-match-summary-banner svg {
  width: 20px;
  height: 20px;
  color: #10b981;
  flex-shrink: 0;
}

[data-theme="light"] .recs-match-summary-banner svg {
  color: #059669;
}

/* Match Tier Badges on Tender Cards */
.badge-regional-match {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-global-supplement {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(8, 145, 178, 0.1);
  color: #0891B2;
  border: 1px solid rgba(8, 145, 178, 0.25);
}

.slide-header {
  margin-bottom: 20px;
}

.slide-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 4px;
}

.slide-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.slide-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.slide-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.slide-actions-spacer {
  flex: 1;
}

.btn-step-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-step-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

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

.btn-step-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-step-prev:hover {
  background: var(--surface-active);
  border-color: var(--border-hover);
}

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

/* Quick Sector Chips */
.quick-chips-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.quick-chips-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quick-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  padding: 5px 12px;
  border-radius: 16px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-chip:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

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

/* ─── Home Page Search History Section ───────────────────────────────────── */
.home-history-card {
  margin-top: 24px;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color 0.25s, box-shadow 0.25s;
}

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

.home-history-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 145, 178, 0.03);
  transition: background 0.2s;
  user-select: none;
}

.home-history-header:hover {
  background: rgba(8, 145, 178, 0.06);
}

.home-history-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-history-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-history-icon-circle svg {
  width: 20px;
  height: 20px;
}

.home-history-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.home-history-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
  margin-bottom: 0;
}

.home-history-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-history-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(8, 145, 178, 0.12);
  color: #0891B2;
  border: 1px solid rgba(8, 145, 178, 0.25);
  white-space: nowrap;
}

.btn-toggle-home-history {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-home-history:hover {
  color: #0891B2;
  border-color: #0891B2;
}

#home-history-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-history-body {
  padding: 20px 24px;
  transition: all 0.3s ease;
}

.home-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.home-history-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.home-history-item-card:hover {
  border-color: rgba(8, 145, 178, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  background: var(--surface-hover);
}

.home-history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-history-domain-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.home-history-globe {
  width: 16px;
  height: 16px;
  color: #0891B2;
  flex-shrink: 0;
}

.home-history-domain-text {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-history-time-ago {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}

.home-history-focus-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-history-focus-tag svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.home-history-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-dim);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.home-history-date {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.home-history-date svg {
  width: 12px;
  height: 12px;
}

.btn-home-history-view {
  width: 100%;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid rgba(8, 145, 178, 0.35);
  background: rgba(8, 145, 178, 0.08);
  color: #0891B2;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.btn-home-history-view:hover {
  background: #0891B2;
  color: #ffffff;
  border-color: #0891B2;
  box-shadow: 0 2px 10px rgba(8, 145, 178, 0.35);
  transform: translateY(-1px);
}

.btn-home-history-view svg {
  width: 14px;
  height: 14px;
}

/* Home History Card Collapsed state */
.home-history-card.collapsed .home-history-body {
  display: none;
}

.home-history-card.collapsed #home-history-chevron {
  transform: rotate(-90deg);
}

.home-history-card.collapsed .home-history-header {
  border-bottom: none;
}

/* ─── 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: #ef4444 !important;
  font-weight: 600;
  font-size: 0.8em;
}

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

.field-error-hint {
  font-size: 0.8rem;
  color: #f87171;
  font-weight: 600;
  margin-top: 6px;
  display: block;
  animation: fadeIn 0.2s ease;
}

.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);
}

.input-wrapper input.input-error {
  border-color: #f87171 !important;
  background: rgba(248, 113, 113, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}

/* ─── Custom Select Wrapper & Dropdowns ─────────────────────────────────── */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  transition: transform 0.25s ease;
}

.custom-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 13px 40px 13px 44px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-select:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.custom-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-select optgroup {
  font-weight: 700;
  color: #0891B2;
  background: #0f172a;
  padding: 8px 4px;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
}

.custom-select option {
  font-weight: 500;
  color: #f8fafc;
  background: #0f172a;
  padding: 12px 14px;
  font-size: 0.92rem;
}

[data-theme="light"] .custom-select {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .custom-select optgroup {
  background: #f1f5f9;
  color: #0891B2;
}

[data-theme="light"] .custom-select option {
  background: #ffffff;
  color: #0f172a;
}

.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;
  justify-content: space-between;
  gap: 14px;
  background: var(--red-dim);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  color: #fca5a5;
  font-size: 0.9rem;
  margin-bottom: 24px;
  animation: slideIn 0.3s ease;
  flex-wrap: wrap;
}

.error-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

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

.btn-error-search-again {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-error-search-again:hover {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
  transform: translateY(-1px);
}

.btn-error-search-again svg {
  width: 14px;
  height: 14px;
  color: currentColor;
}

/* ─── Progress ───────────────────────────────────────────────────────────── */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  margin-bottom: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.progress-header-wrap {
  text-align: center;
  margin-bottom: 24px;
}

.progress-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-bottom: 12px;
}

.progress-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.progress-title {
  font-size: 1.22rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.progress-live-detail {
  font-size: 0.86rem;
  color: var(--accent);
  font-weight: 500;
  min-height: 22px;
  transition: color 0.3s ease;
}

/* ─── Slider Progress UI ─────────────────────────────────────────────────── */
.progress-slider-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .progress-slider-container {
  background: rgba(0, 0, 0, 0.02);
}

.progress-slider-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-slider-stage {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.5s infinite ease-in-out;
}

.progress-slider-status {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.progress-slider-pct-wrap {
  display: flex;
  align-items: center;
}

.progress-slider-pct {
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.progress-slider-track-wrap {
  position: relative;
  padding: 4px 0;
}

.progress-slider-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  position: relative;
  overflow: visible;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .progress-slider-track {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-slider-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 50%, #10b981 100%);
  background-size: 200% 100%;
  animation: shimmerGradient 3s linear infinite;
  position: relative;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

@keyframes shimmerGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.progress-slider-thumb {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow), 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.step-status-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: all 0.3s;
}

.step-status-tag.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.step-status-tag.done {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--green);
}

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

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

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

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

.step-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.step-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.step-name {
  font-weight: 600;
  font-size: 0.94rem;
  color: inherit;
}

.step-subtext {
  font-size: 0.77rem;
  color: var(--text-dim);
  transition: color 0.3s;
}

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

/* Dynamic Live Ranking Counter Pill (1 to 15) */
.rank-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
  opacity: 0;
  transform: scale(0.92);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rank-live-pill.active {
  opacity: 1;
  transform: scale(1);
}

.rank-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: rankDotPulse 1.2s infinite ease-in-out;
}

@keyframes rankDotPulse {
  0%, 100% {
    transform: scale(0.85);
    box-shadow: 0 0 4px var(--green);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 10px 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;
  gap: 14px;
  margin-bottom: 12px;
}

.tender-sn-col {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  flex-shrink: 0;
  padding-top: 1px;
}

.tender-sn {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.tender-title-col {
  flex: 1;
  min-width: 0;
}

.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-cloud,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  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: 5px 12px;
  border-radius: 100px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.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 (Tendrax co-powered by TendersOnTime) ────────────────────── */
.footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  padding: 36px 24px;
  margin-top: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer-simple-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-logo-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  box-shadow: 0 0 12px var(--accent-glow);
}

.footer-logo-mini svg {
  width: 20px;
  height: 18px;
  display: block;
}

.footer-brand-mono {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

[data-theme="dark"] .footer-brand-mono {
  color: #ffffff;
}

[data-theme="light"] .footer-brand-mono {
  color: #0f172a;
}

.footer-copower-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 100px;
}

[data-theme="light"] .footer-copower-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.footer-copower-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-copower-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #3b82f6;
  letter-spacing: 0.2px;
}

[data-theme="light"] .footer-copower-name {
  color: #1d4ed8;
}

/* ─── 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: 20px 24px;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}

.email-customizer-card.customizer-collapsed {
  padding: 14px 20px;
  margin-bottom: 16px;
}

.email-customizer-card.customizer-collapsed .customizer-header {
  margin-bottom: 0;
}

.customizer-subtitle-collapsed {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.email-customizer-card:not(.customizer-collapsed) .customizer-subtitle-collapsed {
  display: none;
}

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

.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);
}

.customizer-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-customizer-submit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.2s ease;
}

.btn-customizer-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
  filter: brightness(1.08);
}

.btn-customizer-submit svg {
  width: 15px !important;
  height: 15px !important;
}

.btn-customizer-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-customizer-close:hover {
  background: var(--surface-hover);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--red);
  transform: translateY(-1px);
}

.btn-customizer-close svg {
  width: 14px !important;
  height: 14px !important;
}

/* Toggle Selection Button (Fixed Hover Bug: text never disappears) */
.btn-toggle-reorder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  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: var(--accent);
  transform: translateY(-1px);
}

.btn-toggle-reorder span {
  color: inherit !important;
}

.btn-toggle-reorder svg {
  color: inherit;
}

[data-theme="light"] .btn-toggle-reorder {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .btn-toggle-reorder:hover {
  background: #eff6ff;
  border-color: var(--accent);
  color: var(--accent);
}

/* Button to open customizer from inside email preview */
.btn-customize-draft {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-customize-draft:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-customize-draft svg {
  width: 14px !important;
  height: 14px !important;
}

[data-theme="light"] .btn-customize-draft {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .btn-customize-draft:hover {
  background: #eff6ff;
  border-color: var(--accent);
  color: var(--accent);
}

.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(--accent);
  color: var(--text);
}

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

[data-theme="light"] .count-pill {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .count-pill:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.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;
}

/* Checkbox Customizer List */
.tender-check-list,
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

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

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

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

.tender-check-item.item-checked {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.tender-check-item.item-unchecked {
  opacity: 0.6;
  border-style: dashed;
  background: rgba(0, 0, 0, 0.08);
}

.tender-check-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
}

.tender-check-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tender-check-box {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.tender-check-sn {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
}

.tender-check-item.item-checked .tender-check-sn {
  color: var(--accent);
}

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

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

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

.tender-check-meta .meta-tag strong {
  color: var(--text);
  font-weight: 600;
}

.tender-check-status {
  flex-shrink: 0;
}

.count-pill.pill-clear {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.count-pill.pill-clear:hover {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

.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);
}

/* 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;
}

/* ─── Customizer Action Footer Bar ───────────────────────────────────────── */
.customizer-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.customizer-footer-count {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.customizer-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-customizer-close-subtle {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-customizer-submit-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.2s ease;
}

.btn-customizer-submit-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-customizer-submit-primary svg {
  width: 14px !important;
  height: 14px !important;
}

/* ─── Email Body Table: Seamless Dark Theme Conversion ──────────────────── */
[data-theme="dark"] .email-preview-container,
[data-theme="dark"] .email-body .email-preview-container {
  background: #0b1329 !important;
  background-color: #0b1329 !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .email-body .email-preview-container p,
[data-theme="dark"] .email-preview-container p,
[data-theme="dark"] .email-body .email-preview-container div,
[data-theme="dark"] .email-preview-container div,
[data-theme="dark"] .email-body .email-preview-container span,
[data-theme="dark"] .email-preview-container span,
[data-theme="dark"] .email-body .email-preview-container h2,
[data-theme="dark"] .email-preview-container h2 {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .email-body .email-preview-container strong,
[data-theme="dark"] .email-preview-container strong,
[data-theme="dark"] .email-body .email-preview-container b,
[data-theme="dark"] .email-preview-container b {
  color: #ffffff !important;
}

[data-theme="dark"] .email-body table,
[data-theme="dark"] .email-preview-table,
[data-theme="dark"] table.email-preview-table {
  background: #111c38 !important;
  background-color: #111c38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

/* Bulletproof Header in Dark Mode (no white bar) */
[data-theme="dark"] .email-body thead,
[data-theme="dark"] .email-body thead tr,
[data-theme="dark"] .email-body tr.email-table-header-row,
[data-theme="dark"] .email-body th,
[data-theme="dark"] .email-body th.email-table-th,
[data-theme="dark"] .email-preview-table thead,
[data-theme="dark"] .email-preview-table thead tr,
[data-theme="dark"] .email-preview-table tr.email-table-header-row,
[data-theme="dark"] .email-preview-table th,
[data-theme="dark"] .email-preview-table th.email-table-th,
[data-theme="dark"] table.email-preview-table thead,
[data-theme="dark"] table.email-preview-table thead tr,
[data-theme="dark"] table.email-preview-table tr.email-table-header-row,
[data-theme="dark"] table.email-preview-table th,
[data-theme="dark"] table.email-preview-table th.email-table-th {
  background: #0f172a !important;
  background-color: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  font-weight: 700 !important;
}

/* Rows in Dark Mode */
[data-theme="dark"] .email-body tbody tr,
[data-theme="dark"] .email-body tr.email-table-row,
[data-theme="dark"] .email-preview-table tbody tr,
[data-theme="dark"] .email-preview-table tr.email-table-row,
[data-theme="dark"] table.email-preview-table tbody tr,
[data-theme="dark"] table.email-preview-table tr.email-table-row {
  background: #111c38 !important;
  background-color: #111c38 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Cells in Dark Mode */
[data-theme="dark"] .email-body td,
[data-theme="dark"] .email-body td.email-table-td,
[data-theme="dark"] .email-preview-table td,
[data-theme="dark"] .email-preview-table td.email-table-td,
[data-theme="dark"] table.email-preview-table td,
[data-theme="dark"] table.email-preview-table td.email-table-td {
  background: #111c38 !important;
  background-color: #111c38 !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .email-body td:first-child,
[data-theme="dark"] .email-body td.email-table-td:first-child,
[data-theme="dark"] .email-preview-table td:first-child,
[data-theme="dark"] .email-preview-table td.email-table-td:first-child,
[data-theme="dark"] table.email-preview-table td:first-child,
[data-theme="dark"] table.email-preview-table td.email-table-td:first-child {
  color: #60a5fa !important;
  font-weight: 700 !important;
}

/* Selected sequence badge in customizer */
.inclusion-pill.pill-in {
  background: rgba(37, 99, 235, 0.14);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

[data-theme="light"] .inclusion-pill.pill-in {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.tender-check-item.item-checked {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

[data-theme="light"] .tender-check-item.item-checked {
  border-color: #93c5fd;
  background: #f8faff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06);
}

.rank-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px var(--accent-glow);
  white-space: nowrap;
}

.rank-move-btns {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 2px;
}

.btn-rank-move {
  width: 22px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.15s;
}

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

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

@keyframes pulseHighlight {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
  50% { transform: scale(1.04); box-shadow: 0 0 16px var(--accent-glow); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
}

.pulse-highlight {
  animation: pulseHighlight 0.6s ease-in-out;
}

/* ─── Feedback Card ─────────────────────────────────────────────────────── */
.feedback-card {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

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

.feedback-header {
  margin-bottom: 1.25rem;
}

.feedback-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.feedback-title svg {
  color: var(--yellow);
}

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

.feedback-rank-group {
  margin-bottom: 1.25rem;
}

.feedback-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.star-rating-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.star-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.star-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  transform: translateY(-1px);
}

.star-btn.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #000;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.feedback-text-group {
  margin-bottom: 1.25rem;
}

.feedback-text-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.feedback-text-group textarea:focus {
  border-color: var(--accent);
}

.feedback-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-feedback-submit {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-feedback-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-feedback-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Right Sidebar Feedback Placement ─────────────────────────────────── */
.sidebar-feedback-card {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
}

.sidebar-feedback-card .feedback-header {
  margin-bottom: 12px;
}

.sidebar-feedback-card .feedback-title {
  font-size: 0.98rem;
  gap: 6px;
}

.sidebar-feedback-card .feedback-subtitle {
  font-size: 0.78rem;
}

.sidebar-feedback-card .feedback-rank-group {
  margin-bottom: 10px;
}

.sidebar-feedback-card .feedback-label {
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.sidebar-feedback-card .star-rating-buttons {
  display: flex;
  gap: 5px;
  justify-content: space-between;
}

.sidebar-feedback-card .star-btn {
  padding: 5px 0;
  font-size: 0.78rem;
  border-radius: 6px;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.sidebar-feedback-card .feedback-text-group {
  margin-bottom: 10px;
}

.sidebar-feedback-card .feedback-text-group textarea {
  padding: 8px 10px;
  font-size: 0.84rem;
  border-radius: 8px;
  min-height: 55px;
}

.sidebar-feedback-card .feedback-action-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.sidebar-feedback-card .btn-feedback-submit {
  width: 100%;
  padding: 9px 14px;
  font-size: 0.86rem;
  text-align: center;
  justify-content: center;
}

.sidebar-feedback-card .feedback-status-msg {
  font-size: 0.8rem;
  text-align: center;
}

.btn-feedback-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.feedback-status-msg {
  font-size: 0.88rem;
  font-weight: 500;
}

.feedback-status-msg.success {
  color: var(--green);
}

.feedback-status-msg.error {
  color: var(--red);
}

.feedback-status-msg.loading {
  color: var(--accent);
}

/* ─── CRM User Session Badge ────────────────────────────────────────────── */
.user-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-hover);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.user-session-badge svg {
  color: var(--accent);
}

.session-timer-pill {
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--th-bg);
  color: var(--accent);
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ─── Lock Screen Overlay ─────────────────────────────────────────────────── */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 11, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lock-card {
  max-width: 480px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--red-dim);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.lock-icon svg {
  width: 32px;
  height: 32px;
}

.lock-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.lock-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.lock-badge-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
}

.pulse-dot.red {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

/* ─── Model Fetched & Tab Badges Styling (v2.0) ─────────────────────────── */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.18);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: 6px;
  transition: all 0.2s ease;
}

[data-theme="light"] .tab-badge {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.tab.active .tab-badge {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

/* Model Fetched Header Card - Theme Adaptive (Light & Dark) */
.model-fetched-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

@media (min-width: 768px) {
  .model-fetched-header-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.model-fetched-header-info {
  flex: 1;
}

.model-fetched-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.model-fetched-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.3px;
}

.model-fetched-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

[data-theme="light"] .model-fetched-badge {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.model-fetched-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 680px;
}

.model-fetched-subtitle strong {
  color: var(--text);
  font-weight: 600;
}

.model-fetched-filter-wrap {
  min-width: 280px;
}

.model-fetched-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.mf-search-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}

.model-fetched-search-input {
  width: 100%;
  padding: 11px 36px 11px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

[data-theme="light"] .model-fetched-search-input {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.model-fetched-search-input::placeholder {
  color: var(--text-dim);
}

.model-fetched-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}

.mf-search-clear {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  transition: color 0.2s;
}

.mf-search-clear:hover {
  color: var(--text);
}

/* Tender Card Actions & Move to Email Button */
.tender-card-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.tender-origin-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tender-origin-kw {
  font-weight: 600;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

[data-theme="light"] .tender-origin-kw {
  color: #0284c7;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.btn-move-to-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-move-to-email:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
}

.btn-move-to-email:active {
  transform: translateY(0);
}

.btn-move-to-email svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.btn-move-to-email.in-draft {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: none;
}

.btn-move-to-email.in-draft:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: none;
}

.btn-move-to-email .btn-in-draft-text {
  display: inline;
}

.btn-move-to-email .btn-remove-draft-text {
  display: none !important;
}

.btn-move-to-email.in-draft {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: none;
}

.btn-move-to-email.in-draft .btn-in-draft-text {
  display: inline;
}

.btn-move-to-email.in-draft .btn-remove-draft-text {
  display: none !important;
}

.btn-move-to-email.in-draft:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: none;
}

.btn-move-to-email.in-draft:hover .btn-in-draft-text {
  display: none !important;
}

.btn-move-to-email.in-draft:hover .btn-remove-draft-text {
  display: inline !important;
}

/* Toast Notification */
.tendrax-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 999999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.tendrax-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.tendrax-toast svg {
  width: 18px;
  height: 18px;
  color: #10b981;
  flex-shrink: 0;
}

/* Progress 60s Cancel Action */
.progress-cancel-wrap {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

.btn-cancel-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 10px 20px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-search:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  transform: translateY(-1px);
}

[data-theme="light"] .btn-cancel-search {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

[data-theme="light"] .btn-cancel-search:hover {
  background: #fee2e2;
  border-color: #f87171;
}

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

.progress-cancel-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Focus Sector Capsule - Light & Dark Mode Compatible */
.stat-chip.stat-chip-sector {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.stat-chip.stat-chip-sector svg {
  color: #818cf8;
}

[data-theme="light"] .stat-chip.stat-chip-sector {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

[data-theme="light"] .stat-chip.stat-chip-sector svg {
  color: #4f46e5;
}

/* Compact Model Fetched Cards - High Density 10-Item View */
.mf-card-compact {
  padding: 12px 18px !important;
  border-radius: 12px !important;
  margin-bottom: 0 !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s !important;
}

.mf-card-compact:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="dark"] .mf-card-compact:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.mf-card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mf-card-left-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mf-card-compact .tender-sn {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.35;
  min-width: 24px;
  padding-top: 1px;
}

.mf-title-group {
  flex: 1;
  min-width: 0;
}

.mf-title {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  word-break: break-word;
}

.mf-card-action {
  flex-shrink: 0;
}

.mf-card-compact .btn-move-to-email {
  padding: 6px 13px !important;
  font-size: 0.78rem !important;
  border-radius: 7px !important;
  gap: 6px !important;
}

.mf-card-compact .btn-move-to-email svg {
  width: 14px !important;
  height: 14px !important;
}

.mf-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px !important;
  margin: 6px 0 0 0 !important;
  padding-left: 34px;
}

.mf-meta-row .meta-pill {
  padding: 2px 8px !important;
  font-size: 0.71rem !important;
  gap: 4px !important;
}

.mf-meta-row .meta-pill svg {
  width: 11px !important;
  height: 11px !important;
}

.meta-pill-tid {
  font-family: monospace;
  font-size: 0.7rem !important;
  background: rgba(99, 102, 241, 0.06) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
  color: var(--text-dim) !important;
}

.meta-pill-kw {
  border-color: rgba(14, 165, 233, 0.25) !important;
  background: rgba(14, 165, 233, 0.05) !important;
}

.mf-meta-row .tender-origin-kw {
  padding: 0 4px !important;
  font-size: 0.71rem !important;
  border: none !important;
  background: transparent !important;
}

.mf-reason {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 5px;
  padding-left: 34px;
}

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

@media (max-width: 680px) {
  .mf-card-top-row {
    flex-direction: column;
    gap: 8px;
  }
  .mf-meta-row,
  .mf-reason {
    padding-left: 0;
  }
}

/* Model Fetched Candidates List Scroll Container - Starts scrolling after 10 outputs */
#model-fetched-list {
  max-height: 850px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 10px 14px 4px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  margin-top: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

#model-fetched-list::-webkit-scrollbar {
  width: 6px;
}

#model-fetched-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

#model-fetched-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  transition: background 0.2s ease;
}

#model-fetched-list::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.65);
}

[data-theme="light"] #model-fetched-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

[data-theme="light"] #model-fetched-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

[data-theme="dark"] #model-fetched-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] #model-fetched-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.36);
}

/* ─── In-Window Progress Notice Box ─────────────────────────────────────── */
.progress-notice-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 14px;
  padding: 22px 24px;
  margin-top: 24px;
  animation: slideIn 0.3s ease;
}

[data-theme="light"] .progress-notice-box {
  background: #fef2f2;
  border-color: #fca5a5;
}

.progress-notice-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.progress-notice-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  flex-shrink: 0;
}

.progress-notice-icon svg {
  width: 22px;
  height: 22px;
}

.progress-notice-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.2px;
}

[data-theme="light"] .progress-notice-title {
  color: #991b1b;
}

.progress-notice-message {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

[data-theme="light"] .progress-notice-message {
  color: #7f1d1d;
}

.progress-notice-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .progress-notice-actions {
  border-top-color: #fee2e2;
}

.btn-progress-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-progress-back:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
/* ─── Easter Egg: Own-Name Website ───────────────────────────────────────── */
.name-easter-egg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 640px;
  margin: 24px auto;
  padding: 40px 24px;
  text-align: center;
}
.name-easter-egg.hidden {
  display: none;
}
.name-easter-egg-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.name-easter-egg-subtitle {
  margin: -12px 0 0;
  max-width: 480px;
  font-size: 1rem;
  color: var(--text-muted);
}
.name-easter-egg-gif {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
}
.name-easter-egg-btn {
  padding: 12px 32px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.name-easter-egg-btn:hover {
  background: var(--accent-2);
}
