/* ============================================================
   Julia — Educational Web App
   Design tokens extracted from bncc-math-8.html
   ============================================================ */

:root {
  --bg: #F5F1EB;
  --bg-warm: #EDE8E0;
  --bg-card: #FAFAF7;
  --ink: #2C2824;
  --ink-light: #6B6560;
  --ink-muted: #A09A94;
  --accent: #BA3030;
  --accent-light: #D4524240;
  --accent-glow: #BA303018;
  --border: #D8D2CA;
  --border-light: #E8E3DC;
  --shadow-sm: 0 1px 3px rgba(44,40,36,0.04);
  --shadow-md: 0 4px 16px rgba(44,40,36,0.06);
  --shadow-lg: 0 8px 32px rgba(44,40,36,0.08);
  --radius: 2px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

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

/* --- Header --- */
header {
  padding: 3rem 2rem 2rem;
  max-width: 960px;
  margin: 0 auto;
  animation: fadeIn 0.8s ease-out;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.header-mark {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.header-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

h1 span {
  color: var(--accent);
  font-weight: 500;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--ink-light);
  font-weight: 300;
  max-width: 540px;
  line-height: 1.8;
}

/* --- Navigation pills --- */
.nav-bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  animation: fadeIn 0.8s ease-out 0.15s both;
}

.nav-pill {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
  font-family: 'DM Sans', sans-serif;
  border-radius: var(--radius);
}

.nav-pill:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
  background: var(--bg-card);
}

.nav-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* --- Content area --- */
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* --- Stats bar --- */
.stats-bar {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2rem;
  padding: 1.25rem 0;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.stat-number .red { color: var(--accent); }

.stat-label {
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* --- Theme / topic header --- */
.theme-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  animation: slideUp 0.5s ease-out;
}

.theme-icon {
  font-size: 1.8rem;
  line-height: 1;
  opacity: 0.7;
}

.theme-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.theme-desc {
  font-size: 0.85rem;
  color: var(--ink-light);
  font-weight: 300;
  margin-bottom: 2rem;
  max-width: 640px;
  line-height: 1.8;
  animation: slideUp 0.5s ease-out 0.1s both;
}

/* --- Cards --- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  animation: slideUp 0.45s ease-out both;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.35s ease;
  transform-origin: top;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.card:hover::before {
  transform: scaleY(1);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.card-code {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
}

.card-meta {
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.card-text {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.75;
  font-weight: 300;
}

/* --- Subject cards (home) --- */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.subject-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  animation: slideUp 0.45s ease-out both;
}

.subject-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.35s ease;
  transform-origin: top;
}

.subject-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.subject-card:hover::before {
  transform: scaleY(1);
}

.subject-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.subject-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.subject-card-desc {
  font-size: 0.85rem;
  color: var(--ink-light);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.subject-card-stats {
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* --- Breadcrumb --- */
.breadcrumb {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  animation: fadeIn 0.6s ease-out;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* --- Lesson body (rendered Markdown) --- */
.lesson-body {
  animation: slideUp 0.5s ease-out 0.1s both;
  max-width: 720px;
}

.lesson-body h1,
.lesson-body h2,
.lesson-body h3,
.lesson-body h4 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.lesson-body h1 { font-size: 1.8rem; font-weight: 400; }
.lesson-body h2 { font-size: 1.4rem; font-weight: 500; border-bottom: 1px solid var(--border-light); padding-bottom: 0.5rem; }
.lesson-body h3 { font-size: 1.15rem; font-weight: 500; }
.lesson-body h4 { font-size: 1rem; font-weight: 600; font-family: 'DM Sans', sans-serif; }

.lesson-body p {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--ink);
  font-weight: 300;
  margin-bottom: 1rem;
}

.lesson-body ul,
.lesson-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
  font-size: 0.92rem;
  line-height: 1.85;
  font-weight: 300;
}

.lesson-body li {
  margin-bottom: 0.3rem;
}

.lesson-body strong {
  font-weight: 500;
  color: var(--ink);
}

.lesson-body em {
  font-style: italic;
  color: var(--ink-light);
}

.lesson-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1rem 0;
  background: var(--bg-warm);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--ink-light);
  font-weight: 300;
  line-height: 1.8;
}

.lesson-body code {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.85em;
  background: var(--bg-warm);
  padding: 0.15em 0.4em;
  border-radius: var(--radius);
  color: var(--accent);
}

.lesson-body pre {
  background: var(--ink);
  color: var(--bg);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.82rem;
  line-height: 1.7;
}

.lesson-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.lesson-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.lesson-body th,
.lesson-body td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.lesson-body th {
  background: var(--bg-warm);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lesson-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* --- Lesson pager --- */
.lesson-progress {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s ease-out;
}

.lesson-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.lesson-progress-dot.active {
  background: var(--ink-muted);
}

.lesson-progress-dot.current {
  background: var(--accent);
  transform: scale(1.25);
}

.lesson-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  max-width: 720px;
  animation: fadeIn 0.5s ease-out;
}

.pager-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  min-width: 5.5rem;
  text-align: center;
}

.pager-btn:hover:not(.disabled) {
  border-color: var(--ink-muted);
  background: var(--bg-warm);
}

.pager-btn.disabled {
  color: var(--ink-muted);
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.pager-btn.pager-practice {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.pager-btn.pager-practice:hover {
  background: var(--ink-light);
  border-color: var(--ink-light);
}

.pager-indicator {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .pager-btn { padding: 0.5rem 0.8rem; font-size: 0.78rem; min-width: 4.5rem; }
  .lesson-pager { gap: 0.5rem; }
}

/* --- Exercises --- */
.exercises {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 720px;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  border-radius: var(--radius);
  animation: slideUp 0.45s ease-out both;
  transition: border-color 0.3s ease;
}

.exercise-card.answered {
  border-color: var(--border);
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.exercise-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  min-width: 1.5rem;
}

.exercise-type-badge {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
}

.exercise-prompt {
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.85;
  font-weight: 300;
}

.exercise-prompt p {
  margin-bottom: 0.5rem;
}

.exercise-prompt p:last-child {
  margin-bottom: 0;
}

/* Choices */
.choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-btn {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.6;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--ink-muted);
  background: var(--bg-warm);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-btn.selected {
  border-color: var(--ink-muted);
  background: var(--bg-warm);
}

.choice-btn.correct {
  border-color: #4a8c5c;
  background: #4a8c5c12;
}

.choice-btn.wrong {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.choice-label {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-muted);
  min-width: 1.2rem;
  flex-shrink: 0;
}

.choice-btn.correct .choice-label { color: #4a8c5c; }
.choice-btn.wrong .choice-label { color: var(--accent); }

.choice-text {
  flex: 1;
}

.choice-text p {
  margin: 0;
}

/* Numeric input */
.numeric-input-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.numeric-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
  background: transparent;
  transition: border-color 0.25s ease;
  outline: none;
}

.numeric-input:focus {
  border-color: var(--ink-muted);
}

.numeric-input.correct {
  border-color: #4a8c5c;
  background: #4a8c5c12;
}

.numeric-input.wrong {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.submit-btn {
  padding: 0.7rem 1.2rem;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.submit-btn:hover:not(:disabled) {
  background: var(--ink-light);
  border-color: var(--ink-light);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Feedback */
.exercise-feedback {
  margin-top: 0;
  transition: margin 0.3s ease;
}

.exercise-feedback:not(:empty) {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.feedback-correct {
  font-size: 0.88rem;
  font-weight: 500;
  color: #4a8c5c;
  margin-bottom: 0.5rem;
}

.feedback-wrong {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.feedback-wrong strong {
  font-weight: 500;
}

.feedback-explanation {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.8;
  font-weight: 300;
}

.feedback-explanation p {
  margin-bottom: 0.5rem;
}

.feedback-explanation p:last-child {
  margin-bottom: 0;
}

/* Exercise link on lesson cards */
.card-exercises {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
}

/* --- Footer --- */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.footer-left {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.footer-right {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: 0.06em;
}

/* --- BNCC tags --- */
.bncc-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.5s ease-out;
}

.bncc-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  background: var(--accent-glow);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius);
}

.bncc-tag.small {
  font-size: 0.62rem;
  padding: 0.12rem 0.4rem;
}

.card-bncc {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* --- Admin --- */
.header-admin-link {
  transition: color 0.2s ease;
}

.header-admin-link:hover {
  color: var(--ink-light);
}

.admin-section {
  margin-bottom: 3rem;
}

.admin-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-section-desc {
  font-size: 0.85rem;
  color: var(--ink-light);
  font-weight: 300;
  margin-bottom: 1.25rem;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: var(--bg-warm);
}

.admin-table a {
  color: var(--ink);
  font-weight: 500;
  transition: color 0.2s;
}

.admin-table a:hover {
  color: var(--accent);
}

.admin-cell-muted {
  color: var(--ink-muted);
  font-weight: 300;
}

.admin-cell-mono {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--ink-light);
}

.admin-cell-center {
  text-align: center;
}

/* --- Toggle switch --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  transition: background 0.25s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  header { padding: 2rem 1.25rem 1.5rem; }
  .nav-bar { padding: 0 1.25rem 1.25rem; }
  .content { padding: 0 1.25rem 3rem; }
  .breadcrumb { padding: 0 1.25rem; }
  .footer { padding: 1.5rem 1.25rem; flex-direction: column; gap: 0.5rem; }
  .stats-bar { gap: 1.5rem; flex-wrap: wrap; }
  .card-top { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .subject-grid { grid-template-columns: 1fr; }

  /* Exercises mobile */
  .exercise-card { padding: 1.25rem 1rem; }
  .choice-btn { padding: 0.7rem 0.75rem; gap: 0.5rem; font-size: 0.85rem; }
  .numeric-input-wrap { flex-direction: column; }
  .numeric-input { width: 100%; }
  .submit-btn { width: 100%; text-align: center; }

  /* Lesson body mobile */
  .lesson-body { max-width: 100%; }
  .lesson-body table { font-size: 0.78rem; display: block; overflow-x: auto; }
  .lesson-body th, .lesson-body td { padding: 0.4rem 0.6rem; }
  .lesson-body pre { padding: 1rem; font-size: 0.78rem; }
  .lesson-body blockquote { padding: 0.6rem 1rem; }
}
