/* V159 sequential training stage flow: rules -> evidence -> decision -> quiz */
.stage-flow-v159 .nav-list{gap:10px;}
.stage-flow-v159 .nav-item{position:relative; display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; white-space:nowrap;}
.stage-flow-v159 .nav-item.stage-locked{opacity:.58; border-color:rgba(255,255,255,.12);}
.stage-flow-v159 .nav-item.stage-done::after{content:'✓'; display:inline-flex; width:18px; height:18px; align-items:center; justify-content:center; border-radius:999px; background:rgba(67,236,154,.20); color:#9fffd0; font-size:12px; border:1px solid rgba(115,255,190,.32);}
.stage-flow-v159 .nav-item.stage-next{box-shadow:0 0 0 1px rgba(151,134,255,.40),0 0 28px rgba(89,94,255,.18) inset;}
.v159-stage-card{padding:28px; border-radius:28px; background:linear-gradient(135deg,rgba(24,32,48,.88),rgba(7,12,24,.82)); border:1px solid rgba(214,224,255,.14); box-shadow:0 24px 70px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.08); overflow:hidden; position:relative;}
.v159-stage-card::before{content:''; position:absolute; inset:-20%; background:radial-gradient(circle at 20% 10%,rgba(140,126,255,.20),transparent 32%),radial-gradient(circle at 92% 18%,rgba(68,221,255,.12),transparent 34%),radial-gradient(circle at 62% 95%,rgba(52,216,148,.12),transparent 38%); pointer-events:none;}
.v159-stage-card>*{position:relative; z-index:1;}
.v159-stage-top{display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:22px;}
.v159-stage-top h3{font-size:clamp(30px,4vw,54px); line-height:1.02; letter-spacing:-.055em; margin:6px 0 10px; color:#f8fbff;}
.v159-stage-top p{font-size:clamp(15px,1.55vw,19px); color:rgba(232,238,250,.78); max-width:860px; line-height:1.65; margin:0;}
.v159-stage-pill{display:inline-flex; align-items:center; justify-content:center; border-radius:999px; padding:10px 14px; background:rgba(140,126,255,.16); color:#e8e2ff; border:1px solid rgba(171,155,255,.30); font-weight:900; letter-spacing:.08em; text-transform:uppercase; font-size:12px; white-space:nowrap;}
.v159-stage-pill.green{background:rgba(48,214,139,.15); color:#b7ffd8; border-color:rgba(81,239,163,.33);}
.v159-stage-pill.red{background:rgba(255,76,116,.13); color:#ffd1dc; border-color:rgba(255,105,139,.30);}
.v159-flow-grid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:22px 0;}
.v159-flow-step{border-radius:24px; padding:18px; border:1px solid rgba(255,255,255,.13); background:rgba(255,255,255,.055); min-height:164px; display:flex; flex-direction:column; gap:9px;}
.v159-flow-step strong{font-size:20px; color:#fff; letter-spacing:-.02em;}
.v159-flow-step span{font-size:14px; color:rgba(236,242,255,.72); line-height:1.55;}
.v159-flow-step b{font-size:12px; width:max-content; border-radius:999px; padding:7px 10px; background:rgba(255,255,255,.08); color:#cfc8ff; border:1px solid rgba(255,255,255,.12);}
.v159-rule-list{display:grid; gap:12px; margin:20px 0 4px;}
.v159-rule-row{display:grid; grid-template-columns:52px 1fr; gap:14px; align-items:flex-start; padding:16px; border-radius:22px; border:1px solid rgba(255,255,255,.11); background:rgba(3,8,18,.42);}
.v159-rule-row .num{width:42px;height:42px;border-radius:16px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,rgba(150,130,255,.30),rgba(74,210,255,.16));border:1px solid rgba(255,255,255,.15);font-weight:950;color:#fff;}
.v159-rule-row strong{display:block;color:#fff;font-size:17px;margin-bottom:5px;}
.v159-rule-row span{display:block;color:rgba(231,238,250,.76);line-height:1.55;font-size:14.5px;}
.v159-status-strip{display:flex; flex-wrap:wrap; gap:10px; margin:18px 0;}
.v159-status-chip{border-radius:999px; padding:11px 13px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12); color:#e8eefb; font-weight:850; font-size:13px;}
.v159-status-chip.warn{background:rgba(255,185,70,.13);border-color:rgba(255,209,114,.28);color:#ffdf9d;}
.v159-status-chip.good{background:rgba(48,214,139,.14);border-color:rgba(95,245,171,.28);color:#baffda;}
.v159-stage-actions{display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; align-items:center;}
.v159-primary{border:none; cursor:pointer; border-radius:999px; padding:15px 22px; min-height:50px; color:#07101c; font-weight:950; letter-spacing:-.015em; background:linear-gradient(135deg,#eff1ff,#c7baff 48%,#8eefff); box-shadow:0 15px 38px rgba(144,192,255,.22);}
.v159-primary:disabled{opacity:.55; cursor:not-allowed; filter:grayscale(.3);}
.v159-secondary{border:1px solid rgba(255,255,255,.16); cursor:pointer; border-radius:999px; padding:13px 18px; min-height:48px; color:#edf3ff; font-weight:850; background:rgba(255,255,255,.06);}
.v159-lock-card{padding:22px; border-radius:24px; background:rgba(255,78,116,.10); border:1px solid rgba(255,95,135,.26); color:#ffe2e9; margin-top:20px;}
.v159-lock-card h4{margin:0 0 8px;font-size:22px;color:#fff;}
.v159-lock-card p{margin:0;color:#ffd4df;line-height:1.55;}
.v159-dev-mini{font-size:12px;color:rgba(232,238,255,.60); margin-left:auto;}
.stage-flow-v159 .lab-result-v158.show{scroll-margin-top:120px;}
@media (max-width: 860px){
  .stage-flow-v159 .sidebar{position:relative; top:auto; width:100%; max-width:100%; padding:12px; margin:0 auto 14px; border-radius:24px;}
  .stage-flow-v159 .nav-list{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
  .stage-flow-v159 .nav-item{min-height:42px; font-size:13px; padding:9px 10px;}
  .v159-stage-card{padding:20px; border-radius:24px; width:100%; max-width:100%;}
  .v159-stage-top{display:block;}
  .v159-stage-top h3{font-size:32px;}
  .v159-flow-grid{grid-template-columns:1fr;}
  .v159-flow-step{min-height:auto;}
  .v159-rule-row{grid-template-columns:42px 1fr; padding:14px;}
  .v159-rule-row .num{width:36px;height:36px;border-radius:13px;}
  .v159-stage-actions{display:grid; grid-template-columns:1fr;}
  .v159-primary,.v159-secondary{width:100%; justify-content:center;}
  .v159-status-strip{display:grid; grid-template-columns:1fr;}
}

/* V160: no standalone global Rules tab. Each stage owns its own rules card. */
body.stage-flow-v160 #quizRulesSection{
  display:none !important;
}
body.stage-flow-v160 .nav-list{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.stage-flow-v160 .nav-item[data-section="rules"]{
  display:none !important;
}
.v160-stage-card{
  width: min(100%, 1240px);
  margin-inline: auto;
}
.v160-stage-card .v159-stage-top h3{
  line-height: 1.05;
}
.v160-stage-card .v159-stage-actions{
  justify-content: flex-start;
}
@media (max-width: 760px){
  body.stage-flow-v160 .nav-list{
    grid-template-columns: 1fr;
  }
  .v160-stage-card{
    border-radius: 24px;
    padding: 18px;
  }
  .v160-stage-card .v159-stage-top{
    gap: 14px;
  }
}
