﻿:root {
  --bg: #f7fcfb;
  --surface: #ffffff;
  --surface-soft: #f5fffd;
  --text: #17312d;
  --muted: #5d716c;
  --line: #cfe8e2;
  --primary: #02c39a;
  --primary-dark: #019a7b;
  --primary-soft: rgba(2, 195, 154, 0.12);
  --accent: #e66560;
  --accent-strong: #bf514c;
  --warning: #ffd61f;
  --warning-soft: rgba(255, 214, 31, 0.18);
  --success: #8ac926;
  --success-soft: rgba(138, 201, 38, 0.16);
  --danger: #e66560;
  --info-soft: rgba(133, 251, 255, 0.22);
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 12px 28px rgba(14, 68, 58, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.hero,
.panel {
  border-radius: 28px;
  border: 1px solid rgba(2, 195, 154, 0.16);
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(14, 68, 58, 0.08);
}

.hero {
  padding: 28px;
  background: linear-gradient(135deg, rgba(2, 195, 154, 0.12) 0%, rgba(133, 251, 255, 0.34) 62%, rgba(255, 214, 31, 0.16) 100%);
}

.hero-top,
.section-head,
.question-head,
.chapter-section-head,
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-brand {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.eyebrow,
.metric-label,
.section-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(23, 49, 45, 0.64);
}

.hero h1,
.panel h2,
.panel h3,
.panel h4 {
  margin: 0;
}

.hero h1,
.panel h2 {
  font-family: Georgia, serif;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
}

.panel h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.hero p,
.muted,
.metric-card small,
.selection-chip span {
  color: var(--muted);
}

.hero p {
  margin: 12px 0 0;
  max-width: 760px;
  font-size: 15px;
}

.hero-tools,
.toolbar,
.hero-meta,
.hero-badges,
.selection-actions,
.selection-controls,
.chip-row,
.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn,
.phase-step {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #ffffff;
  background: var(--primary);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover,
.phase-step:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn:disabled,
.phase-step:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn-soft,
.phase-step {
  color: var(--primary-dark);
  background: #ffffff;
  border: 1px solid rgba(2, 195, 154, 0.18);
}

.btn-soft:hover,
.phase-step:hover {
  background: var(--surface-soft);
}

.meta-pill,
.selection-chip,
.chip,
.option-badge,
.part-badge,
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.meta-pill {
  padding: 8px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(2, 195, 154, 0.16);
}

.meta-pill.strong {
  color: #ffffff;
  background: var(--primary-dark);
  border-color: transparent;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.metric-card {
  padding: 18px 20px;
  display: grid;
  gap: 6px;
}

.metric-card strong {
  font-size: 1.42rem;
}

.course-card strong {
  font-size: 1.1rem;
}

.phase-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.phase-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  color: var(--muted);
}

.phase-step .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.phase-step.is-active,
.phase-step.is-complete {
  box-shadow: var(--shadow);
}

.phase-step.is-active {
  background: var(--primary);
  color: #ffffff;
}

.phase-step.is-active .step-index,
.phase-step.is-complete .step-index {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

.phase-step.is-complete {
  background: rgba(2, 195, 154, 0.14);
  color: var(--primary-dark);
}

.view-shell {
  margin-top: 22px;
}

.step-view {
  display: none;
}

.step-view.is-active {
  display: block;
}

.panel {
  padding: 24px;
}

.form-grid,
.chapter-grid,
.selection-summary,
.question-shell,
.question-bank {
  display: grid;
  gap: 18px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field.wide {
  grid-column: span 2;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="search"],
.field input[type="file"],
.field textarea,
.field select,
.mark-field input[type="number"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.mark-field input:focus {
  border-color: rgba(2, 195, 154, 0.44);
  box-shadow: 0 0 0 4px rgba(2, 195, 154, 0.12);
}

.selection-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 280px) auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.chapter-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.chapter-tile {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 148px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  cursor: pointer;
}

.chapter-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(14, 68, 58, 0.09);
}

.chapter-tile.is-selected {
  border-color: rgba(2, 195, 154, 0.58);
  background: linear-gradient(180deg, rgba(133, 251, 255, 0.18), rgba(255, 255, 255, 0.98));
  box-shadow: 0 16px 28px rgba(2, 195, 154, 0.12);
}

.chapter-tile input[type="checkbox"] {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.chapter-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: #7a6112;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-title {
  margin: 0;
  padding-right: 24px;
  font-size: 1.08rem;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

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

.selection-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.selection-chip {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.selection-chip strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
}

.selection-chip span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.selection-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-bank {
  margin-top: 18px;
}

.chapter-panel {
  display: grid;
  gap: 16px;
}

.question-shell {
  gap: 16px;
}

.question-block {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.question-block.is-selected {
  border-color: rgba(2, 195, 154, 0.5);
  background: rgba(133, 251, 255, 0.14);
}

.question-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(133, 251, 255, 0.1);
}

.question-body {
  padding: 18px;
}

.question-stack,
.part-list,
.option-list {
  display: grid;
  gap: 14px;
}

.question-copy,
.content-panel {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.question-copy {
  background: rgba(133, 251, 255, 0.14);
  border-color: rgba(2, 195, 154, 0.18);
}

.question-text,
.question-note,
.option-copy,
.part-main,
.rich-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.question-media,
.option-media {
  max-width: 560px;
}

.question-media img,
.option-media img,
.content-image,
.paper-image,
.option-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.option-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  padding: 7px 10px;
  border: 1px solid rgba(2, 195, 154, 0.16);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.option-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.option-badge,
.part-badge,
.mini-badge {
  padding: 6px 10px;
  background: rgba(23, 49, 45, 0.08);
  color: var(--text);
}

.part-list {
  margin-top: 16px;
}

.part-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.part-item.is-active {
  border-color: rgba(2, 195, 154, 0.46);
  background: rgba(2, 195, 154, 0.09);
  box-shadow: 0 10px 22px rgba(14, 68, 58, 0.06);
}

.part-item input[type="checkbox"],
.selection-toggle input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.part-main {
  display: grid;
  gap: 10px;
}

.selection-toggle,
.mark-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.mark-field {
  padding-right: 10px;
}

.mark-field input[type="number"] {
  width: 84px;
  padding: 10px 12px;
  border-radius: 12px;
}

.mark-field.is-disabled {
  opacity: 0.82;
}

.mark-field input:disabled {
  background: rgba(207, 232, 226, 0.22);
  color: #78928c;
  cursor: not-allowed;
}

.match-table,
.paper-match-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #ffffff;
}

.match-table th,
.match-table td,
.paper-match-table th,
.paper-match-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.paper-preview {
  min-height: 480px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #d6d6d6;
  background: #ffffff;
}

.paper-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 36px;
  border-radius: 0;
  border: 1px solid #d0d0d0;
  background: #ffffff;
  box-shadow: none;
}

.paper-header {
  display: block;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid #444;
  text-align: center;
}

.paper-kicker {
  display: none;
}

.paper-title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.25;
  color: #111111;
}

.paper-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  color: #222222;
  font-size: 0.82rem;
}

.paper-instructions {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 0;
  border: 1px solid #c8c8c8;
  background: #ffffff;
}

.paper-section + .paper-section {
  margin-top: 24px;
}

.paper-section-title {
  display: none;
}

.paper-body {
  display: grid;
}

.paper-question {
  padding: 12px 0;
  border-top: 1px solid #d7d7d7;
}

.paper-question:first-of-type {
  border-top: none;
}

.paper-question-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.paper-question-title {
  font-weight: 700;
  line-height: 1.5;
  color: #111111;
  font-size: 0.98rem;
}

.paper-question-number,
.paper-part-label {
  color: #111111;
  font-weight: 700;
}

.paper-marks {
  white-space: nowrap;
  color: #111111;
  font-weight: 700;
}

.paper-parts {
  width: 100%;
  border-collapse: collapse;
}

.paper-logo {
  display: block;
  width: auto;
  max-width: 90px;
  max-height: 72px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.paper-part {
  display: table-row;
}

.paper-part-label,
.paper-part-content {
  display: table-cell;
  vertical-align: top;
}

.answer-space {
  margin-top: 10px;
  border-bottom: 1px dashed #95b9b0;
}

.answer-space.mini {
  min-height: 24px;
}

.answer-space.short {
  min-height: 46px;
}

.answer-space.long {
  min-height: 120px;
}

.answer-key {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 2px solid rgba(207, 232, 226, 0.92);
}

.answer-key h2,
.answer-section h3 {
  margin: 0 0 12px;
}

.answer-entry {
  margin-top: 8px;
  line-height: 1.6;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

@media (max-width: 1080px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-toolbar {
    grid-template-columns: 1fr;
  }

  .selection-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .form-grid.two,
  .phase-nav,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .part-item {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .part-item .mark-field {
    grid-column: 3;
  }

  .paper-shell {
    padding: 24px;
  }
}

@media (max-width: 680px) {
  .page {
    padding-inline: 14px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .hero-brand,
  .question-head,
  .section-head,
  .chapter-section-head,
  .paper-question-head,
  .action-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-tools,
  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .part-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .part-item .part-badge,
  .part-item .mark-field {
    grid-column: 2;
  }

  .option-item {
    flex-direction: column;
  }

  .paper-header {
    grid-template-columns: 1fr;
  }
}
