/* ch2-2 독립 스타일시트 — 공통 기준: DESIGN_GUIDE.md */
:root {
  --canvas-width: 1920;
  --canvas-height: 1080;
  --page: #f2f4f9;
  --paper: #ffffff;
  --ink: #243a60;
  --muted: #5c6b7d;
  --line: #d9e1eb;
  --blue: #3b5998;
  --blue-soft: #eef3fb;
  --orange: #f28c28;
  --orange-dark: #a85a0c;
  --orange-soft: #fff4e8;
  --green: #2f9d75;
  --green-soft: #edf8f2;
  --danger: #c43f52;
  --danger-soft: #fff1f3;
  --shadow: 0 24px 70px rgba(36, 58, 96, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  position: relative;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Nanum Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-weight: 700;
}

body * {
  font-family: inherit;
  font-weight: 700;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin: 0;
}

strong,
b {
  color: inherit;
}

.deck {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  container-type: size;
  overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--deck-scale, 1));
  transform-origin: center;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.slide {
  position: absolute;
  inset: 0;
  display: none;
  padding: 44px 52px 48px;
  background:
    radial-gradient(circle, rgba(59, 89, 152, 0.15) 0 3px, transparent 4px) right 30px bottom 30px / 23px 23px no-repeat,
    var(--page);
}

.slide.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.slide::before {
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: linear-gradient(90deg, var(--blue) 0 34%, var(--orange) 34% 67%, var(--green) 67%);
  content: "";
}

.slide-header {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.unit {
  display: inline-grid;
  min-width: 72px;
  height: 44px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 22px 22px 22px 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 32px;
}

.page-ref {
  position: absolute;
  top: 2px;
  right: 0;
  border-radius: 18px 18px 5px 18px;
  padding: 9px 17px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 24px;
}

h1 {
  color: var(--blue);
  font-size: 74px;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.subtitle {
  margin-top: 12px;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.35;
}

.subtitle strong {
  color: var(--blue);
}

[data-tone="blue"] {
  --tone: var(--blue);
  --tone-dark: var(--blue);
  --tone-soft: var(--blue-soft);
  --tone-badge: var(--blue-badge);
  --tone-sub: var(--blue-sub);
}

[data-tone="orange"] {
  --tone: var(--orange);
  --tone-dark: var(--orange-dark);
  --tone-soft: var(--orange-soft);
  --tone-badge: var(--orange-badge);
  --tone-sub: var(--orange-sub);
}

[data-tone="green"] {
  --tone: var(--green);
  --tone-dark: var(--green);
  --tone-soft: var(--green-soft);
  --tone-badge: var(--green-badge);
  --tone-sub: var(--green-sub);
}

.learning-card,
.model-process > article,
.split-panel,
.evaluation-notes article,
.regression-card,
.error-figure,
.metrics-panel,
.food-model-card,
.classification-core,
.algorithm-card,
.accuracy-panel,
.penguin-matrix-panel,
.cluster-concept-card,
.kmeans-intro-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 10px solid var(--tone, var(--blue));
  border-radius: 20px;
  background: var(--paper);
}

.nav-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 10;
  width: 4cqw;
  min-width: 54px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-prev {
  left: 0;
}

.nav-next {
  right: 0;
}

.nav-zone span {
  position: absolute;
  top: 50%;
  display: block;
  width: 28px;
  height: 28px;
  opacity: 0.22;
  transform: translateY(-50%) rotate(45deg);
}

.nav-prev span {
  left: 18px;
  border-bottom: 6px solid var(--ink);
  border-left: 6px solid var(--ink);
}

.nav-next span {
  right: 18px;
  border-top: 6px solid var(--ink);
  border-right: 6px solid var(--ink);
}

.nav-zone:hover span,
.nav-zone:focus-visible span {
  opacity: 0.65;
}

.nav-zone:disabled {
  cursor: default;
}

.nav-zone:disabled span {
  opacity: 0.08;
}

.footer {
  position: fixed;
  right: 22px;
  bottom: 16px;
  left: 22px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.footer p {
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 17px;
}

.dots {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #b6c4d6;
  cursor: pointer;
}

.dot.active {
  width: 34px;
  background: var(--blue);
}

/* 1쪽: 기계학습 유형 */
.learning-map {
  display: flex;
  flex: 1;
  min-height: 0;
}

.learning-branches {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.learning-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.learning-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  padding: 18px 20px;
  background: var(--tone-soft);
}

.learning-card > header h2 {
  color: var(--tone-dark);
  font-size: 56px;
  line-height: 1.15;
}

.learning-card > header > span {
  grid-column: 2;
  grid-row: 1;
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 27px;
}

.learning-card > header p {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.3;
}

.type-pair {
  display: grid;
  min-height: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 18px 18px;
}

.type-pair section {
  display: grid;
  min-height: 0;
  grid-template-columns: 126px minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  align-content: space-evenly;
  gap: 7px 16px;
  border-radius: 16px;
  padding: 14px;
  background: var(--tone-soft);
}

.type-pair b {
  grid-row: 1 / 4;
  display: grid;
  align-self: stretch;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--tone-dark);
  font-size: 45px;
  text-align: center;
}

.type-pair p {
  font-size: 31px;
  line-height: 1.24;
}

.type-pair em,
.type-pair small {
  color: var(--muted);
  font-size: 27px;
  font-style: normal;
  line-height: 1.25;
}

.type-pair small {
  color: var(--tone-dark);
}

.reinforcement-content {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(330px, 1fr) auto auto;
  gap: 12px;
  margin: 16px 18px 18px;
  border-radius: 16px;
  padding: 14px;
  background: var(--green-soft);
}

.reinforcement-diagram {
  position: relative;
  min-height: 0;
}

.agent-node,
.environment-node {
  position: absolute;
  z-index: 2;
  left: 18%;
  display: grid;
  width: 64%;
  height: 108px;
  place-items: center;
  border: 3px solid var(--green);
  border-radius: 22px;
  background: #fff;
  color: var(--green);
  font-size: 40px;
}

.agent-node {
  top: 18px;
}

.environment-node {
  bottom: 18px;
}

.action-path,
.feedback-path {
  position: absolute;
  z-index: 3;
  top: 72px;
  bottom: 72px;
  width: 15%;
}

.action-path {
  left: 3%;
  border-top: 5px solid var(--green);
  border-bottom: 5px solid var(--green);
  border-left: 5px solid var(--green);
}

.feedback-path {
  right: 3%;
  border-top: 5px solid var(--orange);
  border-right: 5px solid var(--orange);
  border-bottom: 5px solid var(--orange);
}

.action-path span,
.feedback-path span {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  background: var(--green-soft);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  white-space: nowrap;
}

.action-path span {
  left: -10px;
  padding: 8px 4px;
}

.feedback-path span {
  right: -16px;
  padding: 8px 4px;
}

.action-path i,
.feedback-path i {
  position: absolute;
  z-index: 5;
  display: block;
  width: 0;
  height: 0;
}

.action-path i {
  right: -5px;
  bottom: -14px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 21px solid var(--green);
}

.feedback-path i {
  top: -14px;
  left: -5px;
  border-top: 13px solid transparent;
  border-right: 21px solid var(--orange);
  border-bottom: 13px solid transparent;
}

.reward-copy {
  border-radius: 13px;
  padding: 12px;
  background: #fff;
  font-size: 31px;
  line-height: 1.25;
  text-align: center;
}

.reward-copy strong {
  color: var(--green);
}

.examples,
.cluster-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.examples span,
.cluster-examples span {
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: var(--muted);
  font-size: 25px;
}

/* 2쪽: 구현 과정 */
.model-process {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) 68px;
  gap: 16px;
}

.model-process > article {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  gap: 13px;
  padding: 19px;
}

.model-process > article:not(:nth-of-type(4))::after {
  position: absolute;
  top: 47%;
  left: calc(100% + 1px);
  z-index: 4;
  width: 16px;
  color: var(--blue);
  content: "→";
  font-size: 38px;
  text-align: center;
}

.model-process article > span,
.algorithm-card header span,
.kmeans-intro-steps li > span {
  display: grid;
  width: 54px;
  min-width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--tone-soft);
  color: var(--tone-dark);
  font-size: 25px;
}

.model-process h2 {
  color: var(--tone-dark);
  font-size: 46px;
  line-height: 1.16;
}

.model-process article p {
  color: var(--muted);
  font-size: 31px;
  line-height: 1.3;
}

.stage-points {
  display: grid;
  min-height: 0;
  grid-auto-rows: 1fr;
  gap: 9px;
}

.stage-points b {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 12px;
  padding: 8px;
  background: var(--tone-soft);
  color: var(--ink);
  font-size: 27px;
  line-height: 1.18;
  text-align: center;
}

.feedback-loop {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border: 2px dashed #9cb3cf;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 29px;
}

.feedback-loop strong {
  color: var(--blue);
  font-size: 40px;
}

/* 3쪽: 학습과 평가 */
.train-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.split-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.split-panel > h2,
.evaluation-notes h2,
.regression-card h2,
.error-figure h2,
.metrics-panel > h2,
.food-model-card h2,
.penguin-matrix-panel h2,
.kmeans-intro-card h2 {
  color: var(--tone-dark);
  font-size: 50px;
  line-height: 1.16;
}

.dataset-bar {
  display: grid;
  height: 82px;
  grid-template-columns: 4fr 1fr;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  font-size: 31px;
}

.dataset-bar span {
  display: grid;
  place-items: center;
  background: var(--blue);
}

.dataset-bar span:last-child {
  background: var(--orange);
}

.split-flow {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 1fr 38px 145px 38px 1fr;
  align-items: center;
}

.split-flow section {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  padding: 18px;
  background: var(--blue-soft);
}

.split-flow section:last-child {
  background: var(--orange-soft);
}

.split-flow section > span {
  color: var(--blue);
  font-size: 27px;
}

.split-flow section:last-child > span {
  color: var(--orange-dark);
}

.split-flow h3 {
  font-size: 46px;
}

.split-flow p {
  color: var(--muted);
  font-size: 31px;
  line-height: 1.32;
}

.split-flow b {
  color: var(--blue);
}

.split-flow > i {
  color: var(--blue);
  font-size: 36px;
  font-style: normal;
  text-align: center;
}

.model-node {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 6px solid #bfd4f5;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 29px;
  line-height: 1.25;
  text-align: center;
}

.evaluation-notes {
  display: grid;
  min-height: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.evaluation-notes article {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding: 22px;
}

.evaluation-notes p {
  color: var(--muted);
  font-size: 29px;
  line-height: 1.34;
}

.overfit-card h2,
.score-compare b,
.score-compare i {
  color: var(--danger);
}

.score-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.score-compare span {
  border-radius: 12px;
  padding: 10px 7px;
  background: var(--danger-soft);
  font-size: 25px;
  text-align: center;
}

.score-compare i {
  font-size: 29px;
  font-style: normal;
}

.folds {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  border-radius: 12px;
}

.folds span {
  display: grid;
  height: 56px;
  place-items: center;
  border-right: 2px solid #fff;
  background: var(--green-soft);
  color: var(--green);
  font-size: 25px;
}

.folds span:nth-child(3) {
  background: var(--green);
  color: #fff;
}

/* 4쪽: 선형 회귀 */
.regression-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) 134px;
  gap: 15px 20px;
}

.regression-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px;
}

.regression-card header,
.algorithm-card header {
  display: flex;
  align-items: center;
  gap: 15px;
  border-radius: 15px;
  padding: 13px 15px;
  background: var(--tone-soft);
}

.regression-card header > span {
  display: grid;
  width: 54px;
  min-width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--tone-dark);
  font-size: 25px;
}

.regression-card header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 29px;
}

.mini-chart,
.residual-chart {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 4px 30px 0 48px;
  border-bottom: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
  background: repeating-linear-gradient(0deg, transparent 0 62px, #e8edf3 63px 64px);
}

.mini-chart > b {
  position: absolute;
  bottom: var(--y);
  left: var(--x);
  width: 20px;
  height: 20px;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: var(--blue);
}

.trend-line,
.regression-line {
  position: absolute;
  bottom: 12%;
  left: 4%;
  width: 92%;
  height: 6px;
  transform: rotate(-24deg);
  transform-origin: left center;
  border-radius: 99px;
  background: var(--orange);
}

.axis-x,
.axis-y,
.chart-x,
.chart-y {
  position: absolute;
  color: var(--muted);
  font-size: 27px;
}

.axis-x,
.chart-x {
  right: 0;
  bottom: -34px;
}

.axis-y,
.chart-y {
  top: 46%;
  left: -84px;
  transform: rotate(-90deg);
}

.formula {
  border-radius: 13px;
  padding: 10px 14px;
  background: var(--tone-soft);
  color: var(--ink);
  font-size: 31px;
  text-align: center;
}

.formula strong {
  color: var(--tone-dark);
}

.variable-map {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 1fr 44px 170px 44px 1fr;
  align-items: center;
}

.variable-map > div {
  display: grid;
  gap: 9px;
}

.variable-map span,
.variable-map strong,
.variable-map > b {
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 29px;
  text-align: center;
}

.variable-map span {
  padding: 11px;
}

.variable-map strong,
.variable-map > b {
  height: 128px;
  padding: 12px;
}

.variable-map strong {
  border-radius: 50%;
}

.variable-map i {
  color: var(--orange);
  font-size: 38px;
  font-style: normal;
  text-align: center;
}

.term-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.term-strip section {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.term-strip section > b {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 27px;
}

.term-strip h3 {
  font-size: 29px;
}

.term-strip p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 23px;
  line-height: 1.2;
}

/* 5쪽: 회귀 성능 평가 */
.metric-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
}

.error-figure,
.metrics-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 16px;
  padding: 21px;
}

.residual-chart {
  margin-bottom: 2px;
  background: repeating-linear-gradient(0deg, transparent 0 72px, #e8edf3 73px 74px);
}

.regression-line {
  bottom: 14%;
  transform: rotate(-27deg);
}

.residual {
  position: absolute;
  width: 19px;
  height: 19px;
}

.residual b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--blue);
}

.residual em {
  position: absolute;
  top: 9px;
  left: 8px;
  width: 4px;
  height: var(--err);
  border-radius: 99px;
  background: var(--danger);
}

.r1 { left: 15%; bottom: 33%; --err: 58px; }
.r2 { left: 31%; bottom: 47%; --err: 38px; }
.r3 { left: 50%; bottom: 48%; --err: 72px; }
.r4 { left: 67%; bottom: 72%; --err: 35px; }
.r5 { left: 83%; bottom: 76%; --err: 64px; }

.error-figure > p {
  display: flex;
  justify-content: center;
  gap: 20px;
  color: var(--muted);
  font-size: 25px;
}

.error-figure > p span {
  color: var(--blue);
}

.error-figure > p i {
  color: var(--danger);
  font-style: normal;
}

.error-figure > p strong {
  color: var(--orange-dark);
}

.metric-list {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.metric-list section {
  display: grid;
  min-height: 0;
  grid-template-columns: 118px 1fr 180px;
  align-items: center;
  gap: 15px;
  border-radius: 15px;
  padding: 11px 14px;
  background: var(--orange-soft);
}

.metric-list section > span {
  display: grid;
  height: 58px;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: var(--orange-dark);
  font-size: 28px;
}

.metric-list h3 {
  font-size: 31px;
}

.metric-list p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 26px;
}

.metric-list em {
  border-radius: 999px;
  padding: 9px;
  background: #fff;
  color: var(--orange-dark);
  font-size: 23px;
  font-style: normal;
  text-align: center;
}

.metric-check {
  display: grid;
  grid-template-columns: 1fr auto 1.35fr auto 1fr;
  align-items: center;
  gap: 9px;
  border-radius: 14px;
  padding: 13px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 25px;
  text-align: center;
}

.metric-check i {
  font-style: normal;
}

.metric-check b {
  border-radius: 999px;
  padding: 8px;
  background: var(--green);
  color: #fff;
}

/* 6쪽: 분류 모델 */
.classification-overview,
.classification-evaluation,
.cluster-overview {
  display: grid;
  flex: 1;
  min-height: 0;
  gap: 20px;
}

.classification-overview {
  grid-template-columns: 1.08fr 0.92fr;
}

.food-model-card,
.classification-core {
  min-height: 0;
  padding: 21px;
}

.food-model-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
}

.food-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  text-align: center;
}

.food-table th,
.food-table td {
  padding: 9px 13px;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 27px;
}

.food-table thead tr:first-child th {
  background: var(--blue);
  color: #fff;
}

.food-table thead tr:nth-child(2) th,
.food-table tbody td:last-child {
  background: var(--blue-soft);
  color: var(--blue);
}

.boundary-types {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.boundary-types section {
  position: relative;
  display: grid;
  min-height: 190px;
  align-content: end;
  gap: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  background: #fff;
  text-align: center;
}

.boundary-types b {
  color: var(--blue);
  font-size: 30px;
}

.boundary-types span {
  color: var(--muted);
  font-size: 25px;
}

.boundary-types i {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 6px;
  height: 135px;
  background: var(--orange);
}

.linear-boundary {
  transform: rotate(44deg);
}

.nonlinear-boundary {
  border: 6px solid var(--orange);
  border-top: 0;
  border-bottom: 0;
  border-radius: 50%;
  background: transparent !important;
  transform: rotate(38deg);
}

.classification-core {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.classification-goal {
  display: grid;
  gap: 9px;
  border-radius: 15px;
  padding: 18px;
  background: var(--orange-soft);
  text-align: center;
}

.classification-goal span {
  color: var(--orange-dark);
  font-size: 28px;
}

.classification-goal strong {
  font-size: 42px;
}

.classification-terms {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.classification-terms div {
  display: grid;
  grid-template-columns: 125px 1fr;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
}

.classification-terms dt {
  color: var(--orange-dark);
  font-size: 31px;
}

.classification-terms dd {
  color: var(--muted);
  font-size: 28px;
  line-height: 1.25;
}

.classification-examples {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  background: #fff;
  color: var(--muted);
  font-size: 25px;
}

.classification-examples b {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--orange-dark);
  font-size: 29px;
}

/* 7쪽: 분류 알고리즘 */
.classification-algorithms {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.algorithm-card {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(210px, 1fr) auto auto;
  gap: 14px;
  padding: 19px;
}

.algorithm-card h2 {
  color: var(--tone-dark);
  font-size: 45px;
  line-height: 1.15;
}

.algorithm-card > p {
  color: var(--muted);
  font-size: 30px;
  line-height: 1.3;
}

.algorithm-card > p b {
  color: var(--tone-dark);
}

.algorithm-card small {
  min-height: 68px;
  border-radius: 13px;
  padding: 11px 13px;
  background: var(--tone-soft);
  color: var(--muted);
  font-size: 25px;
  line-height: 1.25;
}

.penguin-tree,
.logistic-curve,
.neighbor-vote {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.penguin-tree::before {
  position: absolute;
  top: 82px;
  left: 18%;
  width: 64%;
  height: 4px;
  background: #aab9ca;
  content: "";
}

.penguin-tree > b {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 11px;
  padding: 12px 20px;
  background: var(--blue);
  color: #fff;
  font-size: 24px;
  white-space: nowrap;
}

.penguin-tree > i {
  position: absolute;
  top: 94px;
  color: var(--muted);
  font-size: 23px;
  font-style: normal;
}

.penguin-tree > i:nth-of-type(1) { left: 21%; }
.penguin-tree > i:nth-of-type(2) { right: 18%; }

.penguin-tree > strong,
.penguin-tree > em {
  position: absolute;
  bottom: 24px;
  width: 42%;
  border-radius: 11px;
  padding: 15px 7px;
  font-size: 22px;
  font-style: normal;
  text-align: center;
}

.penguin-tree > strong {
  left: 4%;
  background: var(--blue-soft);
  color: var(--blue);
}

.penguin-tree > em {
  right: 4%;
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.logistic-curve {
  border-bottom: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
}

.logistic-curve > b {
  position: absolute;
  top: -18px;
  left: 42%;
  color: var(--orange);
  font-size: 195px;
  line-height: 1;
  transform: rotate(-18deg);
}

.logistic-curve > span,
.logistic-curve > i,
.logistic-curve > em {
  position: absolute;
  color: var(--muted);
  font-size: 22px;
  font-style: normal;
}

.logistic-curve > span {
  left: 4px;
}

.logistic-curve > span:first-child { bottom: 4px; }
.logistic-curve > span:last-child { top: 4px; }
.logistic-curve > i { top: 8px; left: 16px; }

.logistic-curve > em {
  top: 47%;
  right: 10px;
  left: 0;
  border-top: 3px dashed var(--orange);
  color: var(--orange-dark);
  text-align: right;
}

.neighbor-vote {
  border: 3px dashed #bfd4f5;
}

.neighbor-vote > b,
.neighbor-vote > em {
  position: absolute;
  font-size: 35px;
  font-style: normal;
}

.neighbor-vote > b { color: var(--blue); }
.neighbor-vote > em { color: var(--orange); }
.neighbor-vote > b:nth-of-type(1) { top: 30px; left: 23%; }
.neighbor-vote > b:nth-of-type(2) { bottom: 35px; left: 29%; }
.neighbor-vote > em:nth-of-type(1) { top: 34px; right: 25%; }
.neighbor-vote > em:nth-of-type(2) { right: 19%; bottom: 30px; }

.neighbor-vote > strong {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 40px;
}

.neighbor-vote > i {
  position: absolute;
  right: 15px;
  bottom: 10px;
  color: var(--green);
  font-size: 23px;
  font-style: normal;
}

/* 8쪽: 분류 성능 평가 */
.classification-evaluation {
  grid-template-columns: 0.8fr 1.2fr;
}

.accuracy-panel,
.penguin-matrix-panel {
  min-height: 0;
  padding: 22px;
}

.accuracy-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.metric-name {
  color: var(--blue);
  font-size: 48px;
  text-align: center;
}

.accuracy-formula {
  display: grid;
  gap: 13px;
  border-radius: 15px;
  padding: 24px;
  background: var(--blue-soft);
  text-align: center;
}

.accuracy-formula strong {
  border-bottom: 4px solid var(--blue);
  padding-bottom: 13px;
  font-size: 29px;
}

.accuracy-formula i {
  font-size: 29px;
  font-style: normal;
}

.accuracy-panel > p {
  color: var(--muted);
  font-size: 32px;
  line-height: 1.35;
  text-align: center;
}

.accuracy-panel > p b {
  color: var(--blue);
}

.metric-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.metric-tags span {
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 24px;
}

.penguin-matrix-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.penguin-matrix-panel > p {
  color: var(--muted);
  font-size: 28px;
  line-height: 1.3;
}

.penguin-matrix {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  grid-template-rows: 0.8fr repeat(3, 1fr);
  gap: 7px;
}

.penguin-matrix > * {
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 28px;
  text-align: center;
}

.penguin-matrix > b,
.penguin-matrix > strong,
.matrix-corner {
  background: #f5f7fa;
  color: var(--ink);
}

.matrix-corner {
  padding: 7px;
  font-size: 24px;
  line-height: 1.25;
}

.penguin-matrix > em {
  background: var(--green-soft);
  color: var(--green);
  font-size: 34px;
  font-style: normal;
}

.penguin-matrix > i {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 31px;
  font-style: normal;
}

.matrix-key {
  display: flex;
  justify-content: center;
  gap: 26px;
  font-size: 23px;
}

.matrix-key span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.matrix-key b,
.matrix-key i {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.matrix-key b { background: var(--green-soft); }
.matrix-key i { background: var(--danger-soft); }

/* 9쪽: 군집 */
.cluster-overview {
  grid-template-columns: 1.08fr 0.92fr;
}

.cluster-concept-card,
.kmeans-intro-card {
  min-height: 0;
  padding: 21px;
}

.cluster-concept-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
}

.cluster-definition {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 17px;
  border-radius: 15px;
  padding: 16px;
  background: var(--blue-soft);
}

.cluster-definition > span {
  display: grid;
  height: 70px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-size: 29px;
}

.cluster-definition p {
  color: var(--muted);
  font-size: 31px;
  line-height: 1.3;
}

.cluster-definition b {
  color: var(--blue);
}

.music-clusters {
  position: relative;
  min-height: 0;
  margin: 0 18px 0 48px;
  border-bottom: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 49.8%, #edf1f6 50%),
    linear-gradient(transparent 49.8%, #edf1f6 50%);
}

.music-clusters > b {
  position: absolute;
  bottom: var(--y);
  left: var(--x);
  width: 28px;
  height: 28px;
  transform: translate(-50%, 50%);
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(36, 58, 96, 0.2);
}

.music-c1 { background: var(--blue); }
.music-c2 { background: var(--orange); }
.music-c3 { background: var(--green); }

.axis-label-x,
.axis-label-y {
  position: absolute;
  color: var(--muted);
  font-size: 25px;
}

.axis-label-x { right: 8px; bottom: 8px; }
.axis-label-y { top: 8px; left: 10px; }

.music-label {
  position: absolute;
  border-radius: 999px;
  padding: 5px 11px;
  color: #fff;
  font-size: 22px;
  font-style: normal;
}

.label-c1 { bottom: 16%; left: 21%; background: var(--blue); }
.label-c2 { right: 16%; bottom: 20%; background: var(--orange); }
.label-c3 { top: 10%; right: 20%; background: var(--green); }

.cluster-examples b {
  color: var(--blue);
  font-size: 27px;
}

.cluster-examples span {
  border: 1px solid var(--line);
  font-size: 23px;
}

.kmeans-intro-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kmeans-intro-card header {
  display: grid;
  gap: 7px;
}

.kmeans-intro-card header span {
  color: var(--orange-dark);
  font-size: 24px;
}

.kmeans-intro-card > p {
  border-radius: 14px;
  padding: 15px;
  background: var(--orange-soft);
  color: var(--muted);
  font-size: 29px;
  text-align: center;
}

.kmeans-intro-card > p b {
  color: var(--orange-dark);
}

.kmeans-intro-steps {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kmeans-intro-steps li {
  display: flex;
  min-height: 0;
  align-items: center;
  gap: 14px;
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--orange-soft);
}

.kmeans-intro-steps li > span {
  background: #fff;
}

.kmeans-intro-steps div {
  display: grid;
  gap: 5px;
}

.kmeans-intro-steps b {
  font-size: 29px;
}

.kmeans-intro-steps small {
  color: var(--muted);
  font-size: 23px;
}

.kmeans-key {
  display: grid;
  grid-template-columns: auto 1fr auto auto 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 17px;
  background: #fff;
  color: var(--muted);
  font-size: 23px;
}

.kmeans-key strong {
  color: var(--orange-dark);
  font-size: 28px;
}

.kmeans-key i {
  color: var(--orange);
  font-size: 28px;
  font-style: normal;
}

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

/* 최종 공통 화면 기준: 색, 타이포그래피, 카드, 여백, 내비게이션 */
:root {
  --page: #f7fafc;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #5c6b7d;
  --line: #d7e0ea;
  --blue: #2563eb;
  --blue-sub: #4f7fca;
  --blue-badge: #eef5ff;
  --blue-soft: #f6f8fb;
  --orange: #f28c28;
  --orange-sub: #d98a3a;
  --orange-dark: #c66b0d;
  --orange-badge: #fff4e8;
  --orange-soft: #fbf8f6;
  --green: #159957;
  --green-sub: #3fa873;
  --green-badge: #ecf9f2;
  --green-soft: #f6fbf8;
  --danger: #c83449;
  --danger-soft: #fff0f2;
}

body {
  background: var(--page);
  color: var(--ink);
  font-size: 36px;
}

.deck {
  background: var(--paper);
}

.slide {
  padding: 52px;
  background: var(--paper);
}

.slide.active {
  gap: 16px;
}

.slide::before {
  height: 12px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--orange));
}

.unit {
  display: block;
  width: auto;
  min-width: 0;
  height: auto;
  margin-bottom: 6px;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font-size: 38px;
}

.page-ref {
  top: 4px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  background: #f6f8fb;
  color: var(--muted);
  font-size: 26px;
}

h1 {
  color: var(--ink);
  font-size: 82px;
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.3;
}

.subtitle strong {
  color: var(--blue);
}

.learning-card,
.model-process > article,
.split-panel,
.evaluation-notes article,
.regression-card,
.error-figure,
.metrics-panel,
.food-model-card,
.classification-core,
.algorithm-card,
.accuracy-panel,
.penguin-matrix-panel,
.cluster-concept-card,
.kmeans-intro-card {
  border: 2px solid var(--line);
  border-top: 10px solid var(--tone, var(--blue));
  border-radius: 8px;
  background: #fff;
}

.section-heading {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 12px;
}

.section-number,
.model-process article > span,
.algorithm-card header span,
.regression-card header > span,
.kmeans-intro-steps li > span {
  display: grid;
  width: 54px;
  min-width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--tone-soft);
  color: var(--tone-dark);
  font-size: 24px;
}

.slide h2 {
  color: var(--tone-dark, var(--blue));
  font-size: 64px !important;
  line-height: 1.05;
}

.learning-card > header,
.regression-card header,
.algorithm-card header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 0;
  padding: 0 0 14px;
  background: #fff;
}

.learning-card > header > span {
  display: grid;
  width: 54px;
  min-width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  background: var(--tone-soft);
  color: var(--tone-dark);
  font-size: 24px;
}

.learning-card > header > div,
.regression-card header > div {
  min-width: 0;
}

.learning-card > header h2 {
  font-size: 58px !important;
}

.learning-card > header p,
.regression-card header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.2;
}

.learning-card > header p b {
  color: var(--tone-dark);
}

.learning-card {
  gap: 18px;
  padding: 22px;
}

.type-pair {
  gap: 12px;
  padding: 0;
}

.type-pair section {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 7px 16px;
  border-radius: 8px;
  padding: 16px;
  background: var(--tone-soft);
}

.type-pair b {
  border-radius: 8px;
  color: var(--tone-dark);
  font-size: 48px;
}

.type-pair p {
  font-size: 36px;
  line-height: 1.15;
}

.type-pair em,
.type-pair small {
  font-size: 30px;
  line-height: 1.15;
}

.reinforcement-content {
  margin: 0;
  border-radius: 8px;
  padding: 16px;
}

.agent-node,
.environment-node {
  border-radius: 8px;
  font-size: 42px;
}

.action-path span,
.feedback-path span,
.reward-copy {
  font-size: 36px;
}

.examples span {
  border-radius: 8px;
  font-size: 30px;
}

.model-process {
  gap: 14px;
}

.model-process > article {
  gap: 14px;
  padding: 20px;
}

.model-process h2 {
  font-size: 52px !important;
}

.model-process article p {
  color: var(--muted);
  font-size: 36px;
  line-height: 1.22;
}

.stage-points {
  gap: 9px;
}

.stage-points b {
  border-radius: 8px;
  font-size: 30px;
}

.feedback-loop {
  border-radius: 8px;
  font-size: 36px;
}

.split-panel,
.evaluation-notes article,
.regression-card,
.error-figure,
.metrics-panel,
.food-model-card,
.classification-core,
.algorithm-card,
.accuracy-panel,
.penguin-matrix-panel,
.cluster-concept-card,
.kmeans-intro-card {
  padding: 22px;
}

.dataset-bar,
.split-flow section,
.score-compare span,
.folds,
.formula,
.variable-map span,
.variable-map strong,
.variable-map > b,
.metric-list section,
.metric-list section > span,
.metric-check,
.classification-goal,
.classification-examples,
.algorithm-card small,
.penguin-tree,
.logistic-curve,
.neighbor-vote,
.accuracy-formula,
.metric-tags span,
.penguin-matrix > *,
.cluster-definition,
.cluster-examples span,
.kmeans-intro-card > p,
.kmeans-intro-steps li,
.kmeans-key,
.term-strip section,
.boundary-types section {
  border-radius: 8px;
}

.split-flow p,
.evaluation-notes p,
.regression-card header p,
.metric-list p,
.classification-terms dd,
.algorithm-card > p,
.accuracy-panel > p,
.penguin-matrix-panel > p,
.cluster-definition p,
.kmeans-intro-card > p {
  color: var(--muted);
  font-size: 36px;
  line-height: 1.22;
}

.split-flow h3,
.metric-list h3,
.classification-goal strong,
.classification-terms dt,
.kmeans-intro-steps b {
  font-size: 44px;
  line-height: 1.1;
}

.score-compare span,
.folds span,
.formula,
.variable-map span,
.variable-map strong,
.variable-map > b,
.error-figure > p,
.metric-list em,
.metric-check,
.food-table th,
.food-table td,
.boundary-types b,
.boundary-types span,
.classification-goal span,
.classification-examples,
.algorithm-card small,
.accuracy-formula strong,
.accuracy-formula i,
.metric-tags span,
.penguin-matrix > *,
.matrix-key,
.axis-label-x,
.axis-label-y,
.cluster-examples,
.kmeans-intro-steps small,
.kmeans-key {
  font-size: 30px;
}

.term-strip h3 {
  font-size: 40px;
}

.term-strip p,
.axis-x,
.axis-y,
.chart-x,
.chart-y,
.music-label {
  font-size: 30px;
}

.classification-goal,
.kmeans-intro-card > p,
.kmeans-intro-steps li {
  background: var(--orange-soft);
}

/* 최종 소제목 색 위계: 영역 제목보다 한 단계 옅은 공통 색 */
.slide [data-tone] h3,
.slide [data-tone] dt {
  color: var(--tone-sub);
}

.type-pair b,
.type-pair small,
.learning-tag {
  color: var(--tone-sub);
}

.split-flow section:first-child h3,
.term-strip h3,
.error-terms b,
.boundary-types b,
.cluster-examples b {
  color: var(--blue-sub);
}

.split-flow section:last-child h3,
.metric-list section > span,
.r2-heading h3,
.r2-examples b,
.classification-goal span,
.classification-goal strong,
.classification-terms dt,
.classification-examples b,
.kmeans-intro-card header small,
.kmeans-intro-steps b,
.kmeans-key strong {
  color: var(--orange-sub);
}

/* 1쪽: 소제목은 색 영역 위에 직접 놓고 강화 학습의 흰 내부 카드를 제거 */
.learning-card .type-pair b {
  background: transparent;
}

.reinforcement-content .agent-node,
.reinforcement-content .environment-node {
  background: var(--green-badge);
}

.reinforcement-content .reward-copy {
  border: 0;
  padding: 0;
  background: transparent;
}

.reinforcement-content .examples {
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* 최종 적용: 영역 번호를 모든 페이지에서 제목 바로 옆에 고정 */
.slide .section-heading {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr);
  min-width: 0;
  min-height: 64px;
  align-items: start;
  column-gap: 12px;
}

.slide .section-heading > .section-number {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 5px;
}

.slide .section-heading > h2,
.slide .section-heading > div {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

/* 1쪽은 세 영역을 정확히 1:1:1로 유지하고 제목 태그의 잘림만 방지 */
.slide[data-slide="1"] .learning-branches {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.slide[data-slide="1"] .learning-card,
.slide[data-slide="1"] .learning-card > header > div,
.slide[data-slide="1"] .learning-title-row {
  min-width: 0;
}

.slide[data-slide="1"] .learning-title-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.slide[data-slide="1"] .learning-title-row h2 {
  min-width: 0;
  white-space: nowrap;
}

.slide[data-slide="1"] .learning-tag {
  max-width: 100%;
  padding: 6px 9px;
  font-size: 24px;
  letter-spacing: -0.5px;
}

/* 전 페이지 소제목은 공통 2단계 색을 사용 */
.slide [data-tone] h3,
.slide [data-tone] dt {
  color: var(--tone-sub);
}

.type-pair b,
.type-pair small,
.learning-tag {
  color: var(--tone-sub);
}

.split-flow section:first-child h3 {
  color: var(--blue-sub);
}

.split-flow section:last-child h3 {
  color: var(--orange-sub);
}

.term-strip h3 {
  color: var(--blue-sub);
}

.error-terms b {
  color: var(--blue-sub);
}

.metric-list section > span,
.r2-heading h3,
.r2-examples b {
  color: var(--orange-sub);
}

.boundary-types b {
  color: var(--blue-sub);
}

.classification-goal span,
.classification-goal strong,
.classification-terms dt,
.classification-examples b {
  color: var(--orange-sub);
}

.cluster-examples b {
  color: var(--blue-sub);
}

.kmeans-intro-card header small,
.kmeans-intro-steps b,
.kmeans-key strong {
  color: var(--orange-sub);
}

/* 1쪽 세부 구조: 소제목은 영역 배경에 직접 놓고 강화 학습은 별도 흰 카드 제거 */
.learning-card .type-pair b {
  background: transparent;
}

.reinforcement-content .agent-node,
.reinforcement-content .environment-node {
  background: var(--green-badge);
}

.reinforcement-content .reward-copy {
  border: 0;
  padding: 0;
  background: transparent;
}

.reinforcement-content .examples {
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* 영역 번호는 모든 페이지에서 제목 왼쪽에 같은 모양으로 배치 */
.section-heading {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
}

.section-heading > h2,
.section-heading > div {
  min-width: 0;
}

.section-heading .section-number {
  display: grid;
  width: 54px;
  min-width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--tone-badge);
  color: var(--tone-dark);
  font-size: 24px;
  line-height: 1;
}

.model-process > article {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.model-process .section-heading {
  align-items: flex-start;
}

.model-process .section-heading h2 {
  flex: 1;
}

.split-flow section {
  gap: 12px;
}

.split-flow section > span {
  display: none;
}

/* 1쪽 학습 조건은 제목 오른쪽의 스티커로 분리 */
.learning-card > header > div {
  flex: 1;
}

.learning-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.learning-title-row h2 {
  min-width: 0;
}

.learning-tag {
  flex: 0 0 auto;
  border: 2px solid var(--tone);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--tone-badge);
  color: var(--tone-dark);
  font-size: 26px;
  line-height: 1;
  white-space: nowrap;
}

.classification-examples,
.term-strip section,
.boundary-types section,
.penguin-tree,
.logistic-curve,
.neighbor-vote,
.cluster-examples span,
.kmeans-key {
  background: #fff;
}

.algorithm-card h2 {
  font-size: 54px !important;
}

.algorithm-card > p {
  font-size: 36px;
}

.algorithm-card small {
  font-size: 30px;
}

.classification-core > .section-heading,
.food-model-card > .section-heading,
.error-figure > .section-heading,
.metrics-panel > .section-heading,
.penguin-matrix-panel > .section-heading,
.cluster-concept-card > .section-heading {
  flex: 0 0 auto;
}

.metric-name {
  color: var(--blue);
  font-size: 64px !important;
  text-align: left;
}

.cluster-definition {
  grid-template-columns: 1fr;
  background: var(--blue-soft);
}

.kmeans-intro-card header.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kmeans-intro-card header small {
  color: var(--orange-dark);
  font-size: 30px;
}

.kmeans-intro-card h2 {
  font-size: 60px !important;
}

.nav-zone {
  width: 50px;
  min-width: 50px;
}

.nav-zone span {
  width: 30px;
  height: 30px;
  opacity: 0.28;
}

.nav-prev span {
  left: 20px;
}

.nav-next span {
  right: 20px;
}

.footer {
  right: 22px;
  bottom: 18px;
  left: 22px;
  gap: 18px;
}

.footer p {
  padding: 7px 12px;
  font-size: 16px;
}

/* 공통 위계: 활용·사례는 보조 라벨이 아니라 본문 예시이므로 36px */
.type-pair em,
.examples span,
.classification-examples,
.cluster-examples span {
  font-size: 36px;
}

/* 최종 글자 위계 — 전 페이지 공통 */
.unit {
  font-size: 38px;
}

.page-ref {
  font-size: 26px;
}

.slide h1 {
  font-size: 82px;
}

.slide .subtitle {
  font-size: 36px;
}

.slide h2,
.learning-card > header h2,
.model-process h2,
.algorithm-card h2,
.metric-name,
.kmeans-intro-card h2 {
  font-size: 64px !important;
  line-height: 1.05;
}

.type-pair b,
.split-flow h3,
.metric-list h3,
.classification-goal strong,
.classification-terms dt,
.term-strip h3,
.kmeans-intro-steps b {
  font-size: 56px;
  line-height: 1.08;
}

.learning-card > header p,
.type-pair p,
.type-pair em,
.type-pair small,
.reward-copy,
.examples span,
.model-process article p,
.stage-points b,
.feedback-loop,
.dataset-bar,
.split-flow p,
.model-node,
.evaluation-notes p,
.score-compare span,
.folds span,
.regression-card header p,
.formula,
.variable-map span,
.variable-map strong,
.variable-map > b,
.term-strip p,
.error-figure > p,
.metric-list p,
.metric-list em,
.metric-list section > span,
.metric-check,
.food-table th,
.food-table td,
.boundary-types b,
.boundary-types span,
.classification-goal span,
.classification-terms dd,
.classification-examples,
.algorithm-card > p,
.algorithm-card small,
.accuracy-formula strong,
.accuracy-formula i,
.accuracy-panel > p,
.metric-tags span,
.penguin-matrix-panel > p,
.penguin-matrix > *,
.matrix-key,
.cluster-definition p,
.cluster-examples b,
.cluster-examples span,
.kmeans-intro-card > p,
.kmeans-intro-steps small,
.kmeans-key,
.kmeans-key strong,
.kmeans-key i {
  font-size: 36px;
  line-height: 1.2;
}

/* 그래프·도식 보조 라벨만 30px */
.axis-x,
.axis-y,
.chart-x,
.chart-y,
.penguin-tree > b,
.penguin-tree > i,
.penguin-tree > strong,
.penguin-tree > em,
.logistic-curve > span,
.logistic-curve > i,
.logistic-curve > em,
.neighbor-vote > i,
.axis-label-x,
.axis-label-y,
.music-label {
  font-size: 30px;
}

/* 번호와 페이지 조작 요소는 공통 규격 유지 */
.section-number,
.learning-card > header > span,
.model-process article > span,
.regression-card header > span,
.algorithm-card header span,
.kmeans-intro-steps li > span {
  font-size: 24px;
}

.footer p {
  font-size: 16px;
}

/* 페이지별 주 영역 비율 */
.slide[data-slide="3"] .train-layout {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.slide[data-slide="4"] .regression-layout,
.slide[data-slide="5"] .metric-layout,
.slide[data-slide="6"] .classification-overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slide[data-slide="8"] .classification-evaluation {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

/* 5쪽: 교과서 97~98쪽의 오차 함수와 결정계수를 한 화면에 통합 */
.slide[data-slide="5"] .error-figure,
.slide[data-slide="5"] .metrics-panel {
  display: grid;
  min-height: 0;
  gap: 12px;
  padding: 18px;
}

.slide[data-slide="5"] .error-figure {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.slide[data-slide="5"] .metrics-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.slide[data-slide="5"] .error-figure .section-number {
  background: #eef5ff;
  color: var(--blue);
}

.slide[data-slide="5"] .metrics-panel .section-number {
  background: #fff4e8;
  color: #c66b0d;
}

.slide[data-slide="5"] .error-figure {
  border-top-color: var(--blue);
}

.slide[data-slide="5"] .metrics-panel {
  border-top-color: var(--orange);
}

.error-terms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.error-terms p {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #eef5ff;
}

.error-terms b {
  color: var(--blue);
  font-size: 36px;
}

.error-terms span {
  color: var(--muted);
  font-size: 30px;
  line-height: 1.15;
}

.slide[data-slide="5"] .residual-chart {
  min-height: 210px;
  margin-top: 0;
}

.slide[data-slide="5"] .metric-list {
  display: grid;
  flex: none;
  grid-template-rows: repeat(3, auto);
  gap: 8px;
}

.slide[data-slide="5"] .metric-list section {
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 12px;
}

.slide[data-slide="5"] .metric-list h3 {
  font-size: 38px;
}

.slide[data-slide="5"] .metric-list p {
  font-size: 30px;
}

.r2-summary {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 9px;
  border-radius: 8px;
  padding: 13px;
  background: #fff4e8;
}

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

.r2-heading h3 {
  color: #c66b0d;
  font-size: 44px;
}

.r2-heading strong {
  border-radius: 999px;
  padding: 6px 13px;
  background: #fff;
  color: #c66b0d;
  font-size: 30px;
}

.r2-summary > p {
  color: var(--muted);
  font-size: 30px;
  line-height: 1.18;
}

.r2-summary > p b {
  color: #c66b0d;
}

.r2-scale {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 23px;
  text-align: center;
}

.r2-scale i {
  border-radius: 5px;
  padding: 6px 3px;
  background: #fff;
  color: #c66b0d;
  font-style: normal;
}

.r2-examples {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.r2-examples p {
  display: grid;
  align-content: center;
  gap: 5px;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  text-align: center;
}

.r2-examples b {
  color: #c66b0d;
  font-size: 30px;
}

.r2-examples span {
  color: var(--muted);
  font-size: 27px;
  line-height: 1.15;
}

/* 공통 색 체계 — 번호 원, 내용 영역, 예시 영역을 전 페이지에서 분리 */
.slide [data-tone] {
  border-top-color: var(--tone);
  background: #fff;
}

.slide [data-tone] h2,
.slide [data-tone] h3,
.slide [data-tone] dt {
  color: var(--tone-dark);
}

.section-number,
.learning-card > header > span,
.model-process article > span,
.regression-card header > span,
.algorithm-card header span,
.kmeans-intro-steps li > span {
  background: var(--tone-badge);
  color: var(--tone-dark);
}

/* 1쪽 */
.learning-card > header,
.learning-card .type-pair b {
  background: #fff;
}

.learning-card .type-pair section {
  background: var(--tone-soft);
}

.reinforcement-content {
  background: var(--green-soft);
}

.reward-copy,
.examples span,
.agent-node,
.environment-node {
  background: #fff;
}

/* 2쪽 */
.model-process > article {
  background: #fff;
}

.model-process .stage-points b {
  background: var(--tone-soft);
}

/* 3쪽 */
.split-flow section:first-child {
  background: var(--blue-soft);
}

.split-flow section:last-child {
  background: var(--orange-soft);
}

.evaluation-notes article {
  background: #fff;
}

.score-compare span {
  background: var(--danger-soft);
}

.folds span {
  background: var(--green-soft);
}

.folds span:nth-child(3) {
  background: var(--green);
  color: #fff;
}

/* 4쪽 */
.regression-card header,
.term-strip section {
  background: #fff;
}

.simple-regression .formula {
  background: var(--blue-soft);
}

.multiple-regression .formula,
.multiple-regression .variable-map span,
.multiple-regression .variable-map strong,
.multiple-regression .variable-map > b {
  background: var(--orange-soft);
}

.term-strip section > b {
  background: var(--blue-badge);
}

/* 5쪽 */
.error-terms p {
  background: var(--blue-soft);
}

.metric-list section,
.r2-summary {
  background: var(--orange-soft);
}

.metric-list section > span,
.r2-heading strong,
.r2-scale i,
.r2-examples p {
  background: #fff;
}

.slide[data-slide="5"] .error-figure .section-number {
  background: var(--blue-badge);
  color: var(--blue);
}

.slide[data-slide="5"] .metrics-panel .section-number {
  background: var(--orange-badge);
  color: var(--orange-dark);
}

/* 6쪽 */
.food-table th,
.food-table td,
.boundary-types section,
.classification-examples {
  background: #fff;
}

.food-table thead tr:nth-child(2) th,
.food-table tbody td:last-child {
  background: var(--blue-soft);
}

.classification-goal {
  background: var(--orange-soft);
}

/* 7쪽 */
.algorithm-card header,
.penguin-tree,
.logistic-curve,
.neighbor-vote {
  background: #fff;
}

.algorithm-card small {
  background: var(--tone-soft);
}

.penguin-tree > strong {
  background: var(--blue-soft);
}

.penguin-tree > em {
  background: var(--orange-soft);
}

/* 8쪽 */
.accuracy-formula,
.metric-tags span {
  background: var(--blue-soft);
}

.penguin-matrix > b,
.penguin-matrix > strong,
.matrix-corner {
  background: #f5f7fa;
}

.penguin-matrix > em,
.matrix-key b {
  background: var(--green-soft);
}

.penguin-matrix > i,
.matrix-key i {
  background: var(--danger-soft);
}

/* 9쪽 */
.cluster-definition {
  background: var(--blue-soft);
}

.music-clusters,
.cluster-examples span,
.kmeans-key {
  background-color: #fff;
}

.kmeans-intro-card > p,
.kmeans-intro-steps li {
  background: var(--orange-soft);
}

/* 최종 적용: 모든 페이지의 소제목은 공통 2단계 색 */
.slide [data-tone] h3,
.slide [data-tone] dt {
  color: var(--tone-sub);
}

.type-pair b,
.type-pair small,
.learning-tag {
  color: var(--tone-sub);
}

.split-flow section:first-child h3,
.term-strip h3,
.error-terms b,
.boundary-types b,
.cluster-examples b {
  color: var(--blue-sub);
}

.split-flow section:last-child h3,
.metric-list section > span,
.r2-heading h3,
.r2-examples b,
.classification-goal span,
.classification-goal strong,
.classification-terms dt,
.classification-examples b,
.kmeans-intro-card header small,
.kmeans-intro-steps b,
.kmeans-key strong {
  color: var(--orange-sub);
}

/* 최종 적용: 1쪽의 소제목과 강화 학습 내용 */
.learning-card .type-pair b {
  background: transparent;
}

.reinforcement-content .agent-node,
.reinforcement-content .environment-node {
  background: var(--green-badge);
}

.reinforcement-content .reward-copy {
  border: 0;
  padding: 0;
  background: transparent;
}

.reinforcement-content .examples {
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

/* 최종 적용: 모든 영역 번호는 해당 제목 바로 옆 */
.slide .section-heading {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr);
  min-width: 0;
  min-height: 64px;
  align-items: start;
  column-gap: 12px;
}

.slide .section-heading > .section-number {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 5px;
}

.slide .section-heading > h2,
.slide .section-heading > div {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

/* 1쪽 세 영역은 정확히 1:1:1, 조건 태그는 제목 행 안에서 수축 */
.slide[data-slide="1"] .learning-branches {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.slide[data-slide="1"] .learning-card,
.slide[data-slide="1"] .learning-card > header > div,
.slide[data-slide="1"] .learning-title-row {
  min-width: 0;
}

.slide[data-slide="1"] .learning-title-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.slide[data-slide="1"] .learning-title-row h2 {
  min-width: 0;
  white-space: nowrap;
}

.slide[data-slide="1"] .learning-tag {
  max-width: 100%;
  padding: 6px 9px;
  font-size: 24px;
  letter-spacing: -0.5px;
}

/* 4쪽: 가운데 도식 영역을 줄여 아래 용어 설명이 잘리지 않게 확보 */
.slide[data-slide="4"] .regression-layout {
  grid-template-rows: minmax(0, 1fr) 200px;
}

.slide[data-slide="4"] .regression-card {
  gap: 10px;
  padding: 16px 20px;
}

.slide[data-slide="4"] .variable-map strong,
.slide[data-slide="4"] .variable-map > b {
  height: 104px;
}

.slide[data-slide="4"] .term-strip section {
  align-content: center;
}

/* 5쪽: 01 오차 함수에 MAE·MSE·RMSE를 포함하고 02는 결정계수로 분리 */
.slide[data-slide="5"] .error-figure {
  grid-template-rows: auto auto minmax(150px, 0.72fr) auto auto;
}

.slide[data-slide="5"] .metrics-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.slide[data-slide="5"] .error-figure .metric-list section {
  background: var(--blue-soft);
}

.slide[data-slide="5"] .error-figure .metric-list section > span {
  color: var(--blue-sub);
}

.slide[data-slide="5"] .metrics-panel .r2-summary {
  height: 100%;
  align-content: space-between;
}

/* 6쪽: 식품 분류 표의 특징 묶음과 타깃을 2:1로 고정 */
.slide[data-slide="6"] .food-table {
  table-layout: fixed;
}

.slide[data-slide="6"] .food-table col {
  width: 33.3333%;
}

/* 6쪽: 분류 핵심 개념의 용어와 설명을 30:70으로 배치 */
.slide[data-slide="6"] .classification-terms div {
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
}

/* 5쪽: 오차 함수와 결정계수를 위아래로 배치 */
.slide[data-slide="5"] .metric-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 16px;
}

.slide[data-slide="5"] .error-figure {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(130px, 1fr) auto;
  column-gap: 20px;
  row-gap: 8px;
}

.slide[data-slide="5"] .error-figure > .section-heading {
  grid-column: 1 / -1;
  grid-row: 1;
}

.slide[data-slide="5"] .error-figure > .error-terms {
  grid-column: 1;
  grid-row: 2;
}

.slide[data-slide="5"] .error-figure > .residual-chart {
  grid-column: 1;
  grid-row: 3;
  min-height: 130px;
}

.slide[data-slide="5"] .error-figure > p {
  grid-column: 1;
  grid-row: 4;
}

.slide[data-slide="5"] .error-figure > .metric-list {
  grid-column: 2;
  grid-row: 2 / 5;
}

.slide[data-slide="5"] .metrics-panel {
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.slide[data-slide="5"] .metrics-panel > .section-heading {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.slide[data-slide="5"] .metrics-panel > .r2-summary {
  grid-column: 2;
  grid-row: 1;
}

/* 5쪽 최종 비율: 오차 함수와 결정계수를 2열 2:1로 배치 */
.slide[data-slide="5"] .metric-layout {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.slide[data-slide="5"] .metrics-panel {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.slide[data-slide="5"] .metrics-panel > .section-heading {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.slide[data-slide="5"] .metrics-panel > .r2-summary {
  grid-column: 1;
  grid-row: 2;
}

.slide[data-slide="5"] .r2-examples {
  grid-template-columns: minmax(0, 1fr);
}

/* 5쪽: 오차 그래프의 점·회귀선·오차선을 같은 좌표계에 정렬 */
.slide[data-slide="5"] .residual-chart {
  position: relative;
  min-height: 150px;
  margin: 6px 24px 38px 62px;
  overflow: visible;
  border-bottom: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
  background: repeating-linear-gradient(0deg, transparent 0 48px, #e8edf3 49px 50px);
}

.slide[data-slide="5"] .regression-line {
  position: absolute;
  bottom: 14%;
  left: 5%;
  width: 90%;
  height: 5px;
  transform: rotate(-25deg);
  transform-origin: left center;
  border-radius: 999px;
  background: var(--orange);
}

.slide[data-slide="5"] .residual {
  position: absolute;
  bottom: 0;
  left: var(--x);
  width: 0;
  height: 100%;
}

.slide[data-slide="5"] .residual b {
  position: absolute;
  inset: auto;
  bottom: var(--actual);
  left: 0;
  width: 18px;
  height: 18px;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: var(--blue);
}

.slide[data-slide="5"] .residual em {
  position: absolute;
  top: auto;
  bottom: var(--predicted);
  left: -2px;
  width: 4px;
  height: calc(var(--actual) - var(--predicted));
  border-radius: 999px;
  background: var(--danger);
}

/* 5쪽: 결정계수는 사례 대신 범위별 의미를 직접 해석 */
.slide[data-slide="5"] .r2-summary {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.slide[data-slide="5"] .r2-scale,
.slide[data-slide="5"] .r2-examples {
  display: none;
}

.slide[data-slide="5"] .r2-interpretation {
  display: grid;
  min-height: 0;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.slide[data-slide="5"] .r2-interpretation p {
  display: grid;
  align-content: center;
  gap: 5px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.slide[data-slide="5"] .r2-interpretation b {
  color: var(--orange-sub);
  font-size: 36px;
}

.slide[data-slide="5"] .r2-interpretation span {
  color: var(--muted);
  font-size: 30px;
  line-height: 1.18;
}

/* 공통 기준: 그래프 레이블과 범례는 30px */
.slide[data-slide="5"] .error-figure > p {
  font-size: 30px;
}

/* 5쪽: 회귀선은 산점도의 중앙을 지나고 오차선은 회귀선과 실젯값을 정확히 연결 */
.slide[data-slide="5"] .regression-line {
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
  background: var(--orange);
  clip-path: polygon(5% 83.5%, 95% 23.5%, 95% 26.5%, 5% 86.5%);
  z-index: 1;
}

.slide[data-slide="5"] .residual {
  z-index: 2;
}

.slide[data-slide="5"] .residual b {
  z-index: 2;
}

.slide[data-slide="5"] .residual em {
  bottom: var(--low);
  height: var(--gap);
  z-index: 1;
}

/* 5쪽 그래프 범례: 실젯값과 오차는 두 줄, 회귀선 설명은 오른쪽 */
.slide[data-slide="5"] .error-figure > p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: repeat(2, auto);
  justify-content: start;
  gap: 2px 18px;
}

.slide[data-slide="5"] .error-figure > p > span {
  grid-column: 1;
  grid-row: 1;
}

.slide[data-slide="5"] .error-figure > p > i {
  grid-column: 1;
  grid-row: 2;
}

.slide[data-slide="5"] .error-figure > p > strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

/* 5쪽: 그래프의 세로축을 줄이고 범례를 기호·설명 2열, 3행으로 정리 */
.slide[data-slide="5"] .error-figure {
  grid-template-rows: auto auto 120px auto;
}

.slide[data-slide="5"] .error-figure > .residual-chart {
  min-height: 120px;
  height: 120px;
  max-height: 120px;
  align-self: center;
}

.slide[data-slide="5"] .error-figure > .graph-legend {
  grid-column: 1;
  grid-row: 4;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  align-content: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 6px 12px;
  font-size: 30px;
  line-height: 1.15;
}

.slide[data-slide="5"] .graph-legend i {
  font-style: normal;
  text-align: center;
}

.slide[data-slide="5"] .graph-legend i:nth-of-type(1),
.slide[data-slide="5"] .graph-legend i:nth-of-type(1) + span {
  color: var(--blue);
}

.slide[data-slide="5"] .graph-legend i:nth-of-type(2),
.slide[data-slide="5"] .graph-legend i:nth-of-type(2) + span {
  color: var(--danger);
}

.slide[data-slide="5"] .graph-legend i:nth-of-type(3),
.slide[data-slide="5"] .graph-legend i:nth-of-type(3) + span {
  color: var(--orange-dark);
}

/* 5쪽: 오차 함수 약어를 제목으로, 한글 명칭을 같은 줄의 설명으로 표시 */
.slide[data-slide="5"] .error-figure .metric-list section {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 6px;
}

.slide[data-slide="5"] .metric-name-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0;
}

.slide[data-slide="5"] .metric-name-row > b {
  flex: 0 0 auto;
  background: transparent;
  color: var(--blue-sub);
  font-size: 44px;
  line-height: 1;
}

.slide[data-slide="5"] .metric-name-row > span {
  min-width: 0;
  background: transparent;
  color: var(--muted);
  font-size: 32px;
  line-height: 1.1;
}

/* 5쪽: 그래프 높이는 유지하고 Y축 선의 상단만 한 줄만큼 자름 */
.slide[data-slide="5"] .error-figure {
  grid-template-rows: auto auto 150px auto;
}

.slide[data-slide="5"] .error-figure > .residual-chart {
  min-height: 150px;
  height: 150px;
  max-height: 150px;
  border-left: 0;
}

.slide[data-slide="5"] .residual-chart::before {
  position: absolute;
  top: 30px;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--ink);
  content: "";
}

/* 5쪽 최종 그래프 높이: 고정 축소를 취소하고 범례 한 줄만큼만 자연스럽게 확보 */
.slide[data-slide="5"] .error-figure {
  grid-template-rows: auto auto minmax(130px, 1fr) auto;
}

.slide[data-slide="5"] .error-figure > .residual-chart {
  min-height: 130px;
  height: auto;
  max-height: none;
  align-self: stretch;
  border-left: 4px solid var(--ink);
}

.slide[data-slide="5"] .residual-chart::before {
  display: none;
}

.slide[data-slide="5"] .residual em {
  width: 6px;
  left: -3px;
  z-index: 3;
}

.slide[data-slide="5"] .residual b {
  z-index: 4;
}

/* 5쪽: 오차 지표는 왼쪽 명칭·설명, 오른쪽 수식의 2열 구성 */
.slide[data-slide="5"] .error-figure .metric-list section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.slide[data-slide="5"] .metric-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.slide[data-slide="5"] .metric-name-row {
  display: grid;
  align-items: start;
  gap: 2px;
}

.slide[data-slide="5"] .metric-name-row > span {
  font-size: 30px;
}

.slide[data-slide="5"] .metric-copy > p {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.slide[data-slide="5"] .metric-equation {
  min-width: 0;
  background: transparent;
  color: var(--blue);
  font-size: 30px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.slide[data-slide="5"] .metric-equation math {
  display: block;
  margin: 0 auto;
  color: var(--blue);
  font-family: "Times New Roman", "STIX Two Math", serif;
  font-size: 40px;
}

/* 5쪽: 결정계수 범위와 해석을 좌우로 배치 */
.slide[data-slide="5"] .r2-interpretation p {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  column-gap: 0;
  justify-content: start;
}

.slide[data-slide="5"] .r2-interpretation span {
  text-align: left;
}

/* 5쪽 최종 글자 위계: 그래프 축·범례만 30px, 나머지 본문은 36px */
.slide[data-slide="5"] .error-terms span,
.slide[data-slide="5"] .metric-name-row > span,
.slide[data-slide="5"] .metric-copy > p,
.slide[data-slide="5"] .r2-heading > strong,
.slide[data-slide="5"] .r2-summary > p,
.slide[data-slide="5"] .r2-interpretation span {
  font-size: 36px;
}

/* 5쪽: 오차 지표의 약어·한글 명칭·정의를 색과 구분선으로 구별 */
.slide[data-slide="5"] .metric-name-row > b {
  color: var(--blue);
}

.slide[data-slide="5"] .metric-name-row > span {
  color: var(--blue-sub);
}

.slide[data-slide="5"] .metric-copy > p {
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
}

/* 3쪽: 교과서 p.94~95의 모델 선정·학습·평가 전체 구조 */
.slide[data-slide="3"] .model-learning-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.slide[data-slide="3"] .model-selection-card,
.slide[data-slide="3"] .model-training-card,
.slide[data-slide="3"] .model-evaluation-card {
  min-height: 0;
  border: 2px solid var(--line);
  border-top: 10px solid var(--tone);
  border-radius: 8px;
  background: #fff;
}

.slide[data-slide="3"] .model-selection-card {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
}

.slide[data-slide="3"] .model-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.slide[data-slide="3"] .model-options section {
  display: grid;
  align-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 12px;
  background: var(--blue-soft);
  text-align: center;
}

.slide[data-slide="3"] .model-options b {
  color: var(--blue-sub);
  font-size: 40px;
  line-height: 1.08;
}

.slide[data-slide="3"] .model-options span {
  color: var(--muted);
  font-size: 36px;
  line-height: 1.15;
}

.slide[data-slide="3"] .model-learning-bottom {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}

.slide[data-slide="3"] .model-training-card,
.slide[data-slide="3"] .model-evaluation-card {
  display: grid;
  min-height: 0;
  gap: 10px;
  padding: 16px 18px;
}

.slide[data-slide="3"] .model-training-card {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.slide[data-slide="3"] .training-definition,
.slide[data-slide="3"] .model-evaluation-card > p {
  color: var(--muted);
  font-size: 36px;
  line-height: 1.18;
}

.slide[data-slide="3"] .training-split {
  display: grid;
  grid-template-columns: auto auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.slide[data-slide="3"] .training-split > b,
.slide[data-slide="3"] .training-split section {
  display: grid;
  place-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--orange-soft);
  color: var(--orange-sub);
  font-size: 36px;
  text-align: center;
}

.slide[data-slide="3"] .training-split section span {
  color: var(--muted);
  font-size: 36px;
}

.slide[data-slide="3"] .training-split > i {
  color: var(--orange);
  font-size: 36px;
  font-style: normal;
}

.slide[data-slide="3"] .training-checks {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slide[data-slide="3"] .training-checks > section {
  display: grid;
  min-height: 0;
  align-content: space-between;
  gap: 8px;
  border-radius: 8px;
  padding: 12px;
  background: var(--orange-soft);
}

.slide[data-slide="3"] .training-checks h3 {
  color: var(--orange-sub);
  font-size: 44px;
  line-height: 1.05;
}

.slide[data-slide="3"] .training-checks p {
  color: var(--muted);
  font-size: 36px;
  line-height: 1.16;
}

.slide[data-slide="3"] .model-evaluation-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.slide[data-slide="3"] .evaluation-cases {
  display: grid;
  min-height: 0;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.slide[data-slide="3"] .evaluation-cases section {
  display: grid;
  align-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--green-soft);
}

.slide[data-slide="3"] .evaluation-cases b {
  color: var(--green-sub);
  font-size: 36px;
  line-height: 1.1;
}

.slide[data-slide="3"] .evaluation-cases span {
  color: var(--muted);
  font-size: 36px;
  line-height: 1.15;
}

/* 1쪽: 강화 학습 카드의 제목 태그와 초록 내용 영역 잘림 방지 */
.slide[data-slide="1"] .learning-title-row {
  grid-template-columns: max-content max-content;
  justify-content: start;
  gap: 6px;
}

.slide[data-slide="1"] .learning-card {
  box-sizing: border-box;
  padding-right: 18px;
}

.slide[data-slide="1"] .reinforcement-content,
.slide[data-slide="1"] .reinforcement-diagram {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.slide[data-slide="1"] .reinforcement-content {
  overflow: hidden;
}

.slide[data-slide="1"] .feedback-path {
  right: 5%;
}

.slide[data-slide="1"] .feedback-path span {
  right: -6px;
}

/* 3쪽: 모델명·데이터 분할 그림만 남긴 간결한 구성 */
.slide[data-slide="3"] .model-selection-card {
  grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
}

.slide[data-slide="3"] .model-options section {
  min-height: 82px;
}

.slide[data-slide="3"] .model-options b {
  font-size: 56px;
}

.slide[data-slide="3"] .model-training-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.slide[data-slide="3"] .dataset-picture {
  display: grid;
  min-height: 0;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.slide[data-slide="3"] .dataset-picture > b {
  color: var(--orange-sub);
  font-size: 36px;
  white-space: nowrap;
}

.slide[data-slide="3"] .dataset-picture > i {
  color: var(--orange);
  font-size: 44px;
  font-style: normal;
}

.slide[data-slide="3"] .dataset-picture-bar {
  display: grid;
  min-height: 150px;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.3fr);
  overflow: hidden;
  border: 2px solid var(--orange);
  border-radius: 8px;
}

.slide[data-slide="3"] .dataset-picture-bar section {
  display: grid;
  place-content: center;
  gap: 8px;
  background: var(--orange-soft);
  color: var(--orange-sub);
  font-size: 36px;
  text-align: center;
}

.slide[data-slide="3"] .dataset-picture-bar section + section {
  border-left: 3px solid #fff;
  background: var(--green-soft);
  color: var(--green-sub);
}

.slide[data-slide="3"] .dataset-picture-bar span {
  color: var(--muted);
  font-size: 36px;
}

.slide[data-slide="3"] .overfit-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--orange-soft);
  color: var(--muted);
  font-size: 36px;
  line-height: 1.15;
}

.slide[data-slide="3"] .overfit-note b {
  color: var(--orange-sub);
  font-size: 44px;
}

.slide[data-slide="3"] .model-evaluation-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.slide[data-slide="3"] .evaluation-diagrams {
  display: grid;
  min-height: 0;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.slide[data-slide="3"] .evaluation-diagrams section {
  display: grid;
  align-content: center;
  gap: 10px;
}

.slide[data-slide="3"] .evaluation-diagrams b {
  color: var(--green-sub);
  font-size: 36px;
}

.slide[data-slide="3"] .evaluation-bar {
  display: grid;
  min-height: 68px;
  overflow: hidden;
  border: 2px solid var(--green);
  border-radius: 8px;
}

.slide[data-slide="3"] .evaluation-bar.three {
  grid-template-columns: 0.55fr 0.2fr 0.25fr;
}

.slide[data-slide="3"] .evaluation-bar.two {
  grid-template-columns: 0.75fr 0.25fr;
}

.slide[data-slide="3"] .evaluation-bar.one {
  grid-template-columns: minmax(0, 1fr);
}

.slide[data-slide="3"] .evaluation-bar span {
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green-sub);
  font-size: 36px;
}

.slide[data-slide="3"] .evaluation-bar span + span {
  border-left: 3px solid #fff;
}

/* 5쪽: 수식 제거 후 명칭과 설명이 전체 너비를 사용 */
.slide[data-slide="5"] .error-figure .metric-list section {
  grid-template-columns: minmax(0, 1fr);
}

/* 1쪽 최종: 학습 조건 태그는 제목 행의 오른쪽 끝에 유지 */
.slide[data-slide="1"] .learning-title-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  justify-content: stretch;
  gap: 6px;
}

.slide[data-slide="1"] .learning-tag {
  justify-self: end;
}

.slide[data-slide="1"] .learning-card {
  padding-right: 14px;
  padding-left: 18px;
}

/* 5쪽: 실젯값·예측값 개별 설명 대신 오차 함수 정의를 제목 아래 배치 */
.slide[data-slide="5"] .error-figure > .error-definition {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  color: var(--muted);
  font-size: 36px;
  line-height: 1.2;
}

/* 5쪽: 오차 함수와 결정계수를 1:1로, 오차 그래프는 카드 전체 너비로 */
.slide[data-slide="5"] .metric-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slide[data-slide="5"] .error-figure {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(130px, 1fr) auto;
}

.slide[data-slide="5"] .error-figure > .section-heading,
.slide[data-slide="5"] .error-figure > .error-definition,
.slide[data-slide="5"] .error-figure > .residual-chart,
.slide[data-slide="5"] .error-figure > .graph-legend {
  grid-column: 1;
}

/* 1쪽: 예시 문구 너비와 무관하게 강화 학습 도식의 원래 위치 유지 */
.slide[data-slide="1"] .reinforcement-content > * {
  min-width: 0;
}

.slide[data-slide="1"] .feedback-path {
  right: 3%;
}

.slide[data-slide="1"] .feedback-path span {
  right: -16px;
}

/* 2쪽: 제목·설명 행 높이를 통일하고 세부 항목을 남은 영역에 균등 배치 */
.slide[data-slide="2"] .model-process > article {
  grid-template-rows: 142px 96px minmax(0, 1fr);
  align-content: stretch;
}

.slide[data-slide="2"] .model-process .section-heading {
  height: 142px;
  min-height: 142px;
  align-items: start;
}

.slide[data-slide="2"] .model-process > article > p {
  display: grid;
  height: 96px;
  align-content: start;
  margin: 0;
}

.slide[data-slide="2"] .stage-points {
  height: 100%;
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
}

.slide[data-slide="2"] .stage-points b {
  min-height: 0;
  height: 100%;
}

/* 3쪽: 과적합과 교차 검증은 02 모델 학습 영역에 함께 배치 */
.slide[data-slide="3"] .training-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slide[data-slide="3"] .training-notes > p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0;
  border-radius: 8px;
  padding: 12px;
  background: var(--orange-soft);
  color: var(--muted);
  font-size: 36px;
  line-height: 1.15;
}

.slide[data-slide="3"] .training-notes b {
  color: var(--orange-sub);
  font-size: 44px;
  white-space: nowrap;
}

/* 3쪽 최종: 01·02·03을 3열 1:1:1로 배치 */
.slide[data-slide="3"] .model-learning-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
}

.slide[data-slide="3"] .model-selection-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.slide[data-slide="3"] .model-options {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.slide[data-slide="3"] .model-training-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.slide[data-slide="3"] .dataset-picture {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-items: stretch;
  gap: 6px;
}

.slide[data-slide="3"] .dataset-picture > b,
.slide[data-slide="3"] .dataset-picture > i {
  text-align: center;
}

.slide[data-slide="3"] .dataset-picture-bar {
  width: 100%;
  min-height: 120px;
}

.slide[data-slide="3"] .training-notes {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.slide[data-slide="3"] .training-notes > p {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

/* 4쪽: 산점도의 최소제곱 추세에 맞춘 해상도 독립 회귀선 */
.slide[data-slide="4"] .mini-chart .trend-line {
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
  transform-origin: initial;
  background: var(--orange);
  clip-path: polygon(5% 87%, 92% 7.9%, 92% 10.9%, 5% 90%);
  z-index: 1;
}

.slide[data-slide="4"] .mini-chart > b {
  z-index: 2;
}

/* 3쪽: 훈련·테스트 데이터를 6:4, 같은 노랑 계열로 표현 */
.slide[data-slide="3"] .dataset-picture-bar {
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 0.4fr);
}

.slide[data-slide="3"] .dataset-picture-bar section + section {
  border-left-color: var(--orange);
  background: var(--orange-badge);
  color: var(--orange-dark);
}

.slide[data-slide="3"] .dataset-picture {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 6px;
}

.slide[data-slide="3"] .dataset-action-labels {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 0.4fr);
  color: var(--orange-sub);
  font-size: 36px;
  text-align: center;
}

.slide[data-slide="3"] .dataset-picture-bar {
  min-height: 60px;
  height: 60px;
}

/* 3쪽 모델 평가: 분할선은 테두리색, 영역은 같은 초록 계열의 명도로 구분 */
.slide[data-slide="3"] .evaluation-bar span + span {
  border-left-color: var(--green);
}

.slide[data-slide="3"] .evaluation-bar span:nth-child(1) {
  background: var(--green-soft);
}

.slide[data-slide="3"] .evaluation-bar span:nth-child(2) {
  background: var(--green-badge);
}

.slide[data-slide="3"] .evaluation-bar span:nth-child(3) {
  background: #dff4e8;
  color: var(--green);
}
