:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --brand:#133a5e;
  --brand2:#0b2b47;
  --ok:#16784a;
  --okBg:#e7f7ee;
  --bad:#a21d1d;
  --badBg:#fdecec;
  --shadow: 0 10px 30px rgba(2,6,23,.06);
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  max-width: 980px;
  margin: 28px auto;
  padding: 0 18px 60px;
}

h1{
  margin: 6px 0 6px;
  font-size: 30px;
  letter-spacing: -0.02em;
}
p{ margin: 6px 0 14px; color: var(--muted); }

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

.qhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.qnum{
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.qtext{
  font-size: 18px;
  line-height: 1.35;
  margin: 10px 0 14px;
  font-weight: 650;
}

.choices{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.choice{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor:pointer;
  transition: transform .06s ease, border-color .12s ease, box-shadow .12s ease;
}
.choice:hover{
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
  transform: translateY(-1px);
}
.choice input{
  margin-top: 3px;
  transform: scale(1.15);
  accent-color: var(--brand);
}
.letter{
  width: 26px;
  font-weight: 900;
  color: var(--brand);
}
.opt{
  flex:1;
  color: var(--text);
  line-height: 1.35;
}

/* Sticky submit bar */
.actions{
  margin: 18px 0;
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}
.stickybar{
  position: sticky;
  bottom: 10px;
  z-index: 20;
  margin-top: 18px;
  padding: 12px;
  background: rgba(246,247,251,.85);
  backdrop-filter: blur(10px);
  border-radius: 14px;
}

.btn{
  display:inline-block;
  background: var(--brand);
  color:#fff;
  text-decoration:none;
  border:0;
  padding: 11px 16px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
  letter-spacing: .01em;
}
.btn:hover{ background: var(--brand2); }
.btn.ghost{
  background: #e9eef5;
  color: var(--brand);
}
.btn.ghost:hover{ background:#dde7f2; }

/* Score / review */
.scorecard{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin: 16px 0 18px;
}
.scoreline{ display:flex; align-items:baseline; gap:14px; }
.scorebig{ font-size: 34px; font-weight: 900; }
.scoresub{ font-size: 18px; color: var(--muted); }

.pill{
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill.ok{ background: var(--okBg); color: var(--ok); border: 1px solid #bfead0; }
.pill.bad{ background: var(--badBg); color: var(--bad); border: 1px solid #f4b9b9; }

.review{ margin-top: 12px; display:flex; flex-direction:column; gap:10px; }
.review-row{
  display:grid;
  grid-template-columns: 34px 1fr auto;
  gap:10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  align-items:center;
}
.review-row.correct{ border-color:#bfead0; background:#f3fbf6; }
.review-row.selected-wrong{ border-color:#f4b9b9; background:#fff5f5; }
.review-row.selected-right{ border-color:#bfead0; background:#f3fbf6; }
.mark{ color: var(--muted); font-size: 13px; white-space:nowrap; }

.explain{ margin-top: 12px; }
.explain summary{
  cursor:pointer;
  font-weight: 900;
  color: var(--brand);
}
.explain-body{
  margin-top: 10px;
  color: var(--text);
  line-height: 1.5;
  background:#f8fafc;
  border:1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
}
.ref{ margin-top: 10px; font-size: 13px; color: var(--muted); }
.ref a{ color: var(--brand); text-decoration:none; }
.ref a:hover{ text-decoration:underline; }

/* Exam library grid */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.tag{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  background:#f1f5f9;
  padding:6px 10px;
  border-radius:999px;
  display:inline-block;
  border: 1px solid var(--line);
}