/* ============================================================
   Northwind Talent Assessment - shared design system
   ============================================================ */

:root {
  --bg: #f5f6fa;
  --bg-soft: #eceefb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e2e5f0;
  --border-strong: #cdd2e4;
  --text: #171a2b;
  --text-soft: #565c78;
  --text-faint: #858ba6;
  --primary: #4338ca;
  --primary-soft: #eef0ff;
  --primary-strong: #372fb0;
  --success: #0f8a5f;
  --success-soft: #e6f6ef;
  --warning: #b25e09;
  --warning-soft: #fdf1e2;
  --danger: #c02b3f;
  --danger-soft: #fdecef;
  --info: #1f6fb2;
  --shadow-sm: 0 1px 2px rgba(18, 22, 45, 0.06);
  --shadow-md: 0 6px 24px rgba(18, 22, 45, 0.08);
  --shadow-lg: 0 18px 48px rgba(18, 22, 45, 0.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1020;
    --bg-soft: #151832;
    --surface: #171a30;
    --surface-2: #1d2140;
    --border: #272c4d;
    --border-strong: #363c66;
    --text: #eef0fb;
    --text-soft: #a8aeca;
    --text-faint: #767ca0;
    --primary: #8b83ff;
    --primary-soft: #23234a;
    --primary-strong: #a49dff;
    --success: #4ad197;
    --success-soft: #14322a;
    --warning: #e6a852;
    --warning-soft: #33280f;
    --danger: #ff7a8c;
    --danger-soft: #3a1620;
    --info: #6ab5f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 0.4em; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 620; }
p { margin: 0 0 1em; }
a { color: var(--primary); }

/* ---------- layout ---------- */

.app-shell { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #7c6bff);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.brand small { display: block; font-size: 11px; color: var(--text-faint); font-weight: 500; letter-spacing: 0; }

.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-soft); }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 24px 72px; }
main.wide { max-width: 1400px; }

.page-head { margin-bottom: 22px; }
.page-head p { color: var(--text-soft); max-width: 70ch; margin-bottom: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.09em; font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--text-soft); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); } }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- buttons ---------- */

.btn {
  --btn-bg: var(--primary);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit; font-weight: 580; font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn.secondary { --btn-bg: var(--surface); --btn-fg: var(--text); border-color: var(--border-strong); }
.btn.ghost { --btn-bg: transparent; --btn-fg: var(--primary); }
.btn.subtle { --btn-bg: var(--primary-soft); --btn-fg: var(--primary); }
.btn.danger { --btn-bg: var(--danger); }
.btn.lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-soft); display: flex; align-items: center; gap: 8px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 1em; }
.field-hint { font-size: 12.5px; color: var(--text-faint); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 640; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.tag.auto { background: var(--success-soft); color: var(--success); border-color: transparent; }
.tag.manual { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.tag.info { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag.success { background: var(--success-soft); color: var(--success); border-color: transparent; }

/* ---------- notices ---------- */

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--text);
  border: 1px solid transparent; font-size: 13.5px;
}
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.success { background: var(--success-soft); color: var(--success); }
.notice strong { font-weight: 650; }

/* ---------- steps ---------- */

.stepper { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.step-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-soft); font-weight: 550;
}
.step-chip .idx {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--border); color: var(--text-soft); font-size: 11px; font-weight: 700;
}
.step-chip.done { border-color: transparent; background: var(--success-soft); color: var(--success); }
.step-chip.done .idx { background: var(--success); color: #fff; }
.step-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.step-chip.active .idx { background: var(--primary); color: #fff; }

/* ---------- stat blocks ---------- */

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; }
.stat .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.stat .value small { font-size: 0.8rem; font-weight: 500; color: var(--text-faint); margin-left: 4px; }
.stat .trend { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

.score-row { display: grid; grid-template-columns: 150px 1fr 52px; gap: 12px; align-items: center; margin-bottom: 9px; font-size: 13.5px; }
.score-row .bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.score-row .bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7c6bff); }
.score-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }

.big-score { display: flex; align-items: baseline; gap: 8px; }
.big-score .n { font-size: 3rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.big-score .u { color: var(--text-faint); font-size: 0.95rem; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- misc ---------- */

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block { display: flex; align-items: center; gap: 10px; color: var(--text-soft); padding: 40px 0; justify-content: center; }

.empty-state { padding: 48px 24px; text-align: center; color: var(--text-soft); }
.empty-state h3 { color: var(--text); }

.divider { height: 1px; background: var(--border); margin: 18px 0; border: none; }

.pill-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 1.15rem;
  padding: 6px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
}
.pill-timer.urgent { background: var(--danger-soft); color: var(--danger); }

.progress-line { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #7c6bff); transition: width 0.3s ease; }

.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-md); max-width: 340px; font-size: 13.5px;
  animation: toast-in 0.2s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   Candidate flow specifics
   ============================================================ */

/* landing */
.hero { padding: 56px 0 28px; }
.hero h1 { font-size: 2.6rem; max-width: 18ch; }
.hero p.lead { font-size: 1.08rem; color: var(--text-soft); max-width: 62ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-steps { margin-top: 46px; }
.hero-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.hero-step .n { font-size: 12px; font-weight: 700; color: var(--primary); letter-spacing: 0.08em; }
.hero-step h3 { margin: 6px 0 6px; }
.hero-step p { margin: 0; font-size: 13.5px; color: var(--text-soft); }

/* upload */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 46px 24px;
  text-align: center;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon { font-size: 2rem; }
.dropzone h3 { margin: 10px 0 4px; }
.dropzone p { margin: 0; color: var(--text-soft); font-size: 13.5px; }

.file-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.file-chip .name { font-weight: 600; }

.parse-preview {
  max-height: 190px; overflow: auto; white-space: pre-wrap;
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; color: var(--text-soft);
}

/* typing test */
.typing-stage { position: relative; }
.typing-text {
  font-family: var(--mono);
  font-size: 20px;
  line-height: 2.05;
  letter-spacing: 0.01em;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  user-select: none;
  min-height: 190px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.typing-text .ch { color: var(--text-faint); position: relative; }
.typing-text .ch.ok { color: var(--text); }
.typing-text .ch.bad { color: var(--danger); background: var(--danger-soft); border-radius: 3px; }
.typing-text .ch.bad.space { background: var(--danger); opacity: 0.55; }
.typing-text .ch.cur::before {
  content: ""; position: absolute; left: -1px; top: 0.1em; bottom: 0.1em;
  width: 2px; background: var(--primary); border-radius: 2px;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.typing-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.typing-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-radius: var(--radius); backdrop-filter: blur(2px); cursor: pointer; text-align: center;
}
.typing-live { display: flex; gap: 26px; flex-wrap: wrap; }
.typing-live .item .k { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; }
.typing-live .item .v { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.duration-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .duration-choice { grid-template-columns: minmax(0, 1fr); } }
.duration-option {
  text-align: left; padding: 20px; border-radius: var(--radius);
  border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer;
  font: inherit; color: var(--text); transition: all 0.15s ease;
}
.duration-option:hover { border-color: var(--primary); }
.duration-option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.duration-option .big { font-size: 1.6rem; font-weight: 720; letter-spacing: -0.02em; }

/* customer service */
.chat-bubble {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px; padding: 16px 18px; font-size: 15px; line-height: 1.65;
}
.chat-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #7c6bff, var(--primary)); color: #fff; font-weight: 650; font-size: 13px;
}
.note-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-soft); }
.note-list li { margin-bottom: 5px; }
.reply-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-faint); }

/* game */
.game-frame { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.game-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.compare-col { background: var(--surface); }
.compare-col + .compare-col { border-left: 1px solid var(--border); }
.compare-col h4 { margin: 0; padding: 10px 14px; background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); border-bottom: 1px solid var(--border); }
.field-row { display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s ease; }
.field-row:last-child { border-bottom: none; }
.field-row .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 650; }
.field-row .v { font-family: var(--mono); font-size: 13px; }
.field-row:hover { background: var(--surface-2); }
.field-row.picked { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.field-row.reveal-hit { background: var(--success-soft); box-shadow: inset 3px 0 0 var(--success); }
.field-row.reveal-miss { background: var(--danger-soft); box-shadow: inset 3px 0 0 var(--danger); }
@media (max-width: 720px) { .compare-grid { grid-template-columns: minmax(0, 1fr); } .compare-col + .compare-col { border-left: none; border-top: 1px solid var(--border); } }

.ticket { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); }
.ticket p { margin: 0 0 10px; font-size: 14px; }
.bucket-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.bucket-btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
  padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 580; cursor: pointer;
}
.bucket-btn:hover { border-color: var(--primary); color: var(--primary); }
.bucket-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.bucket-btn.right { background: var(--success); border-color: var(--success); color: #fff; }
.bucket-btn.wrong { background: var(--danger); border-color: var(--danger); color: #fff; }

.seq-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }
.seq-item .pos { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.seq-item .txt { flex: 1; font-size: 14px; }
.seq-item .moves { display: flex; flex-direction: column; gap: 3px; }
.seq-item .moves button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft); border-radius: 6px; width: 26px; height: 20px; cursor: pointer; line-height: 1; font-size: 11px; }
.seq-item .moves button:hover { border-color: var(--primary); color: var(--primary); }
.seq-item.right { border-color: var(--success); }
.seq-item.wrong { border-color: var(--danger); }

table.audit { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.audit th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); padding: 8px 12px; border-bottom: 1px solid var(--border); }
table.audit td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; }
table.audit tbody tr { cursor: pointer; }
table.audit tbody tr:hover td { background: var(--surface-2); }
table.audit tbody tr.picked td { background: var(--primary-soft); }
table.audit tbody tr.reveal-hit td { background: var(--success-soft); }
table.audit tbody tr.reveal-miss td { background: var(--danger-soft); }

/* completion */
.celebrate { text-align: center; padding: 40px 20px 10px; }
.celebrate .mark {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; font-size: 2.1rem;
}

/* typing passage word grouping (keeps words from breaking mid-word) */
.typing-text { white-space: pre-wrap; }
.typing-text .w { display: inline-block; }
table.data th.num { text-align: right; }

/* ============================================================
   Admin console
   ============================================================ */

.admin-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--text); color: var(--surface); padding: 3px 7px; border-radius: 5px;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type="search"], .filters select {
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.filters input[type="search"] { min-width: 260px; }
.filters .grow { flex: 1; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--text-soft); }

.mini-bar { display: inline-block; width: 54px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; vertical-align: middle; margin-right: 7px; }
.mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #7c6bff); }

.steps-dots { display: inline-flex; gap: 4px; }
.steps-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); display: block; }
.steps-dots i.on { background: var(--success); }

.attempt-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: var(--surface); }
.attempt-card + .attempt-card { margin-top: 12px; }
.attempt-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.attempt-head .when { font-size: 12.5px; color: var(--text-faint); }

.reply-block {
  white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.6;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  border: none; background: none; font: inherit; font-size: 14px; font-weight: 560; color: var(--text-soft);
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.on { color: var(--primary); border-bottom-color: var(--primary); }

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; font-weight: 550; }

/* ---------- narrow screens ---------- */

@media (max-width: 620px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 14px; line-height: 1.15; max-width: 170px; }
  .brand small { display: none; }
  .topbar-user { gap: 8px; }
  main { padding: 20px 14px 56px; }
  h1 { font-size: 1.55rem; }
  .hero { padding: 30px 0 18px; }
  .hero h1 { font-size: 1.9rem; }
  .card { padding: 18px 16px; }
  .typing-text { font-size: 16px; line-height: 1.9; padding: 16px; }
  .big-score .n { font-size: 2.4rem; }
  .filters input[type="search"] { min-width: 0; width: 100%; }
  .score-row { grid-template-columns: 110px 1fr 42px; font-size: 12.5px; }
  .kv { grid-template-columns: 120px 1fr; }
}
