:root {
  --bg-a: #f8f6ef;
  --bg-b: #e6efe3;
  --ink: #1f2430;
  --accent: #006d77;
  --accent-2: #e29578;
  --card: #ffffffd9;
  --border: #0000001a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #fff6d8 0 18%, transparent 19%),
    radial-gradient(circle at 90% 70%, #d9f2ec 0 18%, transparent 19%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b));
}

.app {
  width: min(980px, 92vw);
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1rem;
}

.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.3rem;
  backdrop-filter: blur(4px);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0;
}

h1 {
  margin: 0.35rem 0 0.4rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.subtitle {
  margin: 0 0 0.4rem;
  font-weight: 700;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.65rem 0;
}

.grid {
  display: grid;
  gap: 0.55rem;
}

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

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.help {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.hero-list,
.help-list {
  margin-top: 0;
  margin-bottom: 0.55rem;
  padding-left: 1.2rem;
}

.task {
  margin: 0 0 0.7rem;
  background: #ffffffc2;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.task-list {
  margin-top: -0.35rem;
  margin-bottom: 0.7rem;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.editor {
  width: 100%;
  min-height: 17rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  resize: vertical;
}

.editor.small {
  min-height: 9rem;
}

#mainCode {
  min-height: 28rem;
}

.CodeMirror {
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.CodeMirror-gutters {
  border-right: 1px solid var(--border);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: var(--accent-2);
}

.output {
  margin: 0.5rem 0 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  min-height: 3.25rem;
}

.model-answer {
  margin-top: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffffc2;
  padding: 0.45rem 0.7rem;
}

.model-answer summary {
  cursor: pointer;
  font-weight: 600;
}

.model-answer pre {
  margin: 0.6rem 0 0.2rem;
  overflow-x: auto;
}

.status {
  margin: 0;
  font-size: 0.95rem;
  text-align: right;
}

.status span {
  font-weight: 700;
}

.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;
}

@media (max-width: 700px) {
  .two {
    grid-template-columns: 1fr;
  }
}


.solution-code {
  width: 100%;
}

.solution-editor {
  margin-top: 0.55rem;
}

.model-answer .CodeMirror {
  background: #fff;
}

.download-wrap {
  margin: 0.8rem 0 2rem;
  text-align: center;
}

.download-btn {
  font-size: 1.1rem;
  padding: 0.85rem 1.4rem;
  background: #0b525b;
  box-shadow: 0 10px 24px #0b525b33;
}

.download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.pdf-report {
  position: static;
  width: 1050px;
  max-width: 100%;
  background: #ffffff;
  color: #1b1f2a;
  font-family: "Space Grotesk", sans-serif;
  padding: 24px;
  margin: 16px auto;
  border: 1px solid #d7dbe4;
}

.pdf-header h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.pdf-header p {
  margin: 0 0 4px;
}

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

.pdf-section h2 {
  margin: 0 0 10px;
}

.pdf-question {
  border: 1px solid #d7dbe4;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  page-break-inside: avoid;
}

.pdf-question h3,
.pdf-question h4 {
  margin: 0 0 8px;
}

.pdf-question p {
  margin: 0 0 6px;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 700;
  font-size: 0.82rem;
}

.status-pill.pass {
  background: #d9f7df;
  color: #1f6b2b;
}

.status-pill.fail {
  background: #fde3e3;
  color: #8a2424;
}

.pdf-code-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.pdf-code-table .ln {
  width: 42px;
  text-align: right;
  padding: 2px 8px 2px 0;
  color: #6f7788;
  border-right: 1px solid #d7dbe4;
  vertical-align: top;
}

.pdf-code-table .code {
  white-space: pre;
  padding: 2px 0 2px 10px;
}

.pdf-output {
  margin: 6px 0 0;
  background: #f6f8fb;
  border: 1px solid #d7dbe4;
  border-radius: 8px;
  padding: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.tok-key {
  color: #7a2bb8;
  font-weight: 700;
}

.tok-string {
  color: #0f6b4f;
}

.tok-comment {
  color: #7d8799;
  font-style: italic;
}

.tok-num {
  color: #214ec6;
}
