* {
  box-sizing: border-box;
}

:root {
  color: #172033;
  background: #f3f6fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
}

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

.hero {
  margin-bottom: 28px;
}

.eyebrow,
.lesson-count {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.intro {
  max-width: 700px;
  margin-bottom: 12px;
  color: #53627a;
  font-size: 1.08rem;
}

.privacy-note {
  margin-bottom: 0;
  color: #68758a;
  font-size: 0.9rem;
}

.lesson-card {
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid #d9e1ee;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(35, 57, 90, 0.1);
}

.lesson-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
}

.runtime-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 99px;
  background: #e7edf6;
}

.progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 180ms ease;
}

.lesson-description {
  min-height: 28px;
  margin-bottom: 22px;
  color: #53627a;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #26344b;
  font-size: 0.9rem;
  font-weight: 700;
}

textarea {
  display: block;
  width: 100%;
  min-height: 310px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  background: #101827;
  color: #e5eefc;
  font: 0.92rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

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

button {
  padding: 11px 17px;
  border: 0;
  border-radius: 9px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary {
  border: 1px solid #bfd0e7;
  background: #eff6ff;
  color: #1d4ed8;
}

button.secondary:hover:not(:disabled) {
  background: #dbeafe;
}

button.subtle {
  order: 3;
  background: transparent;
  color: #53627a;
}

.output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

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

.text-button {
  padding: 4px 0;
  background: transparent;
  color: #2563eb;
  font-size: 0.82rem;
}

.text-button:hover:not(:disabled) {
  background: transparent;
  color: #1d4ed8;
  text-decoration: underline;
}

pre {
  min-height: 100px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  background: #101827;
  color: #dbeafe;
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  color: #68758a;
  font-size: 0.9rem;
}

a {
  color: #2563eb;
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 960px);
    padding-top: 28px;
  }

  .lesson-header {
    display: block;
  }

  .runtime-status {
    display: inline-block;
    margin-top: 14px;
  }

  .actions button {
    width: 100%;
  }

  button.subtle {
    order: initial;
  }
}
