:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #5e6a72;
  --line: #d7dee3;
  --paper: #f7f9fa;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b5853;
  --blue: #2563eb;
  --amber: #c56a18;
  --rose: #b83f62;
  --shadow: 0 16px 45px rgba(23, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
select,
input {
  font: inherit;
}

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

.sidebar {
  background: #10252c;
  color: #f4fbfc;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-height: 100vh;
  overflow-y: auto;
}

.brand {
  display: grid;
  gap: 5px;
}

.brand strong {
  font-size: 20px;
}

.brand span,
.nav-label,
.nav-group-label,
.setting-label {
  color: rgba(244, 251, 252, 0.72);
  font-size: 13px;
}

.nav-group-label {
  margin-top: 10px;
  color: rgba(244, 251, 252, 0.5);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav[hidden],
.admin-nav[hidden] {
  display: none !important;
}

.server-role-instructor .admin-nav,
.role-instructor .admin-nav {
  display: none !important;
}

.server-role-manager [data-curriculum-admin-only],
.role-manager [data-curriculum-admin-only],
.server-role-instructor [data-curriculum-admin-only],
.role-instructor [data-curriculum-admin-only] {
  display: none !important;
}

.nav button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-nav {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.server-auth-sidebar {
  margin-top: auto;
  padding: 16px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.server-auth-logout-form {
  margin: 0;
}

.server-auth-logout-form button {
  width: 100%;
}

.settings {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.settings label {
  display: grid;
  gap: 6px;
}

.settings select,
.settings input {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4fbfc;
  background: #183640;
  padding: 0 10px;
}

.content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-logout-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.topbar-logout-button:hover,
.topbar-logout-button:focus-visible {
  background: #fff1f1;
  border-color: #e9b4b4;
  outline: 3px solid rgba(164, 54, 47, 0.16);
  outline-offset: 2px;
}

.data-source-badge {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.lesson-pill {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  background: #e8f4f2;
  color: var(--teal-dark);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.32fr);
  gap: 24px;
  padding: 24px 28px;
  align-items: start;
}

.instructor-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.instructor-flow {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  cursor: pointer;
  font: inherit;
}

.selection-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.phase-choice-grid,
.lesson-choice-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mode-choice-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.mode-choice-panel > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.phase-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lesson-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.phase-choice-card,
.lesson-choice-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.phase-choice-card {
  min-height: 128px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.phase-choice-card:hover,
.lesson-choice-button:hover {
  border-color: var(--teal);
  background: #eef8f6;
}

.phase-choice-card span,
.phase-choice-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.phase-choice-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.lesson-choice-button {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 900;
  text-align: center;
}

.admin-workspace {
  padding: 24px 28px;
}

.admin-overview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-login-workspace {
  padding: 24px 28px;
}

.admin-login-card {
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-login-error {
  margin: 0;
  color: #a4362f;
  font-weight: 800;
}

.admin-header {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.admin-header h2 {
  margin: 0;
  font-size: 28px;
}

.admin-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-scope {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: end;
  gap: 8px;
}

.admin-scope span,
.admin-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: #fbfcfc;
  cursor: pointer;
}

.admin-scope span.active,
.admin-tab.active {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: #ecf8f4;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
  padding: 20px;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  overflow: hidden;
}

.continuations-section-highlight {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2), var(--shadow);
}

.video-section-highlight {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2), var(--shadow);
}

.admin-preview-panel {
  grid-column: 1 / -1;
}

.backup-panel {
  grid-column: 1 / -1;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.backup-summary {
  margin: 0;
  padding: 14px;
  color: var(--muted);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.admin-dashboard-stat {
  grid-column: span 4;
  display: grid;
  gap: 6px;
  min-height: 92px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-dashboard-stat:nth-child(n + 6) {
  grid-column: span 5;
}

.admin-dashboard-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-dashboard-stat strong {
  color: var(--ink);
  font-size: 22px;
}

.admin-dashboard-breakdown {
  display: grid;
  gap: 5px;
}

.admin-dashboard-breakdown span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-transform: none;
}

.panel-actions {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.lesson-plan-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.lesson-plan-toolbar label {
  display: grid;
  gap: 6px;
}

.lesson-plan-toolbar label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-plan-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
}

.lesson-plan-save-status {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.lesson-plan-save-status[data-tone="pending"] {
  color: #8a5b00;
  background: #fff7df;
}

.lesson-plan-save-status[data-tone="success"] {
  color: #126c51;
  background: #eaf8f2;
}

.lesson-plan-save-status[data-tone="error"] {
  color: #9f1d1d;
  background: #fff1f1;
}

.empty-state {
  margin: 0;
  padding: 16px;
  color: var(--muted);
}

.admin-skill-list,
.admin-phase-list {
  display: grid;
}

.admin-skill-row,
.admin-phase-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.admin-skill-row {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
}

.admin-skill-card-row,
.admin-continuation-card-row {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  min-height: 0;
  gap: 14px;
  padding: 12px 14px;
}

.admin-skill-card-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.admin-skill-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-skill-card-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.admin-skill-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-skill-card-meta span {
  white-space: nowrap;
}

.admin-skill-card-actions {
  justify-content: flex-start;
}

.admin-skill-card-actions button {
  min-height: 42px;
}

.admin-phase-card.active {
  background: #eef8f6;
  box-shadow: inset 4px 0 0 var(--teal);
}

.admin-skill-row:last-child,
.admin-phase-card:last-child {
  border-bottom: 0;
}

.admin-order {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e4ebee;
  font-weight: 900;
}

.admin-skill-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.admin-skill-copy strong {
  overflow-wrap: anywhere;
}

.admin-skill-copy code {
  display: block;
  overflow-wrap: anywhere;
  color: #1f4d59;
  font-size: 11px;
  line-height: 1.35;
}

.admin-skill-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-status {
  min-width: 78px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #ecf8f4;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.admin-row-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 900;
}

.preview-button {
  background: var(--teal);
  color: #ffffff;
}

.edit-button {
  background: #edf2f4;
  color: var(--ink);
}

.delete-button {
  background: #f9e7ec;
  color: #9c2348;
}

.skill-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.skill-form label {
  display: grid;
  gap: 6px;
}

.skill-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-form input,
.skill-form select,
.skill-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-preview-stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  background: #071114;
  color: #d5e4e7;
}

.admin-preview-stage iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
}

.admin-preview-stage img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.sequence-preview {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.sequence-preview img,
.sequence-preview iframe {
  width: 100%;
  min-height: 240px;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #0d343d;
}

.lesson-card,
.side-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lesson-card {
  overflow: hidden;
}

.dashboard-card {
  padding: 20px;
}

.lesson-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.lesson-card-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.lesson-card-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-meter {
  min-width: 176px;
  min-height: 84px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid #9ad4c4;
  border-radius: 8px;
  background: #ecf8f4;
  color: var(--teal-dark);
  text-align: center;
}

.status-meter strong {
  font-size: 30px;
  line-height: 1;
}

.status-meter span {
  font-size: 12px;
  font-weight: 800;
}

.lesson-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding-top: 18px;
}

.lesson-mode-panel {
  display: flex;
  justify-content: flex-start;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 0 0;
}

.lesson-mode-panel label,
.readonly-mode {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.lesson-mode-panel span,
.admin-setting span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-mode-panel select,
.flexible-actions select,
.admin-setting select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.lesson-mode-panel select {
  min-height: 40px;
  padding: 0 12px;
}

.readonly-mode strong {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #9ad4c4;
  border-radius: 8px;
  background: #ecf8f4;
  color: var(--teal-dark);
  padding: 0 12px;
  font-size: 14px;
}

.admin-setting {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.admin-setting select {
  min-height: 40px;
  padding: 0 12px;
}

.lesson-controls-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  overflow: hidden;
}

.dashboard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  overflow: hidden;
}

.storybook-section {
  grid-column: 1 / -1;
}

.flexible-lesson-panel {
  margin-top: 14px;
}

.free-practice-panel {
  grid-column: 1 / -1;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.free-practice-mode .topbar,
.free-practice-mode #instructorBreadcrumb,
.free-practice-mode .data-source-badge {
  display: none;
}

.free-practice-mode .workspace {
  padding-top: 18px;
}

.free-practice-remote {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.free-practice-remote h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.free-practice-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.free-practice-tab {
  min-height: 72px;
  border: 0;
  border-radius: 8px;
  background: #10252c;
  color: #ffffff;
  cursor: pointer;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
}

.free-practice-tab:hover,
.free-practice-tab:focus-visible {
  background: var(--teal);
  outline: 4px solid rgba(15, 118, 110, 0.2);
}

.free-practice-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 18px;
}

.free-practice-section h3 {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f1f5f6;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.free-practice-storybook-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.free-practice-storybook-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: #0d343d;
}

.free-practice-storybook-card strong {
  display: block;
  margin-bottom: 14px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
}

.free-practice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.free-practice-actions button,
.free-practice-touch-row {
  min-height: 68px;
  font-size: 18px;
  font-weight: 900;
}

.free-practice-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.free-practice-touch-row {
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 14px 16px;
  cursor: pointer;
}

.free-practice-touch-row .row-status {
  width: 38px;
  height: 38px;
  background: #10252c;
  color: #ffffff;
}

.free-practice-touch-row .row-copy {
  gap: 0;
}

.free-practice-touch-row .row-copy strong {
  font-size: clamp(18px, 2vw, 24px);
}

.free-practice-touch-row:hover,
.free-practice-touch-row:focus-visible {
  background: #ecf8f4;
  outline: 4px solid rgba(15, 118, 110, 0.18);
  outline-offset: -4px;
}

.flexible-list {
  display: grid;
}

.flexible-item-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(260px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.flexible-item-row:last-child {
  border-bottom: 0;
}

.flexible-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
}

.flexible-actions select {
  min-height: 34px;
  max-width: 240px;
  padding: 0 10px;
}

.locked-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-heading {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #f1f5f6;
}

.section-heading span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-heading strong {
  color: var(--muted);
  font-size: 12px;
}

.lesson-list {
  display: grid;
}

.lesson-row {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.lesson-row:last-child {
  border-bottom: 0;
}

.lesson-row:hover,
.lesson-row.active {
  background: #eef8f6;
}

.lesson-row.completed {
  background: #effaf4;
}

.lesson-row.upcoming {
  color: #3f4c53;
}

.featured-row {
  min-height: 92px;
}

.row-status {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e4ebee;
  color: var(--muted);
  font-weight: 900;
}

.lesson-row.active .row-status {
  background: var(--teal);
  color: #ffffff;
}

.lesson-row.completed .row-status {
  background: #0f766e;
  color: #ffffff;
}

.row-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.row-copy strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.row-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.lesson-media-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 2px;
}

.row-copy .lesson-media-status span {
  color: #315d68;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.video-debug {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #1f4d59;
  font-size: 11px;
  line-height: 1.35;
  background: #e9f3f5;
  border: 1px solid #c9dde2;
  border-radius: 6px;
  padding: 6px 8px;
}

.rotation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #c9dde2;
  border-radius: 8px;
  background: #f2f8f9;
}

.rotation-copy {
  display: grid;
  gap: 2px;
}

.rotation-panel strong {
  color: var(--ink);
  font-size: 13px;
}

.rotation-panel span {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.row-kind {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.row-play-button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--teal);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.row-play-button.as-label {
  display: inline-grid;
  place-items: center;
}

.current-step-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 0;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.media-stage {
  aspect-ratio: 16 / 9;
  background: #0d343d;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.compact-stage {
  height: 100%;
  min-height: 210px;
  aspect-ratio: auto;
}

.media-stage img,
.media-stage video,
.media-stage iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-stage iframe {
  border: 0;
}

.media-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.card-body {
  padding: 22px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.active-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.active-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.coaching-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.coaching-points span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: #fbfcfc;
  font-size: 13px;
  font-weight: 700;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
}

.primary-button,
.secondary-button,
.start-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.secondary-button {
  padding: 0 14px;
  background: #edf2f4;
  color: var(--ink);
}

.primary-button {
  padding: 0 18px;
  background: var(--teal);
  color: white;
}

.start-button {
  min-height: 58px;
  padding: 0 28px;
  background: var(--amber);
  color: #ffffff;
  font-size: 18px;
}

.lesson-controls-panel .start-button,
.lesson-controls-panel .primary-button,
.lesson-controls-panel .secondary-button {
  min-height: 64px;
  font-size: 18px;
  font-weight: 900;
}

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

.side-panel {
  padding: 18px;
}

.progress-panel {
  margin-top: 14px;
}

.side-panel h2,
.cms-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 14px;
}

.timeline-item {
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: 8px;
  text-align: left;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.timeline-item.active {
  border-color: var(--teal);
  box-shadow: inset 4px 0 0 var(--teal);
}

.timeline-item.completed {
  background: #ecf8f4;
  border-color: #9ad4c4;
}

.timeline-item.upcoming {
  opacity: 0.72;
}

.timeline-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-title {
  font-weight: 800;
  line-height: 1.25;
}

.presentation-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 0.28fr);
  background: #05080a;
  color: #ffffff;
}

.presentation-overlay[hidden] {
  display: none;
}

.presentation-timeline {
  grid-column: 1 / -1;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-padding-inline: 96px;
  padding: 10px 96px 10px 14px;
  background: rgba(16, 37, 44, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.presentation-exit-button {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 30;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #ffffff;
  color: #10252c;
  cursor: pointer;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.presentation-exit-button:hover,
.presentation-exit-button:focus-visible {
  background: #ffd7d7;
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.presentation-timeline-item {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 0 1px transparent;
}

.presentation-timeline-item.current {
  min-height: 54px;
  max-width: 280px;
  background: #ffffff;
  border-color: #f2c879;
  color: #10252c;
  font-size: clamp(17px, 1.55vw, 24px);
  box-shadow: 0 0 0 3px rgba(242, 200, 121, 0.36);
}

.presentation-timeline-item.completed {
  background: rgba(15, 118, 110, 0.42);
  border-color: rgba(154, 212, 196, 0.56);
  color: #ffffff;
}

.presentation-stage {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000000;
  overflow: hidden;
}

.presentation-stage img,
.presentation-stage video,
.presentation-stage iframe,
.presentation-media {
  grid-area: 1 / 1;
  display: block;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  object-fit: contain;
}

.presentation-stage video,
.presentation-stage iframe,
.presentation-media {
  width: 100%;
  height: 100%;
}

.presentation-stage img,
.presentation-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.challenge-slide {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(28px, 5vw, 72px);
  background: #10343b;
}

.challenge-slide p {
  display: none;
}

.challenge-slide h3 {
  margin: 0;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 1.05;
}

.presentation-panel {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  align-items: stretch;
  gap: 14px;
  background: #10252c;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 0;
}

.presentation-panel-content {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  gap: 14px;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

#presentationModeDebug {
  display: none;
}

#presentationType {
  margin: 0;
  color: #9bd8cf;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 900;
  text-transform: uppercase;
}

.presentation-panel h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 44px);
  line-height: 1.1;
}

.presentation-panel p {
  margin: 0;
  color: #d5e4e7;
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.3;
}

#presentationDescription {
  max-width: 68ch;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(18px, 1.55vw, 24px);
  line-height: 1.5;
  white-space: normal;
}

#presentationDescription[hidden] {
  display: none;
}

#presentationDescription strong {
  display: block;
  margin-bottom: 6px;
  color: #9bd8cf;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 900;
  text-transform: uppercase;
}

#presentationDescription span {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.presentation-panel h2,
#presentationDescription {
  grid-column: 1;
}

.presentation-teacher-prompt,
.presentation-coach-support,
.presentation-coaching-points {
  grid-column: 1;
  display: grid;
  gap: 8px;
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
}

.presentation-teacher-prompt {
  background: rgba(155, 216, 207, 0.12);
}

.presentation-coach-support {
  align-self: end;
  gap: 8px;
  overflow: visible;
  padding: 10px 12px;
}

.presentation-teacher-prompt[hidden],
.presentation-coach-support[hidden],
.presentation-coaching-points[hidden] {
  display: none;
}

.presentation-teacher-prompt strong,
.presentation-coach-support strong,
.presentation-coaching-points strong {
  color: #9bd8cf;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 900;
  letter-spacing: 0;
}

.presentation-teacher-prompt blockquote {
  margin: 0;
  color: #ffffff;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 800;
  line-height: 1.35;
}

.coach-support-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-support-buttons button {
  min-height: 56px;
  justify-content: center;
  padding: 10px 14px;
  font-size: 16px;
  text-align: center;
}

.coach-support-menu-button {
  width: 100%;
}

.correction-video-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #05080a;
}

.correction-video-stage iframe,
.correction-video-stage video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  object-fit: contain;
}

.correction-video-label {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: grid;
  gap: 3px;
  max-width: min(520px, calc(100% - 36px));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(16, 37, 44, 0.92);
  color: #ffffff;
  padding: 10px 14px;
}

.correction-video-label strong {
  color: #9bd8cf;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.correction-video-label span {
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 900;
  line-height: 1.15;
}

.correction-video-close {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  min-height: 64px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #10252c;
  padding: 0 18px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.field-helper {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.presentation-coaching-points ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
}

.presentation-coaching-points li {
  color: #ffffff;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 800;
  line-height: 1.25;
}

.presentation-mode-debug {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.presentation-mode-debug span {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 900;
}

.presentation-skill-screen {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 44px;
  color: #ffffff;
  text-align: center;
}

.presentation-skill-screen p,
.presentation-skill-screen span {
  display: none;
}

.presentation-skill-screen h3 {
  margin: 0;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 1;
}

.presentation-actions {
  grid-column: 1;
  grid-row: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-self: end;
  gap: 14px;
  margin-top: 0;
}

.presentation-actions button {
  min-height: 64px;
  padding: 0 18px;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 900;
}

#presentationCompleteButton {
  min-height: 76px;
  background: var(--amber);
  font-size: clamp(20px, 2.2vw, 30px);
}

#presentationPreviousButton,
#presentationNextButton,
#presentationReplaceSkillButton {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.replace-skill-dialog,
.coach-support-dialog {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 10, 0.72);
}

.replace-skill-dialog[hidden],
.coach-support-dialog[hidden] {
  display: none;
}

.replace-skill-card,
.coach-support-card {
  width: min(760px, 94vw);
  max-height: 85vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.coach-support-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.coach-support-dialog-body {
  min-height: 0;
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

.coach-support-dialog-body section {
  display: grid;
  gap: 8px;
}

.coach-support-dialog-body strong {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.coach-support-dialog-body p {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.coach-support-dialog-body ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.coach-support-dialog-body li {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.coach-support-dialog-actions {
  display: grid;
  gap: 10px;
}

.coach-support-dialog-actions button {
  min-height: 60px;
  justify-content: start;
  font-size: 17px;
  text-align: left;
}

.replace-skill-options {
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}

.replace-skill-option {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  padding: 12px;
  cursor: pointer;
  text-align: left;
}

.replace-skill-scroll-hint {
  margin: 0;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 28%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.replace-skill-card .form-actions,
.coach-support-card .form-actions {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.replace-skill-card .form-actions button,
.coach-support-card .form-actions button {
  min-height: 64px;
  min-width: 160px;
  font-weight: 900;
}

.replace-skill-option:hover,
.replace-skill-option:focus-visible {
  border-color: var(--teal);
  background: #eef8f6;
  outline: 3px solid rgba(15, 118, 110, 0.18);
}

.replace-skill-order {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e4ebee;
  font-weight: 900;
}

.replace-skill-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.replace-skill-copy strong {
  overflow-wrap: anywhere;
}

.replace-skill-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.secondary-button.dark {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.lesson-complete {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  align-content: center;
  gap: 28px;
  place-items: center;
  background: #0f766e;
  color: #ffffff;
  text-align: center;
}

.lesson-complete[hidden] {
  display: none;
}

.admin-mode #instructorArea,
.admin-mode #adminLoginArea,
.admin-mode #instructorSettings,
.admin-mode .lesson-pill {
  display: none !important;
}

.instructor-mode #adminArea,
.instructor-mode #adminLoginArea {
  display: none !important;
}

.admin-login-mode #adminArea,
.admin-login-mode #instructorArea,
.admin-login-mode #instructorSettings,
.admin-login-mode .lesson-pill {
  display: none !important;
}

.lesson-complete h2 {
  margin: 0;
  font-size: clamp(48px, 8vw, 120px);
  line-height: 1;
}

.lesson-complete .start-button {
  background: #ffffff;
  color: var(--teal-dark);
}

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

  .sidebar {
    position: static;
  }

  .settings {
    margin-top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-dashboard-grid,
  .current-step-panel,
  .admin-header,
  .admin-grid,
  .rotation-panel {
    grid-template-columns: 1fr;
  }

  .admin-scope {
    justify-content: start;
  }

  .admin-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard-stat,
  .admin-dashboard-stat:nth-child(n + 6) {
    grid-column: span 1;
  }

  .progress-panel {
    position: static;
  }

  .presentation-overlay {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .presentation-stage {
    grid-column: 1;
    grid-row: 2;
    min-height: 58vh;
  }

  .presentation-panel {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    grid-template-columns: 1fr;
    align-content: start;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .presentation-panel h2,
  #presentationDescription,
  .presentation-actions {
    grid-column: 1;
  }

  .presentation-actions {
    grid-row: auto;
  }

  .replace-skill-dialog,
  .coach-support-dialog {
    padding: 10px;
    place-items: stretch;
  }

  .replace-skill-card,
  .coach-support-card {
    width: 100%;
    max-height: 85vh;
  }
}

@media (max-width: 620px) {
  .topbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .workspace {
    padding: 16px;
  }

  .settings,
  .lesson-dashboard-grid,
  .free-practice-tabs,
  .free-practice-actions,
  .free-practice-library,
  .admin-dashboard-grid,
  .admin-grid,
  .sequence-preview {
    grid-template-columns: 1fr;
  }

  .free-practice-storybook-card {
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    padding: 16px;
  }

  .admin-skill-row,
  .admin-phase-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .admin-status {
    grid-column: 2;
    justify-self: start;
  }

  .admin-row-actions {
    grid-column: 2;
    justify-content: start;
  }

  .admin-skill-card-row,
  .admin-continuation-card-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .admin-skill-card-top {
    grid-template-columns: 1fr;
  }

  .admin-skill-card-meta {
    display: grid;
    gap: 6px;
  }

  .admin-skill-card-meta span {
    white-space: normal;
  }

  .admin-skill-card-actions {
    grid-column: auto;
  }

  .admin-skill-card-actions button {
    flex: 1 1 140px;
  }

  .lesson-card-header {
    grid-template-columns: 1fr;
  }

  .status-meter {
    width: 100%;
  }

  .lesson-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .row-kind {
    grid-column: 2;
  }

  .row-actions {
    grid-column: 2;
    justify-items: start;
  }

  .active-title {
    font-size: 24px;
  }
}
