:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #5f6e64;
  --line: #d8ded7;
  --panel: #ffffff;
  --paper: #f7f8f5;
  --accent: #0b6b4f;
  --accent-strong: #07533d;
  --warn: #9a5b00;
  --bad: #9f1d1d;
  --good: #0f6a3d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body.embedded {
  background: #fff;
}

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

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  color: #8b968f;
  cursor: not-allowed;
  background: #f0f2ef;
}

.player-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

body.embedded .player-shell {
  max-width: 100%;
  padding: 0;
}

.player-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 0 18px;
}

body.embedded > .player-shell > .player-bar {
  display: none;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

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

.capability-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #e4c370;
  background: #fff8df;
  color: #5b4300;
  font-size: 14px;
}

.capability-summary a {
  color: #654600;
  font-weight: 650;
}

body.embedded > .player-shell > .capability-summary {
  display: none;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
}

.status-band > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.status-band > div:last-child {
  border-right: 0;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.status-band strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.progress-track {
  height: 5px;
  background: #e5ebe5;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

#progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 160ms ease;
}

.notice {
  border: 1px solid #e4c370;
  background: #fff8df;
  color: #5b4300;
  padding: 10px 12px;
  margin-top: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

body.embedded .workspace {
  display: block;
  margin-top: 0;
}

.lesson-root,
.evidence-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.lesson-root {
  min-height: 420px;
  padding: 30px;
}

.lesson-root:focus {
  outline: none;
}

body.embedded .lesson-root {
  min-height: 0;
  border: 0;
}

.lesson-root:empty::before {
  content: "Waiting for content.";
  color: var(--muted);
}

.lesson-root h2 {
  font-size: 24px;
  margin: 0 0 12px;
}

.lesson-root h3 {
  font-size: 18px;
  margin: 0 0 10px;
}

.lesson-root p,
.lesson-root li {
  font-size: 17px;
  line-height: 1.62;
}

.lesson-root p {
  margin: 0 0 14px;
}

.tb-article-image {
  margin: 18px 0;
}

.tb-article-image img {
  display: block;
  height: auto;
  max-width: 100%;
}

.tb-segment {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.tb-segment:first-child {
  border-top: 0;
  padding-top: 0;
}

.tb-catalog {
  display: none !important;
}

.continue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
}

.continue-row .hint {
  color: var(--muted);
  font-size: 14px;
}

.qti-panel {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 16px;
  margin: 16px 0;
  background: #fbfcfa;
}

.qti-panel fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.qti-panel legend {
  font-weight: 700;
  margin-bottom: 10px;
}

.qti-fragment {
  min-width: 0;
  overflow-wrap: anywhere;
}

.qti-fragment img,
.qti-fragment svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.qti-fragment math {
  font-size: 1.08em;
}

.qti-fragment table {
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  overflow-x: auto;
  display: block;
}

.qti-fragment th,
.qti-fragment td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.qti-fragment th {
  background: #edf3ef;
  font-weight: 700;
}

.qti-prompt {
  margin-bottom: 12px;
}

.qti-prompt > :last-child,
.choice-content > :last-child {
  margin-bottom: 0;
}

.choice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  margin: 8px 0;
  background: #fff;
  border-radius: 6px;
}

.choice-row input {
  flex: 0 0 auto;
  margin: 4px 0 0;
}

.choice-content {
  flex: 1 1 auto;
}

.choice-content img,
.choice-content svg {
  max-height: 240px;
}

.text-entry-row {
  display: block;
  margin: 8px 0;
}

.text-entry-row input,
.match-row select,
.inline-choice-select {
  width: min(100%, 360px);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.extended-text-row {
  display: block;
  margin: 8px 0;
}

.extended-text-row textarea {
  display: block;
  width: min(100%, 680px);
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  resize: vertical;
  line-height: 1.45;
}

.order-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding-left: 28px;
}

.order-row {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 6px;
}

.order-row::marker {
  font-weight: 700;
  color: var(--accent-strong);
}

.order-row,
.match-row {
  align-items: center;
  gap: 12px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.order-controls {
  display: flex;
  gap: 6px;
}

.order-controls button {
  min-height: 30px;
  padding: 0 8px;
}

.match-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
}

.graphic-gap-instructions {
  color: var(--muted);
  font-size: 15px !important;
}

.graphic-gap-label-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.graphic-gap-label {
  min-height: 42px;
  border: 2px solid #b7c6bd;
  background: #fff;
  color: var(--ink);
}

.graphic-gap-label.selected {
  border-color: var(--accent-strong);
  background: #dff3ea;
  box-shadow: 0 0 0 2px rgba(11, 107, 79, .18);
}

.graphic-gap-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.graphic-gap-frame {
  position: relative;
  width: min(100%, 720px);
  min-width: 540px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.graphic-gap-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.graphic-gap-overlay {
  position: absolute;
  inset: 0;
}

.graphic-gap-target {
  position: absolute;
  min-height: 0;
  padding: 4px;
  overflow: hidden;
  border: 3px dashed #7a2f00;
  border-radius: 5px;
  background: rgba(255, 245, 225, .78);
  color: #542000;
  font-size: clamp(11px, 1.7vw, 15px);
  line-height: 1.15;
}

.graphic-gap-target:hover,
.graphic-gap-target:focus-visible {
  background: rgba(255, 237, 199, .94);
  outline: 3px solid #fff;
  box-shadow: 0 0 0 5px var(--accent-strong);
}

.graphic-gap-target.filled {
  border-style: solid;
  border-color: var(--accent-strong);
  background: rgba(223, 243, 234, .92);
  color: #063d2d;
}

.inline-choice-select {
  width: auto;
  min-width: 150px;
  margin: 0 4px;
  vertical-align: baseline;
}

.hottext-choice {
  display: inline;
  min-height: 0;
  margin: 0 2px;
  padding: 2px 5px;
  border-color: #b7c6bd;
  border-radius: 4px;
  background: #f8fbf8;
  line-height: 1.35;
  vertical-align: baseline;
}

.hottext-choice.selected {
  border-color: var(--accent);
  background: #dff3ea;
  color: var(--accent-strong);
}

.feedback {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.feedback.good {
  color: var(--good);
}

.feedback.bad {
  color: var(--bad);
}

.glossary-term {
  border-bottom: 1px dotted var(--accent);
  color: var(--accent-strong);
  cursor: help;
  position: relative;
}

.glossary-term:focus::after,
.glossary-term:hover::after {
  content: attr(data-definition);
  position: absolute;
  z-index: 4;
  left: 0;
  top: 1.8em;
  width: min(320px, 70vw);
  padding: 10px 12px;
  background: #10241c;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .18);
}

.tts-button {
  margin-left: 8px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 13px;
}

.example-practice-container {
  display: grid;
  gap: 10px;
}

.headers-row,
.step-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.header,
.step {
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.header {
  font-weight: 700;
  background: #f0f4ef;
}

.answer-box {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: #f3faf6;
}

.evidence-panel {
  padding: 16px;
  position: sticky;
  top: 12px;
}

body.embedded > .player-shell > .workspace > .evidence-panel {
  display: none;
}

.evidence-panel h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.evidence-panel dl {
  margin: 0;
}

.evidence-panel dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 14px;
}

.evidence-panel dd {
  margin: 4px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .player-shell {
    padding: 12px;
  }

  .player-bar,
  .workspace {
    display: block;
  }

  .bar-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .status-band {
    grid-template-columns: 1fr 1fr;
  }

  .status-band > div:nth-child(2) {
    border-right: 0;
  }

  .status-band > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .lesson-root {
    padding: 20px;
  }

  .evidence-panel {
    position: static;
    margin-top: 12px;
  }

  .headers-row,
  .step-row,
  .order-row,
  .match-row {
    grid-template-columns: 1fr;
  }
}
