:root {
  --bg: #0b1223;
  --panel: #0f1a33;
  --panel-strong: #0c1429;
  --text: #e8ecf5;
  --muted: #9caac1;
  --accent: #6ff1c5;
  --accent-strong: #2aeaa6;
  --danger: #ff6b6b;
  --warning: #f7c266;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(120% 120% at 20% 20%, rgba(106, 255, 210, 0.08), transparent 45%),
              radial-gradient(80% 80% at 80% 10%, rgba(102, 153, 255, 0.06), transparent 40%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 32px;
}

.page {
  max-width: 1200px;
  margin: 0 auto 64px;
}

.page__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 {
  margin: 6px 0 12px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

h2 {
  margin: 6px 0 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.hero__badge {
  background: linear-gradient(120deg, rgba(110, 241, 197, 0.14), rgba(108, 169, 255, 0.14));
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  color: var(--text);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow);
}

.hero__user {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero__user-badge {
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.page-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-nav__btn {
  border-color: var(--border);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.page-nav__btn--active {
  background: rgba(111, 241, 197, 0.18);
  color: var(--text);
}

.page-section {
  margin-top: 20px;
}

.page-section + .panel,
.page-section + .page-section {
  margin-top: 20px;
}

.panel--welcome,
.panel--help,
.panel--study {
  text-align: left;
}

.welcome-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.help-list {
  margin: 12px 0 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

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

.grid--main {
  grid-template-columns: 1fr 320px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel--quiz {
  background: linear-gradient(180deg, rgba(110, 241, 197, 0.05), rgba(14, 25, 48, 0.9));
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel__sub {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}

.panel__sub--topics {
  margin-top: 16px;
}

.topic-mode-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.topic-fine-tune-status {
  font-size: 13px;
  color: var(--muted);
  margin-left: 12px;
  line-height: 1.6;
}

.topic-fine-tune-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-left: 8px;
  animation: spin 1s linear infinite;
}

.saved-topics-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-end;
}
.saved-topics-controls--top {
  margin-bottom: 10px;
}
.saved-topics-controls--global {
  justify-content: flex-start;
  margin-bottom: 16px;
}
.saved-topics-controls__label {
  font-size: 12px;
  color: var(--muted);
  width: 100%;
  margin-bottom: 4px;
  margin-left: 2px;
}
.saved-topics-controls input {
  flex: 1 1 220px;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
}

.saved-topics__list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.saved-topics__empty {
  margin: 0;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.saved-topics__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  color: #fff;
  margin-bottom: 8px;
  transition: border 0.2s ease, background 0.2s ease;
}
.saved-topics__item:last-child {
  margin-bottom: 0;
}
.saved-topics__item--selected {
  border-color: var(--accent);
  background: rgba(157, 247, 218, 0.08);
}
.saved-topics__name {
  flex: 1;
  background: none;
  border: none;
  color: inherit;
  font-size: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.saved-topics__name:hover {
  text-decoration: underline;
}
.saved-topics__delete {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}
.saved-topics__delete:hover {
  background: rgba(255, 255, 255, 0.15);
}

.topic-fine-tune-spinner.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.panel__sub--code pre {
  background: #0b1424;
}
.panel__sub--code #contextPreview {
  max-height: 260px;
  overflow-y: auto;
}
.exam-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}
.exam-search-row--tight {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}
.exam-search-row select.small-select {
  min-width: 160px;
  max-width: 220px;
}
.exam-search-row input {
  min-width: 180px;
  max-width: 260px;
  width: 100%;
}
.exam-results {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #0c162d;
}
.exam-results.hidden { display: none; }
.exam-results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.exam-results .checkbox-list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}
.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0c162d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.checkbox-list input {
  width: 16px;
  height: 16px;
}
.topic-controls {
  display: flex;
  gap: 8px;
}
.small-select {
  background: #0c162d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 140px;
}

.panel--status .status-block {
  background: #0c162d;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

#statusQuestionNumber {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

#statusQuestionNumber.hidden {
  display: none;
}

.doc-search-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 18px;
}

.doc-search__tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-search__tab {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 6px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.doc-search__tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.doc-search__tab--active {
  background: rgba(9, 156, 239, 0.15);
  color: #8ad0ff;
  border-color: rgba(138, 208, 255, 0.4);
}

.doc-search__panes {
  margin-top: 14px;
}

.doc-search__pane {
  display: none;
}

.doc-search__pane.doc-search__pane--active {
  display: block;
}

.doc-search__controls .inline__item {
  flex: 1;
  min-width: 160px;
}

.doc-search__feedback {
  font-size: 0.85rem;
  margin-bottom: 10px;
  color: var(--muted);
}

.doc-search__feedback--muted {
  color: rgba(255, 255, 255, 0.65);
}

.doc-search-results {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 10px;
}

.doc-search-result {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.doc-search-result__meta {
  flex: 1;
}

.doc-search-result__snippet {
  font-size: 0.85rem;
  color: #d1d7ff;
  margin-top: 4px;
  line-height: 1.4;
}

.doc-search-result__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.doc-search-result__link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: underline;
}

.doc-search-result__label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.is-vr .lede.lede--secondary {
  display: block;
}

.panel--vr {
  display: none;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(110, 241, 197, 0.1), rgba(5, 81, 136, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.panel--vr .panel__header h3 {
  margin: 0;
}

.panel--vr p.lede {
  color: #e3f8ff;
  font-size: 1rem;
}

body.is-vr .panel {
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
body.is-vr .panel__header h2,
body.is-vr .panel__header h3,
body.is-vr .panel__header h1 {
  font-size: 1.2rem;
}
body.is-vr .btn {
  padding: 16px 22px;
  font-size: 1rem;
  min-width: 180px;
}
body.is-vr .panel--vr {
  display: block;
}

.vr-display {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(110, 241, 197, 0.2), rgba(5, 10, 30, 0.95));
  display: grid;
  place-items: center;
  padding: 32px;
  z-index: 20;
}
.vr-display.hidden {
  display: none;
}
.vr-display.vr-visible {
  display: grid;
}
.vr-display__content {
  text-align: center;
  max-width: 640px;
  border-radius: 18px;
  padding: 28px;
  background: rgba(11, 18, 35, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}
.vr-display__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 18px 0;
  flex-wrap: wrap;
}
.vr-display.hidden {
  display: none;
}
.vr-renderer {
  display: none;
}
.vr-renderer.vr-visible {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 15;
}
.vr-fullscreen main,
.vr-fullscreen header,
.vr-fullscreen section {
  filter: brightness(0.8);
  transition: filter 0.3s ease;
}

.status-text {
  color: var(--text);
  white-space: pre-wrap;
}

.custom-exam-panel {
  margin-top: 12px;
  padding: 12px 16px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.custom-exam-panel input,
.custom-exam-panel textarea {
  width: 100%;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 18px;
}

.status-text--strong {
  font-weight: 600;
  color: #d6e2ff;
}
.status-text .muted {
  display: block;
  margin-top: 2px;
}

.status-score {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-score__ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1a2a4f, #0c162d 60%);
  border: 2px solid #2e4776;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #9df7da;
  box-shadow: 0 0 0 1px #19305a, 0 10px 25px rgba(0, 0, 0, 0.25);
}

.status-score__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-score__trend {
  font-size: 12px;
  color: #9df7da;
}

#timerPauseBtn {
  margin-top: 8px;
}

.settings-tabs {
  margin-top: 16px;
}

.settings-tabs__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.settings-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  color: #f0f4ff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
}

.settings-tab--active {
  background: #0f62fe;
  border-color: #0f62fe;
  color: #fff;
}

.settings-pane {
  display: none;
}

.settings-pane--active {
  display: block;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
}

.drop-zone {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone--active {
  border-color: var(--accent);
  background: rgba(15, 98, 254, 0.1);
}

.drop-zone input {
  display: none;
}

.manual-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.manual-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: inherit;
}

.manual-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.manual-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.panel--settings.hidden {
  display: none;
}

.panel__sub--chat .chat-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #0c162d;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-log {
  max-height: 320px;
  overflow-y: auto;
  background: #0b1424;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-row input {
  flex: 1;
}

.hidden { display: none; }

.modal.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  width: min(900px, 90vw);
  max-height: 80vh;
  background: #0d182f;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

.modal__content--wide {
  width: min(900px, 95vw);
  max-height: 80vh;
  overflow: hidden;
}

.modal__content--wide .history {
  overflow: auto;
  max-height: 70vh;
}

.modal--settings {
  z-index: 1050;
}

.modal__content--settings {
  width: min(1100px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.modal--auth {
  z-index: 1060;
}

.modal__content--auth {
  width: min(520px, 90vw);
  max-height: 90vh;
  padding: 24px;
}

.modal--topics {
  z-index: 1070;
}

.modal--topic-save {
  z-index: 1075;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form__status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.modal__actions--settings {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.form-row.inline {
  flex-direction: row;
  gap: 12px;
}

.inline__item { flex: 1; }

.inline__item--small { max-width: 160px; }
.inline__item--button { max-width: 180px; }

label {
  font-size: 13px;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0c162d;
  color: var(--text);
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.server-key-note {
  background: #101c35;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.buttons { flex-direction: row; gap: 10px; }

.btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  background: #0e1a32;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.btn:active { transform: translateY(0); }

.btn--primary { background: linear-gradient(120deg, #2aeaa6, #6fd3ff); color: #071020; border: none; }
.btn--secondary { background: #142542; }
.btn--ghost { background: transparent; }
.full-width { width: 100%; }
.btn--small { padding: 8px 12px; font-size: 13px; }

.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.status { min-height: 18px; margin: 0; color: var(--muted); font-size: 13px; }

.chip {
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.chip--accent { background: rgba(106, 255, 210, 0.12); color: #9df7da; border-color: rgba(106, 255, 210, 0.4); }
.chip--muted { color: var(--muted); }

.score {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(106, 255, 210, 0.15), rgba(42, 234, 166, 0.1));
  border: 1px solid rgba(106, 255, 210, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.score__percent { font-size: 30px; font-weight: 800; color: #a8ffdf; }
.score__detail { color: #d9fff2; font-size: 13px; }

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__topic {
  font-size: 0.85rem;
  margin-top: 2px;
  color: var(--muted);
}

.question-summary {
  background: rgba(10, 18, 34, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.question-summary {
  background: rgba(10, 18, 34, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.question-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.question-summary__item {
  flex: 1;
  min-width: 130px;
}
.question-summary__score {
  margin-top: 4px;
}
.question-summary__percent {
  font-size: 1.4rem;
  font-weight: 700;
  color: #9df7da;
}
.question-summary__detail {
  font-size: 0.8rem;
  color: var(--muted);
}
.question-summary__trend {
  font-size: 0.75rem;
  margin-top: 2px;
  color: #f7c266;
}
.question-summary__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 12px;
}
.question-header__info {
  flex: 1;
}
.question-header__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.question-header__difficulty {
  font-size: 0.8rem;
  margin-top: 4px;
  color: var(--muted);
}
.question-header__actions {
  display: flex;
  gap: 8px;
}

.question {
  background: rgba(12, 22, 45, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.question.correct {
  background: rgba(75, 179, 140, 0.18);
  border-color: rgba(106, 255, 210, 0.6);
  box-shadow: 0 0 0 1px rgba(106, 255, 210, 0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.question__meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }

.question__text { font-size: 16px; line-height: 1.6; }

.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.question__actions {
  margin-top: 16px;
}
.question__actions .btn.hidden {
  display: none;
}

.choice-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  background: #101c35;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.choice-row:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: #132241;
  transform: translateY(-1px);
}

.choice-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #0e1a32;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.12s ease, background 0.2s ease;
}

.choice-btn:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.choice-btn:disabled { cursor: not-allowed; opacity: 0.8; transform: none; }
.choice-btn.correct { border-color: rgba(106, 255, 210, 0.8); background: rgba(106, 255, 210, 0.18); }
.choice-btn.incorrect { border-color: rgba(255, 107, 107, 0.6); background: rgba(255, 107, 107, 0.18); }
.choice-row.correct {
  background: rgba(75, 179, 140, 0.18);
  border-color: rgba(106, 255, 210, 0.5);
}
.choice-row--selected {
  border-color: var(--accent);
}
.choice-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  border-radius: 4px;
}

.choice-label {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.explanation {
  background: rgba(10, 16, 30, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  color: var(--muted);
}

.history ul, ul { list-style: none; padding: 0; margin: 0; }
.history li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.history .tag { padding: 6px 10px; border-radius: 10px; font-size: 12px; }
.history .tag.correct { background: rgba(106, 255, 210, 0.15); color: #a8ffdf; }
.history .tag.incorrect { background: rgba(255, 107, 107, 0.15); color: #ffb3b3; }
.history .link {
  color: #9df7da;
  cursor: pointer;
  text-decoration: underline;
}
.history .muted { color: var(--muted); font-size: 12px; }

.exam-options {
  margin-top: 8px;
  background: rgba(12, 22, 45, 0.8);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
}
.exam-options__buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

pre, code {
  font-family: 'Fira Code', 'SFMono-Regular', Consolas, monospace;
}

pre {
  background: #0a1326;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  overflow: auto;
  white-space: pre-wrap;
  color: #dfe7ff;
}

code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
  color: #cce4ff;
}

.question code { color: #cce4ff; }

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .grid--main { grid-template-columns: 1fr; }
  body { padding: 20px; }
  .page__hero { flex-direction: column; align-items: flex-start; }
  .hero__badge { align-self: flex-end; }
}
