/* Shared learning surfaces. Color and spacing tokens live in styles.css. */
.compact-heading {
  margin-bottom: 30px;
}
.compact-heading .eyebrow {
  color: var(--accent);
  margin-bottom: 10px;
}
.compact-heading h1 {
  font-size: 2.7rem;
  margin-bottom: 14px;
}
.lesson-heading {
  margin-bottom: 28px;
}
.lesson-heading h1 {
  font-size: 2.4rem;
  max-width: 950px;
  margin-top: 9px;
  letter-spacing: -0.045em;
}
.learning-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.lesson-rail {
  position: sticky;
  top: 26px;
}
.lesson-rail > h3 {
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  color: #8c91a3;
  margin-bottom: 17px;
}
.lesson-rail nav {
  display: grid;
  gap: 6px;
}
.lesson-rail nav a {
  font-size: 0.76rem;
  padding: 10px 10px 10px 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.5;
  color: var(--muted);
  border-right: 2px solid transparent;
}
.lesson-rail nav a > span {
  font-size: 0.65rem;
  min-width: 20px;
  color: #999caf;
}
.lesson-rail nav a .icon {
  width: 14px;
  height: 16px;
  color: #168e75;
}
.lesson-rail nav a.current {
  color: var(--accent);
  font-weight: 700;
  border-color: var(--accent);
}
.rail-tip {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 25px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.rail-tip .icon {
  width: 16px;
  height: 18px;
  color: var(--accent);
}
.rail-tip p {
  font-size: 0.75rem;
  line-height: 1.65;
}
.learning-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
}
.learning-tabs a {
  flex: 1;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 11px 8px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--muted);
}
.learning-tabs a.selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.learning-tabs a .icon {
  width: 17px;
  height: 17px;
}
.tab-index {
  display: none;
}
.learning-content {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.lesson-summary {
  padding: 18px 20px;
  background: #f5f5fe;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.lesson-summary .icon {
  color: var(--accent);
  width: 19px;
  height: 22px;
}
.lesson-summary p {
  font-size: 0.96rem;
  color: #585c79;
}
.reading-section {
  position: relative;
  margin-top: 36px;
  padding-top: 2px;
}
.reading-section h2 {
  font-size: 1.34rem;
  line-height: 1.4;
  margin-bottom: 16px;
}
.section-number {
  font-size: 0.64rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.reading-section > p {
  font-size: 1rem;
  line-height: 1.85;
  color: #555b6e;
  margin-bottom: 14px;
}
.formula {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Cambria Math", Georgia, serif;
  font-size: 1.2rem;
  background: #f4f4fc;
  color: #39376d;
  border-left: 3px solid #9991f0;
  border-radius: 0 10px 10px 0;
  padding: 20px 24px;
  margin: 22px 0;
  line-height: 1.75;
}
.reading-bullets {
  padding-left: 20px;
  color: #555b6e;
  margin: 18px 0;
  line-height: 1.85;
}
.reading-bullets li {
  margin-bottom: 8px;
  padding-left: 5px;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 17px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.65;
}
th {
  background: #f7f8fc;
  color: #545971;
  font-weight: 650;
  text-align: left;
}
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
td {
  color: #62677c;
}
.worked-example {
  border: 1px solid #cce8e0;
  border-radius: 14px;
  padding: 25px;
  background: #f8fcfb;
  margin-top: 36px;
}
.example-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.65rem;
  color: #168c73;
  font-weight: 700;
  letter-spacing: 0.09em;
  margin-bottom: 13px;
}
.example-label .icon {
  width: 16px;
  height: 16px;
}
.worked-example h2 {
  font-size: 1.15rem;
}
.exercise-prompt {
  font-size: 1rem;
  line-height: 1.8;
  color: #555b6e;
  margin: 19px 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.worked-disclosure summary {
  color: #168e75;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.solution-steps {
  padding: 0 0 0 28px;
  margin: 24px 0;
  list-style: decimal;
}
.solution-steps li {
  padding-left: 9px;
  margin-bottom: 20px;
}
.solution-steps li::marker {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}
.solution-steps h4 {
  font-size: 0.97rem;
  margin-bottom: 8px;
}
.solution-steps p {
  font-size: 0.93rem;
  line-height: 1.8;
  color: #616679;
}
.answer-box {
  display: flex;
  gap: 12px;
  border-radius: 10px;
  padding: 18px;
  background: #e6f5ee;
  color: #16785e;
  font-size: 0.92rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.answer-box .icon {
  width: 19px;
  height: 22px;
}
.lesson-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 25px 0;
}
.lesson-bottom > div > p {
  font-size: 0.71rem;
  margin-top: 10px;
  max-width: 350px;
}
.button.completed {
  background: #e1f3ea;
  border-color: #bbe2d3;
  color: #16886c;
}
.field-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 9px;
  color: #5a5e74;
}
.field {
  border: 1px solid #dcdfeb;
  border-radius: 9px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  font-size: 0.9rem;
  width: 100%;
  min-height: 44px;
}
textarea {
  resize: vertical;
  width: 100%;
  border: 1px solid #dcdfeb;
  border-radius: 11px;
  padding: 16px;
  color: #45485f;
  line-height: 1.75;
  background: #fafbfe;
  font-size: 0.93rem;
}
.input-note {
  font-size: 0.75rem;
  margin-top: 8px;
}
.exercise-card .eyebrow {
  color: var(--accent);
  margin-bottom: 10px;
}
.exercise-card > h2 {
  font-size: 1.35rem;
}
.exercise-origin {
  font-size: 0.78rem;
  margin: 10px 0;
}
.hint-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}
.hint {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 15px;
}
.hint summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}
.hint p {
  font-size: 0.9rem;
  line-height: 1.75;
  margin-top: 12px;
  color: #62677d;
}
.solution-disclosure {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.solution-disclosure > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 9px;
  align-items: center;
}
.solution-disclosure > summary .icon {
  width: 20px;
  height: 20px;
}
.self-check {
  margin-top: 25px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.self-check h4 {
  margin-bottom: 14px;
  font-size: 0.93rem;
}
.self-check label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 11px;
  font-size: 0.85rem;
  color: var(--muted);
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.self-check p {
  font-size: 0.73rem;
  margin-top: 16px;
}
.quiz-card > .eyebrow {
  color: var(--accent);
  margin-bottom: 10px;
}
.quiz-intro {
  font-size: 0.91rem;
  margin-top: 14px;
}
.quiz-question {
  margin: 26px 0 0;
  border: 0;
  padding: 0;
}
.quiz-question legend {
  display: flex;
  gap: 10px;
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.65;
  margin-bottom: 16px;
  color: #35394e;
}
.quiz-question legend > span {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding-top: 4px;
}
.quiz-options {
  display: grid;
  gap: 9px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #61667d;
  transition: 0.15s;
}
.quiz-option:hover {
  border-color: #a9a1f0;
  background: #faf9ff;
}
.option-letter {
  flex-shrink: 0;
  background: #f0f1f7;
  border-radius: 7px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 0.73rem;
  color: #8a8da2;
  font-weight: 700;
}
.quiz-option.correct {
  background: #f1faf5;
  border-color: #87cdb0;
}
.quiz-option.correct .option-letter {
  background: #d5edde;
  color: #198267;
}
.quiz-option.incorrect {
  background: #fff6f7;
  border-color: #e6a0ac;
}
.quiz-option.incorrect .option-letter {
  background: #f8dde3;
  color: #b74e68;
}
.feedback {
  padding: 15px 17px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.75;
  margin-top: 13px;
}
.feedback.success {
  background: #edf8f1;
  color: #1c805f;
}
.feedback.retry {
  background: #fff4ec;
  color: #a56b32;
}
.quiz-result {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 24px;
}
.reflection {
  padding: 25px;
  border: 1px solid #dedbef;
  background: #f5f4fe;
  border-radius: 13px;
  margin-top: 24px;
}
.reflection h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.reflection p {
  font-size: 0.93rem;
  line-height: 1.8;
}
.reflection .button {
  margin-top: 20px;
}
.lab-intro {
  margin-bottom: 22px;
}
.lab-intro .eyebrow {
  color: var(--accent);
  margin-bottom: 8px;
}
.lab-intro p:last-child {
  margin-top: 12px;
  font-size: 0.92rem;
}
/* Study plan and exercise library */
.plan-summary {
  display: flex;
  gap: 24px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 30px;
}
.progress-ring {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  position: relative;
}
.progress-ring svg {
  width: 100%;
  height: 100%;
}
.progress-ring > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-family: "Manrope", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
}
.progress-ring small {
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
}
.plan-summary .eyebrow {
  font-size: 0.64rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.plan-summary h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.plan-summary p {
  font-size: 0.87rem;
}
.plan-summary .button {
  margin-left: auto;
  white-space: nowrap;
}
.method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 35px;
}
.method-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  position: relative;
}
.method-card > span {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #a6a9ba;
  font-size: 0.7rem;
}
.method-card > .icon {
  width: 23px;
  height: 23px;
  color: var(--accent);
  margin-bottom: 13px;
}
.method-card h3 {
  font-size: 0.98rem;
  margin-bottom: 10px;
}
.method-card p {
  font-size: 0.83rem;
  line-height: 1.7;
}
.plan-topics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.plan-topic {
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius);
  background: white;
}
.plan-topic-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.plan-topic-title .pill {
  margin-left: auto;
  background: color-mix(in srgb, var(--topic) 10%, white);
  color: var(--topic);
}
.plan-topic-title .eyebrow {
  font-size: 0.6rem;
  color: var(--topic);
  margin-bottom: 4px;
}
.plan-topic-title h2 {
  font-size: 1.08rem;
}
.plan-topic > p {
  font-size: 0.85rem;
  margin: 18px 0;
}
.plan-lessons {
  display: grid;
  gap: 5px;
}
.plan-lessons a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.79rem;
  line-height: 1.6;
  padding: 9px 0;
  color: var(--muted);
  border-top: 1px solid #f0f1f7;
}
.plan-lessons a:hover {
  color: var(--accent);
}
.mini-check {
  border: 1px solid #dce0eb;
  border-radius: 5px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 3px;
}
.mini-check .icon {
  width: 12px;
  height: 12px;
  opacity: 0;
}
.mini-check.done {
  background: #e4f4ec;
  border-color: #b2dfcc;
  color: #168b72;
}
.mini-check.done .icon {
  opacity: 1;
}
.plan-lessons small {
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.68rem;
  padding-top: 2px;
}
.practice-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.source-note {
  display: flex;
  gap: 12px;
  background: #efedfb;
  border: 1px solid #e1ddf5;
  padding: 19px 22px;
  border-radius: 12px;
  margin-bottom: 26px;
}
.source-note .icon {
  color: var(--accent);
  width: 19px;
  height: 24px;
}
.source-note p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: #666482;
}
.practice-sheet {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 25px;
  overflow: hidden;
}
.sheet-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 17px 25px;
  border-bottom: 1px solid var(--line);
  background: #fafbfe;
  font-size: 0.78rem;
  color: var(--muted);
}
.practice-sheet .exercise-card {
  padding: 29px;
}
.exam-setup {
  background: white;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 25px;
}
.exam-setup p {
  font-size: 0.91rem;
  margin-top: 13px;
  line-height: 1.8;
}
.controls-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-top: 23px;
}
.controls-row > label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 400px;
}
.controls-row select {
  margin-top: 8px;
}
#mixed-quiz > .quiz-card,
#topic-exercises > .exercise-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 29px;
  margin: 25px 0;
}
/* Simulation controls and traces */
.lab-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.lab-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  background: white;
  color: var(--muted);
  font-size: 0.8rem;
}
.lab-choice .icon {
  width: 17px;
  height: 17px;
}
.lab-choice.active {
  background: var(--accent-soft);
  border-color: #d2ccf8;
  color: var(--accent);
  font-weight: 650;
}
.lab-choice:hover {
  border-color: #a89fec;
}
.simulation-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
}
.learning-content .simulation-card {
  border: 0;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}
.simulation-heading {
  margin-bottom: 24px;
}
.simulation-heading .eyebrow {
  color: var(--accent);
  font-size: 0.64rem;
  margin-bottom: 8px;
}
.simulation-heading h2 {
  font-size: 1.3rem;
}
.simulation-heading p:last-child {
  font-size: 0.91rem;
  line-height: 1.75;
  margin-top: 12px;
  max-width: 760px;
}
.sim-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: #f7f8fc;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sim-controls > label {
  font-size: 0.75rem;
  font-weight: 600;
  flex: 1;
  min-width: 140px;
}
.sim-controls > label > .field {
  margin-top: 7px;
  font-size: 0.82rem;
}
.sim-controls > label:has(#search-depth) {
  min-width: 80px;
  flex: 0.5;
}
.sim-controls .button {
  font-size: 0.8rem;
}
.sim-controls .checkbox-label {
  font-size: 0.8rem;
  min-width: 100px;
  flex: 0;
  white-space: nowrap;
  margin-bottom: 10px;
}
.checkbox-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.edit-graph {
  font-size: 0.82rem;
  margin-top: 20px;
}
.edit-graph summary {
  color: var(--accent);
  cursor: pointer;
}
.edit-graph p {
  margin: 12px 0;
}
.edge-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.edge-edit-grid label {
  font-size: 0.75rem;
}
.edge-edit-grid input {
  margin-top: 5px;
}
.sim-error {
  color: #ba4165;
  font-size: 0.86rem;
  line-height: 1.65;
  margin: 15px 0;
}
.sim-error:empty {
  display: none;
}
.trace-host {
  margin: 20px 0;
}
.trace-stage {
  min-height: 100px;
}
.trace-status {
  display: flex;
  gap: 13px;
  align-items: center;
  background: #f7f6fd;
  border-radius: 10px;
  padding: 15px 17px;
  font-size: 0.85rem;
  margin: 18px 0;
}
.trace-status > .pill {
  font-size: 0.71rem;
  flex-shrink: 0;
}
.trace-status p {
  line-height: 1.7;
  color: #626580;
  font-size: 0.84rem;
}
.trace-player {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.trace-player .button {
  font-size: 0.78rem;
  padding: 10px 13px;
}
.trace-player .button > .icon {
  height: 15px;
  width: 15px;
}
.trace-player .icon-button {
  height: 40px;
  width: 38px;
}
.trace-player .icon-button > .icon {
  height: 17px;
  width: 17px;
}
.trace-count {
  font-size: 0.74rem;
  color: var(--muted);
  margin-left: auto;
}
.speed-label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.69rem;
}
.speed-label select {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.73rem;
  color: var(--muted);
  background: white;
  padding: 7px 5px;
}
.trace-player > input[type="range"] {
  width: 100%;
  margin-top: 9px;
  accent-color: var(--accent);
  height: 5px;
  cursor: pointer;
}
.graph-svg,
.game-svg,
.csp-svg {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 12px auto 0;
  overflow: visible;
}
.graph-edge {
  stroke: #d9dce8;
  stroke-width: 2;
}
.graph-edge.path {
  stroke: #20a488;
  stroke-width: 4;
}
.edge-label {
  font:
    15px "DM Sans",
    sans-serif;
  fill: #73798e;
}
.graph-node circle {
  fill: white;
  stroke: #ced3e3;
  stroke-width: 2;
  transition:
    fill 0.25s,
    stroke 0.25s;
}
.graph-node text {
  fill: #585e76;
  font:
    600 20px "DM Sans",
    sans-serif;
}
.graph-node .heuristic-label {
  font-size: 12px;
  font-weight: 400;
  fill: #969bb0;
}
.graph-node.current circle {
  fill: var(--accent);
  stroke: var(--accent);
}
.graph-node.current > text:not(.heuristic-label) {
  fill: white;
}
.graph-node.expanded circle,
.graph-node.path circle {
  fill: #def3eb;
  stroke: #78c8b1;
}
.graph-node.frontier circle {
  fill: #fff1cf;
  stroke: #e8c77c;
}
.graph-legend {
  display: flex;
  justify-content: center;
  gap: 23px;
  margin: 13px 0 22px;
  font-size: 0.72rem;
  color: var(--muted);
}
.graph-legend > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.graph-legend i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.legend-current {
  background: var(--accent);
}
.legend-frontier {
  background: #e4b34f;
}
.legend-expanded {
  background: #58b69e;
}
.search-state {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 25px;
}
.search-state h3 {
  font-size: 0.92rem;
}
.search-state p {
  font-size: 0.75rem;
  line-height: 1.65;
  margin-top: 7px;
}
.search-state th,
.search-state td {
  font-size: 0.75rem;
  padding: 9px 12px;
}
.search-state .table-scroll {
  margin-top: 12px;
}
.token-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.token {
  border: 1px solid #d6d3ef;
  background: #f4f2ff;
  color: #746bba;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 7px;
}
.empty-caption {
  font-size: 0.78rem;
  color: #979caf;
  line-height: 1.7;
}
.result-box {
  padding: 19px 20px;
  background: #ecf8f2;
  border: 1px solid #c8e7d8;
  border-radius: 11px;
  margin-top: 20px;
  line-height: 1.75;
  color: #218161;
}
.result-box > p:first-child {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: #3b9980;
  font-weight: 700;
  margin: 0 0 7px;
}
.result-box h3 {
  font-size: 1rem;
  line-height: 1.6;
  color: #267f68;
}
.result-box > p:last-child {
  font-size: 0.85rem;
  margin: 9px 0 0;
  color: #4f8d78;
  letter-spacing: 0;
  font-weight: 400;
}
.result-box span {
  font-size: 0.79rem;
}
.sim-caption {
  font-size: 0.78rem;
  line-height: 1.75;
  background: #fafbfe;
  border-radius: 9px;
  padding: 16px 18px;
  margin-top: 23px;
  color: #777d92;
}
#search-comparison {
  margin-top: 15px;
}
.leaf-controls {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.leaf-controls label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.leaf-controls input {
  margin-top: 5px;
  padding: 9px;
}
.game-node rect {
  fill: #f4f3fc;
  stroke: #d4d0ee;
  stroke-width: 1.5;
}
.game-node text {
  font:
    600 19px "DM Sans",
    sans-serif;
  fill: #686383;
}
.game-node.current rect {
  fill: #5046e5;
  stroke: #5046e5;
}
.game-node.current text:not(.node-caption) {
  fill: white;
}
.game-node .node-caption {
  font-size: 12px;
  font-weight: 400;
  fill: #a0a0b5;
}
.game-node.pruned rect {
  fill: #faf1f3;
  stroke: #efc6d1;
  stroke-dasharray: 4;
}
.game-node.pruned text {
  fill: #c5a2ad;
}
.domain-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 15px 0;
}
.domain-strip > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.76rem;
}
.domain-strip span {
  display: flex;
  gap: 5px;
}
.domain-strip i {
  display: block;
  height: 9px;
  width: 9px;
  border-radius: 50%;
}
.csp-node text {
  font:
    600 19px "DM Sans",
    sans-serif;
}
.csp-node.active circle {
  transition: 0.2s;
}
.manual-color {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.manual-color summary {
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}
.manual-color p {
  font-size: 0.84rem;
  margin: 15px 0;
}
.manual-color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.manual-color-grid label {
  font-size: 0.78rem;
  color: var(--muted);
}
.manual-color-grid select {
  margin-top: 6px;
  font-size: 0.83rem;
}
.formula-input-row {
  display: flex;
  gap: 12px;
}
.formula-field {
  font-family: "Cambria Math", Georgia, serif;
  font-size: 1.2rem;
  background: #fafaff;
}
.formula-input-row .button {
  flex-shrink: 0;
}
.example-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.example-buttons .button {
  font-family: "DM Sans", sans-serif;
}
.truth-summary {
  display: flex;
  gap: 15px;
  align-items: center;
  margin: 24px 0;
}
.truth-summary p {
  font-size: 0.85rem;
}
.valuation-panel {
  padding: 20px;
  border: 1px solid var(--line);
  background: #fafbfe;
  border-radius: 12px;
}
.valuation-panel h3 {
  font-size: 0.91rem;
}
.assignment-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 17px 0;
}
.assignment-switches label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: Georgia, serif;
  font-size: 1.05rem;
}
.assignment-switches input {
  appearance: none;
  width: 36px;
  height: 20px;
  background: #d9dce8;
  border-radius: 20px;
  position: relative;
  border: 0;
  margin: 0;
  transition: background 0.2s;
}
.assignment-switches input:before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.assignment-switches input:checked {
  background: var(--accent);
}
.assignment-switches input:checked:before {
  transform: translateX(16px);
}
.switch-value {
  font:
    600 0.7rem "DM Sans",
    sans-serif;
  color: #878aa2;
}
.valuation-outcome {
  font-size: 0.88rem;
}
.valuation-outcome.true {
  color: #19886d;
}
.valuation-outcome.false {
  color: #be5d79;
}
.truth-table td,
.truth-table th {
  text-align: center;
}
.truth-table tr[data-row] {
  cursor: pointer;
}
.truth-table tr[data-row]:hover {
  background: #f5f4fe;
}
.truth-table tr.selected-row {
  background: #efedff;
}
.boolean {
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 5px;
  padding: 3px 8px;
}
.boolean.true {
  background: #dff0e8;
  color: #2e9071;
}
.boolean.false {
  background: #f5e5ea;
  color: #b46c84;
}
.clause-input {
  font-family: "Cambria Math", Georgia, serif;
  font-size: 1.07rem;
}
.clause-stack {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}
.clause {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfbff;
}
.clause > span {
  font-size: 0.73rem;
  color: #9b95bd;
  min-width: 25px;
}
.clause strong {
  font:
    500 1.05rem "Cambria Math",
    Georgia,
    serif;
  color: #69627f;
}
.clause small {
  margin-left: auto;
  font-size: 0.65rem;
  color: #aaa3bc;
}
.clause.empty {
  background: #fff0f4;
  border-color: #ecc0cf;
}
.clause.empty strong {
  color: #b75072;
}
.dpll-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 24px;
}
.dpll-layout h3 {
  font-size: 0.92rem;
}
.dpll-layout p {
  font-size: 0.85rem;
}
.fact-switches {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.fact-switches label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.fact-switches b {
  color: #5046e5;
}
.horn-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 23px 0;
}
.horn-fact {
  padding: 17px 10px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 11px;
  text-align: center;
}
.horn-fact > span {
  font:
    600 1.5rem "Manrope",
    sans-serif;
  color: #a5a9bc;
}
.horn-fact p {
  font-size: 0.72rem;
  margin-top: 5px;
  color: #9095a9;
}
.horn-fact small {
  font-size: 0.6rem;
  color: #b0b4c3;
}
.horn-fact.known {
  background: #f0f9f4;
  border-color: #ccebdc;
}
.horn-fact.known > span {
  color: #23936d;
}
.horn-fact.known p {
  color: #629d86;
}
.horn-fact.just-added {
  box-shadow: 0 0 0 2px #98d6bd;
  animation: fade-in 0.3s;
}
.horn-rules {
  display: grid;
  gap: 9px;
}
.horn-rule {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.horn-rule > span {
  font-size: 0.71rem;
  color: #a6a2bd;
}
.horn-rule strong {
  font-family: "Cambria Math", Georgia, serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: #7d7793;
}
.horn-rule small {
  margin-left: auto;
  font-size: 0.65rem;
  color: #aaa6bc;
}
.horn-rule.fired {
  background: #f2f0fd;
  border-color: #d9d1f5;
}
.horn-rule.fired strong {
  color: #7062b3;
}
.quantifier-controls {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.quantifier-controls button {
  font-size: 0.8rem;
}
.relation-table th,
.relation-table td {
  text-align: center;
  vertical-align: middle;
}
.relation-table input {
  width: 22px;
  height: 22px;
}
.quantifier-results {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}
.quantifier-result {
  position: relative;
  padding: 19px 110px 19px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.quantifier-result h3 {
  font-family: "Cambria Math", Georgia, serif;
  font-size: 1.13rem;
}
.quantifier-result p {
  font-size: 0.79rem;
  margin-top: 9px;
}
.quantifier-result > span {
  position: absolute;
  right: 18px;
  top: 20px;
  font-size: 0.71rem;
  font-weight: 700;
}
.quantifier-result.true {
  background: #f2faf6;
  border-color: #d1e9dc;
}
.quantifier-result.true > span {
  color: #23936d;
}
.quantifier-result.false {
  background: #fff8fa;
  border-color: #f1dce4;
}
.quantifier-result.false > span {
  color: #ba6e8a;
}
.inference-toggle {
  margin: 18px 0;
}
.knowledge-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  align-items: start;
}
.knowledge-svg {
  width: 100%;
  display: block;
  overflow: visible;
}
.knowledge-node {
  cursor: pointer;
}
.knowledge-node rect {
  fill: #f2f0fd;
  stroke: #d6d0ee;
  stroke-width: 1.5;
}
.knowledge-node text {
  font:
    500 13px "DM Sans",
    sans-serif;
  fill: #8676b2;
}
.knowledge-node.individual rect {
  fill: #eaf7f2;
  stroke: #b7dfcf;
}
.knowledge-node.individual text {
  fill: #278c71;
}
.knowledge-node.selected rect {
  fill: #5046e5;
  stroke: #5046e5;
}
.knowledge-node.selected text {
  fill: white;
}
.relation-label {
  font:
    10px "DM Sans",
    sans-serif;
  fill: #aaa4bb;
}
.knowledge-layout aside {
  padding: 20px;
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-top: 18px;
}
.knowledge-layout aside h3 {
  font-size: 1.12rem;
  margin: 13px 0;
}
.knowledge-layout aside p {
  font-size: 0.84rem;
  line-height: 1.75;
}
.knowledge-layout aside h4 {
  font-size: 0.75rem;
  margin: 19px 0 10px;
}
.triple {
  font-size: 0.75rem;
  padding: 8px 0;
  color: #78758e;
  line-height: 1.65;
}
.triple.inferred {
  color: #29937c;
}
.knowledge-triples {
  margin-top: 22px;
}
.knowledge-triples h3 {
  font-size: 0.96rem;
}
.knowledge-triples > p {
  font-size: 0.83rem;
  margin-top: 10px;
}
.triple-code {
  display: grid;
  gap: 6px;
  padding: 18px;
  margin-top: 15px;
  background: #f5f6fc;
  border-radius: 10px;
  font-size: 0.8rem;
  overflow-x: auto;
}
.triple-code code {
  white-space: nowrap;
  color: #77708f;
}
.triple-code code.inferred {
  color: #32967c;
}
@keyframes fade-in {
  from {
    opacity: 0.5;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 1200px) {
  .learning-layout {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 20px;
  }
  .learning-content {
    padding: 25px;
  }
  .learning-tabs a {
    font-size: 0.75rem;
    gap: 5px;
  }
  .learning-tabs a .icon {
    display: none;
  }
  .method-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .plan-topics {
    grid-template-columns: 1fr;
  }
  .simulation-card {
    padding: 24px;
  }
  .knowledge-layout {
    grid-template-columns: 1fr 1fr;
  }
  .sim-controls > label {
    min-width: 120px;
  }
  .plan-summary .button {
    white-space: normal;
    text-align: center;
  }
  .lesson-heading h1 {
    font-size: 2.1rem;
  }
  .trace-player .button {
    padding: 10px;
  }
  .leaf-controls {
    gap: 7px;
  }
  .leaf-controls .field {
    font-size: 0.8rem;
  }
}
@media (max-width: 950px) {
  .learning-layout {
    grid-template-columns: 1fr;
  }
  .lesson-rail {
    position: static;
    display: none;
  }
  .learning-tabs a .icon {
    display: block;
  }
  .search-state {
    grid-template-columns: 1fr 1fr;
  }
  .plan-summary {
    gap: 18px;
    padding: 22px;
  }
  .plan-summary .button {
    margin-left: 0;
  }
  .progress-ring {
    width: 90px;
    height: 90px;
  }
  .plan-summary {
    flex-wrap: wrap;
  }
  .plan-summary > div:nth-child(2) {
    flex: 1;
    min-width: 170px;
  }
  .knowledge-layout {
    grid-template-columns: 1fr;
  }
  .knowledge-layout aside {
    margin-top: 0;
  }
  .knowledge-svg {
    max-height: 380px;
  }
  .learning-content .simulation-card {
    padding: 0;
  }
  .compact-heading h1 {
    font-size: 2.3rem;
  }
}
@media (max-width: 700px) {
  .learning-content {
    padding: 22px 18px;
  }
  .lesson-heading h1 {
    font-size: 1.9rem;
  }
  .lesson-heading .meta-row {
    font-size: 0.73rem;
    gap: 10px;
  }
  .learning-tabs {
    gap: 2px;
    padding: 4px;
    margin-bottom: 17px;
  }
  .learning-tabs a {
    font-size: 0.69rem;
    padding: 10px 5px;
    gap: 5px;
    flex-direction: column;
  }
  .learning-tabs a .icon {
    width: 17px;
    height: 17px;
  }
  .reading-section h2 {
    font-size: 1.25rem;
  }
  .reading-section > p {
    font-size: 1rem;
  }
  .formula {
    font-size: 1.12rem;
    padding: 16px 18px;
  }
  .worked-example {
    padding: 20px 17px;
  }
  .worked-example h2 {
    font-size: 1.06rem;
  }
  .solution-steps {
    padding-left: 22px;
  }
  .solution-steps li {
    padding-left: 5px;
  }
  .answer-box {
    padding: 16px;
    font-size: 0.86rem;
  }
  .lesson-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  .lesson-bottom > .button {
    width: 100%;
  }
  .lesson-bottom > div {
    width: 100%;
  }
  .lesson-bottom > div > .button {
    width: 100%;
  }
  .compact-heading h1 {
    font-size: 2.2rem;
  }
  .plan-summary {
    padding: 20px;
  }
  .method-card {
    padding: 19px;
  }
  .plan-topic {
    padding: 21px;
  }
  .plan-topic-title {
    gap: 11px;
  }
  .plan-topic-title h2 {
    font-size: 0.96rem;
  }
  .plan-topic .topic-symbol {
    width: 38px;
    height: 38px;
  }
  .plan-topic-title .pill {
    font-size: 0.68rem;
  }
  .plan-summary .button {
    width: 100%;
  }
  .practice-tabs {
    gap: 7px;
  }
  .practice-tabs .button {
    font-size: 0.75rem;
    padding: 10px 12px;
    flex: 1;
  }
  .sheet-header {
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .practice-sheet .exercise-card {
    padding: 21px 18px;
  }
  .source-note {
    padding: 17px 18px;
  }
  .exercise-prompt {
    font-size: 0.98rem;
  }
  .controls-row {
    align-items: stretch;
    flex-direction: column;
  }
  .exam-setup {
    padding: 23px 20px;
  }
  #mixed-quiz > .quiz-card,
  #topic-exercises > .exercise-card {
    padding: 24px 19px;
  }
  .quiz-question legend {
    font-size: 0.96rem;
  }
  .quiz-option {
    padding: 13px 12px;
    font-size: 0.87rem;
    gap: 10px;
  }
  .quiz-result {
    flex-wrap: wrap;
  }
  .simulation-card {
    padding: 22px 18px;
  }
  .simulation-heading h2 {
    font-size: 1.2rem;
  }
  .simulation-heading p:last-child {
    font-size: 0.87rem;
  }
  .lab-choice {
    font-size: 0.75rem;
    padding: 9px 10px;
  }
  .lab-selector {
    gap: 7px;
  }
  .sim-controls {
    padding: 14px;
    gap: 11px;
  }
  .sim-controls .button {
    width: 100%;
  }
  .sim-controls > label {
    min-width: 115px;
    flex: 1;
  }
  .edge-edit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trace-status {
    padding: 12px;
    align-items: flex-start;
    gap: 9px;
  }
  .trace-status p {
    font-size: 0.78rem;
  }
  .trace-status > .pill {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
  .trace-player {
    gap: 6px;
  }
  .trace-player .button {
    font-size: 0.7rem;
    min-height: 40px;
    padding: 9px 10px;
  }
  .trace-player .button > .icon {
    display: none;
  }
  .trace-count {
    font-size: 0.69rem;
    margin-left: 0;
  }
  .speed-label {
    margin-left: auto;
  }
  .search-state {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .graph-legend {
    font-size: 0.66rem;
    gap: 15px;
  }
  .leaf-controls {
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }
  .manual-color-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .domain-strip {
    gap: 7px;
  }
  .domain-strip > div {
    padding: 7px;
    font-size: 0.65rem;
    gap: 7px;
  }
  .domain-strip i {
    width: 7px;
    height: 7px;
  }
  .formula-input-row {
    flex-direction: column;
    gap: 10px;
  }
  .formula-input-row .button {
    width: 100%;
  }
  .example-buttons .button {
    font-size: 0.72rem;
    padding: 8px 10px;
  }
  .truth-summary {
    flex-wrap: wrap;
    gap: 9px;
  }
  .truth-summary p {
    font-size: 0.8rem;
  }
  .horn-facts {
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
  }
  .horn-fact {
    padding: 13px 5px;
  }
  .horn-fact p {
    font-size: 0.61rem;
  }
  .horn-fact small {
    font-size: 0.55rem;
  }
  .horn-fact > span {
    font-size: 1.25rem;
  }
  .horn-rule {
    padding: 10px 12px;
    gap: 10px;
  }
  .horn-rule strong {
    font-size: 1rem;
  }
  .dpll-layout {
    grid-template-columns: 1fr;
  }
  .quantifier-result {
    padding: 17px;
  }
  .quantifier-result > span {
    position: static;
    display: block;
    margin-bottom: 10px;
  }
  .quantifier-result h3 {
    font-size: 1.07rem;
  }
  .knowledge-triples > p {
    font-size: 0.8rem;
  }
  .triple-code {
    font-size: 0.73rem;
  }
  .clause small {
    font-size: 0.61rem;
  }
  .clause strong {
    font-size: 0.95rem;
  }
  .trace-player .speed-label {
    width: auto;
  }
  .graph-svg {
    margin-top: 0;
  }
  .self-check label {
    font-size: 0.8rem;
  }
  .reflection {
    padding: 22px 18px;
  }
  .method-card p {
    font-size: 0.8rem;
  }
  .simulation-card table {
    font-size: 0.75rem;
  }
  .simulation-card th,
  .simulation-card td {
    padding: 10px;
  }
  .truth-table td,
  .truth-table th {
    padding: 11px;
  }
  .lab-intro h2 {
    font-size: 1.2rem;
  }
  .source-note p {
    font-size: 0.84rem;
  }
}
@media (max-width: 380px) {
  .horn-facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .trace-player .button {
    font-size: 0.65rem;
  }
  .method-grid {
    grid-template-columns: 1fr;
  }
  .learning-tabs a {
    font-size: 0.63rem;
  }
}
@media print {
  .lesson-rail,
  .learning-tabs,
  .lesson-bottom,
  .trace-player,
  .lab-selector,
  .practice-tabs {
    display: none;
  }
  .learning-layout {
    display: block;
  }
  .learning-content {
    border: 0;
    padding: 0;
  }
  .worked-disclosure > summary,
  .solution-disclosure > summary {
    display: none;
  }
  .reading-section {
    break-inside: avoid;
  }
  .reading-section > p {
    color: #333;
  }
  .compact-heading h1,
  .lesson-heading h1 {
    font-size: 2rem;
  }
}
.sim-controls .checkbox-label {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  white-space: normal;
}
.reading-figure{margin:26px 0;padding:20px;background:#f8f9fc;border:1px solid var(--line);border-radius:14px}.reading-figure img{display:block;max-width:100%;height:auto;margin:auto}.reading-figure figcaption{font-size:13px;color:var(--muted);margin-top:14px;text-align:center}
