:root {
  --bg: #FAF9F5;
  --card: #FCFBF8;
  --panel: #F0EDE3;
  --line: #E4E0D2;
  --ink: #1B1F2A;
  --muted: #6B6656;
  --accent: #1D3F72;
  --accent-ink: #FFFFFF;
  --go: #1E8E5A;
  --go-bg: #E7F3ED;
  --bad: #B23B3B;
  --bad-bg: #FBEAEA;
  --amber: #A9720C;
  --amber-bg: #FBF0DC;
  --dots: #D8D3C6;
  --radius: 14px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans Georgian', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.topheader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px dashed var(--line);
  max-width: 1180px;
  margin: 0 auto;
}
.topheader .mark {
  width: 28px; height: 28px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.topheader span.name { font-weight: 800; font-size: 15.5px; }
.topheader .spacer { flex: 1; }
.topheader .side { font-size: 13px; color: var(--muted); font-weight: 600; cursor: pointer; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 48px;
}
.page-narrow { max-width: 460px; margin: 0 auto; width: 100%; }
.page-wide { max-width: 1100px; margin: 0 auto; width: 100%; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; align-self: flex-start; }
.brand .mark { width: 30px; height: 30px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.brand span { font-weight: 800; font-size: 16px; }

.switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border-radius: 14px; max-width: 100%; }
.switch button {
  height: 44px; padding: 0 18px; border: none; border-radius: 10px; background: transparent;
  color: var(--muted); font-family: 'Noto Sans Georgian'; font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
}
.switch button.active { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(27,31,42,.14); }
.switch-wrap { width: 100%; display: flex; margin-bottom: 26px; }

h1.headline { margin: 0 0 12px; font-size: 30px; font-weight: 800; line-height: 1.25; text-wrap: balance; }
p.sub { margin: 0 0 26px; color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 460px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field input {
  width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); padding: 0 16px; font-family: inherit; font-size: 15.5px; color: var(--ink);
}
.field input::placeholder { color: #A39D8B; }
.field input:focus { outline: none; border-color: var(--accent); }

.row-inline { display: flex; gap: 10px; align-items: flex-end; }
.row-inline .field { flex: 1; margin-bottom: 0; }

.btn {
  height: 52px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink);
  font-family: 'Noto Sans Georgian'; font-weight: 700; font-size: 15.5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:disabled { background: #A9AFBE; opacity: 1; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.feedback-chip { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 15px; white-space: nowrap; }
.feedback-chip.correct { background: var(--go-bg); color: var(--go); }
.feedback-chip.wrong { background: var(--bad-bg); color: var(--bad); }

.hint { margin-top: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.65; text-align: center; }
.error-text { color: var(--bad); font-size: 13.5px; margin: -8px 0 14px; }

.statpanel { position: relative; background: var(--panel); border-radius: 20px; padding: 30px 28px; overflow: hidden; width: 100%; }
.statpanel .dotarc { position: absolute; right: -60px; top: 10px; opacity: .9; pointer-events: none; }
.stat { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 15px 0; border-bottom: 1px dashed var(--line); }
.stat:last-child { border-bottom: none; }
.stat .v { font-size: 32px; font-weight: 800; line-height: 1; }
.stat .l { font-size: 13px; color: var(--muted); }

.topbar { display: flex; align-items: center; width: 100%; margin-bottom: 16px; }
.link-btn { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 0; }
.chip-general { border: 1.5px dashed #A6976F; border-radius: var(--radius-sm); height: 46px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 700; font-size: 14px; margin-bottom: 10px; cursor: pointer; }
.chip-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: 100%; margin-bottom: 18px; }
.chip { aspect-ratio: 1; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; }
.chip.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.picked-line { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.picked-line strong { color: var(--ink); }

.exam-shell { width: 100%; max-width: 640px; }
.exam-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.exam-top .q { font-weight: 700; font-size: 15px; }
.exam-top .stats { display: flex; gap: 16px; font-weight: 600; font-size: 13.5px; }
.exam-top .stats .go { color: var(--go); }
.exam-top .stats .br { color: var(--bad); }
.timer { font-weight: 700; font-size: 15px; }
.timer.low { color: var(--bad); }
.trackbar { height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 18px; overflow: hidden; }
.trackbar > div { height: 100%; background: var(--accent); transition: width .3s; }

.signboard { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--panel); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; position: relative; overflow: hidden; }
.signboard img { width: 100%; height: 100%; object-fit: contain; }

.answer-grid { display: flex; gap: 8px; margin-bottom: 14px; }
.answer-btn { flex: 1; height: 50px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-family: 'Noto Sans Georgian'; font-weight: 700; font-size: 17px; cursor: pointer; color: var(--ink); }
.answer-btn.picked { background: var(--accent); border-color: var(--accent); color: #fff; }
.answer-btn.correct { background: var(--go-bg); border-color: var(--go); color: var(--go); }
.answer-btn.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.answer-btn:disabled { cursor: default; }

.feedback-box { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-size: 13.5px; }
.feedback-box.wrong { background: var(--bad-bg); color: var(--bad); }
.feedback-box.correct { background: var(--go-bg); color: var(--go); }
.feedback-row { display: flex; justify-content: space-between; margin-top: 5px; color: var(--ink); font-weight: 600; }

.page-exam { height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.exam-edge-bar { display: none; }
.exam-header { display: none; }
.exam-mobile-top { padding: 20px 20px 0; max-width: 640px; margin: 0 auto; width: 100%; box-sizing: border-box; flex: none; }
.exam-layout { padding: 0 20px 40px; max-width: 640px; margin: 0 auto; width: 100%; box-sizing: border-box; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.exam-main-col { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.exam-layout .signboard { flex: 1; height: auto; min-height: 180px; }
.exam-sidebar { display: none; }
.feedback-side { display: none; }

.exam-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; }
.exam-card .lbl { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.exam-card .big { font-size: 30px; font-weight: 800; }
.exam-card .big.low { color: var(--bad); }
.exam-card .of { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-left: 6px; }

.exam-pills { display: flex; gap: 12px; margin-bottom: 14px; }
.exam-pill { flex: 1; border-radius: var(--radius); padding: 15px 16px; }
.exam-pill.good { background: var(--go-bg); }
.exam-pill.bad { background: var(--bad-bg); }
.exam-pill .n { font-size: 24px; font-weight: 800; }
.exam-pill.good .n { color: var(--go); }
.exam-pill.bad .n { color: var(--bad); }
.exam-pill .l { font-size: 12.5px; margin-top: 2px; font-weight: 600; }
.exam-pill.good .l { color: var(--go); }
.exam-pill.bad .l { color: var(--bad); }

.exam-side-btn { width: 100%; margin-bottom: 12px; }

@media (min-width: 1024px) {
  .exam-edge-bar { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 9px; background: #15181F; z-index: 5; }
  .exam-header { display: flex; align-items: center; gap: 10px; padding: 22px 40px 22px 48px; border-bottom: 1px dashed var(--line); }
  .exam-header .mark { width: 28px; height: 28px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
  .exam-header .name { font-weight: 800; font-size: 16px; }
  .exam-header .exit { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; background: none; border: none; font-family: inherit; cursor: pointer; }

  .exam-mobile-top { display: none; }
  .exam-mobile-actions { display: none; }

  .exam-layout { display: grid; grid-template-columns: 1fr 420px; grid-template-rows: minmax(0, 1fr); gap: 56px; width: 100%; max-width: none; margin: 0; padding: 44px 56px 44px 64px; align-items: stretch; box-sizing: border-box; flex: 1; min-height: 0; }
  .exam-main-col { display: flex; flex-direction: column; min-height: 0; }
  .exam-layout .signboard { flex: 1; height: auto; min-height: 200px; }
  .exam-layout .answer-grid { gap: 14px; }
  .exam-layout .answer-btn { height: 72px; font-size: 23px; border-radius: 14px; }
  .exam-sidebar { display: flex; flex-direction: column; min-height: 0; }
  .exam-side-actions { margin-top: auto; }
  .feedback-side { display: block; margin-bottom: 14px; padding: 20px 22px; font-size: 15.5px; }
  .exam-card { padding: 26px 28px; }
  .exam-card .lbl { font-size: 14.5px; }
  .exam-card .big { font-size: 38px; }
  .exam-card .of { font-size: 16px; }
  .exam-pill { padding: 20px 20px; }
  .exam-pill .n { font-size: 30px; }
  .exam-pill .l { font-size: 14px; }
  .exam-side-btn { height: 58px; font-size: 16px; }
}

.page-results { height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.results-header { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-bottom: 1px dashed var(--line); flex: none; }
.results-header .mark { width: 26px; height: 26px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.results-header .name { font-weight: 800; font-size: 15px; }

.results-body { max-width: 560px; width: 100%; margin: 0 auto; padding: 32px 24px 60px; box-sizing: border-box; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.results-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; flex: none; }
.results-title-row h1 { margin: 0; font-size: 22px; font-weight: 800; }
.results-type { font-size: 13px; color: var(--muted); }

.tabs { flex: none; }

.result-panel { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; flex: 1; min-height: 0; overflow-y: auto; justify-content: center; align-content: center; }
.result-panel-left { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 220px; }
.result-panel-right { display: flex; flex-direction: column; gap: 12px; min-width: 140px; }
.result-panel-mistakes { display: block; align-content: flex-start; }

.results-actions { flex: none; }

.ring { width: 92px; height: 92px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { fill: none; stroke: var(--panel); stroke-width: 9; }
.ring .arc { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .4s; }
.ring .arc.go { stroke: var(--go); }
.ring .arc.bad { stroke: var(--bad); }
.ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-mid .score { font-size: 26px; font-weight: 800; line-height: 1; }
.ring-mid .of { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.pass-side { display: flex; flex-direction: column; gap: 8px; }
.pass-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 100px; width: fit-content; }
.pass-badge.pass { background: var(--go-bg); color: var(--go); }
.pass-badge.fail { background: var(--bad-bg); color: var(--bad); }
.pass-side p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 220px; }

.mini-stat-box { background: var(--panel); border-radius: var(--radius-sm); padding: 12px 16px; }
.mini-stat-box .l { font-size: 11.5px; color: var(--muted); }
.mini-stat-box .v { font-size: 17px; font-weight: 800; margin-top: 2px; }

.results-actions { display: flex; gap: 10px; }
.results-actions .btn { flex: 1; }

@media (max-width: 1023px) {
  .results-body { padding: 40px 28px 70px; }
  .results-title-row { margin-bottom: 26px; }
  .results-title-row h1 { font-size: 27px; }
  .results-type { font-size: 14.5px; }

  .tabs { padding: 5px; border-radius: 14px; margin-bottom: 22px; }
  .tabs button { height: 50px; font-size: 15.5px; }

  .result-panel { padding: 30px 26px; gap: 26px; margin-bottom: 26px; }
  .ring { width: 116px; height: 116px; }
  .ring .trk, .ring .arc { stroke-width: 8; }
  .ring-mid .score { font-size: 30px; }
  .ring-mid .of { font-size: 12px; }
  .pass-side { gap: 10px; }
  .pass-badge { font-size: 14px; padding: 7px 14px; }
  .pass-side p { font-size: 14px; max-width: 260px; }

  .mini-stat-box { padding: 18px 20px; }
  .mini-stat-box .l { font-size: 13px; }
  .mini-stat-box .v { font-size: 22px; margin-top: 4px; }
  .result-panel-right { gap: 14px; }

  .results-actions { gap: 12px; }
  .results-actions .btn { height: 58px; font-size: 16px; }
}

.review-body { max-width: 640px; width: 100%; margin: 0 auto; padding: 24px 20px 32px; box-sizing: border-box; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.review-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex: none; }
.review-count { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.review-card { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-bottom: 16px; }
.review-q { font-weight: 700; font-size: 15px; margin-bottom: 12px; flex: none; }
.review-image { flex: 1; height: auto; min-height: 200px; margin-bottom: 16px; }
.review-answers { display: flex; gap: 10px; flex: none; }
.review-answer { flex: 1; border-radius: var(--radius-sm); padding: 14px 16px; }
.review-answer .l { display: block; font-size: 12px; margin-bottom: 4px; }
.review-answer .v { display: block; font-size: 22px; font-weight: 800; }
.review-answer.wrong { background: var(--bad-bg); }
.review-answer.wrong .l { color: var(--bad); opacity: .8; }
.review-answer.wrong .v { color: var(--bad); }
.review-answer.correct { background: var(--go-bg); }
.review-answer.correct .l { color: var(--go); opacity: .8; }
.review-answer.correct .v { color: var(--go); }
.review-nav { display: flex; gap: 10px; flex: none; }
.review-nav .btn { flex: 1; }

@media (min-width: 1024px) {
  .review-body { max-width: none; padding: 44px 64px; }
  .review-image { min-height: 400px; }
  .review-top { margin-bottom: 20px; }
  .review-count { font-size: 15px; }
  .review-q { font-size: 19px; margin-bottom: 16px; }
  .review-answers { gap: 16px; }
  .review-answer { padding: 20px 22px; }
  .review-answer .l { font-size: 14.5px; }
  .review-answer .v { font-size: 30px; }
  .review-nav .btn { height: 60px; font-size: 17px; }
}

@media (min-width: 1024px) {
  .results-body { zoom: 1.55; }
}

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border-radius: 13px; width: 100%; margin-bottom: 16px; }
.tabs button { flex: 1; height: 40px; border: none; border-radius: 9px; background: transparent; font-family: 'Noto Sans Georgian'; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(27,31,42,.12); }

.mistake-row { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.mistake-row img { width: 52px; height: 38px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--line); flex: none; }
.mistake-row .meta { flex: 1; font-size: 12.5px; color: var(--muted); }
.mistake-row .meta strong { color: var(--ink); }

.panel { width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 0 12px 12px; border-bottom: 1.5px solid var(--line); }
table.data-table td { padding: 13px 12px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 600; }
.status-pill.active { background: var(--go-bg); color: var(--go); }
.status-pill.bad { background: var(--bad-bg); color: var(--bad); }
.device-tag { margin-left: 6px; padding: 1px 7px; border-radius: 100px; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 600; }
.time-hint { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-size: 13px; font-weight: 600; line-height: 1.5; }
.danger-link { color: var(--bad); }
.danger-btn { background: var(--bad); }
.exam-modal { max-height: 85vh; overflow-y: auto; }
.status-pill.idle { background: var(--amber-bg); color: var(--amber); }

.page-dash { min-height: 100vh; }

.dash-topnav {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 16px 32px; border-bottom: 1px dashed var(--line);
}
.dash-brand { display: flex; align-items: center; gap: 10px; }
.dash-brand .mark { width: 30px; height: 30px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.dash-brand .name { font-weight: 800; font-size: 16px; }
.dash-brand .sep { color: var(--line); font-size: 14px; }
.dash-brand .subtitle { color: var(--muted); font-size: 14px; font-weight: 600; }

.dash-nav-tabs { display: flex; align-items: center; gap: 8px; }
.dash-nav-tabs button {
  height: 40px; padding: 0 16px; border: none; border-radius: 10px; background: transparent;
  font-family: 'Noto Sans Georgian'; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.dash-nav-tabs button.active { color: var(--accent); }
.dash-nav-tabs button.pill { background: var(--panel); }
.dash-nav-tabs button.pill.active { background: #E4E9F2; color: var(--accent); }
.dash-nav-tabs .badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 100px; }

.dash-topnav-right { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.code-chip { display: flex; align-items: center; gap: 7px; background: var(--panel); border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-left { font-size: 13px; color: var(--muted); }
.logout-link { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; }

.dash-body { padding: 32px 32px 60px; max-width: 1400px; margin: 0 auto; }
.dash-page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.dash-page-title h1 { margin: 0; font-size: 26px; font-weight: 800; }
.livepill { display: inline-flex; align-items: center; gap: 7px; background: var(--go-bg); color: var(--go); font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 100px; }
.livepill .d { width: 6px; height: 6px; border-radius: 50%; background: var(--go); }

.dash-stats { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; width: 100%; }
.dash-stat { flex: 1; min-width: 150px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; }
.dash-stat .num { font-size: 26px; font-weight: 800; }
.dash-stat .label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.hard-topics { margin-bottom: 24px; }
.hard-topics-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.hard-topics-hint { font-size: 12px; color: var(--muted); cursor: help; white-space: nowrap; }
.hard-topic-list { list-style: none; margin: 0; padding: 0; }
.hard-topic {
  display: grid; grid-template-columns: 30px minmax(140px, 1.2fr) 2fr 52px; align-items: center; gap: 16px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.hard-topic:last-child { border-bottom: 0; padding-bottom: 2px; }
.hard-topic-rank {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 700;
}
.hard-topic.top .hard-topic-rank { background: var(--bad-bg); color: var(--bad); }
.hard-topic-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 14px; }
.hard-topic-name small { font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.hard-topic-bar { height: 8px; border-radius: 99px; background: var(--panel); overflow: hidden; }
.hard-topic-bar span { display: block; height: 100%; border-radius: inherit; background: var(--amber); }
.hard-topic.top .hard-topic-bar span { background: var(--bad); }
.hard-topic-pct { text-align: right; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }

.dash-filters { display: flex; gap: 12px; margin-bottom: 16px; }
.search-input { flex: 1; max-width: 320px; display: flex; align-items: center; gap: 8px; height: 42px; border: 1.5px solid var(--line); border-radius: 11px; padding: 0 14px; background: var(--card); color: var(--muted); }
.search-input input { border: none; outline: none; background: none; font-family: inherit; font-size: 14px; color: var(--ink); flex: 1; }
.mini-select { height: 42px; border: 1.5px solid var(--line); border-radius: 11px; padding: 0 14px; font-family: inherit; font-size: 14px; background: var(--card); color: var(--ink); }
.mini-input { height: 38px; border: 1.5px solid var(--line); border-radius: 9px; padding: 0 12px; font-family: inherit; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #E4E9F2; color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.type-cell strong { display: block; font-size: 13.5px; }
.type-cell span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress-cell { display: flex; align-items: center; gap: 10px; }
.mini-track { width: 80px; height: 5px; border-radius: 3px; background: var(--panel); overflow: hidden; flex: none; }
.mini-track > div { height: 100%; background: var(--accent); }

.card-row { cursor: pointer; }
.card-row:hover { background: var(--panel); }
.ticket-cell { display: flex; align-items: center; gap: 10px; }
.ticket-thumb { width: 44px; height: 32px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; }

.live-cards, .history-cards { display: none; }
.list-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.list-card:last-child { margin-bottom: 0; }
.list-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.list-card-name { font-weight: 700; font-size: 14.5px; }
.list-card-type { font-size: 12px; color: var(--muted); margin-top: 6px; }
.list-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.list-card-meta strong { color: var(--ink); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; }
.pagination-info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pagination .link-btn:disabled { opacity: .4; cursor: default; }

.card-modal-backdrop { position: fixed; inset: 0; background: rgba(27,31,42,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card-modal { background: var(--card); border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; }
.card-modal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-weight: 700; font-size: 15px; }
.card-modal-img { width: 100%; border-radius: var(--radius-sm); border: 1.5px solid var(--line); margin-bottom: 16px; display: block; }
.card-modal-stats { display: flex; gap: 10px; }
.card-modal-stats > div { flex: 1; background: var(--panel); border-radius: var(--radius-sm); padding: 12px 14px; }
.card-modal-stats .l { display: block; font-size: 11.5px; color: var(--muted); }
.card-modal-stats .v { display: block; font-size: 17px; font-weight: 800; margin-top: 2px; }
[x-cloak] { display: none !important; }

@media (max-width: 760px) {
  .dash-topnav { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .dash-brand { flex-wrap: wrap; row-gap: 4px; }

  .dash-nav-tabs {
    width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
  }
  .dash-nav-tabs::-webkit-scrollbar { display: none; }
  .dash-nav-tabs button { flex: none; white-space: nowrap; padding: 0 12px; }

  .dash-topnav-right { width: 100%; margin-left: 0; justify-content: space-between; flex-wrap: wrap; row-gap: 8px; }

  .dash-body { padding: 20px 16px 48px; }
  .dash-page-title { flex-wrap: wrap; gap: 10px; }
  .dash-page-title h1 { font-size: 21px; }

  .dash-stats { gap: 10px; }
  .dash-stat { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 14px; }
  .dash-stat .num { font-size: 21px; }

  .dash-filters { flex-wrap: wrap; }
  .search-input { max-width: none; width: 100%; }
  .mini-select { width: 100%; }

  .panel { padding: 16px; }
  .hard-topics { margin-bottom: 16px; }
  .hard-topic {
    grid-template-columns: 28px 1fr auto; grid-template-areas: "rank name pct" ". bar bar";
    column-gap: 12px; row-gap: 8px;
  }
  .hard-topic-rank { grid-area: rank; }
  .hard-topic-name { grid-area: name; }
  .hard-topic-pct { grid-area: pct; }
  .hard-topic-bar { grid-area: bar; height: 6px; }
  table.data-table { font-size: 12.5px; }
  table.data-table th, table.data-table td { padding: 10px 8px; white-space: nowrap; }

  .table-panel { display: none; }
  .live-cards, .history-cards { display: block; }
}

.login-header {
  width: 100%; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  padding: 20px 24px;
}
.login-header .mark { width: 28px; height: 28px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.login-header span { font-weight: 800; font-size: 16px; }
.login-body { flex: 1; width: 100%; box-sizing: border-box; display: flex; padding: 24px; }
.page-login { padding: 0; }

@media (min-width: 1024px) {
  .page { padding-top: 48px; }
  h1.headline { font-size: 36px; }

  .page-login { padding: 0; min-height: 100vh; }
  .login-header { padding: 22px 40px; border-bottom: 1px dashed var(--line); }
  .login-body { align-items: center; justify-content: center; padding: 44px 40px 52px; }
  .login-grid { display: grid; grid-template-columns: 1.1fr .8fr; gap: 80px; align-items: center; max-width: 1480px; width: 100%; }
  .row-inline { align-items: flex-end; }

  .page-login h1.headline { font-size: 58px; }
  .page-login p.sub { font-size: 20px; max-width: 550px; }
  .page-login .switch button { height: 56px; font-size: 17.5px; padding: 0 24px; }
  .page-login .field input { height: 66px; font-size: 19px; border-radius: 14px; }
  .page-login .field label { font-size: 15.5px; }
  .page-login .btn { height: 66px; font-size: 19px; padding: 0 32px; border-radius: 14px; }
  .page-login .hint { font-size: 14.5px; }

  .statpanel { padding: 52px 46px; border-radius: 26px; }
  .stat .v { font-size: 54px; }
  .stat .l { font-size: 17px; }
}

@media (max-width: 1023px) {
  .login-header { border-bottom: 1px dashed var(--line); margin-bottom: 24px; }
  .login-body { padding: 0 24px 48px; }
  .login-grid { display: flex; flex-direction: column; width: 100%; max-width: 420px; margin: 0 auto; }
  .statpanel { display: none; }
  .row-inline { flex-direction: column; align-items: stretch; }
  .row-inline .btn { width: 100%; }
}

.site-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; padding: 18px 24px 24px; font-size: 13px; color: var(--muted); }
.site-footer a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Pin the footer to the bottom of the screen on mobile, but only when there's
   room for it — on a short viewport it stays in normal flow so it never
   covers the form, and you just scroll down to it instead. */
@media (max-width: 1023px) and (min-height: 700px) {
  .page-login .site-footer {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .page-login .login-body { padding-bottom: 90px; }
}

@media (max-width: 1023px) {
  .page-exam { height: 100vh; height: 100dvh; }
  .exam-layout { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .exam-layout .signboard { margin: 0 -20px; border: 0; border-radius: 0; background: transparent; cursor: zoom-in; }
  .exam-layout .signboard img { height: auto; max-height: 100%; }
  .exam-layout .answer-grid { margin-bottom: 12px; }
}
.zoom-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.zoom-overlay img { width: 100%; height: 100%; object-fit: contain; }
.zoom-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.6); font-size: 12.5px; pointer-events: none; }
@media (orientation: portrait) {
  .zoom-overlay img { width: 100vh; height: 100vw; flex: none; transform: rotate(90deg); }
}
@media (min-width: 1024px) { .zoom-overlay { display: none !important; } }
.zoom-badge { position: absolute; right: 12px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(27,31,42,.78); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
@media (min-width: 1024px) { .zoom-badge { display: none; } }
