/* HAM MEDIA Academy DESIGN.md v1.1 팔레트만 쓴다.
   색은 여섯 가지: 바탕 #F5F3EE, 종이 #F9F7F3, 글자 #1C1814, 보조 #4A423C, 헤어라인 #E6E1D9, 포인트 Signal Blue #7EB5E8.
   진한 파랑 #326B98은 글자·포커스용으로만. 초록·금색·빨강·네온·보라는 쓰지 않는다.
   글꼴은 Pretendard만 쓰고 대체 글꼴을 반드시 둔다. 음수 자간은 쓰지 않는다. */

@font-face{font-family:Pretendard;src:url("../../ham-media-archive/assets/fonts/Pretendard-Regular.otf") format("opentype");font-weight:400;font-display:swap}
@font-face{font-family:Pretendard;src:url("../../ham-media-archive/assets/fonts/Pretendard-Medium.otf") format("opentype");font-weight:600 900;font-display:swap}

:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --paper: #f9f7f3;
  --ink: #1c1814;
  --muted: #4a423c;
  --quiet: #4A423C;
  --line: #e6e1d9;
  --line-strong: #E6E1D9;
  --brand: #7eb5e8;
  --brand-deep: #326b98;
  --shadow: 0 10px 28px rgba(28, 24, 20, 0.08);
  --header-h: 116px;
  --header-main-h: 72px;
  --header-nav-h: 44px;
  --dock-h: 106px;
  --rail-w: 250px;
  --workbench-w: minmax(330px, 0.86fr);
  --sans: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }

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

.skip-link {
  position: fixed;
  z-index: 20;
  left: 18px;
  top: 12px;
  padding: 10px 16px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  height: var(--header-h);
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--workbench-w);
  grid-template-rows: var(--header-main-h) var(--header-nav-h);
  align-items: center;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px;
  color: var(--ink);
  text-decoration: none;
  border-right: 1px solid var(--line);
}

.brand span {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.brand strong {
  margin-top: -3px;
  font-size: 1.32rem;
  font-weight: 900;
}

.course-identity,
.course-status {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 0 34px;
}

.course-identity span,
.course-status span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.course-identity strong,
.course-status strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-status {
  justify-content: space-between;
  border-left: 1px solid var(--line);
}

.global-navigation {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
}

.global-navigation a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 4px;
}

.global-navigation a:hover,
.global-navigation a:focus-visible {
  color: var(--ink);
  background: var(--bg);
  text-decoration: underline;
  text-decoration-color: var(--brand-deep);
}

.global-navigation a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 3px;
}

.academy-event-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 10px 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.5;
}
.academy-event-banner[hidden] { display: none !important; }
.academy-event-banner span { color: var(--brand-deep); font-weight: 800; }
.academy-event-banner strong { font-weight: 600; }
.academy-event-banner a { margin-left: auto; color: var(--brand-deep); font-weight: 800; text-underline-offset: 4px; }

.course-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(500px, 1.7fr) var(--workbench-w);
  min-height: calc(100dvh - var(--header-h) - var(--dock-h));
}

.lesson-rail,
.artifact-workbench {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100dvh - var(--header-h) - var(--dock-h));
  overflow: auto;
}

.lesson-rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(249, 247, 243, 0.42);
}

.rail-heading {
  padding: 26px 26px 20px;
  border-bottom: 1px solid var(--line);
}

.rail-heading span,
.progress-label span {
  display: block;
  color: var(--quiet);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.rail-heading strong {
  display: block;
  margin-top: 5px;
  font-size: 0.98rem;
  font-weight: 600;
}

.lesson-navigation { padding: 10px 0; }

.lesson-nav-button {
  position: relative;
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 34px 1fr 20px;
  gap: 10px;
  align-items: center;
  padding: 12px 20px 12px 24px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(230, 225, 217, 0.72);
  transition: background 180ms ease, color 180ms ease;
}

.lesson-nav-button::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: transparent;
}

.lesson-nav-button:hover { background: rgba(255, 255, 255, 0.46); }
.lesson-nav-button[aria-current="true"] { background: rgba(126, 181, 232, 0.14); }
.lesson-nav-button[aria-current="true"]::before { background: var(--brand-deep); }

.lesson-number {
  font-size: 1.14rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.lesson-nav-copy { min-width: 0; }
.lesson-nav-copy strong,
.lesson-nav-copy span { display: block; }
.lesson-nav-copy strong { font-size: 0.84rem; }
.lesson-nav-copy span { margin-top: 3px; color: var(--quiet); font-size: 0.7rem; }

.lesson-complete-mark {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--brand-deep);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.67rem;
}

.lesson-nav-button.is-complete .lesson-complete-mark {
  color: var(--paper);
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.rail-progress {
  margin-top: auto;
  padding: 20px 24px 24px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-label strong { font-size: 0.68rem; }

.progress-track {
  height: 5px;
  margin: 10px 0 14px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--brand);
  transition: width 240ms ease;
}

.text-button {
  min-height: 44px;
  padding: 0;
  color: var(--brand-deep);
  background: transparent;
  border: 0;
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

.lesson-column {
  min-width: 0;
  padding: 48px clamp(28px, 4vw, 72px) 170px;
}

.lesson-header {
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow,
.stage-kicker {
  margin: 0 0 8px;
  color: var(--brand-deep);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.lesson-header h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.05rem, 4vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.18;
  text-wrap: balance;
}

.lesson-question {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 20px;
  color: var(--quiet);
  font-size: 0.7rem;
}

.lesson-meta span + span::before {
  margin-right: 18px;
  color: var(--line-strong);
  content: "/";
}

.stage-navigation {
  max-width: 820px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 26px auto 0;
  border-bottom: 1px solid var(--line);
}

.stage-nav-button {
  position: relative;
  min-height: 54px;
  padding: 8px 6px 12px;
  color: var(--quiet);
  background: transparent;
  border: 0;
  font-size: 0.68rem;
  font-weight: 700;
}

.stage-nav-button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  background: transparent;
}

.stage-nav-button:hover { color: var(--ink); }
.stage-nav-button[aria-current="step"] { color: var(--brand-deep); }
.stage-nav-button[aria-current="step"]::after { background: var(--brand); }
.stage-nav-button.is-done::before { margin-right: 5px; color: var(--brand-deep); content: "✓"; }

.lesson-stage {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 42px;
}

.stage-heading h2 {
  max-width: 26ch;
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.24;
  text-wrap: balance;
}

.stage-copy {
  max-width: 65ch;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.78;
}

.stage-copy p { margin: 0 0 12px; }

.stage-guide {
  color: var(--ink);
  font-weight: 600;
}

.hook-line {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
}

.truth-line {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.truth-line:last-child { border-bottom: 1px solid var(--line); }

.stage-block {
  margin: 22px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stage-block + .stage-block { margin-top: 0; border-top: 0; }
.stage-block-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}
.stage-block-prompt {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.stage-block-quote {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.7;
  white-space: pre-line;
}
.stage-block ul { margin: 0; padding-left: 1.1em; }
.stage-block li { margin: 0 0 6px; }
.stage-block-note { margin: 10px 0 0; font-size: 0.88rem; }
.truth-line strong { font-size: 0.76rem; }
.truth-line span { font-size: 1rem; }

.evidence-panel,
.student-work,
.result-stage {
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading-row h3,
.workbench-header h2,
.correction-sheet h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.32;
}

.section-heading-row h3 { font-size: 1.25rem; }

.evidence-viewer {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.media-frame {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.media-frame img,
.media-frame video {
  width: 100%;
  max-height: min(54vh, 560px);
  display: block;
  object-fit: contain;
  background: #1c1814;
}

.media-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  padding: 12px 15px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.7rem;
}

.media-caption strong { color: var(--ink); }

.video-transcript {
  padding: 16px 15px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.7;
}

.video-transcript strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; }
.video-transcript p { margin: 0; padding: 5px 0; border-top: 1px solid var(--line); }
.video-transcript p:first-of-type { border-top: 0; padding-top: 0; }

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

.gallery-grid .media-frame img { aspect-ratio: 16 / 10; }

.text-evidence {
  padding: 18px 0;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.text-evidence strong { display: block; font-size: 1.02rem; }
.text-evidence p { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }

.source-list {
  margin-top: 14px;
  padding: 16px 2px;
  color: var(--muted);
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
}

.source-item + .source-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.source-item strong,
.source-item span { display: block; }
.source-item span { margin-top: 3px; }

.work-fields { display: grid; gap: 28px; margin-top: 22px; }

.work-field,
.correction-sheet label {
  position: relative;
  display: block;
}

.work-field > span:first-child,
.correction-sheet label > span:first-child {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 600;
}

.work-field small {
  max-width: 68ch;
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

textarea {
  width: 100%;
  resize: vertical;
  padding: 15px 16px 30px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--muted);
  border-radius: 14px;
  line-height: 1.62;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea:hover { border-color: #326B98; }
textarea:focus { border-color: var(--brand-deep); box-shadow: 0 0 0 3px rgba(50, 107, 152, 0.12); outline: none; }

.character-count {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: var(--quiet);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.correction-sheet {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 24px 34px;
  padding: 24px 0;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.correction-sheet ul {
  grid-row: span 2;
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 0.77rem;
}

.correction-sheet li + li { margin-top: 8px; }
.correction-sheet label { grid-column: 1 / -1; }

.autosave-state,
.result-state,
.workbench-header > span {
  color: var(--brand-deep);
  font-size: 0.68rem;
  font-weight: 750;
}

.result-stage > p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.verification-list { display: grid; gap: 8px; margin-top: 18px; }

.verification-item {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.verification-item input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-deep); }

.next-lesson-copy {
  padding: 16px 0;
  color: var(--ink) !important;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lesson-next-door {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.lesson-next-door[hidden] { display: none; }

.lesson-next-door p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.lesson-next-door a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  color: var(--brand-deep);
  background: var(--paper);
  border: 1px solid var(--brand-deep);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.lesson-next-door a:hover { background: rgba(126, 181, 232, 0.14); }

.lesson-next-door small {
  display: block;
  margin-top: 10px;
  color: var(--quiet);
  font-size: 0.66rem;
}

.artifact-workbench {
  padding: 28px 28px 36px;
  background: rgba(249, 247, 243, 0.74);
  border-left: 1px solid var(--line);
}

.workbench-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.workbench-header h2 { max-width: 24ch; font-size: 1.08rem; }

.artifact-paper {
  position: relative;
  min-height: 420px;
  margin-top: 22px;
  padding: 40px 34px 28px;
  overflow: hidden;
  background: #F9F7F3;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.paper-kicker {
  margin: 0;
  color: var(--brand-deep);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.artifact-paper h3 {
  margin: 12px 0 0;
  padding-bottom: 14px;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  border-bottom: 2px solid var(--brand);
}

.paper-promise {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.paper-body {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.paper-body p { margin: 0 0 12px; }

.paper-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 36px;
  padding-top: 12px;
  color: var(--quiet);
  border-top: 1px solid var(--line);
  font-size: 0.64rem;
}

.artifact-history { margin: 24px 0 0; padding: 0; list-style: none; }

.artifact-history li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  color: var(--quiet);
  font-size: 0.7rem;
}

.history-dot {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.58rem;
}

.artifact-history li.is-current { color: var(--ink); font-weight: 750; }
.artifact-history li.is-complete .history-dot { color: var(--paper); background: var(--brand-deep); border-color: var(--brand-deep); }
.artifact-history small { font-size: 0.62rem; }

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 22px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  min-width: 210px;
  color: var(--ink);
  background: var(--brand);
  border: 1px solid var(--brand);
}

.primary-button:hover { background: #7EB5E8; border-color: #326B98; }
.secondary-button { color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); }
.secondary-button:hover { border-color: var(--brand-deep); }
.danger-button { color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); }
.danger-button:hover { border-color: var(--ink); }
.primary-button:active,
.secondary-button:active,
.danger-button:active { transform: translateY(1px) scale(0.985); }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.privacy-note { margin: 12px 3px 0; color: var(--quiet); font-size: 0.66rem; }

.course-dock {
  position: fixed;
  z-index: 9;
  right: 0;
  bottom: 0;
  left: var(--rail-w);
  min-height: var(--dock-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 18px 28px 18px 34px;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-top: 1px solid rgba(230, 225, 217, 0.9);
  box-shadow: 0 -10px 28px rgba(28, 24, 20, 0.08);
  backdrop-filter: blur(18px);
}

.dock-copy span,
.dock-copy strong,
.dock-copy small { display: block; }
.dock-copy span { color: var(--brand-deep); font-size: 0.66rem; font-weight: 800; }
.dock-copy strong { margin-top: 2px; font-size: 1rem; font-weight: 600; }
.dock-copy small { margin-top: 2px; color: var(--quiet); font-size: 0.68rem; }
.dock-actions { display: flex; gap: 8px; }

.reset-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(28, 24, 20, 0.2);
}

.reset-dialog::backdrop { background: rgba(28, 24, 20, 0.46); backdrop-filter: blur(4px); }
.reset-dialog form { padding: 30px; }
.reset-dialog h2 { margin: 0; font-size: 1.45rem; font-weight: 900; }
.reset-dialog p:not(.eyebrow) { color: var(--muted); font-size: 0.82rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  :root { --rail-w: 210px; }
  .site-header,
  .course-shell { grid-template-columns: var(--rail-w) minmax(470px, 1fr); }
  .site-header .course-status { display: none; }
  .artifact-workbench {
    position: relative;
    top: auto;
    grid-column: 2;
    height: auto;
    overflow: visible;
    border-top: 1px solid var(--line);
  }
  .lesson-rail { grid-row: 1 / span 2; height: calc(100dvh - var(--header-h) - var(--dock-h)); }
  .artifact-paper { min-height: 360px; }
}

@media (max-width: 760px) {
  :root { --header-h: 104px; --header-main-h: 58px; --header-nav-h: 46px; --dock-h: 118px; }
  .site-header { grid-template-columns: 1fr auto; }
  .brand { padding: 0 18px; border-right: 0; }
  .brand span { font-size: 0.58rem; }
  .brand strong { font-size: 1.12rem; }
  .global-navigation { justify-content: space-between; gap: 2px; padding: 0 10px; }
  .global-navigation a { min-height: 44px; padding: 0 8px; font-size: 0.7rem; }
  .course-identity { justify-content: flex-end; padding: 0 16px; }
  .course-identity span { display: none; }
  .course-identity strong { max-width: 18ch; font-size: 0.68rem; text-align: right; }
  .course-shell { display: block; }
  .lesson-rail {
    position: sticky;
    z-index: 8;
    top: var(--header-h);
    width: 100%;
    height: auto;
    display: block;
    overflow: hidden;
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }
  .rail-heading,
  .rail-progress { display: none; }
  .lesson-navigation {
    display: flex;
    overflow-x: auto;
    padding: 0 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .lesson-nav-button {
    width: 92px;
    min-width: 92px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    padding: 7px 5px;
    text-align: center;
    border-bottom: 0;
    scroll-snap-align: center;
  }
  .lesson-nav-button::before { inset: auto 8px 0; width: auto; height: 3px; }
  .lesson-number { font-size: 0.85rem; }
  .lesson-nav-copy strong { font-size: 0.64rem; }
  .lesson-nav-copy span,
  .lesson-complete-mark { display: none; }
  .lesson-column { padding: 30px 18px 150px; }
  .lesson-header { padding-bottom: 22px; }
  .lesson-header h1 { max-width: 18ch; font-size: clamp(1.7rem, 7.5vw, 2.4rem); }
  .lesson-question { margin-top: 14px; font-size: 0.92rem; }
  .lesson-meta { gap: 6px 10px; }
  .lesson-meta span + span::before { margin-right: 10px; }
  .stage-navigation {
    display: flex;
    overflow-x: auto;
    margin-top: 18px;
    scrollbar-width: thin;
  }
  .stage-nav-button { min-width: 104px; }
  .lesson-stage { padding-top: 30px; }
  .stage-heading h2 { max-width: 22ch; font-size: 1.55rem; }
  .truth-line { grid-template-columns: 72px 1fr; }
  .section-heading-row { align-items: flex-end; }
  .gallery-grid { grid-template-columns: 1fr; }
  .media-frame img,
  .media-frame video { max-height: 62vh; }
  .media-caption { display: block; }
  .media-caption span { display: block; margin-top: 3px; }
  .correction-sheet { display: block; padding: 20px 0; }
  .correction-sheet ul { margin: 18px 0; }
  .artifact-workbench { padding: 32px 18px 150px; border-left: 0; }
  .artifact-paper { padding: 34px 27px 24px; }
  .export-actions { grid-template-columns: 1fr; }
  .course-dock {
    left: 0;
    min-height: var(--dock-h);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .dock-copy { min-width: 0; }
  .dock-copy strong,
  .dock-copy small { max-width: 25ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock-actions .secondary-button { display: none; }
  .primary-button { min-width: 164px; min-height: 54px; padding-inline: 16px; }
}

@media (max-width: 390px) {
  .academy-event-banner { align-items: flex-start; gap: 2px 12px; padding: 8px 16px; font-size: 0.72rem; }
  .academy-event-banner strong { flex-basis: 100%; }
  .academy-event-banner a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 0; }
  .course-identity strong { max-width: 15ch; }
  .lesson-column { padding-inline: 16px; }
  .lesson-header h1 { font-size: 1.75rem; }
  .section-heading-row { display: block; }
  .section-heading-row > .text-button,
  .section-heading-row > .autosave-state,
  .section-heading-row > .result-state { margin-top: 8px; }
  .truth-line { grid-template-columns: 64px 1fr; }
  .course-dock { grid-template-columns: minmax(0, 1fr) auto; }
  .dock-copy small { display: none; }
  .primary-button { min-width: 148px; padding-inline: 13px; font-size: 0.73rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  .lesson-nav-button[aria-current="true"],
  .stage-nav-button[aria-current="step"],
  .primary-button { outline: 2px solid CanvasText; }
  .artifact-paper,
  .media-frame,
  .text-evidence { border: 1px solid CanvasText; }
}

@media print {
  .site-header,
  .lesson-rail,
  .stage-navigation,
  .course-dock,
  .text-button,
  .export-actions { display: none !important; }
  .course-shell { display: block; }
  .lesson-column,
  .artifact-workbench { padding: 20px; }
  .artifact-workbench { position: static; height: auto; border: 0; }
  .artifact-paper { box-shadow: none; break-inside: avoid; }
}

/* 1강의 대화 수업에만 적용. 다른 강의 배치·입력과 결과 작업대는 유지한다. */
.is-dialogue-lesson [hidden] { display: none !important; }
.is-dialogue-lesson .artifact-workbench { display: none; }
.is-dialogue-lesson .course-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.is-dialogue-lesson .lesson-column { width: min(100%, 1000px); margin-inline: auto; }
.is-dialogue-lesson .stage-copy { max-width: 760px; font-size: 18px; line-height: 1.85; }
.is-dialogue-lesson .stage-block { padding: 0; margin: 0 0 20px; border: 0; }
.is-dialogue-lesson .dialogue-section-title { margin: 34px 0 18px; font-size: 23px; line-height: 1.6; }
.is-dialogue-lesson .stage-block-quote { padding-left: 18px; border-left: 3px solid var(--brand); font-size: 19px; font-weight: 400; white-space: pre-wrap; }
.is-dialogue-lesson .dialogue-source-link { display: block; min-height: 44px; padding: 8px 0; color: var(--brand-deep); text-underline-offset: 4px; }
.is-dialogue-lesson .dialogue-table { overflow-x: auto; }
.is-dialogue-lesson .dialogue-table table { width: 100%; border-collapse: collapse; font-size: 17px; }
.is-dialogue-lesson .dialogue-table th, .is-dialogue-lesson .dialogue-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.is-dialogue-lesson .dialogue-work-fields { display: grid; gap: 28px; }
.is-dialogue-lesson textarea { font-size: 18px; line-height: 1.7; }
.is-dialogue-lesson .dialogue-recheck-notice { padding: 16px 0; border-block: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.is-dialogue-lesson .dialogue-edit-guidance { margin: -12px 0 8px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.7; }
.is-dialogue-lesson .dialogue-edit-guidance p { margin: 0 0 8px; }
.is-dialogue-lesson .dialogue-edit-button { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--brand-deep); text-align: left; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { .is-dialogue-lesson .course-shell { display: block; } }

/* 1강 처음 쓰는 사람 보완 (2026-10-20): AI와 오가는 순서·펼쳐 읽기·바로 가기·메모칸 안내 */
.is-dialogue-lesson .stage-block-steps { margin: 12px 0 0; padding-left: 1.4em; }
.is-dialogue-lesson .stage-block-steps li { margin: 0 0 10px; }
.is-dialogue-lesson .stage-block-steps li::marker { color: var(--brand-deep); font-weight: 750; }
.is-dialogue-lesson .stage-block-paragraph .stage-block-label { font-size: 17px; }
.is-dialogue-lesson .stage-block:has(> .stage-block-steps) { padding: 18px 18px 8px; border: 1px solid var(--line); border-left: 4px solid var(--brand-deep); background: var(--paper); }
.is-dialogue-lesson .stage-block:has(> .stage-block-steps) > .stage-block-label { font-size: 18px; line-height: 1.7; }
.is-dialogue-lesson .stage-block-details { padding: 0; border-block: 1px solid var(--line); }
.is-dialogue-lesson .stage-block-details + .stage-block-details { margin-top: -21px; border-top: 0; }
.is-dialogue-lesson .stage-block-details > summary { min-height: 52px; padding: 14px 0; color: var(--brand-deep); font-weight: 700; cursor: pointer; }
.is-dialogue-lesson .stage-block-details[open] > summary { margin-bottom: 8px; }
.is-dialogue-lesson .stage-block-details > .stage-block { padding-left: 4px; }
.is-dialogue-lesson .stage-block-jump { margin-top: 28px; }
.is-dialogue-lesson .stage-jump-button { width: 100%; max-width: 420px; min-height: 52px; }
.is-dialogue-lesson .student-work-note { margin: 4px 0 18px; color: var(--muted); font-size: 16px; line-height: 1.7; }
@media (max-width: 760px) {
  .is-dialogue-lesson .lesson-question,
  .is-dialogue-lesson .lesson-meta { display: none; }
  .is-dialogue-lesson .lesson-header h1 { font-size: 1.5rem; }
  .is-dialogue-lesson .stage-heading h2 { font-size: 1.35rem; }
}
