:root {
  --bg: #0f172a; --card: #1e293b; --ink: #f1f5f9; --muted: #94a3b8;
  --primary: #6366f1; --primary-ink: #fff; --ok: #22c55e; --bar: #334155; --error: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
#app { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }
.view { animation: fade .2s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
h1 { font-size: 1.5rem; } h2 { font-size: 1.3rem; }
.muted { color: var(--muted); }
.statement { font-size: 1.25rem; font-weight: 600; margin: 24px 0; min-height: 3.5em; }
label { display: block; margin: 14px 0 6px; font-weight: 600; }
input, textarea {
  width: 100%; padding: 12px; font-size: 1rem; border-radius: 10px;
  border: 1px solid var(--bar); background: var(--card); color: var(--ink);
}
button { cursor: pointer; font-size: 1rem; border: none; border-radius: 12px; padding: 14px 18px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); width: 100%; margin-top: 18px; font-weight: 600; }
.btn-secondary { background: var(--card); color: var(--ink); border: 1px solid var(--bar); }
.btn-link { background: none; color: var(--muted); width: 100%; margin-top: 10px; text-decoration: underline; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.code-big { font-size: 2.5rem; font-weight: 800; letter-spacing: .25em; text-align: center; background: var(--card); border-radius: 14px; padding: 22px; margin: 12px 0; }
.progress { height: 8px; background: var(--bar); border-radius: 99px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.ratings { display: grid; gap: 10px; }
.rating-btn { text-align: left; background: var(--card); border: 2px solid var(--bar); color: var(--ink); border-radius: 12px; padding: 14px; }
.rating-btn .n { font-weight: 800; margin-right: 8px; }
.rating-btn .d { color: var(--muted); font-size: .85rem; display: block; margin-top: 2px; }
.rating-btn.selected { border-color: var(--primary); background: #312e81; }
.nav { display: flex; gap: 10px; margin-top: 22px; }
.nav button { flex: 1; }
.dim { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.dim .row { display: flex; justify-content: space-between; align-items: baseline; }
.dim .name { font-weight: 700; }
.dim .score { font-weight: 800; }
.dim .meter { height: 10px; background: var(--bar); border-radius: 99px; margin: 8px 0 4px; overflow: hidden; }
.dim .meter > div { height: 100%; background: var(--primary); }
.dim .band { color: var(--muted); font-size: .85rem; }
.band-desc { color: var(--muted); font-size: .82rem; margin-top: 6px; line-height: 1.4; }
.overall .band-desc { margin-top: 8px; }
.overall { background: #312e81; border-radius: 12px; padding: 16px; margin: 8px 0 16px; text-align: center; }
.overall .big { font-size: 2rem; font-weight: 800; }
.highlow { display: flex; gap: 10px; margin: 8px 0 18px; }
.highlow .box { flex: 1; background: var(--card); border-radius: 12px; padding: 12px; }
.highlow .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.error { color: var(--error); min-height: 1.2em; }
.status { color: var(--ok); min-height: 1.2em; }
.toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.toggle-btn { flex: 1; background: var(--card); color: var(--ink); border: 2px solid var(--bar); border-radius: 12px; padding: 12px; }
.toggle-btn.active { border-color: var(--primary); background: #312e81; font-weight: 600; }
.rev-item { background: var(--card); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.rev-q { font-weight: 600; }
.rev-n { color: var(--muted); margin-right: 6px; }
.rev-a { color: #a5b4fc; margin-top: 4px; font-size: .95rem; }
.rev-unanswered { color: var(--error); margin-top: 4px; font-size: .95rem; }
.rev-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--bar); }
.rev-group-head .name { font-weight: 700; font-size: 1.05rem; }
.rev-group-head .meta { color: var(--muted); font-size: .82rem; text-align: right; }
@media print {
  body { background: #fff; color: #000; }
  .btn-primary, .btn-secondary, .btn-link, .nav, #view-wizard, #view-welcome, #view-code { display: none !important; }
  .dim, .overall, .highlow .box { border: 1px solid #ccc; }
}

/* ---- Facilitator dashboard (scoped; participant screens unaffected) ---- */
#admin-main h1 { margin: 8px 0 24px; }
#admin-main > h2 {
  margin: 36px 0 14px; padding-bottom: 8px;
  font-size: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--bar);
}
#session-form { margin-bottom: 22px; }
#session-form label { margin-top: 0; }
#session-form button { width: 100%; margin-top: 12px; }

.session-card {
  background: var(--card); border: 1px solid var(--bar);
  border-radius: 14px; padding: 18px 18px 16px; margin-bottom: 16px;
}
.session-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.session-name { font-weight: 700; font-size: 1.15rem; }
.session-count {
  flex: none; font-weight: 800; font-size: .9rem; white-space: nowrap;
  color: #c7d2fe; background: #312e81; padding: 5px 13px; border-radius: 999px;
}
.session-sub { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.card-actions { display: flex; gap: 12px; margin-top: 18px; }
.card-actions button { flex: 1; margin-top: 0; padding: 12px; }

#session-list .btn-link { margin: 8px 0 0; padding: 14px; }
#report { margin-top: 4px; }
#report .dim, #report .overall { margin-bottom: 14px; }
#report-scope { color: var(--ink); font-weight: 600; }
#admin-main p.muted { margin: 0 0 14px; }
#export-link { display: block; text-align: center; margin-top: 18px; }
#password-form { margin-bottom: 8px; }
#password-form button { width: 100%; margin-top: 14px; }
#pw-status, #pw-error { margin: 10px 0 0; }
#btn-logout { margin-top: 28px; }

/* login screen breathing room */
#admin-login { padding-top: 8px; }
#admin-login .btn-primary { margin-top: 22px; }
