:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --ink: #14201d;
  --muted: #66716e;
  --line: #d9ded5;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --terminal: #101715;
  --terminal-text: #d9f7e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(207, 221, 126, 0.24), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 18px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.25rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.run-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.run-button:hover {
  background: var(--accent-strong);
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.notice {
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #31514c;
  padding: 12px 14px;
  font-size: 0.95rem;
}

.panels {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  min-height: 560px;
}

.editor-panel,
.output-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(23, 32, 29, 0.08);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

select {
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

textarea,
pre {
  width: 100%;
  min-height: 510px;
  margin: 0;
  border: 0;
  outline: 0;
  padding: 18px;
  resize: none;
  font: 0.95rem/1.58 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

textarea {
  display: block;
  background: #fbfcf8;
  color: #17201d;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  background: var(--terminal);
  color: var(--terminal-text);
}

.status-badge {
  min-width: 70px;
  border-radius: 999px;
  background: #e9f4ef;
  color: var(--accent-strong);
  padding: 5px 10px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-badge.error {
  background: #fee2e2;
  color: #991b1b;
}

.lesson-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lesson-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  padding: 14px;
}

.lesson-strip strong,
.lesson-strip span {
  display: block;
}

.lesson-strip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

footer {
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .run-button {
    width: 100%;
  }

  .panels,
  .lesson-strip {
    grid-template-columns: 1fr;
  }

  textarea,
  pre {
    min-height: 360px;
  }
}
