:root {
  --navy: #052548;
  --blue: #075681;
  --ink: #142b3f;
  --muted: #536675;
  --paper: #fff;
  --wash: #f5f6f4;
  --line: #dce3e7;
  --a: #075681;
  --b: #c26932;
  --c: #708d83;
  --focus: #d77328;
  --topbar-h: 54px;
  --pager-h: 48px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  overflow: hidden;
}

a {
  color: var(--blue);
}

button, input, select {
  font: inherit;
}

button, select {
  cursor: pointer;
}

button {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.48rem 0.88rem;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
}

button:hover {
  background: #edf2f5;
}

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

button.primary:hover {
  background: var(--blue);
  border-color: var(--blue);
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: #fff;
  padding: 10px;
  z-index: 30;
}

.skip-link:focus {
  top: 10px;
}

/* Full-screen compact top bar */
.topbar {
  height: var(--topbar-h);
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 25;
  border-bottom: 1px solid #163d66;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

#menu-toggle, #fullscreen-toggle {
  background: #0c3562;
  color: #fff;
  border: 1px solid #355d87;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
}

#menu-toggle:hover, #fullscreen-toggle:hover {
  background: var(--blue);
}

.course {
  font-size: 17px;
  text-decoration: none;
  color: #fff;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.course span {
  font-size: 11px;
  letter-spacing: 0.02em;
  opacity: 0.78;
}

.topbar-chapter {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b7cde0;
  border-left: 1px solid #2b5078;
  padding-left: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  white-space: nowrap;
}

.header-actions a {
  color: #fff;
  text-decoration: none;
}

.header-actions a:hover {
  text-decoration: underline;
}

.topbar-counter {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #c9dbea;
  font-weight: 600;
}

.topbar-pill {
  background: var(--b);
  color: #fff !important;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.topbar-pill:hover {
  text-decoration: none !important;
  filter: brightness(1.08);
}

/* Off-canvas slide drawer */
.nav-backdrop {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(5, 37, 72, 0.35);
  z-index: 19;
}

.sidebar {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: min(380px, 90vw);
  height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  padding: 22px 18px 24px 22px;
  background: var(--wash);
  border-right: 1px solid var(--line);
  z-index: 20;
  box-shadow: 12px 0 36px rgba(5, 37, 72, 0.24);
}

.sidebar.open {
  display: block;
}

.sidebar-heading {
  padding: 0 10px 14px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

.sidebar h2 {
  font-size: 21px;
  margin: 4px 0;
  color: var(--navy);
  line-height: 1.25;
}

.sidebar-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0;
}

.nav-group {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 10px 6px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  gap: 10px;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: 4px;
  color: #435867;
  border-left: 3px solid transparent;
  align-items: center;
}

.nav-link:hover {
  background: #e8edf0;
}

.nav-link.active {
  background: #e3ebf0;
  border-left-color: var(--blue);
  color: var(--navy);
  font-weight: 700;
}

.nav-link.is-lab {
  padding-left: 22px;
  font-size: 11.5px;
  color: var(--blue);
}

.nav-link.is-lab.active {
  border-left-color: var(--b);
  background: #f5ebe3;
  color: var(--navy);
}

.nav-link .nav-number {
  font-size: 10px;
  min-width: 24px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.nav-link .lab-dot {
  margin-left: auto;
  color: var(--b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-foot {
  font-size: 11px;
  color: var(--muted);
  padding: 18px 10px 0;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

/* Main full-screen viewport */
.page-layout {
  height: calc(100dvh - var(--topbar-h));
  width: 100vw;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  margin: 0;
}

.slide-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(16px, 2.5vh, 32px) clamp(24px, 4vw, 68px);
  overflow: hidden;
}

.slide-viewport {
  width: 100%;
  max-width: 1580px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Lecture Slide Full-Screen Styling */
.slide-copy {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 3vh, 42px) clamp(24px, 4vw, 64px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(5, 37, 72, 0.05);
}

.slide-copy h1 {
  font-size: clamp(32px, 3.6vw, 54px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--blue);
  margin: 0 0 clamp(18px, 2.6vh, 32px);
  max-width: 1280px;
}

.slide-copy p,
.slide-copy ol,
.slide-copy ul {
  font-size: clamp(20px, 1.95vw, 28px);
  line-height: 1.55;
  margin: clamp(8px, 1.2vh, 16px) 0;
  color: var(--ink);
  max-width: 1320px;
}

.slide-copy ol,
.slide-copy ul {
  padding-left: 1.4em;
}

.slide-copy li + li {
  margin-top: 4px;
}

.slide-copy .slide-footer {
  font-size: clamp(16px, 1.4vw, 21px);
  line-height: 1.45;
  color: var(--blue);
  margin-top: auto;
  padding-top: clamp(16px, 2vh, 28px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.lab-next-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fdf3ec;
  border: 1px solid #e6b89c;
  color: var(--b);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.lab-next-chip:hover {
  background: var(--b);
  color: #fff;
}

.slide-copy.cover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  padding: clamp(36px, 6vw, 88px);
  justify-content: center;
}

.slide-copy.cover h1 {
  color: #fff;
  font-size: clamp(40px, 4.6vw, 68px);
  max-width: 980px;
}

.slide-copy.cover p {
  color: #e1ebf2;
  font-size: clamp(20px, 1.8vw, 26px);
  margin: 6px 0;
}

.slide-copy.cover .slide-footer {
  border-top-color: #1f466e;
  color: #9ec3e0;
}

.slide-copy.section {
  background: var(--navy);
  border-color: var(--navy);
  padding: clamp(36px, 6vw, 88px);
  justify-content: center;
}

.slide-copy.section h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(38px, 4.2vw, 62px);
}

.slide-copy.section p {
  color: #d6e4ef;
}

.slide-copy.references p {
  font-size: clamp(16px, 1.4vw, 21px);
  margin-bottom: 14px;
}

.slide-copy.compact {
  padding: clamp(14px, 2.2vh, 28px) clamp(20px, 3.2vw, 52px);
}

.slide-copy.compact h1 {
  font-size: clamp(26px, 2.8vw, 42px);
  margin: 0 0 clamp(10px, 1.4vh, 18px);
}

.slide-copy.compact p,
.slide-copy.compact ol,
.slide-copy.compact ul {
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.42;
  margin: clamp(4px, 0.7vh, 10px) 0;
}

.slide-copy.compact .equation {
  padding: clamp(10px, 1.4vh, 16px) 18px;
  margin: clamp(6px, 0.9vh, 12px) 0;
  font-size: clamp(17px, 1.65vw, 24px);
}

.slide-copy.compact .slide-table {
  font-size: clamp(14px, 1.25vw, 18px);
  margin: 6px 0 10px;
}

.slide-copy.compact .slide-table th,
.slide-copy.compact .slide-table td {
  padding: 8px 12px;
}

.slide-copy.compact .slide-footer {
  padding-top: clamp(10px, 1.2vh, 16px);
  font-size: clamp(14px, 1.2vw, 18px);
}

.slide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 3.5vw, 56px);
  margin: clamp(10px, 1.8vh, 22px) 0;
}

.slide-columns h2 {
  font-size: clamp(21px, 1.8vw, 27px);
  color: var(--blue);
  margin: 0 0 10px;
}

.slide-columns p {
  font-size: clamp(18px, 1.6vw, 23px);
}

.equation {
  padding: clamp(14px, 2.2vh, 26px) 24px;
  margin: clamp(8px, 1.4vh, 18px) 0;
  background: var(--wash);
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  overflow-x: auto;
  font-size: clamp(21px, 2.2vw, 32px);
  color: var(--ink);
}

.equation mjx-container[display="true"] {
  margin: 0 !important;
  text-align: left !important;
}

mjx-container {
  color: inherit;
}

mjx-container:not([display="true"]) {
  display: inline-block;
  vertical-align: -0.03em;
}

math {
  font-family: "Cambria Math", "STIX Two Math", math;
  line-height: 1.2;
  color: inherit;
}

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

table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}

.slide-table {
  font-size: clamp(15px, 1.35vw, 20px);
  margin: 10px 0 18px;
}

.slide-table th {
  background: var(--navy);
  color: #fff;
  padding: 11px 14px;
  font-weight: 600;
}

.slide-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.slide-table tr:nth-child(even) {
  background: #f5f7f8;
}

/* Dedicated Full-Screen Interactive Lab Slide */
.lab {
  background: var(--wash);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  padding: clamp(16px, 2.4vh, 28px) clamp(22px, 3vw, 42px);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-shadow: 0 8px 28px rgba(5, 37, 72, 0.05);
}

.lab-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.lab-kicker {
  color: var(--b);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.lab-parent-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.lab-parent-link:hover {
  text-decoration: underline;
}

.lab h2 {
  font-size: clamp(22px, 2.1vw, 31px);
  line-height: 1.18;
  margin: 0 0 4px;
  letter-spacing: -0.025em;
  color: var(--navy);
}

.lab > p {
  font-size: clamp(13.5px, 1.08vw, 15.5px);
  line-height: 1.45;
  margin: 0 0 8px;
  color: var(--ink);
  max-width: 1320px;
}

/* Presenter Walkthrough / Clicker Animation Banner */
.walkthrough-bar {
  background: linear-gradient(90deg, #052548 0%, #075681 100%);
  color: #fff;
  border-radius: 6px;
  padding: 10px 16px;
  margin: 2px 0 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(5, 37, 72, 0.14);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.walkthrough-bar:hover {
  box-shadow: 0 6px 18px rgba(5, 37, 72, 0.22);
}

.wt-main {
  min-width: 0;
}

.wt-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.wt-badge {
  background: var(--b);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}

.wt-headline {
  font-size: clamp(14.5px, 1.25vw, 18px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.wt-takeaway {
  font-size: clamp(13px, 1.08vw, 15.5px);
  line-height: 1.42;
  color: #e3eef6;
  margin: 0;
}

.wt-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wt-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #d8e6f0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
}

.wt-pill:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.wt-pill.active {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}

.wt-btn {
  background: var(--b);
  color: #fff;
  border: 1px solid #d97d45;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
}

.wt-btn:hover {
  background: #d4763d;
  border-color: #fff;
}

.wt-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.wt-btn.secondary.playing {
  background: #2e7d32;
  border-color: #66bb6a;
}

@keyframes controlPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(194, 105, 50, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(194, 105, 50, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(194, 105, 50, 0);
  }
}

.control-highlight {
  background: #fff7f1 !important;
  border-radius: 5px;
  padding: 6px 8px !important;
  margin-left: -8px !important;
  margin-right: -8px !important;
  border-left: 3px solid var(--b) !important;
  animation: controlPulse 1s ease-out;
}

.lab .demo-note {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.lab-glossary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: clamp(12px, 0.98vw, 13.5px);
  color: var(--ink);
}

.glossary-badge {
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}

.glossary-item {
  background: #fff;
  border: 1px solid #d5dfe5;
  border-radius: 4px;
  padding: 3px 9px;
  line-height: 1.35;
}

.glossary-item strong {
  color: var(--navy);
  margin-right: 4px;
}

.lab .hint {
  font-size: 13px;
  line-height: 1.48;
  color: var(--muted);
  margin: 8px 0 0;
}

.demo-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(380px, 1.28fr);
  gap: clamp(20px, 2.8vw, 38px);
  align-items: center;
  margin: 4px 0;
}

.controls {
  min-width: 0;
  background: #fff;
  padding: clamp(14px, 1.8vh, 20px);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.controls label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 14px;
  transition: background 0.2s ease;
}

.control-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

output {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
}

input[type=range] {
  display: block;
  width: 100%;
  accent-color: var(--blue);
  margin-top: 8px;
  cursor: pointer;
  min-height: 24px;
}

input[type=checkbox], input[type=radio] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

select {
  background: #fff;
  border: 1px solid #becbd3;
  border-radius: 4px;
  padding: 7px 11px;
  width: 100%;
  max-width: 100%;
  color: var(--ink);
  margin-top: 6px;
}

.check-label {
  display: flex !important;
  align-items: center;
}

.result {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(14px, 2vh, 24px);
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
}

.result h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  color: var(--muted);
}

.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 60px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  margin: 10px 0;
}

.bar-track {
  height: 16px;
  background: #dfe6e9;
  overflow: hidden;
  border-radius: 2px;
}

.bar-fill {
  height: 100%;
  min-width: 0;
  background: var(--a);
  transition: width 0.15s ease;
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.metric {
  font-size: 32px;
  line-height: 1.2;
  color: var(--navy);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.metric-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.metric-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.metric-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.small-table {
  font-size: clamp(12.5px, 1.05vw, 14.5px);
}

.small-table th, .small-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #d1dbe0;
  font-variant-numeric: tabular-nums;
}

.small-table th {
  font-weight: 600;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0 4px;
}

.calculation {
  background: var(--wash);
  padding: 11px 16px;
  font-size: clamp(14px, 1.25vw, 16.5px);
  line-height: 1.55;
  margin: 0 0 12px;
  overflow-x: auto;
  border-left: 3px solid var(--blue);
}

.calculation mjx-container[display="true"] {
  margin: 2px 0 !important;
  text-align: left !important;
}

.chart {
  width: 100%;
  max-height: 29dvh;
  height: auto;
  display: block;
  margin: 6px auto 10px;
}

.chart text {
  fill: var(--muted);
  font: 11px Arial, Helvetica, sans-serif;
}

/* Interactive Quiz Stepper */
.quiz-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.quiz-tab {
  text-align: left;
  padding: 9px 12px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.quiz-card {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.quiz-card legend {
  font-weight: 700;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.35;
  color: var(--navy);
  margin-bottom: 14px;
  padding: 0;
  display: block;
}

.quiz-option-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-list li {
  margin: 0;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
  background: var(--wash);
}

.quiz-option input[type=radio] {
  margin: 3px 0 0;
  flex-shrink: 0;
}

.quiz-option:hover {
  background: #e9eff2;
}

.quiz-option.selected {
  border-color: var(--blue);
  background: #eef5f9;
}

.feedback {
  font-size: 14px;
  color: var(--blue);
  padding: 10px 14px;
  margin-top: 12px;
  background: #eef5f9;
  border-left: 3px solid var(--blue);
  border-radius: 3px;
}

/* Bottom Pager Bar */
.pager {
  height: var(--pager-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 0 28px;
  background: var(--wash);
  flex-shrink: 0;
}

.pager a {
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  color: var(--navy);
}

.pager a:hover {
  color: var(--blue);
}

.pager a[aria-disabled=true] {
  opacity: 0.3;
  pointer-events: none;
}

.pager-hint {
  font-size: 12px;
  color: var(--muted);
}

/* Estimation Lab Tabs */
.est-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.est-tab {
  font-size: 12.5px;
  padding: 6px 12px;
}

.est-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.exercise-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 12px 0;
}

.exercise-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  margin: 0;
}

.exercise-controls input, .exercise-controls select {
  width: 100%;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid #becbd3;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  margin-top: 2px;
}

.fit-status {
  padding: 8px 12px;
  background: #e7eeeb;
  border-left: 3px solid var(--c);
  font-size: 12.5px;
  margin: 8px 0;
}

.joint-parameter-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.joint-parameter-tiles > div {
  background: var(--wash);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.joint-parameter-tiles span {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.joint-parameter-tiles strong {
  font-size: 20px;
  line-height: 1.25;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.calibration-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--wash);
  padding: 10px 14px;
  margin: 10px 0 0;
  border-radius: 4px;
}

.calibration-metrics strong {
  display: block;
  font-size: 15px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.slide-columns > div {
  min-width: 0;
}

.slide-columns .col-eq {
  display: block;
  margin-top: 10px;
  max-width: 100%;
  overflow-x: auto;
}

[hidden] {
  display: none !important;
}

@media (max-width: 960px) {
  html, body {
    overflow: auto;
  }
  .page-layout, .slide-stage, .slide-viewport, .slide-copy, .lab {
    height: auto;
  }
  .demo-layout, .slide-columns {
    grid-template-columns: 1fr;
  }
  .topbar-chapter, .pager-hint, .course span {
    display: none;
  }
}

@media print {
  .topbar, .sidebar, .pager {
    display: none !important;
  }
  html, body, .page-layout, .slide-stage, .slide-viewport {
    height: auto;
    overflow: visible;
  }
}

/* Keep the DGP reference table and equations visible together. */
.slide-copy.symbol-table-slide .equation {
  font-size: clamp(14px, 1.25vw, 19px);
  padding: 8px 12px;
}
.slide-copy.symbol-table-slide .slide-table th,
.slide-copy.symbol-table-slide .slide-table td {
  padding: 5px 10px;
}

.slide-copy.statement-slide {
  justify-content: flex-start;
}
.slide-copy.statement-slide h1 {
  font-size: clamp(32px, 3.6vw, 54px);
  color: var(--blue);
  margin: 0 0 clamp(18px, 2.6vh, 32px);
}
.slide-copy.statement-slide p {
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.35;
  max-width: 1200px;
}

/* Reserve content height: flexbox must not crop equations or tables to fit enlarged prose. */
.slide-copy > * {
  flex-shrink: 0;
}

/* Keep the complete information-set comparison beside the chart. */
.value-layout { align-items: center; }
.value-sidebar { min-width: 0; }
.value-layout .chart { max-height: 19dvh; margin: 12px auto 0; }
.value-layout .small-table { font-size: clamp(13px, 1.15vw, 17px); }
.value-layout .small-table th, .value-layout .small-table td { padding: 10px 10px; }

/* Use the screen width when presenting, keeping only a small outer gutter. */
:fullscreen .slide-stage { padding: 10px 12px; }
:fullscreen .slide-viewport { max-width: none; }
:fullscreen .slide-copy:not(.cover):not(.section) h1,
:fullscreen .slide-copy:not(.cover):not(.section) p,
:fullscreen .slide-copy ol,
:fullscreen .slide-copy ul { max-width: none; }
