:root {
  --brand: #0070B2;
  --brand-dark: #005a91;
  --brand-darker: #00466f;
  --brand-deepest: #003353;
  --brand-light: #338ec4;
  --brand-lighter: #cce4f0;
  --brand-bg: #e6f1f8;
  --brand-tint: #f0f7fc;
  --accent: #f5a623;
  --accent-dark: #d18610;

  --navy: var(--brand-darker);
  --navy-2: var(--brand-dark);
  --gold: var(--accent);
  --gold-2: var(--accent-dark);

  --bg: #f4f8fc;
  --card: #ffffff;
  --text: #1a2a3a;
  --muted: #6c7d92;
  --border: #dde6ef;
  --ok: #1c8a4c;
  --warn: #c47a04;
  --danger: #c0392b;
  --shadow: 0 4px 18px rgba(0, 112, 178, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
body > .footer { flex-shrink: 0; }

a { color: var(--navy-2); }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 70, 111, 0.12);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  padding: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-weight: 700; letter-spacing: .25px; font-size: 16px; }
.brand-sub { font-size: 12px; color: #d6e8f4; }

/* Container */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: grid;
  gap: 24px;
}
.result-container { max-width: 760px; }

.hero h1 { margin: 0 0 10px; color: var(--brand-darker); font-size: 30px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.info-grid {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.info-grid li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column;
}
.info-grid strong { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.info-grid span { font-weight: 600; color: var(--brand-darker); }
.info-grid li { border-top: 3px solid var(--brand); }

.rules {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.rules summary { cursor: pointer; font-weight: 600; color: var(--brand-darker); }
.rules ul { margin: 10px 0 4px 18px; padding: 0; }
.rules li { margin: 4px 0; }

/* Card */
.card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card h2 { margin-top: 0; color: var(--brand-darker); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
form label > .field-label {
  display: block;
  font-weight: 500;
  color: var(--text);
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="search"], select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.grid.two   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .grid.two   { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
}

.campus-form { margin-bottom: 18px; }

.tabs-cell {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tabs-cell.warn { background: #fbecd0; color: #7a5208; }
.tabs-cell.danger { background: #fdecea; color: #8b2a1d; }

textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
  resize: vertical;
  min-height: 70px;
}
textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.multi-cell { white-space: normal; }
.chip {
  display: inline-block;
  background: var(--brand-bg);
  color: var(--brand-darker);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}

.campus-table th, .campus-table td { vertical-align: top; }

.modal-card.wide { max-width: 560px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 4px;
}
.inline-form {
  display: flex; gap: 8px; margin: 14px 0;
}
.inline-form input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.allowlist {
  list-style: none; padding: 0; margin: 0;
  max-height: 280px; overflow-y: auto;
  border-top: 1px solid var(--border);
}
.allowlist li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.allowlist li.muted { display: block; padding: 18px 0; }

/* Clockwise time picker */
.clock-field .field-label { margin-bottom: 6px; }
.schedule-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px dashed var(--brand-lighter);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--muted);
  transition: border-color .15s, background .15s;
}
.schedule-trigger:hover { background: var(--brand-tint); border-color: var(--brand); }
.schedule-trigger.has-value {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-bg);
  color: var(--brand-darker);
  font-weight: 600;
}
.schedule-trigger-icon { font-size: 16px; }
.schedule-trigger-text { flex: 1; }
.schedule-trigger-caret { opacity: .6; }
.clock-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-lighter);
  border-radius: 12px;
}
.clock-picker .clock-date {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--text);
}
.clock-time {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
}
.clock-col {
  display: grid; grid-template-rows: auto auto auto auto;
  justify-items: center;
  gap: 4px;
}
.clock-step {
  background: #fff;
  border: 1px solid var(--brand-lighter);
  color: var(--brand);
  width: 70px;
  padding: 4px 0;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: background .12s, transform .05s, border-color .12s;
}
.clock-step:hover { background: var(--brand-bg); border-color: var(--brand); }
.clock-step:active { transform: scale(0.96); background: var(--brand); color: #fff; }
.clock-num {
  width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--brand-darker);
  border: 1px solid var(--brand-lighter);
  background: #fff;
  border-radius: 10px;
  padding: 6px 0;
}
.clock-num:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.clock-lbl {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}
.clock-colon {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand);
  align-self: center;
  padding-bottom: 18px;
}
.clock-quick {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.clock-quick button {
  background: #fff;
  border: 1px solid var(--brand-lighter);
  color: var(--brand);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.clock-quick button:hover { background: var(--brand-bg); }
.clock-preview {
  background: #fff;
  border: 1px dashed var(--brand-lighter);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.clock-preview.active { border-style: solid; color: var(--brand-darker); }
.clock-preview strong { color: var(--brand-darker); }

/* Pre-test countdown screen */
body.center-screen > main > .container {
  flex: 1;
  justify-content: center;
  align-items: stretch;
}
body.center-screen > main > .container > section {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.countdown-screen {
  text-align: center;
  padding: 40px 28px;
  border-top: 4px solid var(--brand);
}
.countdown-screen h2 {
  margin: 4px 0 6px;
  color: var(--brand-darker);
  font-size: 28px;
}
.countdown-tag {
  display: inline-block;
  background: var(--brand-bg);
  color: var(--brand-darker);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.countdown-tag.tag-muted { background: #f3eee7; color: var(--accent-dark); }
.countdown-clock {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  margin: 28px 0 18px;
  flex-wrap: wrap;
}
.cd-block {
  display: flex; flex-direction: column; align-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 14px;
  padding: 18px 14px 12px;
  min-width: 90px;
  box-shadow: 0 6px 18px rgba(0, 70, 111, 0.20);
}
.cd-num {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
}
.cd-lbl {
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: .85;
}
.cd-sep {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand);
  align-self: center;
  padding-top: 8px;
  animation: blink 1s infinite;
}
.countdown-window {
  background: var(--brand-bg);
  color: var(--brand-darker);
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  margin: 4px 0 8px;
  font-size: 14px;
}
@media (max-width: 540px) {
  .cd-block { min-width: 70px; padding: 14px 10px 10px; }
  .cd-num { font-size: 32px; }
  .cd-sep { display: none; }
}

.req { color: var(--danger); margin-left: 2px; }

.role-picker {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0 18px;
}
.role-picker legend { padding: 0 6px; font-weight: 600; color: var(--brand-darker); font-size: 13px; }
.role-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.role-option:hover { background: var(--brand-tint); }
.role-option input[type="radio"] { margin-top: 4px; accent-color: var(--brand); }
.role-option:has(input:checked) {
  background: var(--brand-bg);
  border-color: var(--brand);
}
.role-title { font-weight: 600; color: var(--brand-darker); }
.role-desc { color: var(--muted); font-size: 13px; }

.consent {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.primary-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .2px;
  transition: background .15s, transform .05s;
}
.primary-btn:hover:not(:disabled) { background: var(--brand-dark); }
.primary-btn:active:not(:disabled) { transform: translateY(1px); }
.primary-btn:disabled { background: #9bb6c8; cursor: not-allowed; }
.primary-btn.full { width: 100%; margin-top: 8px; }

.ghost-btn {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand-lighter);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .15s, border-color .15s;
}
.ghost-btn:hover { background: var(--brand-tint); border-color: var(--brand); }
.small-btn { padding: 4px 10px; font-size: 12px; }

.error {
  margin-top: 12px;
  color: var(--danger);
  background: #fdecea;
  border: 1px solid #f8c6c1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

/* Test page */
.test-body { background: #eef2f8; }
.test-topbar { border-bottom-width: 3px; }
.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', ui-monospace, monospace;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.timer .t-num {
  display: inline-flex; justify-content: center; align-items: center;
  min-width: 38px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}
.timer .t-sep {
  font-size: 22px;
  font-weight: 700;
  opacity: .75;
  animation: blink 1s infinite;
}
.timer .t-lbl {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .75;
  margin-left: 6px;
}
@keyframes blink { 50% { opacity: .25; } }

.timer.warn  { background: rgba(245, 166, 35, 0.28); border-color: var(--accent); }
.timer.warn  .t-num { background: rgba(0,0,0,0.25); }
.timer.danger {
  background: rgba(192, 57, 43, 0.40);
  border-color: var(--danger);
  animation: pulse 1.4s infinite;
}
.timer.danger .t-num { background: rgba(0,0,0,0.30); }

.warn-pill {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.30);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.warn-pill.warn { background: rgba(245, 166, 35, 0.35); border-color: var(--accent); }
.warn-pill.danger {
  background: rgba(192, 57, 43, 0.55);
  border-color: var(--danger);
  animation: pulse 1.4s infinite;
}

.welcome-banner {
  background: var(--brand-bg);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 4px;
}
.welcome-inner { display: flex; flex-direction: column; gap: 4px; }
.welcome-inner strong { color: var(--brand-darker); font-size: 18px; }
@keyframes pulse { 50% { opacity: .55; } }

.test-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
@media (max-width: 920px) {
  .test-layout { grid-template-columns: 1fr; }
  .navigator { order: -1; }
}

.test-single {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.overall-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.overall-bar {
  width: 160px;
  height: 8px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  overflow: hidden;
}
.overall-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 999px;
  transition: width .3s ease;
}

.question-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.qcard-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qcard-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-darker);
}

.qtimer {
  background: var(--brand-tint);
  border: 1px solid var(--brand-lighter);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qtimer-bar {
  height: 8px;
  background: var(--brand-lighter);
  border-radius: 999px;
  overflow: hidden;
}
.qtimer-fill {
  height: 100%;
  width: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .1s linear, background-color .3s;
}
.qtimer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qtimer-count {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--brand-darker);
  font-size: 16px;
}
.qtimer.warn   .qtimer-fill { background: var(--accent); }
.qtimer.warn   .qtimer-count { color: var(--accent-dark); }
.qtimer.danger .qtimer-fill { background: var(--danger); }
.qtimer.danger .qtimer-count { color: var(--danger); animation: pulse 1s infinite; }

.qcard-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.question-area {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.badge {
  background: var(--brand-bg);
  color: var(--brand-darker);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 12px;
}
.question-text {
  margin: 6px 0 22px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.options { display: grid; gap: 10px; margin-bottom: 24px; flex: 1; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.option:hover { background: var(--brand-tint); border-color: var(--brand-light); }
.option input { accent-color: var(--brand); }
.option:has(input:checked) {
  background: var(--brand-bg);
  border-color: var(--brand);
}
.option:has(input:checked) .opt-letter {
  background: var(--brand);
  color: #fff;
}
.opt-letter {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint);
  border-radius: 6px;
  font-weight: 700;
  color: var(--brand);
  font-size: 13px;
  transition: background .15s, color .15s;
}

.test-nav {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.navigator {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 20px;
}
.navigator h3 { margin: 0 0 8px; color: var(--brand-darker); }
.nav-legend {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.nav-legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.dot.answered { background: var(--ok); }
.dot.unanswered { background: #d6dbe6; }
.dot.current { background: var(--gold); }

.nav-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.nav-cell {
  background: var(--brand-tint);
  border: 1px solid var(--brand-lighter);
  color: var(--brand-darker);
  border-radius: 6px;
  padding: 6px 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .15s;
}
.nav-cell:hover { border-color: var(--brand); }
.nav-cell.answered { background: #dcf0e3; border-color: var(--ok); color: #16572f; }
.nav-cell.current { outline: 2px solid var(--accent); }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 51, 83, 0.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 50;
}
.modal.is-open { display: flex; }
[hidden] { display: none !important; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.modal-card h3 { margin-top: 0; color: var(--brand-darker); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* Result */
.score-display { display: flex; justify-content: center; margin: 20px 0; }
.score-circle {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0% 100%, var(--brand-bg) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 800;
  color: var(--brand-darker);
  font-size: 30px;
  position: relative;
}
.score-circle::before {
  content: '';
  position: absolute;
  width: 130px; height: 130px;
  background: #fff;
  border-radius: 50%;
  z-index: 0;
}
.score-circle > * { position: relative; z-index: 1; }
.score-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.score-circle.good { background: conic-gradient(var(--ok) 0% 100%, var(--brand-bg) 100%); color: var(--ok); }
.score-circle.average { background: conic-gradient(var(--warn) 0% 100%, var(--brand-bg) 100%); color: var(--warn); }
.score-circle.low { background: conic-gradient(var(--danger) 0% 100%, var(--brand-bg) 100%); color: var(--danger); }

.breakdown { display: grid; gap: 14px; margin: 16px 0 22px; }
.bd-head { display: flex; justify-content: space-between; font-weight: 600; color: var(--brand-darker); margin-bottom: 6px; }
.bd-bar { background: var(--brand-bg); height: 10px; border-radius: 999px; overflow: hidden; }
.bd-fill { background: var(--brand); height: 100%; border-radius: 999px; }

/* Admin */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.table-wrap { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.results-table th, .results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.results-table th {
  background: var(--brand-tint);
  color: var(--brand-darker);
  font-weight: 700;
}
.results-table tr:hover { background: var(--brand-tint); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill.ok { background: #dcf0e3; color: #16572f; }
.pill.warn { background: #fbecd0; color: #7a5208; }
.pill.bad { background: #fdecea; color: #8b2a1d; }

/* Admin enhancements */
.admin-container { max-width: 1280px; }
.topbar-right { display: flex; align-items: center; gap: 14px; color: #d6e8f4; }

.stats-grid.headline {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat-card { position: relative; }
.stat-card.tone-blue   { border-left: 4px solid var(--brand); }
.stat-card.tone-green  { border-left: 4px solid var(--ok); }
.stat-card.tone-amber  { border-left: 4px solid var(--warn); }
.stat-card.tone-red    { border-left: 4px solid var(--danger); }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.role-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.role-card { padding: 18px 20px; }
.role-card-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.role-card-head h3 { margin: 0; color: var(--brand-darker); }
.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.mini-stats > div {
  background: var(--brand-tint);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.mini-stats .num { display: block; font-size: 22px; font-weight: 800; color: var(--brand); }
.mini-stats .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.role-card-foot {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.role-card-foot strong { color: var(--brand); font-size: 18px; }

.auto-refresh {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 12px !important;
  color: var(--muted) !important;
  margin: 0 !important;
}

/* Footer */
.footer {
  margin-top: 32px;
  padding: 24px 20px;
  background: #ffffff;
  border-top: 3px solid var(--brand);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer .footer-team {
  color: var(--brand-darker);
  font-weight: 700;
  letter-spacing: .3px;
}
.footer a { color: var(--brand); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
.footer .footer-sep { color: var(--brand-lighter); }
@media (max-width: 540px) {
  .footer .footer-sep { display: none; }
}

/* Test card spacing on small screens */
@media (max-width: 640px) {
  .question-area { padding: 18px; }
  .container { padding: 18px 14px 40px; }
  .topbar { padding: 12px 16px; }
}
