:root{
  --bg:#f5f7fb;
  --surface:#ffffff;
  --ink:#111827;
  --muted:#667085;
  --line:#e4e7ec;
  --brand:#5b61f6;
  --brand2:#eef0ff;
  --dark:#111827;
  --good:#5ee2a0;
  --bad:#ff7a7a;
  --neutral:#ffd166;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--bg);
  color:var(--ink);
}

button,input,select{font:inherit}

.app-shell{
  max-width:1160px;
  margin:auto;
  padding:18px 16px 64px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:4px 0 20px;
  position:sticky;
  top:0;
  background:#f5f7fbef;
  backdrop-filter:blur(12px);
  z-index:10;
}

.brand{
  font-size:28px;
  font-weight:950;
  letter-spacing:-.8px;
  color:var(--ink);
  text-decoration:none;
}

.brand span{color:var(--brand)}

.top-actions,
.hero-actions,
.action-group{
  display:flex;
  gap:8px;
  align-items:center;
}

.btn{
  border:0;
  border-radius:12px;
  padding:12px 16px;
  font-weight:850;
  cursor:pointer;
  transition:.18s ease;
}

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

.btn-lg{padding:14px 20px}

.btn-primary{
  background:var(--brand);
  color:white;
}

.btn-ghost{
  background:#edf1f6;
  color:#475467;
}

.btn-soft{
  background:var(--brand2);
  color:#454bd8;
}

.btn-light{
  background:#fff;
  color:#111827;
}

.hero-card{
  background:linear-gradient(135deg,#0f172a,#1f2937);
  color:#fff;
  border-radius:30px;
  padding:48px 38px;
  box-shadow:0 16px 50px #10182825;
}

.hero-card h1{
  font-size:54px;
  line-height:1.02;
  letter-spacing:-2.1px;
  max-width:840px;
  margin:8px 0 16px;
}

.hero-card p{
  font-size:18px;
  line-height:1.6;
  color:#cbd5e1;
  max-width:760px;
}

.eyebrow{
  font-size:12px;
  font-weight:900;
  letter-spacing:1px;
  color:#aeb7c7;
}

.eyebrow.dark{color:#7a8495}

.trust-row{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  margin-top:20px;
  font-size:13px;
  color:#d5dbe5;
}

.feature-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin:18px 0 30px;
}

.feature-card,
.panel,
.kpi-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 8px 30px #1018280a;
}

.feature-card{padding:18px}

.feature-icon{font-size:28px}

.feature-card h3{margin:9px 0 5px}

.feature-card p,
.muted{color:var(--muted)}

.feature-card p{
  font-size:13px;
  line-height:1.5;
}

.panel{
  padding:22px;
  margin:16px 0;
}

.panel h2{
  font-size:25px;
  letter-spacing:-.5px;
  margin:0 0 7px;
}

.panel h3{
  font-size:16px;
  margin:18px 0 5px;
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.grid3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin-top:14px;
}

.kpi-card{
  padding:18px;
  min-height:132px;
}

.kpi{
  font-size:28px;
  font-weight:950;
  letter-spacing:-.5px;
  line-height:1.05;
}

.kpi-label{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

.kpi-help{
  font-size:11px;
  line-height:1.4;
  color:#98a2b3;
  margin-top:8px;
}

label{
  display:block;
  font-size:12px;
  font-weight:800;
  color:#596579;
  margin:12px 0 6px;
}

input,
select{
  width:100%;
  padding:12px 13px;
  border:1px solid #d9dfeb;
  border-radius:11px;
  background:#fff;
  color:var(--ink);
}

input:focus,
select:focus{
  outline:3px solid #e5e7ff;
  border-color:#757afb;
}

.field-help,
.helper-text{
  margin-top:6px;
  font-size:11px;
  color:#98a2b3;
  line-height:1.45;
}

.info-box{
  background:#fafbfe;
  border:1px solid #eef1f6;
  border-radius:14px;
  padding:14px;
  margin-top:14px;
  color:var(--muted);
  font-size:13px;
}

.step-actions{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:20px;
}

.hidden{display:none!important}

.wizard-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
}

.wizard-head>div:first-child{flex:1}

.autosave{
  font-size:12px;
  color:#16805a;
  font-weight:800;
  margin-top:1px;
}

.progress{
  height:6px;
  background:#e8ecf4;
  border-radius:10px;
  overflow:hidden;
  margin:8px 0 22px;
}

.progress div{
  height:100%;
  background:var(--brand);
}

.result-hero{
  background:var(--dark);
  color:white;
  border-radius:26px;
  padding:30px;
}

.result-hero .big{
  font-size:42px;
  font-weight:950;
  line-height:1.05;
  letter-spacing:-1px;
  margin:8px 0;
}

.good{color:var(--good)}
.bad{color:var(--bad)}
.neutral{color:var(--neutral)}

.result-number{
  font-size:20px;
  font-weight:850;
  margin-top:8px;
}

.result-explanation{
  margin-top:16px;
  display:grid;
  gap:6px;
  font-size:14px;
  line-height:1.5;
  color:#d5dbe5;
}

.result-note{
  color:#b9c2d0;
  font-size:13px;
  line-height:1.5;
  margin:14px 0 0;
}

.score-diff{
  display:block;
  margin-top:4px;
  font-size:12px;
  font-weight:850;
  color:#667085;
}

.score-positive{color:#16805a}
.score-negative{color:#b42318}

.table-wrap{
  width:100%;
  overflow-x:auto;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:640px;
}

th,td{
  text-align:left;
  padding:11px 7px;
  border-bottom:1px solid #edf0f5;
  vertical-align:top;
}

th{
  font-size:11px;
  color:#7a8495;
  text-transform:uppercase;
}

.total-row th{
  font-size:13px;
  color:#111827;
}

.comparison-note{
  font-size:12px;
  margin-top:10px;
}

.metric{margin:13px 0}

.metric-head{
  display:flex;
  justify-content:space-between;
  font-size:12px;
  font-weight:800;
}

.score-bars{
  display:grid;
  gap:6px;
  margin-top:6px;
}

.bar{
  height:9px;
  background:#e9edf4;
  border-radius:20px;
  overflow:hidden;
}

.bar div{
  height:100%;
  background:var(--brand);
}

.bar-old div{opacity:.45}
.bar-new div{opacity:1}

.callout{
  border-left:4px solid var(--brand);
  background:#f8f8ff;
  padding:14px 16px;
  border-radius:0 12px 12px 0;
  margin-top:10px;
}

.time-callout{margin-top:16px}

.pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.pill{
  display:inline-block;
  background:var(--brand2);
  color:#454bd8;
  padding:6px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}

.range{
  padding:0;
  border:0;
}

.slider-value{
  font-size:27px;
  font-weight:950;
  margin:10px 0;
}

.mini-stat{
  background:#fafbfe;
  border:1px solid #eef1f6;
  border-radius:14px;
  padding:14px;
}

.score-total{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:12px;
  text-align:center;
}

.score-total strong{
  display:block;
  font-size:22px;
  margin-top:3px;
}

.score-caption{
  font-size:11px;
  color:#98a2b3;
  text-transform:uppercase;
  font-weight:800;
  letter-spacing:.4px;
}

.score-arrow{
  color:#98a2b3;
  font-size:20px;
}

.score-disclaimer{
  margin-top:12px;
  color:#667085;
  font-size:12px;
  line-height:1.45;
}

.saved-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:13px 0;
  border-bottom:1px solid #eef1f6;
}

.saved-meta{
  font-size:12px;
  color:var(--muted);
  margin-top:3px;
}

footer{
  font-size:12px;
  color:#8992a4;
  line-height:1.6;
  margin-top:26px;
  padding-bottom:20px;
}

@media(max-width:820px){

  .feature-grid,
  .kpi-grid,
  .grid2,
  .grid3{
    grid-template-columns:1fr;
  }

  .hero-card{
    padding:32px 22px;
  }

  .hero-card h1{
    font-size:39px;
  }

  .topbar{
    position:static;
  }

  .top-actions .btn:first-child{
    display:none;
  }

  .wizard-head{
    display:block;
  }

  .autosave{
    margin:-14px 0 16px;
  }

  .step-actions .btn{
    flex:1;
  }

  .section-head{
    align-items:flex-start;
  }

  .action-group{
    flex-wrap:wrap;
  }

  .action-group .btn{
    flex:1;
  }

  .trust-row{
    gap:9px 14px;
  }

  .result-hero{
    padding:24px 20px;
  }

  .result-hero .big{
    font-size:34px;
  }

  .result-number{
    font-size:18px;
  }

  .kpi-card{
    min-height:auto;
  }

  .score-total{
    grid-template-columns:1fr auto 1fr;
  }

  table{
    min-width:560px;
  }

  .saved-item{
    align-items:flex-start;
    flex-direction:column;
  }

  .saved-item .btn{
    width:100%;
  }
}

@media(max-width:480px){

  .app-shell{
    padding:12px 12px 44px;
  }

  .hero-card{
    border-radius:22px;
  }

  .hero-card h1{
    font-size:34px;
    letter-spacing:-1.4px;
  }

  .hero-card p{
    font-size:16px;
  }

  .hero-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .hero-actions .btn{
    width:100%;
  }

  .top-actions{
    gap:6px;
  }

  .btn{
    padding:11px 13px;
  }

  .panel{
    padding:18px;
  }

  .result-hero .big{
    font-size:30px;
  }

  .kpi{
    font-size:25px;
  }

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

  .action-group{
    width:100%;
  }

  .action-group .btn{
    width:100%;
  }

  .score-total strong{
    font-size:19px;
  }
}

@media print{

  .topbar,
  .step-actions,
  .btn,
  .feature-grid,
  footer{
    display:none!important;
  }

  .app-shell{
    max-width:none;
    padding:0;
  }

  .panel,
  .kpi-card,
  .result-hero{
    box-shadow:none;
    break-inside:avoid;
  }

  .table-wrap{
    overflow:visible;
  }

  table{
    min-width:0;
  }
}
