:root {
  color-scheme: light;
  --bg: #f6fbf8;
  --surface: #ffffff;
  --surface-blue: #eaf5ff;
  --ink: #18302a;
  --muted: #65756f;
  --green: #4aa477;
  --green-dark: #28775a;
  --blue: #4d86b8;
  --orange: #f5a65b;
  --gold: #f7c948;
  --lock: #a8b5af;
  --line: #d6e5dc;
  --danger: #c04b3c;
  --shadow: 0 12px 32px rgba(24, 48, 42, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f6fbf8 0%, #edf7f3 52%, #f9fbfb 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(247, 201, 72, 0.26), transparent 30%),
    linear-gradient(135deg, #f6fbf8 0%, #eaf5ff 48%, #fff7ea 100%);
}

.login-panel {
  width: min(100%, 390px);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(24, 48, 42, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-badge {
  width: 54px;
  height: 54px;
}

.login-panel h1 {
  margin-bottom: 4px;
  font-size: 2.35rem;
  line-height: 1;
}

.login-field {
  display: grid;
  gap: 7px;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.login-field input {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(24, 48, 42, 0.18);
  border-radius: var(--radius);
  background: #f8fbf9;
  color: var(--ink);
}

.login-field input:focus-visible {
  border-color: rgba(77, 134, 184, 0.7);
  outline: 3px solid rgba(77, 134, 184, 0.24);
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(40, 119, 90, 0.13);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-badge {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 2px solid rgba(74, 164, 119, 0.25);
  border-radius: 50%;
  background: #e7f5ec;
}

.paw-dot,
.paw-pad {
  position: absolute;
  display: block;
  background: var(--green);
}

.paw-dot {
  width: 7px;
  height: 8px;
  border-radius: 50%;
  top: 12px;
}

.paw-dot-a {
  left: 12px;
  transform: rotate(-20deg);
}

.paw-dot-b {
  left: 19px;
  top: 9px;
}

.paw-dot-c {
  right: 11px;
  transform: rotate(20deg);
}

.paw-pad {
  width: 18px;
  height: 15px;
  left: 13px;
  bottom: 10px;
  border-radius: 60% 60% 55% 55%;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-metrics {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.topbar-metrics span {
  padding: 8px 10px;
  border: 1px solid rgba(74, 164, 119, 0.2);
  border-radius: 999px;
  background: #eef8f1;
  white-space: nowrap;
}

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

.account-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-name,
.save-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.account-name {
  min-width: 28px;
  color: var(--ink);
}

.topbar-action {
  min-height: 34px;
  padding-inline: 10px;
}

.view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(74, 164, 119, 0.2);
  border-radius: 999px;
  background: #eef8f1;
}

.view-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--green-dark);
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.view-tab.is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(24, 48, 42, 0.11);
}

.app-frame {
  width: min(100%, 940px);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 64px;
}

.path-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 24px;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.95;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.active-dot {
  background: var(--orange);
}

.open-dot {
  background: var(--green);
}

.locked-dot {
  background: var(--lock);
}

.path-stage {
  position: relative;
  min-height: 420px;
  padding: 14px 0 24px;
}

.path-river {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 50%;
  width: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--line), #d9eaf7 45%, #f7d7a9 100%);
}

.week-band {
  position: relative;
  padding: 16px 0 22px;
  border-top: 1px solid rgba(40, 119, 90, 0.11);
}

.week-band:first-child {
  border-top: 0;
}

.week-title {
  position: sticky;
  top: 76px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(24, 48, 42, 0.08);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 128px;
  margin: 6px 0;
}

.lesson-step.is-left .lesson-card {
  grid-column: 1;
  justify-self: end;
  text-align: right;
}

.lesson-step.is-right .lesson-card {
  grid-column: 3;
  justify-self: start;
}

.lesson-node {
  position: relative;
  grid-column: 2;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
  box-shadow:
    0 8px 0 var(--green-dark),
    var(--shadow);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.lesson-node:hover {
  transform: translateY(-2px);
}

.lesson-node:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.table-action:focus-visible,
.table-title-button:focus-visible,
.column-toggle:focus-visible,
.column-header-button:focus-visible,
.view-tab:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(77, 134, 184, 0.45);
  outline-offset: 4px;
}

.lesson-node::before {
  content: "";
  width: 30px;
  height: 24px;
  border: 4px solid currentColor;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(3px, -2px);
  opacity: 0.92;
}

.lesson-card {
  width: min(100%, 290px);
  padding: 14px;
  border: 1px solid rgba(24, 48, 42, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(24, 48, 42, 0.08);
}

.lesson-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.lesson-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.taxonomy-line {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: #445851;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.3;
}

.taxonomy-item {
  overflow-wrap: anywhere;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lesson-step.is-left .lesson-meta {
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-blue);
  color: #315f89;
  font-size: 0.72rem;
  font-weight: 850;
}

.chip.is-type {
  background: #e9f6ef;
  color: var(--green-dark);
}

.chip.is-age {
  background: #fff2dc;
  color: #98601d;
}

.chip.is-new {
  background: #fff0e2;
  color: #9a531b;
}

.lesson-step.is-new-content .lesson-card,
.lesson-step.is-updated-content .lesson-card {
  border-color: rgba(245, 166, 91, 0.85);
  box-shadow:
    0 0 0 3px rgba(245, 166, 91, 0.18),
    0 10px 26px rgba(24, 48, 42, 0.08);
}

.lesson-step.is-new-content .lesson-node,
.lesson-step.is-updated-content .lesson-node {
  outline: 4px solid rgba(245, 166, 91, 0.28);
  outline-offset: 6px;
}

.lesson-step.is-active .lesson-node {
  background: var(--orange);
  box-shadow:
    0 8px 0 #c9782f,
    0 0 0 0 rgba(245, 166, 91, 0.42),
    var(--shadow);
  animation: activePulse 1.7s ease-out infinite;
}

.lesson-step.is-active .lesson-node::before {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  transform: none;
  box-shadow:
    -10px -8px 0 -7px currentColor,
    10px -8px 0 -7px currentColor,
    0 10px 0 -8px currentColor;
}

.lesson-step.is-completed .lesson-node {
  background: var(--gold);
  color: #5a4100;
  box-shadow:
    0 8px 0 #c7951f,
    var(--shadow);
}

.lesson-step.is-locked .lesson-node {
  background: #ccd6d1;
  color: #708078;
  box-shadow:
    0 8px 0 #aab7b0,
    0 10px 28px rgba(24, 48, 42, 0.06);
  cursor: not-allowed;
}

.lesson-step.is-locked .lesson-node:hover {
  transform: none;
}

.lesson-step.is-locked .lesson-node::before {
  width: 22px;
  height: 18px;
  border: 4px solid currentColor;
  border-radius: 5px;
  transform: none;
}

.lesson-step.is-locked .lesson-node::after {
  content: "";
  position: absolute;
  top: 18px;
  width: 20px;
  height: 16px;
  border: 4px solid currentColor;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
}

.lesson-step.is-locked .lesson-card {
  opacity: 0.68;
}

.overview-island {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  width: min(100%, 720px);
  margin: 12px auto 18px;
  padding: 13px;
  border: 1px solid rgba(77, 134, 184, 0.22);
  border-radius: var(--radius);
  background: #f6fbff;
  box-shadow: 0 10px 24px rgba(24, 48, 42, 0.08);
}

.overview-island.is-new-content {
  border-color: rgba(245, 166, 91, 0.75);
  box-shadow:
    0 0 0 3px rgba(245, 166, 91, 0.16),
    0 10px 24px rgba(24, 48, 42, 0.08);
}

.overview-marker {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 7px;
  background: #eaf5ff;
  color: #315f89;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.overview-body h3 {
  margin: 0 0 7px;
  font-size: 1rem;
}

.overview-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.overview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.overview-links button {
  min-height: 30px;
  max-width: 220px;
  padding: 0 9px;
  border: 1px solid rgba(77, 134, 184, 0.22);
  border-radius: 999px;
  background: var(--surface);
  color: #315f89;
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-stage {
  position: relative;
  min-height: 420px;
  padding: 12px 0 30px;
}

.branch-trunk {
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 50%;
  width: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #d9eaf7, #f7d7a9 50%, #d6e5dc);
}

.branch-root {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
}

.branch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.branch-card.is-left .branch-body {
  grid-column: 1;
  justify-self: end;
}

.branch-card.is-right .branch-body {
  grid-column: 3;
  justify-self: start;
}

.branch-card.is-left .branch-anchor,
.branch-card.is-right .branch-anchor {
  grid-column: 2;
}

.branch-anchor {
  display: grid;
  place-items: center;
  width: 70px;
  min-height: 70px;
  border: 3px solid #d9eaf7;
  border-radius: 50%;
  background: #fff;
  color: #315f89;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(24, 48, 42, 0.1);
}

.branch-body {
  width: min(100%, 350px);
  padding: 15px;
  border: 1px solid rgba(24, 48, 42, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(24, 48, 42, 0.08);
}

.branch-body h2 {
  margin: 0 0 7px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.branch-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.branch-lessons {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.branch-lessons li {
  padding: 8px;
  border: 1px solid rgba(24, 48, 42, 0.09);
  border-radius: 7px;
  background: #f8fbf9;
}

.branch-lessons li.is-new-content {
  border-color: rgba(245, 166, 91, 0.65);
  box-shadow: inset 3px 0 0 var(--orange);
}

.branch-lessons li.is-completed {
  background: #fffaf0;
}

.branch-lessons li.is-locked {
  background: #f2f6f4;
}

.branch-lessons button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.branch-lessons span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.path-empty,
.path-error {
  position: relative;
  z-index: 2;
  padding: 18px;
  border: 1px solid rgba(24, 48, 42, 0.1);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-weight: 800;
}

.lesson-dialog {
  width: min(94vw, 860px);
  max-height: min(88vh, 820px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
}

.lesson-dialog::backdrop {
  background: rgba(24, 48, 42, 0.38);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: min(88vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(24, 48, 42, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(24, 48, 42, 0.26);
}

.dialog-scroll {
  overflow: auto;
  padding: 28px clamp(18px, 4vw, 42px) 22px;
}

.dialog-header {
  padding-right: 42px;
}

.dialog-header h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(24, 48, 42, 0.14);
  border-radius: 50%;
  background: #f3f8f5;
  color: var(--ink);
  cursor: pointer;
}

.icon-button::before,
.icon-button::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 10px;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.icon-button::before {
  transform: rotate(45deg);
}

.icon-button::after {
  transform: rotate(-45deg);
}

.dialog-section {
  padding: 18px 0;
  border-top: 1px solid rgba(24, 48, 42, 0.1);
}

.dialog-section h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--green-dark);
  text-transform: uppercase;
}

.dialog-section p,
.dialog-section li,
.taxonomy-list {
  color: #41564f;
  font-size: 0.98rem;
  line-height: 1.6;
}

.dialog-section p {
  margin: 0;
}

.source-narrative {
  margin-top: 10px !important;
}

.taxonomy-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.taxonomy-list dt {
  color: var(--muted);
  font-weight: 900;
}

.taxonomy-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

#dialog-instructions {
  margin: 0;
  padding-left: 22px;
}

#dialog-instructions li + li {
  margin-top: 7px;
}

.media-list {
  display: grid;
  gap: 12px;
}

.media-item {
  padding: 10px;
  border: 1px solid rgba(24, 48, 42, 0.1);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.media-item video {
  display: block;
  width: 100%;
  max-height: 320px;
  border-radius: 6px;
  background: #10251e;
}

.media-item p {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.link-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.link-list a {
  color: #2d6f98;
  font-weight: 800;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(18px, 4vw, 42px);
  border-top: 1px solid rgba(24, 48, 42, 0.1);
  background: #f8fbf9;
}

.dialog-status {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 900;
}

.primary-action {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--green-dark);
}

.primary-action:disabled {
  background: #c9d5cf;
  color: #697970;
  box-shadow: none;
  cursor: default;
}

.primary-action.is-secondary {
  background: #fff2dc;
  color: #85520f;
  box-shadow: 0 5px 0 #d8903e;
}

.secondary-action,
.table-action {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(24, 48, 42, 0.13);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.table-action {
  min-width: 86px;
  background: #e9f6ef;
}

.table-action.is-preview {
  background: #eaf5ff;
  color: #315f89;
}

.table-action:disabled {
  background: #eef2f0;
  color: #7b8a84;
  cursor: default;
}

.library-hero {
  align-items: center;
}

.library-count {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(74, 164, 119, 0.19);
  border-radius: 999px;
  background: #eef8f1;
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 900;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(24, 48, 42, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(24, 48, 42, 0.06);
}

.control-field {
  display: grid;
  gap: 6px;
}

.control-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.control-field input,
.control-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(24, 48, 42, 0.14);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.control-field input {
  padding: 0 12px;
}

.control-field select {
  padding: 0 34px 0 10px;
}

.control-field input:focus,
.control-field select:focus {
  outline: 3px solid rgba(77, 134, 184, 0.24);
  border-color: rgba(77, 134, 184, 0.5);
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-table-shell {
  border: 1px solid rgba(24, 48, 42, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(24, 48, 42, 0.08);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.lesson-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.lesson-table th,
.lesson-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(24, 48, 42, 0.09);
  text-align: left;
  vertical-align: top;
  font-size: 0.84rem;
}

.lesson-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf7f3;
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-table tbody tr:hover {
  background: #f6fbf8;
}

.lesson-table td {
  color: #435851;
  font-weight: 700;
}

.table-lesson-cell {
  width: 260px;
}

.table-title-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 900;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.table-title-button:hover {
  color: var(--blue);
}

.table-summary {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
}

.table-row.is-completed {
  background: #fffaf0;
}

.table-row.is-locked {
  background: #f8faf9;
}

.table-empty,
.empty-copy {
  color: var(--muted);
  font-weight: 800;
}

.media-notes {
  color: var(--muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

.media-description {
  color: #41564f !important;
  font-size: 0.84rem !important;
  font-weight: 650 !important;
  line-height: 1.5 !important;
}

.column-controls-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(24, 48, 42, 0.09);
  background: #f8fbf9;
}

.column-controls-shell > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.column-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.column-toggle {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(24, 48, 42, 0.13);
  border-radius: 999px;
  background: #e9f6ef;
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
}

.column-toggle.is-off {
  background: #f0f3f1;
  color: #74847d;
  text-decoration: line-through;
}

.column-header-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.is-column-hidden {
  display: none;
}

.table-change-chip {
  margin-top: 6px;
}

.table-row.is-new-content,
.table-row.is-updated-content {
  box-shadow: inset 4px 0 0 var(--orange);
}

.celebration {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.celebration.is-visible {
  display: block;
}

.confetti {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 10px;
  height: 16px;
  border-radius: 3px;
  transform: rotate(var(--spin));
  animation: confettiFall 1100ms ease-in var(--delay) forwards;
}

.confetti-1 {
  background: var(--green);
}

.confetti-2 {
  background: var(--orange);
}

.confetti-3 {
  background: var(--blue);
}

.confetti-4 {
  background: var(--gold);
}

@keyframes confettiFall {
  to {
    top: 105vh;
    transform: translateX(28px) rotate(calc(var(--spin) + 300deg));
  }
}

@keyframes activePulse {
  0% {
    box-shadow:
      0 8px 0 #c9782f,
      0 0 0 0 rgba(245, 166, 91, 0.42),
      var(--shadow);
  }
  70% {
    box-shadow:
      0 8px 0 #c9782f,
      0 0 0 18px rgba(245, 166, 91, 0),
      var(--shadow);
  }
  100% {
    box-shadow:
      0 8px 0 #c9782f,
      0 0 0 0 rgba(245, 166, 91, 0),
      var(--shadow);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-status {
    align-items: flex-end;
    flex-direction: column;
    margin-left: auto;
  }

  .topbar-metrics {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 0.76rem;
  }

  .account-controls {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .path-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .library-controls {
    grid-template-columns: 1fr 1fr;
  }

  .control-search,
  .control-actions {
    grid-column: 1 / -1;
  }

  .path-river {
    left: 38px;
  }

  .week-title {
    top: 78px;
  }

  .lesson-step,
  .lesson-step.is-left,
  .lesson-step.is-right {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    min-height: 118px;
  }

  .lesson-step .lesson-node {
    grid-column: 1;
  }

  .lesson-step.is-left .lesson-card,
  .lesson-step.is-right .lesson-card,
  .lesson-card {
    grid-column: 2;
    justify-self: stretch;
    text-align: left;
    width: 100%;
  }

  .lesson-step.is-left .lesson-meta {
    justify-content: flex-start;
  }

  .overview-island {
    grid-template-columns: 1fr;
    margin-left: 0;
    margin-right: 0;
  }

  .overview-marker {
    min-height: 38px;
  }

  .branch-trunk {
    left: 38px;
  }

  .branch-card,
  .branch-card.is-left,
  .branch-card.is-right {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .branch-card.is-left .branch-anchor,
  .branch-card.is-right .branch-anchor,
  .branch-anchor {
    grid-column: 1;
    width: 62px;
    min-height: 62px;
  }

  .branch-card.is-left .branch-body,
  .branch-card.is-right .branch-body,
  .branch-body {
    grid-column: 2;
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 440px) {
  .login-screen {
    padding: 16px;
  }

  .login-panel {
    padding: 22px;
  }

  .brand-badge {
    width: 40px;
    height: 40px;
  }

  .brand-subtitle {
    display: none;
  }

  .topbar-metrics span {
    padding: 7px 8px;
  }

  .view-switcher {
    order: 3;
    width: 100%;
  }

  .topbar-status {
    width: calc(100% - 56px);
  }

  .view-tab {
    flex: 1;
  }

  .app-frame {
    padding-inline: 12px;
  }

  .library-controls {
    grid-template-columns: 1fr;
  }

  .control-search,
  .control-actions {
    grid-column: auto;
  }

  .lesson-card {
    padding: 12px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action {
    width: 100%;
  }

  .taxonomy-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
