:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1a2233;
  --muted: #64708a;
  --line: #e3e8f2;
  --accent: #2f6df6;
  --accent-d: #1f52c9;
  --good: #16a34a;
  --mid: #d19a00;
  --low: #dc2626;
  --shadow: 0 6px 24px rgba(28, 44, 92, 0.08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap-wide { max-width: 1040px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: -0.2px; }
.brand .sub { font-size: 13px; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; margin: 18px 0;
}
h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: -0.3px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: none;
  padding: 13px 22px; font-size: 15px; font-weight: 600;
  border-radius: 10px; cursor: pointer; transition: background .15s, transform .05s;
  text-decoration: none;
}
.btn:hover { background: var(--accent-d); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.ghost:hover { background: #eef3ff; }
.btn.lg { padding: 16px 30px; font-size: 16px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fbfcfe; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--accent); background: #fff; }

.reqs { list-style: none; padding: 0; margin: 12px 0; }
.reqs li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.reqs li:last-child { border-bottom: none; }
.reqs b { color: var(--ink); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.blue { background: #e8f0ff; color: var(--accent-d); }
.badge.warn { background: #fff4e5; color: #b5730a; }

/* progress bar */
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(244,246,251,.92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
  padding: 12px 20px; display: flex; align-items: center; gap: 16px;
}
.topbar .title { font-weight: 700; font-size: 14px; }
.topbar .spacer { flex: 1; }
.pbar { height: 8px; background: #e3e8f2; border-radius: 8px; overflow: hidden; flex: 1; max-width: 360px; }
.pbar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 8px; background: #eef3ff; color: var(--accent-d); }
.timer.warn { background: #fdecec; color: var(--low); }

.qcard { min-height: 220px; }
.stem { font-size: 18px; font-weight: 600; margin: 6px 0 18px; }
.scenario { font-size: 16px; margin: 6px 0 16px; padding: 14px 16px; background: #f7f9ff; border-left: 3px solid var(--accent); border-radius: 8px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color .12s, background .12s; background: #fff;
}
.opt:hover { border-color: #b9c9f0; background: #fafbff; }
.opt.sel { border-color: var(--accent); background: #eef3ff; }
.opt .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c3cde0; flex: 0 0 auto; margin-top: 1px; display: grid; place-items: center; }
.opt.sel .mark { border-color: var(--accent); background: var(--accent); }
.opt.sel .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt .txt { flex: 1; font-size: 15px; }

/* likert scale */
.scale { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.scale .sopt {
  flex: 1; min-width: 120px; text-align: center; padding: 12px 8px; border: 1.5px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: 13px; background: #fff; transition: .12s;
}
.scale .sopt:hover { border-color: #b9c9f0; }
.scale .sopt.sel { border-color: var(--accent); background: var(--accent); color: #fff; }

/* forced choice */
.fc { display: flex; flex-direction: column; gap: 12px; }
.fc-row { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; }
.fc-row .fc-txt { font-size: 15px; }
.fc-hd { display: grid; grid-template-columns: 70px 1fr 70px; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; padding: 0 14px; }
.pill { text-align: center; padding: 8px 4px; border-radius: 8px; border: 1.5px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 700; user-select: none; }
.pill.most.sel { background: var(--good); color: #fff; border-color: var(--good); }
.pill.least.sel { background: var(--low); color: #fff; border-color: var(--low); }

.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }
.qcount { font-size: 13px; color: var(--muted); }

/* block intro */
.intro-icon { font-size: 40px; }

/* results */
.overall { text-align: center; padding: 10px 0 4px; }
.gauge { font-size: 52px; font-weight: 800; letter-spacing: -1px; }
.gauge.high { color: var(--good); } .gauge.medium { color: var(--mid); } .gauge.low { color: var(--low); }
.cluster { margin: 20px 0; }
.cluster > .chead { display: flex; align-items: baseline; justify-content: space-between; }
.cluster > .chead .cscore { font-weight: 800; font-size: 18px; }
.facet { margin: 12px 0; }
.facet .frow { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.facet .fbar { height: 12px; background: #eef1f7; border-radius: 8px; overflow: hidden; }
.facet .fbar > i { display: block; height: 100%; border-radius: 8px; }
.fbar > i.high { background: var(--good); } .fbar > i.medium { background: var(--mid); } .fbar > i.low { background: var(--low); }
.band-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.band-tag.high { background: #e7f6ec; color: var(--good); }
.band-tag.medium { background: #fbf1d9; color: #a97b00; }
.band-tag.low { background: #fce8e8; color: var(--low); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
table.tbl tr:hover td { background: #fafbff; }

.notice { background: #fff8e6; border: 1px solid #ffe3a3; color: #7a5a00; padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.mobile-only { display: none; }

/* sjt matrix */
.matrix-wrap { overflow-x: auto; margin: 8px 0; }
table.matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
table.matrix th { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; padding: 8px 6px; }
table.matrix th:first-child { text-align: left; }
table.matrix td { border-top: 1px solid var(--line); padding: 12px 6px; }
table.matrix td.mopt { font-size: 14px; padding-right: 14px; min-width: 240px; }
table.matrix td.mcell { text-align: center; }
.mradio { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c3cde0; cursor: pointer; transition: .12s; vertical-align: middle; }
.mradio:hover { border-color: var(--accent); }
.mradio.sel { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }

/* ranking */
.ranklist { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.rankrow { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.rankrow .rnum { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; }
.rankrow .rtext { font-size: 15px; }
.rbtns { display: flex; gap: 6px; }
.rbtn { width: 38px; height: 34px; border: 1.5px solid var(--line); background: #f7f9ff; border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--accent-d); }
.rbtn:hover:not([disabled]) { background: #e8f0ff; border-color: var(--accent); }
.rbtn[disabled] { opacity: .35; cursor: not-allowed; }

/* device check */
.dev-check { list-style: none; padding: 0; margin: 8px 0; }
.dev-check li { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.dev-check li:last-child { border-bottom: none; }
.dev-check .st { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: 0 0 auto; color: #fff; }
.dev-check .st.ok { background: var(--good); }
.dev-check .st.bad { background: var(--low); }
.dev-check .st.pend { background: #c3cde0; }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
}
