:root {
  --ink: #1d2433;
  --muted: #5d6b7c;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-warm: #f97316;
  --surface: #ffffff;
  --border: #e3e8ef;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

:root[data-theme="dark"] {
  --ink: #e7edf6;
  --muted: #a8b4c5;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-warm: #fb923c;
  --surface: #0b1220;
  --border: rgba(231, 237, 246, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: radial-gradient(circle at top, #f7f3ea 0%, #eef2f8 45%, #ffe9da 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

:root[data-theme="dark"] body {
  background: radial-gradient(circle at top, #0b1220 0%, #070b14 55%, #0b1220 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.12), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(249, 115, 22, 0.12), transparent 45%);
  pointer-events: none;
}

:root[data-theme="dark"] body::before {
  background: radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(251, 146, 60, 0.14), transparent 45%);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  position: relative;
  z-index: 1;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .shell-header {
  background: rgba(11, 18, 32, 0.65);
  border-bottom: 1px solid var(--border);
}

.shell-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shell-brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.shell-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shell-nav a,
.shell-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.92rem;
}

:root[data-theme="dark"] .shell-nav a,
:root[data-theme="dark"] .shell-nav button {
  background: rgba(231, 237, 246, 0.06);
  color: var(--ink);
}

.shell-nav a.active {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.12);
}

.login-page {
  min-height: calc(100vh - 84px);
  display: grid;
  place-items: center;
  padding: 24px;
}

@media (max-width: 520px) {
  .login-page {
    padding: 16px;
  }
}

.login-card {
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.login-card .card__header {
  border-bottom: none;
  padding: 28px 28px 0;
}

.login-card .card__body {
  padding: 18px 28px 28px;
}

.login-card .h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
}

.btn-block {
  width: 100%;
}

.login-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

.link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.95rem;
}

.link:hover {
  text-decoration: underline;
}

:root[data-theme="dark"] .link {
  color: var(--ink);
}

@media (max-width: 640px) {
  .shell-header__inner {
    padding: 12px 14px;
  }

  .shell-nav {
    gap: 8px;
  }

  .shell-nav a,
  .shell-nav button {
    padding: 9px 10px;
    font-size: 0.88rem;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11, 18, 32, 0.65);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav a {
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav a.active {
  background: var(--surface);
  border: 1px solid var(--border);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 20px 42px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

:root[data-theme="dark"] .card {
  border-color: rgba(231, 237, 246, 0.12);
}

.panel {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .panel {
  background: rgba(11, 18, 32, 0.78);
  border-color: rgba(231, 237, 246, 0.12);
}

.card__header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.card__body {
  padding: 18px;
}

.h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.label {
  font-weight: 650;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  outline: none;
}

:root[data-theme="dark"] .input {
  background: rgba(231, 237, 246, 0.06);
  color: var(--ink);
}

.input:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 22px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #1f8d7f 100%);
  color: white;
}

.btn-secondary {
  background: #eef1f6;
  color: var(--ink);
}

:root[data-theme="dark"] .btn-secondary {
  background: rgba(231, 237, 246, 0.08);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
  color: white;
}

.btn.danger {
  border-color: rgba(255, 77, 109, 0.55);
  background: linear-gradient(180deg, rgba(255, 77, 109, 0.3), rgba(255, 77, 109, 0.14));
}

.btn.success {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.26), rgba(34, 197, 94, 0.12));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 118, 110, 0.10);
  color: var(--accent-strong);
  font-weight: 650;
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 640px) {
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .sets-list {
    display: grid;
    gap: 14px;
  }

  .set-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transform: translateZ(0);
  }

  :root[data-theme="dark"] .set-card {
    border-color: rgba(231, 237, 246, 0.12);
  }

  .set-card__header {
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(
      135deg,
      rgba(15, 118, 110, 0.14) 0%,
      rgba(249, 115, 22, 0.10) 100%
    );
  }

  :root[data-theme="dark"] .set-card__header {
    background: linear-gradient(
      135deg,
      rgba(45, 212, 191, 0.18) 0%,
      rgba(251, 146, 60, 0.12) 100%
    );
  }

  .set-card__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0;
    font-weight: 800;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
  }

  .set-card__title::after {
    content: "▾";
    font-weight: 900;
    color: var(--accent-strong);
    opacity: 0.9;
    margin-left: 12px;
  }

  :root[data-theme="dark"] .set-card__title::after {
    color: var(--ink);
  }

  .set-card__actions {
    padding: 12px 14px 14px;
  }

  .set-card__meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

:root[data-theme="dark"] .notice {
  background: rgba(231, 237, 246, 0.06);
}

.notice.error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: var(--ink);
}

.notice.success {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: var(--ink);
}

.question {
  display: grid;
  gap: 12px;
}

.header-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .header-panel {
  border-color: rgba(231, 237, 246, 0.12);
}

.question__title {
  font-weight: 800;
  font-size: 18px;
}

.answer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.answer input {
  margin-top: 3px;
}

.answer.correct {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.14);
}

.answer.wrong {
  border-color: rgba(255, 77, 109, 0.6);
  background: rgba(255, 77, 109, 0.14);
}

.answer.disabled {
  opacity: 0.85;
  cursor: default;
}

.img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.header-left h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  margin: 10px 0 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.results-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  margin: 12px 0 8px;
}

.hero-subtitle {
  color: var(--muted);
  max-width: 520px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  background: #f5f7fb;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-strong);
}

:root[data-theme="dark"] .meta-pill {
  background: rgba(231, 237, 246, 0.06);
}

.status-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-radius: 18px;
  color: white;
}

.status-banner.passed {
  background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
}

.status-banner.failed {
  background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
}

.status-banner.practice {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.status-icon {
  font-size: 2.8rem;
}

.status-title {
  font-size: 1.6rem;
  font-weight: 600;
}

.status-subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
}

.status-metric {
  text-align: right;
}

.status-metric span {
  display: block;
}

.metric-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #f5f7fb;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

:root[data-theme="dark"] .stat-card {
  background: rgba(231, 237, 246, 0.06);
  border: 1px solid rgba(231, 237, 246, 0.12);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.details-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
}

.section-header p {
  color: var(--muted);
  max-width: 520px;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 600;
}

:root[data-theme="dark"] .filter-btn {
  background: rgba(231, 237, 246, 0.06);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-btn:hover {
  border-color: var(--accent);
}

.question-review {
  background: #f8fafc;
  padding: 18px;
  border-radius: 16px;
  border-left: 4px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.print-report-head {
  display: none;
}

.question-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.question-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

:root[data-theme="dark"] .question-review {
  background: rgba(231, 237, 246, 0.05);
  border-left-color: rgba(231, 237, 246, 0.18);
}

.question-review.correct {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.question-review.incorrect {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.question-review.unanswered {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.question-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
}

.question-status.correct {
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
}

.question-status.incorrect {
  background: rgba(239, 68, 68, 0.18);
  color: #7f1d1d;
}

.question-status.unanswered {
  background: rgba(245, 158, 11, 0.18);
  color: #7c2d12;
}

.question-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 600;
}

.question-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.question-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="dark"] .question-meta {
  border-color: rgba(231, 237, 246, 0.12);
  background: rgba(231, 237, 246, 0.05);
}

.question-meta__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.question-meta__value {
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--ink);
}

.question-media {
  margin: 4px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.question-media--inline {
  padding: 10px;
  margin-top: 6px;
}

:root[data-theme="dark"] .question-media {
  background: rgba(231, 237, 246, 0.04);
  border-color: rgba(231, 237, 246, 0.12);
}

.question-media__img {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}

.question-media__caption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.answer-info {
  font-size: 0.9rem;
  color: var(--muted);
}

.answers-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.answer-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] .answer-row {
  border-color: rgba(231, 237, 246, 0.12);
  background: rgba(231, 237, 246, 0.06);
}

.answer-row.correct {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.answer-row.chosen {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.12);
}

.answer-row.wrong-choice {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

.answer-badge {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-strong);
  min-width: 56px;
}

.answer-text {
  flex: 1;
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.muted-center {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

@media (max-width: 780px) {
  .status-banner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .status-metric {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .results-card {
    padding: 18px;
  }

  .question-head {
    align-items: stretch;
  }

  .question-number-badge,
  .question-status {
    width: fit-content;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    min-width: 100%;
    width: 100%;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm 12mm 14mm;
  }

  html,
  body {
    background: white !important;
    color: black !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.45;
  }

  .shell-header,
  .actions,
  .filter-buttons,
  .tag,
  .hero-subtitle,
  .print-report-head {
    display: none !important;
  }

  main,
  .app,
  .page {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  .results-card {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 14px !important;
    background: white !important;
  }

  .hero {
    display: block !important;
  }

  .hero h1 {
    font-size: 16pt !important;
    margin: 0 0 8px !important;
  }

  .hero-meta,
  .stats-grid {
    gap: 8px !important;
  }

  .meta-pill,
  .stat-card,
  .question-meta,
  .question-media,
  .answer-row {
    background: white !important;
    color: black !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
  }

  .status-banner {
    color: #111827 !important;
    background: white !important;
    border: 2px solid #cbd5e1 !important;
    padding: 12px 14px !important;
  }

  .status-icon {
    font-size: 18pt !important;
  }

  .status-title {
    font-size: 13pt !important;
  }

  .status-subtitle,
  .metric-label,
  .stat-label,
  .question-media__caption {
    color: #4b5563 !important;
    opacity: 1 !important;
  }

  .question-review {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 10px !important;
    background: white !important;
    border: 1px solid #cbd5e1 !important;
    border-left-width: 4px !important;
  }

  .question-review.correct {
    border-left-color: #16a34a !important;
  }

  .question-review.incorrect {
    border-left-color: #dc2626 !important;
  }

  .question-review.unanswered {
    border-left-color: #d97706 !important;
  }

  .question-status,
  .question-number-badge {
    border: 1px solid #cbd5e1 !important;
    background: white !important;
    color: #111827 !important;
  }

  .question-media__img {
    max-width: 420px !important;
  }

  .answer-badge {
    color: #111827 !important;
  }
}

.test-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.info-chip {
  background: #f5f7fb;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 160px;
}

:root[data-theme="dark"] .info-chip {
  background: rgba(231, 237, 246, 0.06);
}

.info-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-value {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: var(--ink);
}

.timer-block {
  background: linear-gradient(135deg, var(--accent) 0%, #1f8d7f 100%);
  color: white;
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 16px 35px rgba(15, 118, 110, 0.25);
}

.timer-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  opacity: 0.8;
}

.timer {
  font-size: 1.9rem;
  font-weight: 600;
  margin-top: 6px;
}

.timer.warning {
  color: #ffe08a;
  animation: pulse 1s infinite;
}

.timer.danger {
  color: #ffe3e0;
}

.timer.no-limit {
  font-size: 1rem;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-top: 22px;
}

@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 100%;
  }

  .progress-panel,
  .finish-panel {
    width: 100%;
    max-width: 100%;
  }

  .test-info {
    width: 100%;
  }

  .info-chip {
    min-width: 0;
    flex: 1 1 180px;
  }

  .timer-block {
    min-width: 0;
    width: 100%;
  }
}

.question-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.question-panel.switching {
  opacity: 0.65;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

:root[data-theme="dark"] .question-panel {
  border-color: rgba(231, 237, 246, 0.12);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.question-number {
  font-weight: 600;
  color: var(--accent-strong);
}

.question-image {
  max-width: 100%;
  border-radius: 16px;
  margin: 12px 0 18px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.15);
}

.answers-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-item {
  background: #f5f7fb;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

:root[data-theme="dark"] .answer-item {
  background: rgba(231, 237, 246, 0.06);
}

.answer-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.answer-item.selected {
  background: rgba(15, 118, 110, 0.08);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
}

.answer-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #9aa4b2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

.answer-item.selected .answer-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.answer-item.selected .answer-radio::after {
  content: "✓";
}

.answer-item.correct {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.65);
}

.answer-item.incorrect {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.55);
}

.answer-item.locked {
  cursor: default;
}

.answer-item.locked:hover {
  transform: none;
  box-shadow: none;
}

.answer-text {
  flex: 1;
  font-size: 0.98rem;
}

.navigation {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-panel,
.finish-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .progress-panel,
:root[data-theme="dark"] .finish-panel {
  border-color: rgba(231, 237, 246, 0.12);
}

.progress-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.progress-bar {
  height: 10px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

:root[data-theme="dark"] .progress-bar {
  background: rgba(231, 237, 246, 0.10);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #1f8d7f);
  transition: width 0.3s ease;
}

.progress-text {
  color: var(--muted);
  font-size: 0.85rem;
}

.questions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.question-dot {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  background: #edf1f6;
  color: var(--muted);
}

:root[data-theme="dark"] .question-dot {
  background: rgba(231, 237, 246, 0.10);
}

.question-dot.correct {
  background: rgba(34, 197, 94, 0.22);
  color: #166534;
}

.question-dot.incorrect {
  background: rgba(239, 68, 68, 0.18);
  color: #7f1d1d;
}

.question-dot.answered {
  background: rgba(34, 197, 94, 0.2);
  color: #166534;
}

.question-dot.current {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.question-dot:hover {
  transform: scale(1.05);
}

.btn-finish {
  width: 100%;
  margin-top: 12px;
}

.stats-list {
  list-style: none;
  margin-top: 12px;
}

.stats-list li {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.stats-list li:last-child {
  border-bottom: none;
}

.list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink);
}

.list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: none;
}

@media (max-width: 520px) {
  .page {
    padding: 22px 14px 60px;
  }

  .header-panel {
    padding: 18px;
  }

  .question-panel {
    padding: 18px;
  }

  .progress-panel,
  .finish-panel {
    padding: 16px;
  }

  .navigation {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .questions-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Conservative UI polish for the restored working frontend */
.shell-header {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.shell-brand {
  font-size: 1.02rem;
  white-space: nowrap;
}

.shell-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.shell-nav::-webkit-scrollbar {
  height: 6px;
}

.shell-nav::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.24);
  border-radius: 999px;
}

.shell-nav a,
.shell-nav button {
  flex: 0 0 auto;
  min-height: 42px;
  white-space: nowrap;
}

.app {
  max-width: 1280px;
  padding-top: 30px;
  padding-bottom: 56px;
}

.header-panel,
.question-panel,
.progress-panel,
.finish-panel,
.results-card,
.card,
.panel {
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.test-info {
  align-items: stretch;
}

.info-chip {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.content-wrapper {
  grid-template-columns: minmax(0, 1fr) 336px;
  align-items: start;
  gap: 24px;
}

.sidebar {
  position: sticky;
  top: 86px;
}

.question-panel {
  padding: 30px;
}

.question-header {
  gap: 14px;
  align-items: flex-start;
}

.question-number {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.question-image {
  display: block;
  width: 100%;
  max-width: 720px;
  max-height: 440px;
  object-fit: contain;
  margin: 14px auto 22px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="dark"] .question-image {
  background: rgba(231, 237, 246, 0.04);
  border-color: rgba(231, 237, 246, 0.12);
}

.answers-list {
  gap: 14px;
}

.answer-item {
  min-height: 68px;
  padding: 16px 18px;
  border-radius: 16px;
  align-items: flex-start;
}

.answer-radio {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.answer-text {
  line-height: 1.5;
}

.navigation {
  justify-content: space-between;
  align-items: stretch;
}

.navigation .btn {
  flex: 1 1 180px;
}

.progress-panel,
.finish-panel {
  padding: 22px;
}

.questions-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.question-dot {
  min-height: 42px;
  border-radius: 12px;
}

.table th,
.table td {
  line-height: 1.45;
}

@media (max-width: 900px) {
  .shell-header {
    position: static;
  }

  .shell-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell-brand {
    width: 100%;
  }

  .shell-nav {
    width: 100%;
    padding-bottom: 0;
  }

  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .sidebar {
    position: static;
  }

  .question-panel {
    padding: 22px;
  }

  .question-image {
    max-height: 360px;
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 20px 14px 34px;
  }

  .shell-nav a,
  .shell-nav button {
    min-height: 40px;
    padding: 9px 12px;
  }

  .test-info {
    gap: 10px;
  }

  .info-chip {
    min-height: 68px;
    min-width: calc(50% - 5px);
    flex: 1 1 calc(50% - 5px);
  }

  .timer-block {
    padding: 14px 16px;
  }

  .timer {
    font-size: 1.65rem;
  }

  .question-panel,
  .progress-panel,
  .finish-panel,
  .results-card,
  .header-panel {
    border-radius: 16px;
  }

  .question-panel {
    padding: 18px;
  }

  .question-image {
    max-height: 300px;
    margin-bottom: 18px;
  }

  .answer-item {
    min-height: 64px;
    padding: 15px 14px;
    gap: 12px;
  }

  .navigation {
    gap: 10px;
  }

  .navigation .btn {
    flex-basis: 100%;
  }

  .questions-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .question-dot {
    min-height: 38px;
    font-size: 0.78rem;
  }
}
