:root {
  --ink: #1d1d1d;
  --muted: #555555;
  --paper: #ffffff;
  --paper-alt: #f7f7f7;
  --line: #d6d6d6;
  --line-strong: #bcbcbc;
  --navy: #1d1d1d;
  --teal: #2c5aa0;
  --sand: #2c5aa0;
  --rose: #8a3b12;
  --warning: #8a3b12;
  --success: #2d6a3d;
  --shadow: none;
  --radius-lg: 0;
  --radius-md: 0;
  --radius-sm: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  min-height: 100vh;
}

body[data-route="lecture-listen"] {
  zoom: 0.8;
}

.site-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 36px;
}

body[data-route="lecture-listen"] .site-shell {
  padding-top: 10px;
}

.masthead,
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: none;
}

.masthead {
  padding: 16px 20px;
  display: block;
  margin-bottom: 12px;
}

body[data-route="lecture-listen"] .masthead {
  padding: 10px 14px;
  margin-bottom: 8px;
}

body[data-route="lecture-listen"] .masthead-copy h1 {
  font-size: 1.2rem;
  margin: 2px 0 4px;
}

body[data-route="lecture-listen"] .masthead-subtitle {
  font-size: 0.95rem;
}

.masthead-copy h1 {
  margin: 4px 0 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--ink);
}

.eyebrow,
.phase-label,
.section-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

.masthead-subtitle {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.45;
}

.masthead-progress {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.preview-tools {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.preview-tools form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.preview-tools .field-group {
  margin-bottom: 0;
  min-width: 180px;
  flex: 1 1 180px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.progress-text {
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e7e7e7;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 0.28s ease;
}

.app-root {
  min-height: 320px;
}

.card {
  padding: 24px;
}

body[data-route="lecture-listen"] .card {
  padding: 14px;
}

.card h2,
.card h3 {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
}

.card h2 {
  margin: 4px 0 10px;
  font-size: clamp(1.35rem, 2.8vw, 1.8rem);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.lede {
  margin-top: 0;
  line-height: 1.72;
  color: var(--ink);
}

.supporting-copy,
.card p,
.card li,
.card label,
.card summary {
  line-height: 1.65;
}

.muted {
  color: var(--muted);
}

.notice,
.status-banner,
.warning-card,
.summary-panel,
.media-note {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.notice strong,
.status-banner strong,
.summary-panel strong {
  color: var(--navy);
}

.warning-card {
  border-color: #e1b8a5;
  background: #fff8f4;
  color: var(--warning);
}

.success-card {
  border-color: #cfe0d1;
  background: #f5fbf6;
  color: var(--success);
}

.card-stack {
  display: grid;
  gap: 14px;
}

.document-sheet {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.document-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.document-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.columns {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.field-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.field-group,
.question-card,
.scale-block {
  display: grid;
  gap: 10px;
}

.field-group {
  margin-bottom: 6px;
}

.field-group label,
.field-group legend,
.question-card legend,
.scale-block legend {
  font-weight: 700;
  color: var(--navy);
}

.field-group input[type="text"],
.field-group input[type="number"],
.field-group select,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
}

.field-group textarea {
  min-height: 150px;
  resize: vertical;
}

.compact-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.choice-list,
.checkbox-list {
  display: grid;
  gap: 12px;
}

.choice-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: #fafcfe;
}

.choice-card input {
  margin-top: 4px;
}

.question-card {
  border: 1px solid var(--line);
  padding: 18px;
  background: #fff;
}

.question-card-emphasis {
  border: 2px solid #b9cbe3;
  background: #f7faff;
  gap: 14px;
}

.conditional-question {
  gap: 14px;
}

.question-stem {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--navy);
}

.question-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.question-prompt {
  margin: 0;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.5;
  font-weight: 700;
}

.buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 0;
  border: 1px solid var(--line-strong);
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: none;
}

.primary-button {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.secondary-button {
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  background: #fff;
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.checklist {
  margin: 0;
  padding-left: 20px;
}

.checklist li + li {
  margin-top: 8px;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.listen-task-shell {
  gap: 12px;
  padding: 10px 12px 14px;
}

.listen-stage-panel {
  display: grid;
  place-items: center;
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  padding: 0;
  border: 1px solid #c7d1de;
  background: #eef3f8;
  overflow: hidden;
}

.audio-panel,
.visual-panel {
  border: 1px solid var(--line);
  padding: 18px;
  background: #fff;
}

.audio-panel-compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.audio-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.audio-status-grid {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--paper-alt);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--sand);
}

.status-pill.complete::before {
  background: var(--success);
}

.audio-clock {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: #eef4ff;
  color: var(--teal);
  border: 1px solid #c8d8f3;
  font-weight: 700;
}

.listen-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.listen-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.listen-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.listen-actions {
  display: flex;
  justify-content: flex-end;
}

.test-score-grid {
  display: grid;
  gap: 10px;
}

.test-score-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 320px);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.test-score-row-other {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1.1fr) auto minmax(150px, 220px);
}

.test-score-option,
.test-score-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.test-score-option {
  font-weight: 700;
}

.test-score-option input {
  margin: 0;
}

.test-score-inputs {
  justify-content: flex-end;
}

.compact-score {
  width: 100%;
  max-width: 170px;
}

.inline-label {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.visual-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: center;
  text-align: center;
}

#visualStage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.image-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: 0;
  background: #eef3f8;
  overflow: hidden;
}

.image-frame img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: none;
  background: #eef3f8;
  vertical-align: middle;
  object-fit: fill;
  object-position: center center;
}

.image-frame.loaded img {
  display: block;
}

.placeholder-art {
  position: relative;
  display: grid;
  place-items: center;
  padding: 22px;
  width: 100%;
  height: 100%;
  text-align: center;
  color: var(--ink);
  background: #eef3f8;
}

.placeholder-art strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.audio-only-banner {
  width: min(100%, 960px);
  min-height: 100%;
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 0;
  background: #eef3f8;
  align-content: center;
  text-align: center;
}

.audio-only-banner strong {
  font-size: 1.05rem;
}

.scale-block {
  border: 1px solid var(--line);
  padding: 18px;
  background: #fff;
}

.scale-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.likert-card {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.likert-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.likert-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.likert-choice {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.likert-choice input {
  margin: 0;
}

.likert-endpoints {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.summary-panel span {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}

.fine-print {
  font-size: 0.95rem;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .masthead {
    padding: 22px;
  }

  .progress-copy,
  .audio-status-row,
  .likert-endpoints,
  .listen-status-bar,
  .listen-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .test-score-row,
  .test-score-row-other {
    grid-template-columns: 1fr;
  }

  .test-score-inputs {
    justify-content: flex-start;
  }

  .likert-options {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 16px, 1120px);
    padding-top: 10px;
    padding-bottom: 24px;
  }

  .masthead,
  .card {
    padding: 14px;
  }

  .buttons {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .likert-options {
    grid-template-columns: repeat(2, minmax(44px, 1fr));
  }

  .test-score-row,
  .test-score-row-other {
    padding: 12px;
  }

  .listen-stage-panel {
    width: 100%;
    max-width: 100%;
  }

  .image-frame img {
    max-width: 100%;
    max-height: 100%;
  }

  .placeholder-art {
    width: 100%;
  }
}
