:root {
  --white: #FFFFFF;
  --purple: #4A2A7A;
  --purple-dark: #33195A;
  --matcha: #4E7A1E;
  --matcha-dark: #3E6316;
  --matcha-soft: #E8F2D8;
  --orange: #F59E1B;
  --orange-text: #B45F06;
  --orange-soft: #FEF1D6;
  --lavender: #F6F2FB;
  --line: #E6E0EE;
  --text: #231B30;
  --muted: #5F5870;
  --d: #B3261E; --i: #F59E1B; --s: #4E7A1E; --c: #2F5DA8;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--white); color: var(--text);
  font: 16px/1.6 Inter, system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Plus Jakarta Sans", Inter, sans-serif; color: var(--purple-dark); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--white);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--purple-dark); }
.brand small { color: var(--muted); font-size: .78rem; }
.logo { width: 40px; height: 24px; }
.logo line { stroke: #CFC6DC; stroke-width: 2; }
.badge { background: var(--orange-soft); color: var(--orange-text); font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; }

main { max-width: 860px; margin: 0 auto; padding: 32px 16px 48px; outline: none; }
.foot { max-width: 860px; margin: 0 auto; padding: 16px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card.soft { background: var(--lavender); border-color: transparent; }
.hero { background: var(--lavender); border-radius: 20px; padding: 32px 28px; margin-bottom: 24px; }
.hero .kicker { color: var(--matcha-dark); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 0; }
.fact { background: var(--white); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.fact b { display: block; font-family: "Plus Jakarta Sans", sans-serif; font-size: 1.2rem; color: var(--purple); }

ol.steps { padding-left: 1.2em; margin: 0; }
ol.steps li { margin-bottom: .4em; }

form .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input, select {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--text);
}
input:focus, select:focus, button:focus-visible, .choice input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

.btn {
  font: 600 1rem Inter, sans-serif; border: 0; border-radius: 10px; padding: 12px 22px; cursor: pointer;
  background: var(--purple); color: var(--white);
}
.btn:hover { background: var(--purple-dark); }
.btn:disabled { background: #C9C2D6; cursor: not-allowed; }
.btn.secondary { background: var(--white); color: var(--purple); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--lavender); }
.btn.green { background: var(--matcha); }
.btn.green:hover { background: var(--matcha-dark); }
.actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 20px; flex-wrap: wrap; }

/* Soal */
.progress { height: 8px; background: var(--lavender); border-radius: 99px; overflow: hidden; margin: 8px 0 24px; }
.progress span { display: block; height: 100%; background: var(--matcha); transition: width .25s; }
.qhead { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.qtable { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.qtable th { font-size: .78rem; color: var(--muted); font-weight: 600; text-align: center; padding: 0 4px; }
.qtable th:first-child { text-align: left; }
.qtable td { background: var(--lavender); padding: 12px 10px; }
.qtable td:first-child { border-radius: 12px 0 0 12px; padding-left: 16px; font-weight: 500; }
.qtable td:last-child { border-radius: 0 12px 12px 0; }
.qtable tr.is-most td { background: var(--matcha-soft); }
.qtable tr.is-least td { background: var(--orange-soft); }
.choice { display: flex; justify-content: center; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid #CFC6DC; background: var(--white);
  display: grid; place-items: center; font-weight: 700; color: #B9B0C8; cursor: pointer; transition: .15s;
}
.choice.p input:checked + span { background: var(--matcha); border-color: var(--matcha); color: var(--white); }
.choice.k input:checked + span { background: var(--orange); border-color: var(--orange); color: var(--purple-dark); }
.choice input:disabled + span { opacity: .35; cursor: not-allowed; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }

/* Hasil */
.result-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.meta { font-size: .9rem; color: var(--muted); }
.meta b { color: var(--text); }
.headline { background: var(--purple); color: var(--white); border-radius: 20px; padding: 28px; margin: 20px 0; }
.headline h2 { color: var(--white); font-size: 1.6rem; margin-bottom: .2em; }
.headline .code { display: inline-block; background: var(--orange); color: var(--purple-dark); font-weight: 700; border-radius: 8px; padding: 2px 10px; margin-bottom: 10px; }
.headline p { margin: 0; opacity: .92; }

table.lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
table.lines th, table.lines td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line); }
table.lines th:first-child, table.lines td:first-child { text-align: left; }
table.lines thead th { color: var(--muted); font-size: .8rem; font-weight: 600; }

.graphs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.graph { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.graph h3 { margin-bottom: 0; }
.graph .sub { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.graph svg { width: 100%; height: auto; display: block; }
.graph .pname { font-weight: 700; color: var(--purple); margin-top: 8px; }
.graph .pcode { font-size: .82rem; color: var(--matcha-dark); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding: 0; list-style: none; }
.chips li { background: var(--lavender); border-radius: 99px; padding: 2px 10px; font-size: .78rem; }

.headline .small { font-size: .88rem; opacity: .8; margin-top: 8px; }
.gsum { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.box { border-radius: 12px; padding: 14px 16px; }
.box h3 { margin-bottom: 6px; }
.box ul { margin: 0; padding-left: 1.1em; }
.box.good { background: var(--matcha-soft); }
.box.good h3 { color: var(--matcha-dark); }
.box.grow { background: var(--orange-soft); }
.box.grow h3 { color: var(--orange-text); }
.tip { margin: 0; padding: 12px 16px; background: var(--lavender); border-radius: 12px; font-size: .95rem; }
.flags {background: var(--orange-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.flags h3 { color: var(--orange-text); }
.flags ul { margin: 0; padding-left: 1.2em; }
.errors { background: #FDECEA; color: #8A1C14; border-radius: 12px; padding: 12px 16px; margin-top: 12px; }

@media (max-width: 560px) {
  .card, .hero { padding: 18px; }
  .choice span { width: 38px; height: 38px; }
  .qtable td { padding: 10px 6px; }
  .qtable td:first-child { padding-left: 12px; font-size: .95rem; }
  table.lines { font-size: .82rem; }
  table.lines th, table.lines td { padding: 6px 4px; }
}
@media print {
  .topbar, .foot, .actions, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .headline { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .graph, .card { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Peserta v2 ---------- */
.prompt { font-weight: 600; color: var(--purple-dark); font-size: 1.1rem; margin-bottom: 8px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 16px; font-size: .92rem; }
.consent input { width: auto; margin-top: 4px; }
.numgrid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.numgrid .btn { padding: 8px 14px; }
.hero.done { text-align: center; }

/* ---------- Admin ---------- */
.btn.small { padding: 6px 14px; font-size: .9rem; }
.btn.danger { color: #8A1C14; border-color: #F2C4BF; }
a.btn { text-decoration: none; display: inline-block; }
a { color: var(--purple); }
.login { max-width: 420px; margin: 40px auto; }
.search { margin: 8px 0 16px; }
.tablewrap { overflow-x: auto; }
table.list td, table.list th { text-align: left; }
.pill { display: inline-block; background: var(--lavender); color: var(--purple); font-weight: 600; font-size: .8rem; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.pill.warn { background: var(--orange-soft); color: var(--orange-text); }
.report p { margin-bottom: .8em; }
.report ol { padding-left: 1.2em; margin: 0; }
.report ol li { margin-bottom: .5em; }
dl.pairs { margin: 0; display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; }
dl.pairs dt { font-weight: 600; color: var(--purple-dark); }
dl.pairs dd { margin: 0; }
table.answers td { text-align: left; }
table.answers .f { font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--lavender); border-radius: 6px; padding: 0 6px; }
details.card summary { cursor: pointer; }
@media (max-width: 560px) { dl.pairs { grid-template-columns: 1fr; gap: 2px; } dl.pairs dd { margin-bottom: 10px; } }
.report.lead { border-left: 5px solid var(--purple); margin-top: 20px; }
.report.lead p { font-size: 1.02rem; line-height: 1.75; }
.report.lead p:last-child { margin-bottom: 0; background: var(--matcha-soft); border-radius: 10px; padding: 12px 14px; }

/* ---------- Grafik admin lebih kecil ---------- */
.admin .graphs { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.admin .graph { padding: 12px; }
.admin .graph svg { max-width: 190px; margin: 0 auto; }
.admin .graph .sub { margin-bottom: 4px; }

/* ---------- PDF ringkas (dirender di luar layar) ---------- */
.pdf-holder { position: fixed; left: -10000px; top: 0; }
.pdf { width: 700px; background: #fff; color: #231B30; font: 13px/1.55 Inter, sans-serif; }
.pdf p { margin: 0 0 6px; }
.pdf h3 { font: 700 14.5px/1.3 "Plus Jakarta Sans", Inter, sans-serif; color: #33195A; margin: 0 0 5px; }
.pdf .ph { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #4A2A7A; padding-bottom: 6px; margin-bottom: 8px; }
.pdf .pk { font-size: 9.5px; color: #3E6316; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pdf .pn { font: 800 20px/1.2 "Plus Jakarta Sans", Inter, sans-serif; color: #33195A; }
.pdf .pm { font-size: 11.5px; color: #5F5870; }
.pdf .pbrand { text-align: right; font-weight: 700; color: #4A2A7A; font-size: 11px; }
.pdf .pbrand span { color: #4E7A1E; font-weight: 600; }
.pdf .phl { background: #4A2A7A; color: #fff; border-radius: 8px; padding: 8px 11px; margin-bottom: 10px; font-size: 13px; }
.pdf .phl .pc { background: #F59E1B; color: #33195A; font-weight: 700; border-radius: 4px; padding: 0 6px; }
.pdf .pg { display: grid; grid-template-columns: repeat(3, 1fr) 1.15fr; gap: 6px; margin-bottom: 8px; }
.pdf .pgi { border: 1px solid #E6E0EE; border-radius: 6px; padding: 5px; text-align: center; }
.pdf .pgi svg { display: block; margin: 0 auto; }
.pdf .pgt { font-weight: 700; font-size: 11px; color: #33195A; }
.pdf .pgn { font-size: 10.5px; font-weight: 600; color: #4A2A7A; }
.pdf .ptab table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; }
.pdf .ptab th, .pdf .ptab td { padding: 3px 2px; border-bottom: 1px solid #E6E0EE; text-align: center; }
.pdf .ptab td:first-child { text-align: left; font-weight: 600; }
.pdf .pb { margin-bottom: 12px; }
.pdf .pb.lead { border-left: 3px solid #4A2A7A; padding-left: 9px; }
.pdf .pb.lead p:last-child { background: #E8F2D8; border-radius: 6px; padding: 5px 8px; }
.pdf dl { display: grid; grid-template-columns: 140px 1fr; gap: 5px 12px; margin: 0; }
.pdf dt { font-weight: 600; color: #33195A; }
.pdf dd { margin: 0; }
.pdf .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pdf .two > div { border-radius: 6px; padding: 6px 9px; }
.pdf .two .good { background: #E8F2D8; }
.pdf .two .grow { background: #FEF1D6; }
.pdf ul, .pdf ol { margin: 0; padding-left: 16px; }
.pdf li { margin-bottom: 3px; }
.pdf .note { font-size: 11px; color: #5F5870; }

/* ---------- Pilihan versi laporan + batang kecenderungan ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { font: 600 .9rem Inter, sans-serif; border: 0; background: var(--white); color: var(--purple); padding: 10px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--purple); color: var(--white); }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 120px; gap: 12px; align-items: center; }
.bar .bl { font-weight: 600; color: var(--purple-dark); }
.bar .bt { height: 12px; background: var(--lavender); border-radius: 99px; overflow: hidden; }
.bar .bt span { display: block; height: 100%; background: linear-gradient(90deg, var(--matcha), var(--purple)); border-radius: 99px; }
.bar .bv { font-size: .85rem; color: var(--muted); }
@media (max-width: 560px) { .bar { grid-template-columns: 1fr; gap: 4px; } }
.pdf .pbars .bars { gap: 6px; }
.pdf .pbars .bar { grid-template-columns: 220px 1fr 110px; gap: 10px; }
.pdf .pbars .bt { height: 10px; background: #F6F2FB; }
.pdf .pbars .bt span { background: linear-gradient(90deg, #4E7A1E, #4A2A7A); }
.pdf .pbars .bl { color: #33195A; font-weight: 600; }
.pdf .pbars .bv { font-size: 11px; color: #5F5870; }

/* ---------- Versi peserta: ringkasan dan daftar poin ---------- */
.report.quick { background: var(--orange-soft); border-color: transparent; }
.report.quick dl.pairs dt { color: var(--orange-text); }
ul.bul { margin: 0; padding-left: 1.2em; }
ul.bul li { margin-bottom: .4em; }
.pdf .quick { background: #FEF1D6; border-radius: 6px; padding: 7px 10px; }
.pdf .quick dt { color: #B45F06; }

/* ---------- Petunjuk peserta ---------- */
.tp { color: var(--matcha-dark); }
.tk { color: var(--orange-text); }
.example { background: var(--white); border-radius: 12px; padding: 14px; margin-top: 14px; }
.ex-title { font-weight: 700; color: var(--purple-dark); margin-bottom: 8px; }
.ex-row { display: grid; grid-template-columns: 1fr 36px 36px; gap: 8px; align-items: center; background: var(--lavender); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: .92rem; }
.ex-row.is-most { background: var(--matcha-soft); }
.ex-row.is-least { background: var(--orange-soft); }
.ex-b { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #CFC6DC; background: var(--white); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.ex-b.on-p { background: var(--matcha); border-color: var(--matcha); color: #fff; }
.ex-b.on-k { background: var(--orange); border-color: var(--orange); color: var(--purple-dark); }
.ex-note { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.qtable th small { display: block; font-weight: 500; font-size: .66rem; line-height: 1.2; max-width: 64px; margin: 2px auto 0; }
.qtable th.colp { color: var(--matcha-dark); }
.qtable th.colk { color: var(--orange-text); }
