:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --line: #d7deea;
  --text: #10223a;
  --accent: #2563eb;
  --accent-soft: #e9f0ff;
  --ok-soft: #e7fbef;
  --warn-soft: #fff7dd;
  --rose-soft: #fff0f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at 10% 0%, #eef3ff 0%, var(--bg) 45%);
  color: var(--text);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(16, 34, 58, 0.05);
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 28px;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

p {
  margin: 0;
  line-height: 1.58;
}

.controls {
  display: grid;
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

select,
button {
  font: inherit;
}

select {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

button {
  width: fit-content;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #1d4ed8;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfd0f5;
  background: #edf3ff;
  color: #17325f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
}

.chip.alt {
  border-color: #9fdab5;
  background: var(--ok-soft);
  color: #085b39;
}

.chip.warn {
  border-color: #ead07a;
  background: var(--warn-soft);
  color: #6a5100;
}

.chip.rose {
  border-color: #efb5c9;
  background: var(--rose-soft);
  color: #7b2342;
}

.task-text,
.solution,
.theory-wrap,
.question-wrap,
.status-wrap,
.task-meta {
  line-height: 1.55;
}

.task-text p + p,
.theory-wrap p + p,
.task-meta p + p {
  margin-top: 10px;
}

.theory-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.theory-card,
.status-card,
.note-box,
.answer-box,
.python-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.status-card strong,
.theory-card strong {
  color: #17325f;
}

.theory-card p,
.status-card p {
  margin-bottom: 8px;
}

.theory-card p:last-child,
.status-card p:last-child {
  margin-bottom: 0;
}

.question-list,
.solution-list,
.inline-list {
  margin: 0;
  padding-left: 22px;
}

.question-list li,
.solution-list li,
.inline-list li {
  margin-bottom: 8px;
}

.question-list li:last-child,
.solution-list li:last-child,
.inline-list li:last-child {
  margin-bottom: 0;
}

.muted {
  color: #516785;
  font-size: 14px;
}

.note-box {
  background: #edf3ff;
  border-color: #bfd0f5;
}

.answer-box {
  background: var(--ok-soft);
  border-color: #9fdab5;
  font-weight: 700;
}

.python-box {
  margin-top: 10px;
}

.summary-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e5ebf5;
}

.summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-row strong {
  color: #17325f;
}

code,
pre {
  font-family: "Consolas", "DejaVu Sans Mono", monospace;
}

code {
  background: #eef3ff;
  border-radius: 6px;
  padding: 1px 6px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details[open] summary {
  margin-bottom: 12px;
}

@media (max-width: 820px) {
  .theory-grid,
  .status-grid,
  .summary-row {
    grid-template-columns: 1fr;
  }

  .summary-row {
    gap: 4px;
  }
}
