
:root {
  --brand-primary: #3354A1;
  --brand-primary-strong: #264284;
  --brand-accent: #FFF8DB;
  --brand-surface: #FFFFFF;
  --brand-surface-soft: #DDECF2;
  --brand-ink: #21314D;
  --brand-muted: #53627D;
  --brand-border: #BFD3E0;
  --brand-success: #1E6F52;
  --brand-danger: #AA3E3E;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-soft: 0 12px 28px rgba(39, 65, 122, 0.08);
  --font-body: 'Overpass', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Overpass', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #f7fbfd 0%, #edf5f8 100%);
  color: var(--brand-ink);
  font-family: var(--font-body);
}

body {
  line-height: 1.5;
}

body.project-locked {
  overflow: hidden;
}

body.project-locked .app-shell {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.access-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f7fbfd 0%, #edf5f8 100%);
}

.access-gate-card {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
}

.access-gate-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-heading);
}

.access-gate-card p {
  margin: 0.35rem 0 0;
}

.access-gate-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.access-gate-form input {
  min-height: 52px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--brand-border);
  border-radius: 0;
  background: #fff;
  color: var(--brand-ink);
}

.access-gate-form input:focus-visible {
  outline: 2px solid rgba(51, 84, 161, 0.25);
  outline-offset: 2px;
}

.access-gate-error {
  color: var(--brand-danger);
  font-weight: 700;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: calc(0.45rem + env(safe-area-inset-top)) 0.75rem 0.45rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(191, 211, 224, 0.7);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-copy {
  min-width: 0;
}

.brand-logo {
  width: 50px;
  height: 50px;
  background: #fff;
  border: 1px solid var(--brand-border);
  object-fit: contain;
  padding: 0.22rem;
}

#courseTitle,
.section-head h2,
.hero-copy h2,
.card h3,
.result-card h3,
.toast-card h3,
.sidebar-head h2,
.quiz-question h3 {
  margin: 0;
  font-family: var(--font-heading);
}

#courseTitle {
  font-size: 0.96rem;
  line-height: 1.15;
}

.topbar .eyebrow {
  margin-bottom: 0.08rem;
  font-size: 0.62rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-primary);
  font-weight: 800;
}

.ghost-btn,
.primary-btn,
.dropzone,
.step-btn,
.sidebar-card,
.quiz-actions .primary-btn,
.quiz-actions .ghost-btn {
  border-radius: 0;
}

.ghost-btn,
.primary-btn {
  border: 1px solid transparent;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 1 auto;
  min-width: 0;
}

.topbar #openOverview {
  min-height: 38px;
  padding: 0.48rem 0.72rem;
  white-space: nowrap;
}

.compact-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-width: clamp(120px, 24vw, 220px);
}

.compact-status .status-copy {
  font-size: 0.88rem;
  white-space: nowrap;
}

.compact-status .progress-track {
  height: 6px;
  min-width: 82px;
  flex: 1 1 auto;
  border-radius: 999px;
}

.compact-status .progress-fill {
  border-radius: 999px;
}

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

.primary-btn {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(51, 84, 161, 0.18);
}

.ghost-btn:hover,
.primary-btn:hover,
.ghost-btn:focus-visible,
.primary-btn:focus-visible,
.step-btn:hover,
.step-btn:focus-visible,
.option-card:hover,
.option-card:focus-within,
.drag-item:hover,
.drag-item:focus-visible,
.dropzone:hover,
.dropzone:focus-visible {
  transform: translateY(-1px);
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none !important;
}

.icon-only {
  width: 48px;
  padding-inline: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(88vw, 340px);
  background: rgba(255, 255, 255, 0.99);
  border-right: 1px solid var(--brand-border);
  padding: 1rem;
  transform: translateX(-105%);
  transition: transform 0.24s ease;
  z-index: 40;
  overflow-y: auto;
  box-shadow: 0 18px 48px rgba(17, 35, 67, 0.16);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.step-nav {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0 1.2rem;
}

.step-btn {
  width: 100%;
  border: 1px solid var(--brand-border);
  background: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
}

.step-btn .step-index {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--brand-surface-soft);
  font-weight: 800;
  color: var(--brand-primary);
}

.step-btn.active {
  border-color: rgba(51, 84, 161, 0.42);
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.7), rgba(255, 248, 219, 0.5));
}

.step-btn.done .step-index {
  background: rgba(30, 111, 82, 0.12);
  color: var(--brand-success);
}

.step-btn.locked {
  opacity: 0.65;
}

.step-meta strong {
  display: block;
}

.step-meta span {
  display: block;
  font-size: 0.9rem;
  color: var(--brand-muted);
}


.owner-card {
  display: grid;
  gap: 0.55rem;
  align-items: start;
}

.owner-card p {
  margin: 0;
  word-break: break-word;
}

.owner-card a {
  color: var(--brand-primary);
  text-decoration: none;
}

.owner-card a:hover,
.owner-card a:focus-visible {
  text-decoration: underline;
}

.owner-logo {
  width: 100%;
  max-width: 180px;
  height: auto;
  padding: 0.5rem;
  border: 1px solid var(--brand-border);
  background: #fff;
}

.sidebar-card,
.card,
.hero-card,
.result-card,
.toast-card,
.quiz-question,
.dropzone,
.drag-bank {
  background: var(--brand-surface);
  border: 1px solid rgba(191, 211, 224, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.sidebar-card {
  padding: 1rem;
  margin-bottom: 0.9rem;
}

.sidebar-card.muted {
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
}

.main-stage {
  padding: 0.75rem 0.95rem 4.7rem;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.status-bar {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.status-copy {
  margin: 0;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #edf2f7;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), #7f98cf);
  transition: width 0.25s ease;
}

.status-bar.compact-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-width: clamp(120px, 24vw, 220px);
}

.status-bar.compact-status .status-copy {
  font-size: 0.88rem;
  white-space: nowrap;
}

.status-bar.compact-status .progress-track {
  height: 6px;
  min-width: 82px;
  flex: 1 1 auto;
  border-radius: 999px;
}

.status-bar.compact-status .progress-fill {
  border-radius: 999px;
}

.screen {
  display: none;
}

.screen.active {
  display: grid;
  gap: 1rem;
}

.hero-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  background:
    linear-gradient(135deg, rgba(221, 236, 242, 0.95), rgba(255, 255, 255, 0.9) 48%, rgba(255, 248, 219, 0.95));
}

.hero-copy,
.card,
.result-card {
  min-width: 0;
}

.hero-copy p,
.card p,
.section-head p,
.result-card p,
.sidebar-card p,
.quiz-question p {
  margin: 0;
}

.hero-copy h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 0.55rem;
}

.hero-illustration {
  width: min(100%, 390px);
  justify-self: center;
}

.complete-card {
  align-items: center;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.72rem;
  background: #fff;
  border: 1px solid var(--brand-border);
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-up {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.tri-up,
.principle-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.card {
  padding: 1.1rem;
  display: grid;
  gap: 0.7rem;
}

.card.emphasis {
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.6), rgba(255, 255, 255, 1));
  border-left: 6px solid var(--brand-primary);
}

.card.warm {
  background: linear-gradient(180deg, rgba(255, 248, 219, 0.95), rgba(255, 255, 255, 1));
}

.card.soft-blue {
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.95), rgba(255, 255, 255, 1));
}

.wide-card {
  margin-top: -0.2rem;
}

.compact h3 {
  font-size: 1rem;
}

.section-head {
  display: grid;
  gap: 0.35rem;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.15;
}

.check-list,
.icon-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.check-list li,
.icon-list li {
  position: relative;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.28rem 0.1rem 0.36rem 0;
  overflow: hidden;
  isolation: isolate;
}

.bullet-copy {
  position: relative;
  display: inline-block;
  line-height: 1.5;
}

.check-list li::before {
  content: '✓';
  color: var(--brand-primary);
  font-weight: 800;
  margin-top: 0.05rem;
}

.icon-list .material-symbols-rounded,
.pill .material-symbols-rounded,
.icon-note .material-symbols-rounded,
.primary-btn .material-symbols-rounded,
.ghost-btn .material-symbols-rounded {
  color: var(--brand-primary);
}

.primary-btn .material-symbols-rounded {
  color: #fff;
}

.icon-note {
  display: inline-flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 248, 219, 0.85);
  border-left: 4px solid var(--brand-primary);
  font-weight: 600;
}

.note {
  padding: 0.8rem 0.9rem;
  background: rgba(221, 236, 242, 0.6);
  border-left: 4px solid var(--brand-primary);
}

.illustration-card {
  padding: 0.8rem;
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.72), rgba(255,255,255,1));
}

.illustration-card img {
  width: 100%;
  height: auto;
}

.quiz-question {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.option-list,
.matching-list,
.drag-layout {
  display: grid;
  gap: 0.8rem;
}

.option-card {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid var(--brand-border);
  background: #fff;
  padding: 0.9rem 1rem;
}

.option-card input {
  margin-top: 0.2rem;
}

.option-card.correct,
.match-row.correct,
.drag-item.correct {
  border-color: rgba(30, 111, 82, 0.55);
  background: rgba(30, 111, 82, 0.08);
}

.option-card.incorrect,
.match-row.incorrect,
.drag-item.incorrect {
  border-color: rgba(170, 62, 62, 0.55);
  background: rgba(170, 62, 62, 0.08);
}

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

.match-row {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--brand-border);
  background: #fff;
  padding: 0.9rem;
}

.match-row label {
  font-weight: 700;
}

.match-row select {
  min-height: 46px;
  border: 1px solid var(--brand-border);
  background: #fff;
  padding: 0.6rem 0.7rem;
}

.matching-help,
.drag-help {
  font-size: 0.96rem;
  color: var(--brand-muted);
}

.drag-layout {
  grid-template-columns: 1fr;
}

.drag-bank,
.dropzone {
  padding: 1rem;
}

.drag-bank h4,
.dropzone h4 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.drag-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.drag-item {
  border: 1px solid var(--brand-border);
  background: #fff;
  padding: 0.7rem 0.85rem;
  min-height: 46px;
}

.drag-item.selected {
  outline: 3px solid rgba(51, 84, 161, 0.22);
}

.drag-item[draggable="true"] {
  cursor: grab;
}

.dropzone {
  min-height: 150px;
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.42), rgba(255,255,255,0.98));
}

.dropzone.is-over {
  border-color: var(--brand-primary);
  background: linear-gradient(180deg, rgba(255, 248, 219, 0.8), rgba(255,255,255,1));
}

.dropzone p {
  margin: 0 0 0.75rem;
  color: var(--brand-muted);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stacked-actions {
  margin-top: 1rem;
}

.result-card {
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.result-card.pass {
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.72), rgba(255,255,255,1));
  border-left: 6px solid var(--brand-success);
}

.result-card.fail {
  background: linear-gradient(180deg, rgba(255, 248, 219, 0.9), rgba(255,255,255,1));
  border-left: 6px solid var(--brand-danger);
}

.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 35;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(191, 211, 224, 0.8);
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.bottom-nav .ghost-btn,
.bottom-nav .primary-btn {
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  font-size: 0.94rem;
  box-shadow: none;
}

.nav-lock-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--brand-muted);
  font-size: 0.86rem;
}

[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  .hero-card,
  .two-up,
  .photo-layout,
  .media-layout,
  .drag-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principle-grid,
  .tri-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bottom-nav {
    grid-template-columns: auto auto 1fr;
    align-items: center;
  }

  .nav-lock-message {
    grid-column: auto;
    justify-self: end;
    text-align: right;
  }
}


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

  .topbar-tools {
    width: 100%;
    justify-content: space-between;
  }

  .compact-status {
    min-width: 0;
    flex: 1 1 auto;
  }
}

@media (max-width: 560px) {
  .brand-logo {
    width: 42px;
    height: 42px;
  }

  #courseTitle {
    font-size: 0.88rem;
  }

  .topbar #openOverview span:last-child {
    display: none;
  }

  .compact-status .status-copy {
    font-size: 0.82rem;
  }

  .compact-status .progress-track {
    min-width: 64px;
  }

  .bottom-nav .ghost-btn,
  .bottom-nav .primary-btn {
    font-size: 0.88rem;
    padding-inline: 0.65rem;
  }
}


@media (min-width: 960px) {
  .main-stage {
    padding-inline: 1.4rem;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 420px);
    align-items: center;
  }
}


.areas-helper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.areas-status-wrap {
  display: grid;
  gap: 0.35rem;
  justify-items: end;
}

.areas-progress {
  margin: 0;
  font-weight: 800;
  color: var(--brand-primary);
}

.problem-area-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.problem-area-btn {
  width: 100%;
  border: 1px solid var(--brand-border);
  background: linear-gradient(180deg, rgba(221, 236, 242, 0.72), rgba(255, 255, 255, 0.98));
  padding: 0.95rem;
  min-height: 172px;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  text-align: left;
  color: var(--brand-ink);
  box-shadow: var(--shadow-soft);
}

.problem-area-btn:nth-child(even) {
  background: linear-gradient(180deg, rgba(255, 248, 219, 0.92), rgba(255, 255, 255, 0.98));
}

.problem-area-btn:hover,
.problem-area-btn:focus-visible {
  border-color: rgba(51, 84, 161, 0.48);
  box-shadow: 0 16px 32px rgba(39, 65, 122, 0.12);
}

.problem-area-btn.viewed {
  border-color: rgba(30, 111, 82, 0.5);
  box-shadow: 0 18px 34px rgba(30, 111, 82, 0.12);
}

.problem-area-topline,
.problem-area-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.problem-area-main {
  align-items: center;
}

.problem-area-number,
.problem-area-check,
.problem-area-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.problem-area-number {
  background: rgba(51, 84, 161, 0.12);
  color: var(--brand-primary);
  font-weight: 800;
}

.problem-area-check {
  border: 1px solid rgba(83, 98, 125, 0.28);
  color: transparent;
  background: rgba(255, 255, 255, 0.72);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.problem-area-btn.viewed .problem-area-check {
  color: var(--brand-success);
  border-color: rgba(30, 111, 82, 0.32);
  background: rgba(30, 111, 82, 0.1);
}

.problem-area-icon {
  border: 1px solid rgba(51, 84, 161, 0.18);
  color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.72);
}

.problem-area-icon svg {
  width: 24px;
  height: 24px;
}

.problem-area-copy {
  display: grid;
  gap: 0.3rem;
  flex: 1 1 auto;
}

.problem-area-copy strong {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  line-height: 1.2;
}

.problem-area-copy span {
  color: var(--brand-muted);
  font-size: 0.94rem;
}

.problem-area-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.problem-area-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 34, 61, 0.48);
}

.problem-area-dialog {
  position: relative;
  cursor: pointer;
  z-index: 1;
  width: min(100%, 560px);
  background: #fff;
  border: 1px solid var(--brand-border);
  box-shadow: 0 24px 48px rgba(16, 33, 62, 0.22);
  padding: 1.4rem;
}

.problem-area-dialog h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
}

.problem-area-dialog p:last-child {
  margin-bottom: 0;
}

.problem-area-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .areas-helper {
    align-items: flex-start;
    flex-direction: column;
  }

  .areas-status-wrap {
    justify-items: start;
  }

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

@media (max-width: 640px) {
  .problem-area-grid {
    grid-template-columns: 1fr;
  }

  .problem-area-btn {
    min-height: 144px;
  }
}

/* Minimal UI v3 */
.topbar {
  gap: 0.45rem;
  padding: calc(0.24rem + env(safe-area-inset-top)) 0.6rem 0.24rem;
}

.brand-wrap {
  gap: 0.45rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  padding: 0.14rem;
  border-width: 0;
}

.topbar .eyebrow {
  display: none;
}

#courseTitle {
  font-size: 0.82rem;
  line-height: 1.08;
}

.topbar-tools {
  gap: 0.35rem;
}

.compact-status,
.status-bar.compact-status {
  min-width: 72px;
}

.compact-status .status-copy,
.status-bar.compact-status .status-copy {
  display: none;
}

.compact-status .progress-track,
.status-bar.compact-status .progress-track {
  height: 3px;
  min-width: 72px;
  width: clamp(72px, 11vw, 112px);
}

.topbar #openOverview {
  min-height: 30px;
  width: 32px;
  padding: 0;
}

.topbar #openOverview span:last-child {
  display: none;
}

.main-stage {
  padding: 0.65rem 0.9rem 3.75rem;
}

.bottom-nav {
  padding: 0.3rem 0.55rem calc(0.3rem + env(safe-area-inset-bottom));
  gap: 0.4rem;
}

.bottom-nav .ghost-btn,
.bottom-nav .primary-btn {
  min-height: 34px;
  padding: 0.38rem 0.58rem;
  font-size: 0.82rem;
}

.nav-lock-message {
  font-size: 0.76rem;
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: nowrap;
    align-items: center;
  }

  .topbar-tools {
    width: auto;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .brand-logo {
    width: 30px;
    height: 30px;
  }

  #courseTitle {
    font-size: 0.74rem;
  }

  .compact-status .progress-track,
  .status-bar.compact-status .progress-track {
    min-width: 54px;
    width: 54px;
  }

  .bottom-nav .ghost-btn,
  .bottom-nav .primary-btn {
    font-size: 0.76rem;
    padding-inline: 0.45rem;
  }
}


:root {
  --motion-duration: 760ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.motion-target {
  opacity: 0;
  transform: translate3d(0, var(--motion-distance, 22px), 0) scale(0.985);
  filter: blur(10px);
  will-change: transform, opacity, filter;
}

.motion-target.motion-visible {
  animation: motionReveal var(--motion-duration) var(--motion-ease) both;
  animation-delay: var(--motion-delay, 0ms);
}

.check-list li::after,
.icon-list li::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0.2rem;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(51, 84, 161, 0.28), rgba(51, 84, 161, 0.06));
  transform: scaleX(0.08);
  transform-origin: left center;
  opacity: 0;
}

.check-list li .bullet-copy,
.icon-list li .bullet-copy,
.card > p.motion-target,
.card .note.motion-target,
.card .icon-note.motion-target,
.areas-helper p.motion-target,
.result-card p.motion-target {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  filter: blur(10px);
}

.check-list li.motion-visible .bullet-copy,
.icon-list li.motion-visible .bullet-copy {
  animation: bulletCopyReveal 780ms var(--motion-ease) both;
  animation-delay: calc(var(--motion-delay, 0ms) + 110ms);
}

.card > p.motion-target.motion-visible,
.card .note.motion-target.motion-visible,
.card .icon-note.motion-target.motion-visible,
.areas-helper p.motion-target.motion-visible,
.result-card p.motion-target.motion-visible {
  animation: bulletCopyReveal 700ms var(--motion-ease) both;
  animation-delay: calc(var(--motion-delay, 0ms) + 70ms);
}

.check-list li.motion-visible::before {
  animation: bulletTickReveal 700ms var(--motion-ease) both;
  animation-delay: calc(var(--motion-delay, 0ms) + 40ms);
}

.icon-list li.motion-visible .material-symbols-rounded,
.icon-note.motion-visible .material-symbols-rounded {
  animation: bulletIconReveal 760ms var(--motion-ease) both;
  animation-delay: calc(var(--motion-delay, 0ms) + 20ms);
}

.check-list li.motion-visible::after,
.icon-list li.motion-visible::after {
  animation: bulletRuleReveal 860ms var(--motion-ease) both;
  animation-delay: calc(var(--motion-delay, 0ms) + 120ms);
}

.check-list li:hover,
.icon-list li:hover {
  transform: translateX(6px);
  box-shadow: inset 3px 0 0 rgba(51, 84, 161, 0.16);
}

.screen.active .hero-illustration,
.screen.active .illustration-card img {
  transform-origin: center center;
  filter: drop-shadow(0 18px 28px rgba(39, 65, 122, 0.12));
}

.card,
.problem-area-btn,
.option-card,
.match-row,
.drag-item,
.dropzone,
.pill,
.bottom-nav .ghost-btn,
.bottom-nav .primary-btn,
.topbar #openOverview {
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background-color 0.28s ease, filter 0.28s ease;
}

.card:hover,
.problem-area-btn:hover,
.option-card:hover,
.match-row:hover,
.drag-item:hover,
.dropzone:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(39, 65, 122, 0.14);
}

.screen.active .pill {
  position: relative;
  overflow: hidden;
}

.screen.active .pill::after,
.screen.active .progress-track::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.1) 35%, rgba(255,255,255,0.65) 50%, transparent 65%);
  transform: translateX(-135%);
  animation: sheenSweep 4.8s ease-in-out infinite;
  pointer-events: none;
}

.progress-track {
  position: relative;
  overflow: hidden;
}

.progress-fill {
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: progressPulse 2.8s ease-in-out infinite;
}

.problem-area-btn .problem-area-icon svg * {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.problem-area-btn.motion-visible .problem-area-icon svg * {
  animation: iconDraw 0.8s ease forwards;
  animation-delay: calc(var(--motion-delay, 0ms) + 120ms);
}

.problem-area-btn.viewed .problem-area-check {
  animation: checkPop 0.4s var(--motion-ease);
}

.problem-area-modal .problem-area-backdrop {
  opacity: 0;
}

.problem-area-modal .problem-area-dialog {
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(0.96);
  transform-origin: center center;
}

.problem-area-modal.modal-animated .problem-area-backdrop {
  animation: modalFade 0.28s ease forwards;
}

.problem-area-modal.modal-animated .problem-area-dialog {
  animation: modalReveal 0.46s var(--motion-ease) forwards;
}

.section-head h2,
.hero-copy h2,
.card h3,
.result-card h3 {
  text-wrap: balance;
}

@keyframes motionReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, var(--motion-distance, 22px), 0) scale(0.985);
    filter: blur(10px);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes sheenSweep {
  0%, 12% {
    transform: translateX(-135%);
  }
  35%, 100% {
    transform: translateX(135%);
  }
}

@keyframes progressPulse {
  0%, 100% {
    opacity: 0.28;
    transform: translateX(-35%);
  }
  50% {
    opacity: 0.65;
    transform: translateX(35%);
  }
}

@keyframes iconDraw {
  from {
    stroke-dashoffset: 80;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes checkPop {
  0% {
    transform: scale(0.8);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalReveal {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes bulletCopyReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    filter: blur(10px);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes bulletRuleReveal {
  0% {
    opacity: 0;
    transform: scaleX(0.08);
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes bulletTickReveal {
  0% {
    opacity: 0;
    transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
    filter: blur(4px);
  }
  65% {
    opacity: 1;
    transform: translate3d(0, -1px, 0) scale(1.15) rotate(4deg);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes bulletIconReveal {
  0% {
    opacity: 0;
    transform: translate3d(-8px, 10px, 0) scale(0.5) rotate(-12deg);
    filter: blur(5px);
  }
  55% {
    opacity: 1;
    transform: translate3d(0, -2px, 0) scale(1.12) rotate(4deg);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

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

  .motion-target {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}




#screen-welcome .check-list li::before {
  opacity: 0;
  transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
  filter: blur(4px);
}

#screen-welcome .check-list li.motion-visible::before {
  animation: none;
  opacity: 0;
  transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
  filter: blur(4px);
}

#screen-welcome .check-list li.cue-revealed::before {
  animation: bulletTickReveal 700ms var(--motion-ease) both;
}

#screen-welcome .check-list li.cue-revealed {
  background: linear-gradient(90deg, rgba(214, 228, 255, 0.42), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 rgba(51, 84, 161, 0.22);
}







#screen-why .icon-list li.cue-revealed {
  background: linear-gradient(90deg, rgba(214, 228, 255, 0.46), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 rgba(51, 84, 161, 0.24);
  border-radius: 10px;
}

#screen-why .icon-list li.cue-revealed .material-symbols-rounded {
  color: var(--brand-primary);
  transform: scale(1.08);
}

#screen-why .why-keyword {
  display: inline-block;
  border-bottom: 3px solid transparent;
  transition: color 220ms ease, border-color 220ms ease, text-shadow 220ms ease;
}

#screen-why .why-keyword.cue-underlined {
  color: var(--brand-primary);
  font-weight: 700;
  border-bottom-color: color-mix(in srgb, var(--brand-primary) 70%, #ffffff);
  text-shadow: 0 1px 0 rgba(51, 84, 161, 0.08);
}



#screen-who .check-list li::before {
  opacity: 0;
  transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
  filter: blur(4px);
}

#screen-who .check-list li.motion-visible::before {
  animation: none;
  opacity: 0;
  transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
  filter: blur(4px);
}

#screen-who .check-list li.cue-revealed::before {
  animation: bulletTickReveal 700ms var(--motion-ease) both;
}

#screen-who .check-list li.cue-revealed .bullet-copy {
  font-weight: 700;
  color: var(--brand-ink);
}

#screen-who .check-list li.cue-revealed {
  background: linear-gradient(90deg, rgba(214, 228, 255, 0.46), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 rgba(51, 84, 161, 0.24);
  border-radius: 10px;
}

#screen-who .who-delayed-card {
  opacity: 0 !important;
  visibility: hidden;
  transform: scale(0.98);
  pointer-events: none;
}

#screen-who .who-delayed-card.cue-revealed {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  animation: delayedCardReveal 680ms var(--motion-ease) both;
}

#screen-who .who-delayed-card.cue-pulsing {
  animation: delayedCardPulse 1.2s ease-in-out 3;
  transform-origin: center center;
}

@keyframes delayedCardReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.96);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes delayedCardPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
}

#screen-who .who-main-rule.cue-revealed {
  background: linear-gradient(90deg, rgba(214, 228, 255, 0.46), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 rgba(51, 84, 161, 0.24);
  border-radius: 10px;
}

#screen-who .who-main-rule.cue-revealed h3 {
  color: var(--brand-primary);
}

#screen-who .who-keyword {
  display: inline-block;
  border-bottom: 3px solid transparent;
  transition: color 220ms ease, border-color 220ms ease, text-shadow 220ms ease;
}

#screen-who .who-keyword.cue-underlined {
  color: var(--brand-primary);
  font-weight: 700;
  border-bottom-color: color-mix(in srgb, var(--brand-primary) 70%, #ffffff);
  text-shadow: 0 1px 0 rgba(51, 84, 161, 0.08);
}

#screen-what .principle-grid .card {
  position: relative;
  opacity: 1;
  visibility: visible;
  transition: none !important;
}

#screen-what .principle-grid .card.cue-active {
  border-color: color-mix(in srgb, var(--brand-primary) 74%, #ffffff);
  background: rgba(214, 228, 255, 0.92);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 30%, transparent);
  filter: none;
  animation: cueBlink 0.9s ease-in-out infinite;
}

#screen-what .principle-grid .card.cue-active h3 {
  color: var(--brand-primary);
}

#screen-what .principle-grid .card.cue-active p {
  color: color-mix(in srgb, var(--brand-ink) 88%, var(--brand-primary) 12%);
}

.slide-paused,
.slide-paused *,
.slide-paused *::before,
.slide-paused *::after {
  animation-play-state: paused !important;
}

@keyframes cueBlink {
  0%, 100% {
    background: rgba(214, 228, 255, 0.92);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 30%, transparent);
  }
  50% {
    background: rgba(190, 214, 255, 1);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-primary) 46%, transparent);
  }
}

.audio-btn {
  min-height: 38px;
  padding: 0.46rem 0.72rem;
  white-space: nowrap;
}

.audio-btn.active {
  border-color: color-mix(in srgb, var(--brand-primary) 28%, #ffffff);
  background: color-mix(in srgb, var(--brand-primary) 10%, #ffffff);
  color: var(--brand-primary);
}

.audio-btn.is-playing {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 26%, transparent), 0 8px 18px rgba(51, 84, 161, 0.12);
}

.audio-btn.is-paused {
  border-color: color-mix(in srgb, var(--brand-accent) 34%, #ffffff);
  background: color-mix(in srgb, var(--brand-accent) 12%, #ffffff);
}

.audio-btn:disabled {
  opacity: 0.45;
}

@media (max-width: 760px) {
  .audio-btn {
    min-height: 36px;
    padding: 0.4rem 0.58rem;
  }

  #toggleAudioLabel {
    display: none;
  }
}


.no-motion-card,
.no-motion-card * {
  animation: none !important;
  transform: none !important;
  filter: none !important;
}

#screen-what .principle-grid .card {
  transition: none !important;
}

#screen-contains .check-list li::before {
  opacity: 0;
  transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
  filter: blur(4px);
}

#screen-contains .check-list li.motion-visible::before {
  animation: none;
  opacity: 0;
  transform: translate3d(-10px, 6px, 0) scale(0.4) rotate(-18deg);
  filter: blur(4px);
}

#screen-contains .check-list li.cue-revealed::before {
  animation: bulletTickReveal 700ms var(--motion-ease) both;
}

#screen-contains .check-list li.cue-revealed .bullet-copy {
  font-weight: 700;
}

#screen-contains .check-list li.cue-revealed {
  background: linear-gradient(90deg, rgba(214, 228, 255, 0.44), rgba(255, 255, 255, 0));
  box-shadow: inset 3px 0 0 rgba(51, 84, 161, 0.22);
  border-radius: 10px;
}

.media-sequence-card {
  min-height: 330px;
  overflow: hidden;
}

.media-illustration-sequence {
  position: relative;
  min-height: 310px;
  width: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(247, 251, 253, 1), rgba(255, 255, 255, 1));
  border-radius: 18px;
  border: 1px solid var(--brand-border);
  overflow: hidden;
}

.media-big-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 0.35rem;
  opacity: 0;
  transform: scale(0.985);
  filter: blur(7px);
  pointer-events: none;
  transition: opacity 650ms ease, transform 650ms ease, filter 650ms ease;
}

.media-big-frame img {
  width: min(100%, 660px);
  height: auto;
  display: block;
}

#screen-media.media-phase-a .media-big-a,
#screen-media.media-phase-b .media-big-b,
#screen-media.media-phase-c .media-big-c,
#screen-media.sequence-complete .media-big-c {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

#screen-media.media-phase-c.media-links-visible .media-big-c,
#screen-media.sequence-complete .media-big-c {
  animation: mediaFinalSettle 900ms ease both;
}

#screen-media:not(.sequence-running):not(.media-phase-a):not(.media-phase-b):not(.media-phase-c) .media-big-c {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

@keyframes mediaFinalSettle {
  0% { transform: scale(0.985); }
  55% { transform: scale(1.018); }
  100% { transform: scale(1); }
}

@media (max-width: 760px) {
  .media-illustration-sequence { min-height: 260px; }
  .media-caption { font-size: 20px; }
}


.screen.motion-settled .motion-target,
.screen.motion-settled .card > p.motion-target,
.screen.motion-settled .card .note.motion-target,
.screen.motion-settled .card .icon-note.motion-target,
.screen.motion-settled .areas-helper p.motion-target,
.screen.motion-settled .result-card p.motion-target,
.screen.motion-settled .check-list li .bullet-copy,
.screen.motion-settled .icon-list li .bullet-copy {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  animation: none !important;
}

#screen-what .principle-grid .motion-target {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  animation: none !important;
}


.audio-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.audio-choice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 34, 61, 0.58);
  backdrop-filter: blur(8px);
}

.audio-choice-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  background: #fff;
  border: 1px solid var(--brand-border);
  box-shadow: 0 28px 64px rgba(16, 33, 62, 0.28);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.audio-choice-dialog h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.08;
}

.audio-choice-dialog p:last-of-type {
  margin-bottom: 0;
}

.audio-choice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.audio-choice-actions .primary-btn,
.audio-choice-actions .ghost-btn {
  min-height: 48px;
}

.audio-choice-modal .audio-choice-backdrop,
.audio-choice-modal .audio-choice-dialog {
  opacity: 0;
}

.audio-choice-modal .audio-choice-dialog {
  transform: translate3d(0, 24px, 0) scale(0.96);
  transform-origin: center center;
}

.audio-choice-modal.modal-animated .audio-choice-backdrop {
  animation: modalFade 0.28s ease forwards;
}

.audio-choice-modal.modal-animated .audio-choice-dialog {
  animation: modalReveal 0.46s var(--motion-ease) forwards;
}

@media (max-width: 640px) {
  .audio-choice-actions {
    flex-direction: column;
  }

  .audio-choice-actions .primary-btn,
  .audio-choice-actions .ghost-btn {
    justify-content: center;
    width: 100%;
  }
}
