:root {
  --bg-top: #f8fcff;
  --bg-bottom: #eaf4f8;
  --ink: #13222a;
  --muted: #536872;
  --panel: rgba(255, 255, 255, 0.92);
  --line: #d1e3ea;
  --sea: #1e8eb3;
  --sea-deep: #0f6284;
  --good-bg: #dff5ea;
  --good-ink: #156c43;
  --bad-bg: #fde7e5;
  --bad-ink: #a93730;
  --accent: #ffad42;
  --shadow: 0 14px 34px rgba(8, 66, 91, 0.14);
}

:root[data-theme="dark"] {
  --bg-top: #0f1a23;
  --bg-bottom: #0a1118;
  --ink: #eaf4fb;
  --muted: #9db4c1;
  --panel: rgba(21, 33, 43, 0.9);
  --line: #2e4451;
  --sea: #5dc0e0;
  --sea-deep: #83d4ef;
  --good-bg: #143526;
  --good-ink: #8de0b2;
  --bad-bg: #402323;
  --bad-ink: #f2a8a2;
  --accent: #e9b15f;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Manrope", "Avenir Next", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(125, 205, 232, 0.3) 0%, transparent 44%),
    radial-gradient(circle at 85% 18%, rgba(255, 200, 126, 0.28) 0%, transparent 32%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  padding: 10px;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.26;
}

.bg-shape-a {
  width: 260px;
  height: 260px;
  top: -90px;
  right: -110px;
  background: linear-gradient(120deg, #61bad8, #2384ad);
}

.bg-shape-b {
  width: 220px;
  height: 220px;
  left: -90px;
  bottom: -90px;
  background: linear-gradient(120deg, #ffd28b, #f2a04f);
}

.bg-nautica {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.14;
}

.bg-nautica-wheel {
  width: 320px;
  height: 320px;
  right: 30px;
  top: 180px;
  transform: rotate(-10deg);
  background-image: url("./assets/bg-wheel.svg");
}

.bg-nautica-sail {
  width: 280px;
  height: 280px;
  left: 26px;
  bottom: 84px;
  transform: rotate(7deg);
  background-image: url("./assets/bg-sail.svg");
}

:root[data-theme="dark"] .bg-nautica {
  opacity: 0.22;
  filter: saturate(1.1) brightness(1.08);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  height: calc(100dvh - 20px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.panel-lite,
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.app-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-brand-text {
  min-width: 0;
}

.app-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(8, 66, 91, 0.2);
}

.app-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sea-deep);
  font-weight: 800;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: clamp(1.05rem, 2.8vw, 1.55rem);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.header-btn.danger {
  border-color: #d89089;
  color: #b5473f;
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.view {
  height: 100%;
  min-height: 0;
  display: flex;
}

.view > .panel {
  flex: 1 1 auto;
  min-height: 0;
}

.hidden {
  display: none !important;
}

.panel {
  min-height: 0;
  padding: 12px;
}

.setup-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.setup-head {
  display: grid;
  gap: 8px;
}

.setup-head-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(96, 157, 181, 0.12);
  padding: 8px 10px;
}

.setup-head h2 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--sea-deep);
}

:root[data-theme="dark"] .setup-head-top {
  background: rgba(40, 70, 86, 0.38);
}

.setup-head p {
  margin: 5px 0 0;
}

.setup-stepper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.setup-step {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--muted);
  background: rgba(96, 157, 181, 0.08);
}

.setup-step-link {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  border: inherit;
  color: inherit;
  background: inherit;
}

.setup-step-link:hover {
  border-color: var(--sea);
}

.setup-step.active {
  color: var(--sea-deep);
  border-color: var(--sea);
  background: rgba(57, 163, 201, 0.16);
}

.selected-primary-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(96, 157, 181, 0.08);
  color: var(--sea-deep);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 4px 10px;
  width: 100%;
}

.mode-group h3,
.custom-config h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
}

.mode-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.mode-card {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mode-card strong {
  display: block;
  font-size: 0.9rem;
}

.mode-card span {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--muted);
}

.mode-card.active {
  border-color: var(--sea);
  box-shadow: inset 0 0 0 1px var(--sea);
  background: rgba(57, 163, 201, 0.1);
}

.custom-config {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
}

.dataset-chips {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dataset-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.dataset-chip small {
  opacity: 0.8;
}

.dataset-chip.active {
  border-color: var(--sea);
  background: rgba(57, 163, 201, 0.14);
}

.setup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.setup-actions .btn {
  width: 100%;
  min-width: 0;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled,
.part-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
  color: #fff;
}

.btn-secondary {
  background: rgba(113, 167, 188, 0.16);
  color: var(--sea-deep);
}

.btn-accent {
  background: var(--accent);
  color: #2b1a04;
}

.notice {
  display: none;
}

.quiz-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-mode {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(126, 180, 201, 0.14);
}

.section-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
}

.section-status.finalized {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  overflow: visible;
}

.section-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 0.76rem;
}

.section-chip strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 1px;
}

.section-chip.pass {
  border-color: #66c08f;
  background: rgba(66, 160, 110, 0.12);
}

.section-chip.fail {
  border-color: #cf7870;
  background: rgba(185, 84, 74, 0.15);
}

.exam-result {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.84rem;
}

.exam-result.pass {
  border-color: #66c08f;
  background: rgba(66, 160, 110, 0.12);
}

.exam-result.fail {
  border-color: #cf7870;
  background: rgba(185, 84, 74, 0.15);
}

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

.stat-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(121, 177, 199, 0.08);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 9px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 7px;
}

:root[data-theme="dark"] .question-card {
  background: rgba(22, 34, 44, 0.62);
}

.question-source {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--sea-deep);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.report-btn {
  border: 1px solid var(--line);
  background: rgba(96, 157, 181, 0.08);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.report-panel {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(8, 66, 91, 0.12);
  position: relative;
  z-index: 2;
}

.report-fields {
  display: grid;
  gap: 6px;
}

.report-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.report-select,
.report-textarea {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 0.82rem;
}

:root[data-theme="dark"] .report-select,
:root[data-theme="dark"] .report-textarea {
  background: rgba(20, 30, 39, 0.9);
}

.report-textarea {
  resize: vertical;
  min-height: 74px;
}

.report-actions {
  display: flex;
  gap: 6px;
}

.report-send-btn,
.report-cancel-btn {
  padding: 6px 10px;
  font-size: 0.76rem;
}

.report-status {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.question-scroll {
  flex: 1 1 0%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-head {
  display: grid;
  gap: 8px;
}

#question-text {
  margin: 0;
  white-space: pre-line;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.38;
}

.explanation-toggle {
  border: 1px solid var(--line);
  background: rgba(96, 157, 181, 0.08);
  color: var(--ink);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  justify-self: end;
  justify-content: center;
  line-height: 1;
}

.explanation-icon {
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.response-flip {
  perspective: 1200px;
  isolation: isolate;
  overflow: visible;
  min-height: 0;
  touch-action: pan-y;
}

.response-flip-inner {
  display: grid;
  min-height: 0;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  touch-action: pan-y;
}

.response-flip.flipped .response-flip-inner {
  transform: rotateY(180deg);
}

.response-face {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  display: grid;
  gap: 8px;
  align-content: start;
  transition: opacity 0.2s ease;
  touch-action: pan-y;
}

.response-front {
  opacity: 1;
}

.response-back {
  transform: rotateY(180deg) translateZ(0);
  opacity: 0;
}

.response-flip.flipped .response-front {
  opacity: 0;
}

.response-flip.flipped .response-back {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .response-flip-inner {
    transition: none;
  }

  .response-face {
    transition: none;
  }
}

.question-explanation {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.84rem;
  white-space: pre-line;
  background: rgba(96, 157, 181, 0.08);
}

.question-explanation.placeholder {
  color: var(--muted);
  font-style: italic;
}

.question-image-wrap {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  background: rgba(15, 35, 46, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.question-image-wrap img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 560px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.answers {
  display: grid;
  gap: 7px;
}

.answer-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: rgba(96, 157, 181, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.answer-btn.selected {
  border-color: var(--sea);
  box-shadow: inset 0 0 0 1px var(--sea);
}

.answer-btn.reveal {
  background: rgba(79, 176, 215, 0.17);
  border-color: #66b9d8;
}

.answer-btn.correct {
  background: var(--good-bg);
  color: var(--good-ink);
  border-color: #8ac9a7;
}

.answer-btn.wrong {
  background: var(--bad-bg);
  color: var(--bad-ink);
  border-color: #d69791;
}

.solution {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.solution-part {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: rgba(86, 152, 181, 0.08);
}

.solution-part p {
  margin: 0;
  white-space: pre-line;
  font-size: 0.84rem;
}

.part-actions {
  display: flex;
  gap: 6px;
}

.part-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.part-btn.active-yes {
  background: var(--good-bg);
  color: var(--good-ink);
  border-color: #8ac9a7;
}

.part-btn.active-no {
  background: var(--bad-bg);
  color: var(--bad-ink);
  border-color: #d69791;
}

.quiz-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
  margin-top: auto;
}

.quiz-nav .btn {
  width: 100%;
  min-width: 0;
}

.quiz-nav #submit-exam-btn,
.quiz-nav #restart-session-btn {
  grid-column: 1 / -1;
}

.setup-actions .btn,
.quiz-nav .btn {
  min-height: 46px;
  padding: 11px 12px;
  font-size: 0.92rem;
  border-radius: 12px;
}

.scroll-hint {
  margin: -2px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.helpbar {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.76rem;
  color: var(--muted);
}

.helpbar kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(128, 177, 197, 0.14);
}

.ranking-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 14, 19, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.ranking-panel {
  width: min(100%, 900px);
  max-height: min(84vh, 800px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 9px;
}

.ranking-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.ranking-head h2 {
  margin: 0;
  font-size: 1rem;
}

.ranking-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 7px;
}

.ranking-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(96, 157, 181, 0.08);
}

.ranking-item h4 {
  margin: 0;
  font-size: 0.82rem;
  color: var(--sea-deep);
}

.ranking-item p {
  margin: 5px 0 0;
  font-size: 0.8rem;
  line-height: 1.3;
}

.support-panel {
  width: min(100%, 640px);
}

.confirm-panel {
  width: min(100%, 560px);
  max-height: none;
  grid-template-rows: auto auto auto;
}

.confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.confirm-actions .btn {
  width: 100%;
  min-width: 0;
}

.support-links {
  display: grid;
  gap: 8px;
}

.support-link-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  background: rgba(96, 157, 181, 0.1);
}

.support-link-btn:hover {
  border-color: var(--sea);
}

@media (max-width: 780px) {
  body {
    padding: 8px;
  }

  .app-shell {
    height: calc(100dvh - 16px);
  }

  .mode-list {
    grid-template-columns: 1fr;
  }

  .setup-panel {
    padding: 10px;
    gap: 8px;
  }

  .setup-head {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--panel);
    padding: 2px 0 7px;
    border-bottom: 1px solid var(--line);
  }

  .setup-stepper {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .setup-stepper::-webkit-scrollbar {
    display: none;
  }

  .setup-step {
    white-space: nowrap;
  }

  .mode-card {
    border-radius: 14px;
    padding: 10px 11px;
  }

  .setup-actions {
    position: sticky;
    bottom: 0;
    z-index: 7;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 -8px 20px rgba(8, 66, 91, 0.12);
  }

  .setup-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "actions";
    align-items: start;
  }

  .app-brand {
    grid-area: brand;
    gap: 8px;
  }

  .header-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }

  .confirm-actions {
    grid-template-columns: 1fr;
  }

  .app-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(8, 66, 91, 0.16);
  }

  .app-kicker {
    font-size: 0.64rem;
  }

  .app-header h1 {
    font-size: clamp(0.95rem, 4.2vw, 1.2rem);
  }

  .header-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.75rem;
    padding: 8px 6px;
    white-space: nowrap;
  }

  .quiz-active .app-brand-text {
    display: none;
  }

  .quiz-active .app-header {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "brand actions";
    align-items: center;
  }

  .quiz-active .app-brand {
    gap: 6px;
  }

  .question-head {
    gap: 6px;
  }

  .question-meta {
    align-items: flex-start;
  }

  .report-btn {
    font-size: 0.66rem;
    padding: 4px 7px;
  }

  body.report-open .quiz-panel > *:not(.question-card) {
    display: none;
  }

  body.report-open .question-card {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  body.report-open .question-card > *:not(.report-panel) {
    display: none;
  }

  .report-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 10px;
    right: 10px;
    bottom: auto;
    z-index: 120;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 20px);
    overflow: auto;
    border-style: solid;
    background: var(--panel);
    opacity: 1;
  }

  .quiz-panel {
    gap: 5px;
  }

  .section-status {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .section-status.finalized {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    overflow: visible;
    gap: 6px;
    padding-bottom: 0;
  }

  .section-status::-webkit-scrollbar {
    display: none;
  }

  .section-chip {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 4px 8px;
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .section-status.finalized .section-chip {
    min-width: 0;
    white-space: normal;
  }

  .section-chip strong {
    display: inline;
    margin: 0 4px 0 0;
    font-size: 0.7rem;
  }

  .exam-result {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .stats-grid {
    gap: 6px;
  }

  .stat-card {
    padding: 6px 7px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
  }

  .stat-label {
    font-size: 0.62rem;
    line-height: 1;
  }

  .stat-card strong {
    font-size: 0.95rem;
  }

  .explanation-toggle {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0.7rem;
  }

  .quiz-topbar {
    gap: 6px;
  }

  .active-mode {
    font-size: 0.74rem;
  }

  .question-image-wrap img {
    max-height: min(45vh, 460px);
  }

  .bg-nautica-wheel {
    width: 220px;
    height: 220px;
    right: -20px;
    top: 230px;
  }

  .bg-nautica-sail {
    width: 170px;
    height: 170px;
    left: -16px;
    bottom: 120px;
  }

  .helpbar {
    display: none;
  }

}
