:root {
  --bg: #fff9f6;
  --bg-strong: #fff2ec;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-soft: #fff7f4;
  --line: rgba(195, 157, 147, 0.24);
  --line-strong: rgba(195, 157, 147, 0.34);
  --text: #3e3031;
  --muted: #756666;
  --muted-strong: #5f5050;
  --rose: #e4a59d;
  --rose-deep: #cc7a71;
  --peach: #f1d0b8;
  --blue: #b4cadf;
  --sage: #bdd2c1;
  --ok: #5d8a70;
  --warn: #b67b63;
  --error: #b85c5c;
  --shadow: 0 28px 70px rgba(191, 152, 143, 0.16);
  --code-bg: #fffdfb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(228, 165, 157, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(180, 202, 223, 0.28), transparent 24%),
    linear-gradient(180deg, #fff8f4 0%, #fffdfa 42%, #fff7f3 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 42%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.6), transparent 22%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 110px;
}

.hero {
  border-radius: 34px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    linear-gradient(140deg, rgba(255, 249, 246, 0.96), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at top right, rgba(180, 202, 223, 0.18), transparent 32%);
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(204, 122, 113, 0.18);
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--blue));
  box-shadow: 0 0 0 6px rgba(228, 165, 157, 0.12);
}

.hero h1 {
  margin: 18px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(46px, 6vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 18px 0 0;
  max-width: 720px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--muted-strong);
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(195, 157, 147, 0.2);
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 600;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.panel {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 18px 44px rgba(202, 164, 154, 0.12);
}

.panel-highlight {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 239, 0.9));
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.progress-meta strong {
  font-size: 15px;
}

.progress-meta span {
  font-size: 14px;
  color: var(--muted);
}

.progress-track,
.floating-progress__track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(180, 202, 223, 0.2);
}

.progress-bar,
.floating-progress__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), #ebc0b1 48%, var(--blue));
  transition: width 0.35s ease;
}

.progress-foot {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 14px;
  color: var(--muted-strong);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 16px;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  padding: 0 18px 0 48px;
  color: var(--text);
}

.search-wrap svg {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  gap: 10px;
  padding: 0 18px;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  font-weight: 700;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  transform: none;
  opacity: 0.72;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--rose-deep), #d88c84);
  box-shadow: 0 14px 26px rgba(204, 122, 113, 0.22);
}

.button-soft {
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
}

.button-outline {
  color: var(--muted-strong);
  background: transparent;
  border-color: var(--line);
}

.tabs-wrap {
  position: sticky;
  top: 10px;
  z-index: 5;
  margin-top: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 251, 248, 0.84);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 42px rgba(205, 164, 154, 0.12);
}

.tab-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 14px 16px;
  min-height: 70px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tab-button:hover {
  transform: translateY(-1px);
}

.tab-button span {
  font-size: 16px;
  font-weight: 800;
}

.tab-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tab-button--active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 243, 239, 0.92));
  border-color: rgba(204, 122, 113, 0.24);
  color: var(--text);
}

.panels {
  margin-top: 20px;
}

.section-panel {
  border-radius: 34px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-header h2 {
  margin: 14px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

.section-header p {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted-strong);
  line-height: 1.8;
}

.section-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.section-badges span {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.section-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theory-grid,
.snippet-grid,
.task-list {
  display: grid;
  gap: 16px;
}

.theory-grid,
.snippet-grid {
  margin-bottom: 18px;
}

.theory-card,
.snippet-card,
.meta-card,
.solution,
.editor-card {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  overflow: hidden;
}

.theory-card {
  padding: 20px;
}

.theory-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.theory-card p,
.theory-card li {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.76;
  font-size: 14px;
}

.theory-card p + p,
.theory-card ul {
  margin-top: 10px;
}

.theory-card ul {
  padding-left: 18px;
}

.snippet-card header,
.editor-head,
.meta-head,
.solution-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 243, 0.8);
}

.snippet-card header h4,
.editor-head h4,
.meta-head h4,
.solution-head h4 {
  margin: 0;
  font-size: 15px;
}

.snippet-card header span,
.editor-head span,
.meta-head span,
.solution-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.snippet-card pre,
.solution pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  background: var(--code-bg);
}

.task-card {
  border-radius: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.task-card--done {
  border-color: rgba(93, 138, 112, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 250, 244, 0.76));
}

.task-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.task-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(228, 165, 157, 0.14);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.task-title {
  margin: 12px 0 0;
  font-size: 22px;
}

.task-goal {
  margin: 10px 0 0;
  color: var(--muted-strong);
  line-height: 1.75;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.task-tags span {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 245, 0.92);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.task-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 245, 0.92);
  color: var(--muted);
  font-weight: 700;
}

.task-state__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(195, 157, 147, 0.18);
}

.task-state--done {
  border-color: rgba(93, 138, 112, 0.3);
  background: rgba(241, 250, 244, 0.92);
  color: var(--ok);
}

.task-state--done .task-state__check {
  background: var(--ok);
  color: white;
}

.task-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
  gap: 18px;
}

.task-side {
  display: grid;
  gap: 18px;
}

.editor-shell {
  position: relative;
  min-height: 250px;
  background: var(--code-bg);
  overflow: hidden;
}

.editor-prefill {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 249, 246, 0.82);
}

.editor-prefill__label {
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.editor-prefill pre {
  margin: 0;
  padding: 12px 16px 16px;
  overflow: auto;
  background: transparent;
}

.editor-ghost {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(128, 118, 118, 0.68);
  line-height: 1.6;
  font-size: 14px;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  background: transparent;
  tab-size: 4;
  z-index: 1;
  color: rgba(128, 118, 118, 0.68);
}

.editor-input {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  min-height: 250px;
  margin: 0;
  border: 0;
  resize: vertical;
  outline: none;
  padding: 16px 18px;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  caret-color: var(--text);
  tab-size: 4;
  overflow: auto;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 251, 248, 0.78);
}

.meta-body {
  padding: 18px;
}

.meta-note {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted-strong);
}

.expected-answer {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(180, 202, 223, 0.16);
  color: var(--muted-strong);
  font-size: 14px;
}

.expected-answer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.output-box {
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.output-box header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 243, 0.78);
}

.output-box pre {
  margin: 0;
  min-height: 88px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 14px;
  line-height: 1.62;
  background: white;
}

.output-status {
  font-size: 13px;
  font-weight: 700;
}

.output-status--idle {
  color: var(--muted);
}

.output-status--ok {
  color: var(--ok);
}

.output-status--warn {
  color: var(--warn);
}

.output-status--error {
  color: var(--error);
}

.solution summary {
  list-style: none;
  cursor: pointer;
}

.solution summary::-webkit-details-marker {
  display: none;
}

.solution-note {
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.empty-state {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted-strong);
  text-align: center;
}

.floating-progress {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 7;
  width: min(320px, calc(100vw - 20px));
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 250, 247, 0.92);
  box-shadow: 0 18px 46px rgba(183, 146, 137, 0.18);
  backdrop-filter: blur(16px);
}

.floating-progress__eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.floating-progress__title {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.floating-progress__count {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .hero-grid,
  .task-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 16px, 100%);
    padding-top: 16px;
  }

  .hero,
  .section-panel {
    padding: 22px;
    border-radius: 28px;
  }

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

  .toolbar,
  .editor-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .floating-progress {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
  }
}
