:root {
  --navy: #1a2b4a;
  --navy-deep: #0f1a2e;
  --navy-700: #2f3f57;
  --navy-100: #dde4ee;
  --orange: #f26b2a;
  --orange-bright: #ff7a37;
  --orange-dark: #e35411;
  --orange-50: #fff5ed;
  --cream: #fff8f3;
  --paper: #fafbfc;
  --muted: #5b6b82;
  --ok: #1f7a4d;
  --err: #c0392b;
  --shadow-orange: 0 12px 40px -8px rgba(242, 107, 42, 0.5);
  --shadow-navy: 0 12px 40px -8px rgba(26, 43, 74, 0.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--navy);
  font: 16px/1.55 'Manrope', sans-serif; min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3, .display { font-family: 'Sora', sans-serif; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
a { color: var(--orange-dark); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* header / footer */
.topbar { background: #fff; border-bottom: 1px solid var(--navy-100); position: sticky; top: 0; z-index: 20; }
.topbar .inner { max-width: 960px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.topbar img { height: 34px; width: auto; display: block; }
.topbar .who { font-size: .85rem; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { margin-top: auto; background: var(--navy-deep); color: #c6d0de; font-size: .8rem; text-align: center; padding: 1.25rem; }

main { width: 100%; max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
main.narrow { max-width: 720px; }
.hero { background: var(--cream); border-bottom: 1px solid var(--navy-100); }
.hero .inner { max-width: 960px; margin: 0 auto; padding: 2.5rem 1.25rem 2rem; }

.kicker {
  display: inline-block; padding: .25rem .75rem; background: var(--orange-50); color: var(--orange);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; border-radius: 9999px; margin-bottom: .75rem;
}
.swoosh { display: block; width: 160px; height: 14px; margin: .25rem 0 1rem; }

/* cards */
.card { background: #fff; border: 2px solid var(--navy-100); border-radius: 1.5rem; padding: 1.5rem; }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.test-card { display: flex; flex-direction: column; gap: .5rem; transition: border-color .4s, box-shadow .4s, transform .4s; }
.test-card:hover { border-color: var(--orange); box-shadow: var(--shadow-orange); transform: translateY(-3px); }
.test-card .num { width: 2.25rem; height: 2.25rem; border-radius: 9999px; display: grid; place-items: center; font-family: 'Sora'; font-weight: 800; background: var(--navy); color: #fff; }
.test-card.done .num { background: var(--ok); }
.test-card .meta { font-size: .85rem; color: var(--muted); }
.test-card .btn { margin-top: auto; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; cursor: pointer;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1rem; text-decoration: none; border-radius: 9999px;
  padding: .9rem 1.6rem; background: var(--orange); color: #fff; box-shadow: var(--shadow-orange);
  transition: background .25s, transform .25s, box-shadow .25s; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--orange-dark); transform: scale(1.02); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.navy { background: var(--navy); box-shadow: var(--shadow-navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); box-shadow: none; }
.btn.ghost:hover { background: var(--navy); color: #fff; }
.btn.small { padding: .45rem 1rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: var(--err); border: 2px solid var(--err); box-shadow: none; }

.pill { display: inline-block; border-radius: 9999px; padding: .2rem .7rem; font-weight: 700; font-size: .78rem; background: #fff; border: 1px solid var(--navy-100); color: var(--navy); white-space: nowrap; }
.pill.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.pill.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill.ok { background: #e6f4ec; border-color: #bfe3cf; color: var(--ok); }
.pill.warn { background: var(--orange-50); border-color: #ffd9c2; color: var(--orange-dark); }

/* forms */
label.field { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 1rem; }
label.field span { display: block; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=tel], input[type=search], input[inputmode] {
  width: 100%; font: inherit; padding: .8rem 1rem; border: 2px solid var(--navy-100); border-radius: .9rem; background: #fff; color: var(--navy);
}
input:focus { outline: none; border-color: var(--orange); }
.alert { padding: .8rem 1rem; border-radius: .9rem; background: #fdecea; color: var(--err); font-weight: 600; margin-bottom: 1rem; }
.notice { padding: .8rem 1rem; border-radius: .9rem; background: var(--orange-50); color: var(--navy); margin-bottom: 1rem; }

/* test UI */
.test-bar { position: sticky; top: 58px; z-index: 10; background: var(--navy); color: #fff; border-radius: 1rem; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-navy); }
.test-bar .title { font-family: 'Sora'; font-weight: 700; font-size: .95rem; }
.timer { font-family: 'Sora'; font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; background: var(--orange); padding: .15rem .7rem; border-radius: .6rem; }
.timer.low { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { background: #fff; color: var(--orange); } }
.progress { height: 8px; background: rgba(255,255,255,.2); border-radius: 9999px; overflow: hidden; flex: 1; max-width: 220px; }
.progress > div { height: 100%; background: var(--orange); transition: width .3s; }

.q { background: #fff; border: 2px solid var(--navy-100); border-radius: 1.25rem; padding: 1.1rem 1.1rem 1.25rem; margin-bottom: 1rem; }
.q.answered { border-color: #ffd0b5; }
.q .qn { font-family: 'Sora'; font-weight: 700; color: var(--orange); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.q .prompt { font-weight: 700; margin: .25rem 0 .75rem; }
.q img { display: block; max-width: 100%; height: auto; margin: 0 auto .9rem; border-radius: .5rem; border: 1px solid var(--navy-100); background: #fff; }
.zoomwrap { overflow-x: auto; margin-bottom: .9rem; -webkit-overflow-scrolling: touch; }
.zoomwrap img { margin-bottom: 0; cursor: zoom-in; }
.zoomwrap.zoom img { max-width: none; width: 180%; cursor: zoom-out; }
.zoomhint { margin: -.5rem 0 .75rem; text-align: center; }
@media (min-width: 720px) { .zoomhint { display: none; } .zoomwrap.zoom img { width: 150%; } }
a.who { color: var(--navy); font-weight: 700; text-decoration: none; }
.q .series { font-family: 'Sora'; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; margin-bottom: .75rem; word-break: break-word; }
.q .statements { background: var(--paper); border-radius: .9rem; padding: .75rem 1rem; margin-bottom: .9rem; }
.q .statements div + div { margin-top: .25rem; }
.q .statements .concl { font-weight: 700; }

.opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.opts.stack { flex-direction: column; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: block; min-width: 3rem; text-align: center; padding: .6rem 1rem; border-radius: .9rem; border: 2px solid var(--navy-100);
  background: #fff; font-weight: 700; cursor: pointer; user-select: none; transition: all .15s;
}
.opts.stack .opt span { text-align: left; }
@media (hover: hover) { .opt span:hover { border-color: var(--orange-bright); } }
.opt input:checked + span { background: var(--orange); border-color: var(--orange); color: #fff; }
.opt input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }

/* one-at-a-time likert */
.likert-q { text-align: center; padding: 1.75rem 1.25rem; }
.likert-q .stmt { font-family: 'Sora'; font-weight: 700; font-size: clamp(1.15rem, 3.5vw, 1.45rem); min-height: 4.5rem; display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; }
.likert { display: grid; gap: .5rem; }
.likert button {
  font: inherit; font-weight: 700; padding: .85rem 1rem; border-radius: .9rem; border: 2px solid var(--navy-100); background: #fff; color: var(--navy); cursor: pointer; transition: all .15s;
}
@media (hover: hover) { .likert button:hover { border-color: var(--orange); } }
.likert button.sel { background: var(--orange); border-color: var(--orange); color: #fff; }
@media (min-width: 720px) { .likert { grid-template-columns: repeat(5, 1fr); } .likert button { font-size: .85rem; padding: .9rem .4rem; } }
.nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; gap: 1rem; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; padding: .5rem; }
.linkbtn:disabled { opacity: .3; }

.words { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.words .opt span { padding: .85rem .5rem; }

.no-select { -webkit-user-select: none; user-select: none; }
.hidden { display: none !important; }
.center { text-align: center; }
.done-icon { width: 72px; height: 72px; border-radius: 9999px; background: var(--orange); color: #fff; display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto 1rem; box-shadow: var(--shadow-orange); }

/* admin */
.table-wrap { overflow-x: auto; background: #fff; border: 2px solid var(--navy-100); border-radius: 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--navy-100); vertical-align: top; }
th { font-family: 'Sora'; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--paper); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--cream); }
td a.name { font-weight: 700; color: var(--navy); text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar form { flex: 1; min-width: 220px; display: flex; gap: .5rem; }
.bar { display: grid; grid-template-columns: 9.5rem 1fr 3rem; align-items: center; gap: .75rem; margin: .4rem 0; font-size: .9rem; }
.bar .track { height: 12px; background: var(--navy-100); border-radius: 9999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--navy); border-radius: 9999px; }
.bar .fill.o { background: var(--orange); }
.bar .val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bar { grid-template-columns: 7rem 1fr 2.6rem; font-size: .8rem; } }
.stat { background: var(--navy); color: #fff; border-radius: 1.25rem; padding: 1rem 1.25rem; }
.stat.o { background: var(--orange); }
.stat .big { font-family: 'Sora'; font-weight: 800; font-size: 1.9rem; line-height: 1.1; }
.stat .lbl { font-size: .8rem; opacity: .85; }
.kv { display: grid; grid-template-columns: 8rem 1fr; gap: .3rem .75rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--err); font-weight: 700; }
details summary { cursor: pointer; font-weight: 700; }
.copy { font-family: ui-monospace, monospace; font-size: .85rem; background: var(--paper); border: 1px dashed var(--navy-100); padding: .5rem .75rem; border-radius: .6rem; word-break: break-all; }

/* one-at-a-time DISC */
.step-label { margin-bottom: .5rem; }
.step-in { animation: step-in .35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes step-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.wordgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.wordgrid button {
  position: relative; font: inherit; font-family: 'Sora', sans-serif; font-weight: 700; font-size: clamp(1rem, 3.6vw, 1.2rem);
  min-height: 5.5rem; padding: 1rem .75rem; border-radius: 1.1rem; border: 2px solid var(--navy-100); background: #fff; color: var(--navy);
  cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .15s; word-break: break-word;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .wordgrid button:hover { border-color: var(--orange); transform: translateY(-2px); } }
.wordgrid button.sel { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: var(--shadow-orange); }
.wordgrid kbd, .likert kbd { position: absolute; top: .45rem; left: .6rem; font: 700 .7rem 'Manrope', sans-serif; color: var(--muted); opacity: .7; }
.wordgrid button.sel kbd { color: #fff; }
@media (hover: none) { .wordgrid kbd { display: none; } }
.kbd-hint { margin-top: 1rem; min-height: 1.2em; }
