:root {
  --ink: #1c1917;
  --muted: #57534e;
  --paper: #faf7f2;
  --card: #ffffff;
  --line: #e7e0d6;
  --accent: #2563eb;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  line-height: 1.55;
}

.navbar {
  background: #fff;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.hero-brand {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  max-width: 54rem;
}

.hero-logo, .lesson-photo, .preview-pic, .subject-photo {
  border-radius: 18px;
  object-fit: cover;
}

.hero-logo {
  width: 140px;
  height: 140px;
}

.subject-photo {
  width: 100%;
  height: 150px;
  margin-bottom: 0.8rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  max-width: 720px;
}

.chart-box {
  position: relative;
  max-width: 360px;
  height: 140px;
  margin: 0 auto 0.4rem;
}

.chart-box canvas,
#lessonsChart,
#minutesChart,
#unitChart,
#lessonChart {
  max-height: 140px !important;
}

.lesson-photo, .preview-pic {
  width: 100%;
  max-width: 420px;
  max-height: 180px;
  margin: 0.6rem 0 1rem;
}

.long-copy {
  white-space: pre-wrap;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

label {
  display: block;
  width: 100%;
}

.page {
  padding: 2rem 0 4rem;
}

.hero {
  max-width: 46rem;
  margin-bottom: 2rem;
}

.hero h1, .lesson h1 {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0.2rem 0 0.8rem;
}

.lead, .eyebrow, .crumb, .footer, small {
  color: var(--muted);
}

.eyebrow, .crumb {
  font-size: 0.9rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.subject-card, .course-row, .panel, .unit-card, .lesson {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
}

.subject-card {
  display: block;
  padding: 1.2rem 1.3rem 1.1rem;
  text-decoration: none;
  color: inherit;
  border-top: 8px solid var(--accent);
}

.subject-card h2 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

.subject-card p, .unit-card p, .panel p, .lesson p {
  margin: 0 0 0.8rem;
}

.meta {
  font-weight: 600;
  color: var(--accent);
}

.course-list {
  display: grid;
  gap: 0.7rem;
}

.course-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: inherit;
}

.course-row span {
  display: block;
  color: var(--muted);
}

.panel, .unit-card, .lesson {
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
}

.panel h2, .lesson h2, .section-title, .unit-card h3 {
  font-size: 1.05rem;
  margin-top: 1rem;
}

.pdf-list, .lesson-links {
  padding-left: 1.1rem;
}

.pdf-list li, .lesson-links li {
  margin: 0.35rem 0;
}

.goals {
  white-space: pre-wrap;
  font-family: inherit;
  background: #f3efe7;
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.notes {
  background: #f3efe7;
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.product-bar {
  background: #1c1917;
  color: #e7e0d6;
  font-size: 0.85rem;
}
.product-bar a { color: #fff; }
.product-bar-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.4rem 0;
}
.product-bar-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  text-align: left;
  margin-bottom: 1.2rem;
}
.footer-brand, .footer-heading {
  font-weight: 800;
  margin: 0 0 0.5rem;
}
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-grid li { margin: 0.3rem 0; }
.site-footer-wide { text-align: left; }
.footer-note {
  text-align: center;
  color: var(--muted);
  margin: 0;
}
.family-panel p { margin-bottom: 0.6rem; }
.family-links {
  padding-left: 1.1rem;
  margin: 0;
}
.family-links li { margin: 0.35rem 0; }
.small-family { font-size: 0.95rem; }

.prose p { margin: 0 0 0.7rem; }
.prose h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.prose h4 { font-size: 1rem; margin: 0.8rem 0 0.3rem; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 0.8rem; }
.prose li { margin: 0.2rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.35rem 0.55rem; text-align: left; }
.prose th { background: #f3efe7; }
.prose blockquote {
  margin: 0 0 0.8rem;
  padding: 0.4rem 0.8rem;
  border-left: 4px solid var(--line);
  background: #f3efe7;
}
.tox-tinymce { border-radius: 12px !important; margin-bottom: 0.8rem; }
.editor-field { margin: 0 0 0.6rem; }
.editor-field label {
  display: block;
  font-weight: 700;
  margin: 0.7rem 0 0.35rem;
}
.editor-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.35rem 1rem 0.8rem;
  margin: 1rem 0;
}
.editor-group legend {
  font-weight: 800;
  padding: 0 0.4rem;
}
.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--card);
  padding: 0.8rem 0;
  margin: 0;
}

a {
  color: var(--accent);
}
