/* ============ BASE ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand:    #4f46e5;
  --brand-dk: #3730a3;
  --bg:       #f1f5f9;
  --card:     #ffffff;
  --border:   #e2e8f0;
  --text:     #0f172a;
  --muted:    #64748b;
  --radius:   12px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:0 8px 32px rgba(0,0,0,.12);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding-top: 64px;
}

/* ============ NAVBAR ============ */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  padding: 0 24px;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--brand) !important;
  letter-spacing: -0.5px;
}
.navbar-brand span { color: var(--text); }

/* ============ LANDING ============ */
#landing-section { min-height: calc(100vh - 64px); }

/* ============ HERO (image + split) ============ */
.hero {
  background:
    linear-gradient(135deg,
      rgba(20,14,60,0.94) 0%,
      rgba(79,46,186,0.90) 45%,
      rgba(7,89,133,0.88) 100%),
    url('https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1920&q=80')
    center/cover no-repeat;
  padding: 100px 24px 88px;
  color: white;
  position: relative;
  overflow: hidden;
}

/* subtle grain overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-split {
  display: flex;
  align-items: center;
  gap: 56px;
  max-width: 1160px;
  margin: 0 auto;
  position: relative;
}

/* Left column */
.hero-left { flex: 1; min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #c4b5fd;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 22px;
}

.hero-left h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-left p {
  font-size: 1.07rem;
  opacity: 0.82;
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 36px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-hero-primary {
  background: white;
  color: var(--brand);
  border: none;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.3); }

.btn-hero-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,.5);
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-hero-outline:hover { border-color: white; background: rgba(255,255,255,.1); }

.hero-trust {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 28px;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
}
.hero-trust span { display: flex; align-items: center; gap: 6px; }

/* Right column: mock card */
.hero-right {
  flex-shrink: 0;
  width: 360px;
  position: relative;
}

@media (max-width: 900px) { .hero-right { display: none !important; } }

.hero-mock-card {
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06),
    0 32px 80px rgba(0,0,0,.5);
  animation: cardFloat 5s ease-in-out infinite;
}

@keyframes cardFloat {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  33%      { transform: translateY(-6px) rotate(0.3deg); }
  66%      { transform: translateY(-3px) rotate(-0.2deg); }
}

.hmc-header {
  padding: 12px 16px;
  background: rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: rgba(255,255,255,.8);
  font-weight: 600;
}
.hmc-dots { display: flex; gap: 5px; }
.hmc-dot { width: 10px; height: 10px; border-radius: 50%; }
.hmc-r { background: #ef4444; }
.hmc-y { background: #eab308; }
.hmc-g { background: #22c55e; }
.hmc-title { flex: 1; font-size: .78rem; }
.hmc-badge {
  background: rgba(22,163,74,.2);
  border: 1px solid rgba(22,163,74,.4);
  color: #4ade80;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .68rem;
  font-weight: 700;
}

.hmc-stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  gap: 4px;
}
.hmc-stat { text-align: center; }
.hmc-sval { display: block; font-size: 1.3rem; font-weight: 800; color: white; line-height: 1; }
.hmc-slbl { font-size: .62rem; color: rgba(255,255,255,.45); margin-top: 2px; }

.hmc-funnel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hmc-frow {}
.hmc-fbar {
  height: 36px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: white;
  font-size: .72rem;
  font-weight: 700;
}

.hmc-footer {
  padding: 12px 16px;
  background: rgba(0,0,0,.2);
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: rgba(255,255,255,.55);
}

/* Floating pills */
.hero-pill {
  position: absolute;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px;
  padding: 8px 16px 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: .72rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.hero-pill-1 {
  bottom: -16px;
  right: -20px;
  animation: pillFloat1 6s ease-in-out infinite;
}
.hero-pill-2 {
  top: -14px;
  left: -22px;
  animation: pillFloat2 5.5s ease-in-out infinite;
}
@keyframes pillFloat1 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pillFloat2 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.hp-icon { font-size: 1.2rem; }
.hp-val { font-size: .9rem; font-weight: 800; color: white; }
.hp-lbl { font-size: .62rem; color: rgba(255,255,255,.55); }

.features-section {
  padding: 80px 24px;
  background: white;
}
.features-section h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 48px;
  letter-spacing: -0.5px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  max-width: 960px;
  margin: 0 auto;
}
.feature-card {
  padding: 32px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow .2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 16px;
}
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.how-section { padding: 80px 24px; background: var(--bg); }
.how-section h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 48px; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.step { text-align: center; padding: 24px 16px; }
.step-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.step h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.85rem; }

.cta-section {
  padding: 80px 24px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  text-align: center;
  color: white;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.cta-section p { opacity: 0.85; margin-bottom: 32px; }

/* ============ DASHBOARD ============ */
#dashboard-section { padding: 28px 24px; max-width: 1200px; margin: 0 auto; }

.profile-bar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow);
}
.profile-left h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 8px; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--muted);
  border: 1px solid var(--border);
}
.chip.brand { background: #ede9fe; color: var(--brand); border-color: #c4b5fd; }
.chip.green { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.chip.blue  { background: #dbeafe; color: #2563eb; border-color: #93c5fd; }

.timeline-badge {
  text-align: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid;
  min-width: 140px;
}
.timeline-badge .weeks { font-size: 1.5rem; font-weight: 800; }
.timeline-badge .tl-label { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.timeline-badge .tl-status { font-size: 0.8rem; font-weight: 600; }

/* Stats Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .stat-val {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card .stat-lbl { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.stat-card.health-card { border-top: 4px solid transparent; }

/* Main Content Row */
.content-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .content-row { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* ============ FUNNEL ============ */
#funnel-svg-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.funnel-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.8rem;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-item b { font-weight: 600; }
.legend-item span { color: var(--muted); }

/* Health bar */
.health-bar-wrap { margin-top: 16px; }
.health-bar-track {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 4px;
}
.health-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.health-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); }

/* ============ WEEKLY CHART ============ */
.chart-wrap { position: relative; height: 200px; }
.health-summary-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hs-score { font-size: 2rem; font-weight: 800; }
.hs-info { font-size: 0.8rem; }
.hs-label { font-weight: 700; margin-bottom: 2px; }
.hs-desc { opacity: 0.75; }

/* ============ JOBS TABLE ============ */
.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.filter-group { display: flex; gap: 8px; align-items: center; }
.filter-group select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.85rem;
  color: var(--text);
  background: white;
  cursor: pointer;
}

.table-responsive { overflow-x: auto; }
table.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.jobs-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.jobs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.jobs-table tr:last-child td { border-bottom: none; }
table.jobs-table tr:hover td { background: #f8fafc; }

.company-name { font-weight: 600; }
.job-title { color: var(--muted); font-size: 0.82rem; }
.date-cell { color: var(--muted); white-space: nowrap; }

/* Status badges */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.s-Applied      { background: #dbeafe; color: #1d4ed8; }
.s-Screening    { background: #fef9c3; color: #a16207; }
.s-Interview    { background: #fef3c7; color: #d97706; }
.s-FinalRound   { background: #ede9fe; color: #7c3aed; }
.s-Offer        { background: #dcfce7; color: #15803d; }
.s-Rejected     { background: #fee2e2; color: #dc2626; }
.s-Ghosted      { background: #f1f5f9; color: #94a3b8; }

.interview-yes { color: #16a34a; font-weight: 600; font-size: 0.82rem; }
.interview-no  { color: #94a3b8; font-size: 0.82rem; }

.action-btns { display: flex; gap: 4px; }
.btn-icon {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: background .15s, border-color .15s;
}
.btn-icon:hover { background: var(--bg); border-color: #94a3b8; }
.btn-icon.del:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; }

/* ============ MODALS ============ */
.modal-content { border-radius: 16px; border: none; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 20px 24px; }
.modal-title { font-weight: 700; font-size: 1.1rem; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

.form-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 0.88rem;
  padding: 9px 12px;
  transition: border-color .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
  outline: none;
}

.step-tabs { display: flex; gap: 0; margin-bottom: 24px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--border); }
.step-tab {
  flex: 1; padding: 10px; text-align: center;
  background: white; border: none;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  color: var(--muted); transition: background .15s, color .15s;
}
.step-tab.active { background: var(--brand); color: white; }
.step-panel { display: none; }
.step-panel.active { display: block; }

.tab-nav-btns { display: flex; justify-content: space-between; margin-top: 20px; }

/* ============ BUTTONS ============ */
.btn-primary-custom {
  background: var(--brand);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-primary-custom:hover { background: var(--brand-dk); transform: translateY(-1px); }
.btn-secondary-custom {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-secondary-custom:hover { background: #e2e8f0; }

/* ============ TOAST ============ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-msg {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  max-width: 320px;
}
.toast-msg.success { background: #16a34a; }
.toast-msg.error   { background: #dc2626; }
.toast-msg.info    { background: #2563eb; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============ LOADER ============ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ MISC ============ */
.no-data-funnel {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}
/* ============ SCIENCE SECTION ============ */
.sci-section {
  background: #0f172a;
  padding: 88px 24px;
  color: white;
}
.sci-inner { max-width: 920px; margin: 0 auto; }

.sci-badge {
  display: inline-block;
  background: rgba(99,102,241,.18);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.3);
  padding: 5px 16px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.sci-h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -.5px;
}
.sci-sub {
  color: #94a3b8;
  font-size: 1rem;
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: 44px;
}

.sci-stats-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 52px;
  padding: 24px 28px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
}
.sci-stat { text-align: center; }
.sci-stat-num {
  display: block;
  font-size: 2.4rem;
  font-weight: 900;
  color: #818cf8;
  line-height: 1;
  margin-bottom: 4px;
}
.sci-stat-lbl { font-size: .74rem; color: #64748b; font-weight: 500; }
.sci-stat-arrow { font-size: 1.3rem; color: #334155; }

/* Funnel Bars */
.funnel-bars { display: flex; flex-direction: column; gap: 7px; margin-bottom: 36px; }
.fb-row { display: flex; align-items: center; gap: 18px; min-height: 50px; }

.fb-bar {
  height: 50px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: white;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.fb-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.08) 0%, transparent 100%);
}
.fb-b1 { background: linear-gradient(90deg, #15803d, #16a34a); }
.fb-b2 { background: linear-gradient(90deg, #0d7a38, #22c55e); }
.fb-b3 { background: linear-gradient(90deg, #854d0e, #d97706); }
.fb-b4 { background: linear-gradient(90deg, #9a3412, #f97316); }
.fb-b5 { background: linear-gradient(90deg, #b45309, #fbbf24); }
.fb-b6 { background: linear-gradient(90deg, #991b1b, #ef4444); }
.fb-b7 { background: linear-gradient(90deg, #7f1d1d, #dc2626); }

.fb-stage {
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
}
.fb-pct {
  font-size: .82rem;
  font-weight: 800;
  margin-left: 10px;
  white-space: nowrap;
  position: relative;
  background: rgba(0,0,0,.2);
  padding: 2px 8px;
  border-radius: 50px;
}
.fb-annotation { font-size: .76rem; color: #64748b; white-space: nowrap; flex-shrink: 0; }
.fb-annotation.drop-warn  { color: #f59e0b; }
.fb-annotation.drop-crit  { color: #f87171; font-weight: 600; }
.fb-annotation.drop-ok    { color: #4ade80; }

.sci-insight-box {
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.22);
  border-radius: 14px;
  padding: 22px 26px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  color: #cbd5e1;
  font-size: .9rem;
  line-height: 1.65;
}
.si-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }

/* ============ HEALTH EXPLAIN ============ */
.health-explain-section {
  padding: 88px 24px;
  background: white;
  text-align: center;
}
.he-inner { max-width: 920px; margin: 0 auto; }
.health-explain-section h2 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -.5px;
}
.he-sub {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 52px;
  line-height: 1.6;
}

.he-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 64px;
  text-align: left;
}
.he-card {
  padding: 30px 26px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  transition: box-shadow .2s, transform .2s;
}
.he-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.he-num {
  font-size: 3.2rem;
  font-weight: 900;
  color: #e2e8f0;
  line-height: 1;
  margin-bottom: 10px;
}
.he-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.he-formula {
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 7px;
  border-left: 3px solid var(--brand);
  margin-bottom: 14px;
  color: #4338ca;
  word-break: break-word;
}
.he-card p { font-size: .85rem; color: var(--muted); line-height: 1.65; margin: 0; }

/* Color scale */
.color-scale-wrap { max-width: 680px; margin: 0 auto; text-align: center; }
.color-scale-wrap h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }

.color-gradient-strip {
  height: 40px;
  border-radius: 20px;
  background: linear-gradient(to right, #dc2626, #ea580c, #ca8a04, #22c55e, #16a34a, #14532d);
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
  position: relative;
}
.cg-marker {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-size: .65rem;
  color: var(--muted);
  font-weight: 600;
}

.cg-labels {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}
.cg-labels small { font-weight: 400; color: var(--muted); }

.cg-note {
  font-size: .82rem;
  color: var(--muted);
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: left;
  line-height: 1.55;
}

/* ============ FAILURE SECTION ============ */
.failure-section {
  padding: 88px 24px;
  background: #fafafa;
}
.failure-inner { max-width: 960px; margin: 0 auto; text-align: center; }
.failure-section h2 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 10px;
}
.failure-section > .failure-inner > p { color: var(--muted); margin-bottom: 44px; }

.failure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  text-align: left;
  margin-bottom: 48px;
}
.fc {
  background: white;
  border-radius: 14px;
  padding: 26px 22px;
  border: 1.5px solid #fecaca;
  transition: box-shadow .2s, transform .2s;
}
.fc:hover {
  box-shadow: 0 8px 28px rgba(220,38,38,.1);
  transform: translateY(-3px);
}
.fc-icon { font-size: 2rem; margin-bottom: 12px; }
.fc-symptom {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 10px;
  color: #dc2626;
  line-height: 1.4;
}
.fc-cause {
  font-size: .78rem;
  color: #c2410c;
  font-weight: 600;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: #fff7ed;
  border-radius: 6px;
  border-left: 3px solid #fb923c;
}
.fc-fix {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.65;
  padding-top: 12px;
  border-top: 1px solid #fef2f2;
}
.fc-fix strong { color: #15803d; }

/* Remote vs Hybrid compare */
.rh-compare {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  border: 1.5px solid var(--border);
  text-align: left;
}
.rhc-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text);
}
.rhc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.rhc-item {
  padding: 18px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
}
.rhc-item.rhc-highlight {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.rhc-label { font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
.rhc-stat {
  font-size: .92rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 6px;
}
.rhc-note { font-size: .78rem; color: var(--muted); line-height: 1.55; }

/* ============ RESPONSIVE ADJUSTMENTS ============ */
@media (max-width: 640px) {
  .fb-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fb-annotation { font-size: .7rem; }
  .sci-stats-row { justify-content: center; }
  .sci-stat-arrow { display: none; }
  .cg-labels { flex-wrap: wrap; gap: 8px; justify-content: center; }
}

.source-badge {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}
.feedback-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
}
.feedback-trim {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  flex-shrink: 1;
}
.fb-tip-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.fb-info-icon {
  font-size: .85rem;
  color: #94a3b8;
  cursor: help;
  transition: color .15s;
}
.fb-tip-wrap:hover .fb-info-icon { color: var(--brand); }

.fb-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .8rem;
  line-height: 1.6;
  width: 240px;
  white-space: normal;
  word-wrap: break-word;
  z-index: 9000;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.08);
  pointer-events: none;
}
.fb-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}
.fb-tip-wrap:hover .fb-tooltip { display: block; }
