:root{
  --bg:#f3f6fb;
  --card:#ffffff;
  --ink:#11233f;
  --muted:#6a7890;
  --line:#dbe3ef;
  --primary:#1f5eff;
  --primary-dark:#174ed8;
  --primary-soft:#eef4ff;
  --success:#1e9b5f;
  --success-soft:#eaf8f1;
  --warn:#b36a00;
  --warn-soft:#fff6e7;
  --shadow:0 10px 28px rgba(17,35,63,.06);
  --radius:22px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:var(--bg);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.app-shell{
  width:100%;
  max-width:960px;
  margin:0 auto;
  padding:20px 14px 40px;
}

.hero{
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  border:1px solid var(--line);
  border-radius:28px;
  padding:22px 18px;
  box-shadow:var(--shadow);
  margin-bottom:14px;
}

.hero-top{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.hero-title{
  margin:0;
  font-size:32px;
  line-height:1.18;
  letter-spacing:-0.03em;
  font-weight:800;
  color:#0f2347;
}

.hero-subtitle{
  margin:12px 0 0;
  font-size:18px;
  font-weight:700;
  color:#264a87;
}

.hero-desc{
  margin:8px 0 0;
  font-size:14px;
  line-height:1.6;
  color:var(--muted);
}

.hero-badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.meta-strip{
  margin-top:14px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid transparent;
}

.badge-blue{
  background:var(--primary);
  color:#fff;
}

.badge-blue-soft{
  background:var(--primary-soft);
  color:var(--primary-dark);
  border-color:#cfe0ff;
}

.badge-gray{
  background:#f2f5fa;
  color:#4c5b74;
  border-color:#dde5f0;
}

.warning-banner{
  background:#fff8ea;
  border:1px solid #f0d7a7;
  color:#7b5905;
  border-radius:18px;
  padding:14px 16px;
  line-height:1.6;
  font-size:13px;
  margin-bottom:14px;
}

.page-stack{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:24px;
  padding:18px 16px;
  box-shadow:var(--shadow);
}

.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.section-head h2{
  margin:0;
  font-size:24px;
  line-height:1.25;
  letter-spacing:-0.02em;
  color:#102647;
}

.section-sub{
  margin:6px 0 0;
  font-size:13px;
  color:var(--muted);
}

.form-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

label{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:13px;
  font-weight:800;
  color:#263b5d;
}

input,select{
  width:100%;
  min-height:52px;
  border:1px solid #cfd8e6;
  border-radius:14px;
  padding:12px 14px;
  background:#fff;
  font-size:18px;
  color:#12284a;
  outline:none;
}

input:focus,select:focus{
  border-color:#7da8ff;
  box-shadow:0 0 0 4px rgba(31,94,255,.10);
}

input[readonly]{
  background:#f6f9fd;
}

.checks{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}

.checks label{
  flex-direction:row;
  align-items:center;
  gap:8px;
  padding:11px 13px;
  border:1px solid #d8e1ee;
  border-radius:14px;
  background:#fbfcff;
  font-size:14px;
  font-weight:700;
}

.checks input{
  width:auto;
  min-height:auto;
  transform:scale(1.1);
}

.buttons{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:16px;
}

button{
  min-height:52px;
  border-radius:16px;
  border:1px solid #cfd8e6;
  background:#fff;
  color:#16345f;
  font-size:16px;
  font-weight:800;
  cursor:pointer;
}

button.primary{
  background:linear-gradient(135deg,var(--primary-dark),var(--primary));
  color:#fff;
  border-color:transparent;
}

#status{
  margin-top:12px;
  min-height:18px;
  color:var(--muted);
  font-size:12px;
}

.metric.big{
  font-size:28px;
  font-weight:800;
  margin-bottom:12px;
  color:#11233f;
}

.criteria{
  line-height:1.9;
  font-size:15px;
}

.muted{
  color:var(--muted);
}

.result-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.metric-box{
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
  background:#fbfdff;
  min-height:148px;
}

.metric-box.emphasis{
  background:linear-gradient(135deg,#1b57f4 0%, #2d6bff 100%);
  border-color:#2d6bff;
  color:#fff;
}

.metric-box.emphasis small,
.metric-box.emphasis .metric-label{
  color:#eef4ff;
}

.metric-label{
  display:block;
  font-size:17px;
  font-weight:800;
  color:#17345b;
  margin-bottom:6px;
}

.metric-box small{
  display:block;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.metric-value{
  display:block;
  margin-top:18px;
  font-size:42px;
  line-height:1;
  font-weight:900;
  letter-spacing:-0.04em;
}

.threshold{
  margin-top:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.15);
  color:#fff;
  font-size:13px;
  font-weight:800;
}

.decision .pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:8px 12px;
  border-radius:999px;
  background:#eef3fa;
  color:#27456f;
  font-size:13px;
  font-weight:800;
}

.decision[data-level="high"] .pill{
  background:var(--success-soft);
  color:var(--success);
}

.decision[data-level="low"] .pill{
  background:#fff7e8;
  color:#9a6500;
}

.decision h3{
  margin:14px 0 8px;
  font-size:26px;
  line-height:1.3;
  letter-spacing:-0.02em;
}

.nnt{
  margin-top:14px;
  font-size:15px;
  color:#314760;
}

.nnt strong{
  font-size:18px;
  color:#16345f;
}

.clinical-note{
  margin-top:16px;
  padding:14px 15px;
  border-radius:18px;
  background:var(--warn-soft);
  border:1px solid #efd59b;
  color:#785300;
  font-size:14px;
  line-height:1.7;
}

.hidden{
  display:none;
}

.table-wrap{
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
  font-size:13px;
}

th,td{
  border-bottom:1px solid #e6edf7;
  padding:10px 8px;
  text-align:right;
  white-space:nowrap;
}

th:first-child,td:first-child{
  text-align:left;
}

@media (min-width:700px){
  .app-shell{
    padding:28px 20px 50px;
  }

  .hero{
    padding:26px 24px;
  }

  .hero-title{
    font-size:42px;
  }

  .form-grid{
    grid-template-columns:1fr 1fr;
  }

  .buttons{
    grid-template-columns:1fr 1fr 1fr;
  }

  .result-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media (min-width:1024px){
  .hero-top{
    flex-direction:row;
    align-items:flex-start;
    justify-content:space-between;
  }

  .hero-title{
    font-size:48px;
  }

  .form-grid{
    grid-template-columns:1fr 1fr 1fr;
  }

  .result-grid{
    grid-template-columns:repeat(4,1fr);
  }

  .card{
    padding:22px 20px;
  }
}
