:root {
  --ink: #172026;
  --muted: #65717b;
  --line: #dbe2e8;
  --paper: #ffffff;
  --soft: #f5f7f9;
  --nav: #101820;
  --teal: #007c75;
  --teal-strong: #005f5a;
  --gold: #c18400;
  --red: #b42318;
  --green: #147a3d;
  --blue: #2463a6;
  --lavender: #7b5bb8;
  --shadow: 0 16px 40px rgba(18, 32, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: var(--nav);
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(16px, 3vw, 34px);
}

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

.brand-mark {
  align-items: center;
  background: #f6c34a;
  color: #111;
  display: grid;
  font-weight: 900;
  height: 42px;
  place-items: center;
  width: 42px;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.brand p {
  color: #b9c4cc;
  font-size: 13px;
}

.topbar-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.hero {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(24px, 5vw, 56px) 18px 30px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  color: var(--teal-strong);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero h2 {
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: 0;
  line-height: 0.96;
  margin: 0 0 18px;
  max-width: 780px;
}

.hero-text {
  color: #3e4a53;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 760px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  align-items: center;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
}

.btn.primary {
  background: var(--teal);
}

.btn.primary:hover {
  background: var(--teal-strong);
}

.btn.secondary {
  background: #e9eef2;
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.danger {
  background: var(--red);
}

.overview-panel,
.card,
.question-card,
.palette,
.modal {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.overview-panel {
  align-self: start;
  padding: 18px;
}

.mock-visual {
  background:
    linear-gradient(90deg, rgba(0, 124, 117, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 124, 117, 0.14) 1px, transparent 1px),
    #f9fbfb;
  background-size: 34px 34px;
  border: 1px solid var(--line);
  min-height: 190px;
  padding: 16px;
}

.mock-bars {
  display: grid;
  gap: 11px;
  margin-top: 26px;
}

.mock-bar {
  background: #dce7eb;
  height: 14px;
  overflow: hidden;
}

.mock-bar span {
  background: var(--teal);
  display: block;
  height: 100%;
}

.mini-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
}

.mini-tile {
  background: #fff;
  border: 1px solid var(--line);
  min-height: 74px;
  padding: 12px;
}

.mini-tile strong {
  display: block;
  font-size: 24px;
}

.mini-tile span {
  color: var(--muted);
  font-size: 12px;
}

.instructions {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 18px 48px;
}

.card {
  padding: 18px;
}

.card h3,
.question-card h3,
.palette h3,
.analytics h3 {
  font-size: 17px;
  margin: 0 0 10px;
}

.card p,
.card li {
  color: var(--muted);
  line-height: 1.55;
}

.card p {
  margin: 0;
}

.exam-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 310px;
  margin: 0 auto;
  max-width: 1360px;
  padding: 18px;
}

.section-strip {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 18px;
}

.section-chip {
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 9px 12px;
}

.section-chip.active {
  background: #e5f3f1;
  border-color: var(--teal);
  color: var(--teal-strong);
  font-weight: 800;
}

.question-card {
  min-height: 620px;
  padding: 22px;
}

.question-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #eef2f5;
  color: #31404a;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
  text-transform: uppercase;
}

.question-text {
  border-top: 1px solid var(--line);
  color: #202a31;
  font-size: 18px;
  line-height: 1.58;
  margin: 0;
  padding-top: 18px;
}

.passage {
  background: #f8fafb;
  border-left: 4px solid var(--teal);
  color: #33424b;
  line-height: 1.62;
  margin: 16px 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px 16px;
}

.passage h4 {
  color: var(--ink);
  font-size: 18px;
  margin: 0 0 10px;
}

.passage p {
  margin: 0 0 12px;
}

.passage ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.data-table {
  border-collapse: collapse;
  margin: 12px 0;
  min-width: 520px;
  width: 100%;
}

.data-table th,
.data-table td {
  border: 1px solid #cfd8df;
  padding: 9px 10px;
  text-align: center;
}

.data-table th {
  background: #eaf0f3;
  color: #24323a;
}

.options {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.option {
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 30px 1fr;
  min-height: 52px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.option:hover,
.option.selected {
  border-color: var(--teal);
}

.option.selected {
  background: #eef8f7;
}

.option-key {
  align-items: center;
  background: #e9eef2;
  display: grid;
  font-weight: 900;
  height: 28px;
  place-items: center;
  width: 28px;
}

.tita-input {
  border: 1px solid var(--line);
  font-size: 20px;
  margin: 22px 0;
  min-height: 52px;
  padding: 12px 14px;
  width: min(360px, 100%);
}

.actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.palette {
  align-self: start;
  padding: 16px;
  position: sticky;
  top: 14px;
}

.timer {
  background: var(--ink);
  color: #fff;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px;
}

.timer strong {
  font-size: 30px;
}

.palette-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, 1fr);
  margin: 12px 0 16px;
}

.q-dot {
  align-items: center;
  background: #eef2f5;
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  font-weight: 800;
  height: 38px;
  place-items: center;
}

.q-dot.current {
  outline: 3px solid rgba(0, 124, 117, 0.25);
}

.q-dot.answered {
  background: #dff4e8;
  border-color: var(--green);
}

.q-dot.review {
  background: #efe7fb;
  border-color: var(--lavender);
}

.q-dot.skipped {
  background: #fff4db;
  border-color: var(--gold);
}

.legend {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 14px;
}

.legend span {
  color: var(--muted);
  font-size: 12px;
}

.legend b {
  display: inline-block;
  height: 10px;
  margin-right: 6px;
  width: 10px;
}

.analytics {
  margin: 0 auto;
  max-width: 1360px;
  padding: 18px;
}

.score-hero {
  background: var(--nav);
  color: #fff;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto;
  padding: clamp(18px, 3vw, 30px);
}

.score-hero h2 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1;
  margin: 0 0 8px;
}

.score-hero p {
  color: #c4d0d8;
  margin: 0;
}

.score-number {
  align-self: center;
  background: #fff;
  color: var(--ink);
  display: grid;
  min-height: 132px;
  min-width: 172px;
  place-items: center;
  text-align: center;
}

.score-number strong {
  display: block;
  font-size: 46px;
}

.analytics-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
  margin-top: 16px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

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

.metric strong {
  color: var(--ink);
  display: block;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.05;
  margin-top: 6px;
}

.table {
  border-collapse: collapse;
  width: 100%;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: #40505a;
  font-size: 12px;
  text-transform: uppercase;
}

.bar-track {
  background: #edf1f4;
  height: 9px;
  min-width: 80px;
  overflow: hidden;
}

.bar-fill {
  background: var(--teal);
  display: block;
  height: 100%;
}

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

.heat-cell {
  border: 1px solid var(--line);
  min-height: 82px;
  padding: 12px;
}

.heat-cell strong {
  display: block;
}

.heat-cell span {
  color: var(--muted);
  font-size: 12px;
}

.heat-strong { background: #ddf3e7; }
.heat-steady { background: #e9f1fb; }
.heat-watch { background: #fff5da; }
.heat-weak { background: #fde8e6; }

.insight-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.insight-list li {
  border-left: 4px solid var(--teal);
  color: #34434c;
  list-style: none;
  padding: 8px 10px;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-item {
  border: 1px solid var(--line);
  padding: 14px;
}

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

.status {
  font-weight: 900;
}

.status.correct { color: var(--green); }
.status.wrong { color: var(--red); }
.status.skipped { color: var(--gold); }

.solution {
  background: #f8fafb;
  color: #33424b;
  line-height: 1.55;
  margin-top: 10px;
  padding: 12px;
}

.video-slot {
  border: 1px dashed #aab6bf;
  color: var(--muted);
  margin-top: 10px;
  padding: 10px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(10, 16, 20, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 10;
}

.modal {
  max-width: 520px;
  padding: 22px;
  width: 100%;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .exam-layout {
    grid-template-columns: 1fr;
  }

  .instructions {
    grid-template-columns: repeat(2, 1fr);
  }

  .palette {
    position: static;
  }

  .score-hero {
    grid-template-columns: 1fr;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .instructions,
  .mini-grid,
  .legend {
    grid-template-columns: 1fr;
  }

  .question-card {
    min-height: auto;
    padding: 16px;
  }

  .analytics,
  .exam-layout {
    padding: 12px;
  }

  .palette-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
