:root {
  color-scheme: light;
  --ink: #1c2434;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --nav: #172033;
  --teal: #0f8b8d;
  --coral: #ef6f61;
  --gold: #f6bd60;
  --green: #5aaf78;
  --blue: #4464ad;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  background: var(--nav);
  color: #fff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--gold);
  color: #172033;
  font-size: 28px;
  font-weight: 900;
}

.brand-lockup h1,
.brand-lockup p,
.module-header h2,
.module-header p,
.minute-card h3,
.minute-card p,
.topbar h2 {
  margin: 0;
}

.brand-lockup h1 {
  font-size: 20px;
}

.brand-lockup p,
.level-card p,
.nav-list a {
  color: rgba(255, 255, 255, 0.74);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.level-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.level-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

main {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 24px;
}

.topbar,
.module-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr);
  gap: 24px;
  align-items: end;
  padding: 24px;
}

.topbar h2,
.module-header h2 {
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.1;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 110px 130px;
  gap: 12px;
}

label,
.select-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.module-panel {
  padding: 24px;
}

.module-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mastery-meter {
  display: grid;
  place-items: center;
  width: 118px;
  height: 86px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.mastery-meter span {
  font-size: 30px;
  font-weight: 900;
}

.mastery-meter small {
  color: var(--muted);
  font-weight: 800;
}

.minute-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.minute-card {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 276px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.minute-title {
  display: flex;
  gap: 12px;
}

.minute-title > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.minute-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.word-bank,
.reading-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.word-chip,
.sight-chip {
  min-width: 70px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
}

.word-chip.correct,
.sight-chip.correct {
  border-color: rgba(90, 175, 120, 0.5);
  background: rgba(90, 175, 120, 0.12);
}

.word-chip.review,
.sight-chip.review {
  border-color: rgba(239, 111, 97, 0.5);
  background: rgba(239, 111, 97, 0.12);
}

.flashcard {
  display: grid;
  place-items: center;
  min-height: 102px;
  border: 2px dashed rgba(68, 100, 173, 0.34);
  border-radius: 8px;
  background: #f8faff;
  color: var(--blue);
  font-size: 42px;
  font-weight: 900;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
}

.btn.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.results-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.results-band div {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.metric {
  display: block;
  font-size: 30px;
  font-weight: 900;
}

.results-band small,
.report-card small {
  color: var(--muted);
  font-weight: 800;
}

.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.frame-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.frame-card.key-scene {
  border-color: rgba(15, 139, 141, 0.55);
  box-shadow: inset 0 0 0 2px rgba(15, 139, 141, 0.08);
}

.frame-card.not-key-scene {
  opacity: 0.68;
}

.frame-card h3 {
  margin: 0;
  font-size: 18px;
}

.frame-image,
.frame-error {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.frame-error {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-weight: 800;
}

.frame-card p {
  margin: 0;
  line-height: 1.4;
}

.frame-card button {
  justify-self: start;
}

.loading-text {
  margin: 12px 0 0;
  color: var(--blue);
  font-weight: 900;
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 24px;
}

.award-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.award-badge {
  display: grid;
  place-items: center;
  width: 142px;
  min-height: 118px;
  padding: 12px;
  border: 2px solid rgba(246, 189, 96, 0.75);
  border-radius: 8px;
  background: #fff8e8;
  text-align: center;
  font-weight: 900;
}

.award-badge span {
  display: block;
  font-size: 28px;
}

.performance-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.performance-card h3 {
  margin: 0 0 4px;
}

.report-card {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.report-grid div {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.skills-list li {
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef6f6;
  color: #0f5f61;
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell,
  .topbar,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-list a {
    text-align: center;
  }

  .minute-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {
  main,
  .sidebar,
  .module-panel,
  .topbar {
    padding: 16px;
  }

  .profile-grid,
  .results-band {
    grid-template-columns: 1fr 1fr;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .module-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mastery-meter {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .warmup-panel,
  #storyboard,
  #awards,
  #printReport,
  #teacherComment {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  main {
    padding: 0;
  }

  .module-panel,
  .report-card {
    border: 0;
    box-shadow: none;
  }
}
