:root {
  --navy: #1e2a4a;
  --navy2: #2c3e63;
  --accent: #4f7cff;
  --bg: #f6f7f9;
  --panel: #fff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e6e8ec;
  --code-bg: #f3f4f6;
  --quote-bg: #f0f4ff;
  --quote-bd: #4f7cff;
  --sidebar-w: 320px;
}

* {
  box-sizing: border-box
}

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

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

.content small,
.doc-body small {
  font-size: 14px;
}

.layout {
  display: flex;
  height: 100vh;
  overflow: hidden
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--navy);
  color: #dfe5f2;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.brand {
  padding: 22px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .1)
}

.brand h1 {
  font-size: 17px;
  margin: 0 0 4px;
  color: #fff;
  letter-spacing: -.2px
}

.brand p {
  font-size: 14px;
  margin: 0;
  color: #9fb0d6
}

.brand h1 a { color: inherit; text-decoration: none; display: inline-block; border-radius: 4px; }
.brand h1 a:hover { color: #dce6ff; }
.brand h1 a:focus-visible { outline: 2px solid #a7c0ff; outline-offset: 5px; }

.main.is-cover .main-inner { max-width: none; height: 100%; min-height: 0; padding: 24px; display: flex; flex-direction: column; }
.main.is-cover .crumb { display: none; }
.main.is-cover .content { flex: 1; min-height: 320px; border: 0; padding: 0; box-shadow: none; background: transparent; }
.lecture-cover { display: flex; flex-direction: column; height: 100%; min-height: 320px; gap: 16px; }
.cover-toolbar { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.content .cover-toolbar h1 { font-size: 18px; line-height: 1.5; margin: 0; }
.cover-toolbar a { font-size: 14px; }
.slido-presentation { display: block; width: 100%; flex: 1; min-height: 280px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.main.is-cover .navbtns { flex-shrink: 0; margin-top: 16px; }
.main.is-cover .navbtns button { flex: 0 1 auto; margin-left: auto; }
.navbtns [hidden] { display: none; }
@media (max-width: 760px) {
  .main.is-cover .main-inner { padding: 64px 12px 20px; }
  .lecture-cover { gap: 12px; }
}

.search-wrap {
  padding: 14px 16px 10px
}

.search-wrap input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.search-wrap input::placeholder {
  color: #8fa0c8
}

.toc {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 24px
}

.toc-group-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #7e90bd;
  padding: 24px 12px 6px;
}

.toc a {
  display: block;
  padding: 8px 12px;
  margin-left: 16px;
  border-radius: 8px;
  color: #cdd6ec;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.toc a:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff
}

.toc a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600
}

.toc a.has-doc::after {
  content: "📑";
  font-size: 14px;
  margin-left: 6px;
  opacity: .8
}

.toc a.hidden {
  display: none
}

.toc-group.hidden {
  display: none
}

.main {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  scroll-behavior: smooth
}

.main-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 48px 120px
}

.crumb {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: .2px
}

.content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 34px 40px;
  box-shadow: 0 1px 3px rgba(20, 30, 60, .04)
}

.content h1 {
  font-size: 25px;
  margin: 0 0 18px;
  letter-spacing: -.3px;
  color: var(--navy)
}

.content h2 {
  font-size: 20px;
  margin: 26px 0 12px;
  color: var(--navy);
  letter-spacing: -.2px
}

.content h3 {
  font-size: 16px;
  margin: 22px 0 8px;
  color: var(--navy2)
}

.content p {
  margin: 10px 0
}

.content ul,
.content ol {
  margin: 10px 0;
  padding-left: 22px
}

.content li {
  margin: 5px 0
}

.content a {
  color: var(--accent);
  word-break: keep-all
}

.content strong {
  color: #11203f
}

.content em {
  color: #3a4a6b;
  font-style: normal;
  background: #eef2ff;
  padding: 0 4px;
  border-radius: 4px
}

.content blockquote {
  margin: 14px 0;
  padding: 14px 18px;
  background: var(--quote-bg);
  border-left: 4px solid var(--quote-bd);
  border-radius: 0 10px 10px 0;
  color: #23314f;
}

.content blockquote p {
  margin: 6px 0
}

.content blockquote h3 {
  margin: 6px 0;
  color: var(--navy)
}

.content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 14px;
  font-family: Consolas, Menlo, monospace
}

.content pre {
  background: #0f1729;
  color: #e3e9f7;
  padding: 18px 20px;
  border-radius: 10px;
  overflow-x: auto
}

.content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 14px;
  line-height: 1.65
}

.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 14px
}

.content th,
.content td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top
}

.content th {
  background: #eef1f7;
  color: var(--navy);
  font-weight: 700
}

.content tr:nth-child(even) td {
  background: #fafbfd
}

.navbtns {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px
}

.navbtns button {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--navy2);
  text-align: left;
  transition: border .12s, box-shadow .12s;
}

.navbtns button:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79, 124, 255, .12)
}

.navbtns button:disabled {
  opacity: .4;
  cursor: default
}

.navbtns button.next {
  text-align: right
}

.navbtns small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 2px
}

.detail-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 18;
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 30, 60, .28);
  transition: transform .12s, background .12s;
}

.detail-fab:hover {
  background: var(--accent);
  transform: translateY(-2px)
}

.detail-fab.show {
  display: inline-flex
}

.doc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, .42);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s
}

.doc-backdrop.open {
  opacity: 1;
  visibility: visible
}

.doc-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(760px, 92vw);
  z-index: 41;
  background: var(--panel);
  box-shadow: -8px 0 30px rgba(15, 20, 40, .18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22, .61, .36, 1);
  display: flex;
  flex-direction: column;
}

.doc-panel.open {
  transform: translateX(0)
}

.doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  color: #fff;
  flex: 0 0 auto;
}

.doc-head .label {
  font-size: 14px;
  color: #9fb0d6;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 2px
}

.doc-head h2 {
  margin: 0;
  font-size: 16px;
  color: #fff;
  line-height: 1.4
}

.doc-close {
  background: rgba(255, 255, 255, .12);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  flex: 0 0 auto
}

.doc-close:hover {
  background: rgba(255, 255, 255, .25)
}

.doc-body {
  overflow-y: auto;
  padding: 26px 30px 80px;
  flex: 1
}

.doc-body h1 {
  font-size: 23px;
  margin: 0 0 16px;
  color: var(--navy)
}

.doc-body h2 {
  font-size: 19px;
  margin: 26px 0 10px;
  color: var(--navy);
  padding-top: 10px;
  border-top: 1px solid var(--border)
}

.doc-body h2:first-of-type {
  border-top: none;
  padding-top: 0
}

.doc-body h3 {
  font-size: 15px;
  margin: 18px 0 6px;
  color: var(--navy2)
}

.doc-body h4 {
  font-size: 14px;
  margin: 14px 0 6px;
  color: var(--navy2)
}

.doc-body p {
  margin: 9px 0
}

.doc-body ul,
.doc-body ol {
  margin: 9px 0;
  padding-left: 20px
}

.doc-body li {
  margin: 4px 0
}

.doc-body a {
  color: var(--accent);
  word-break: keep-all
}

.doc-body strong {
  color: #11203f
}

.doc-body em {
  color: #3a4a6b;
  font-style: normal
}

.doc-body blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--quote-bg);
  border-left: 4px solid var(--quote-bd);
  border-radius: 0 8px 8px 0;
  color: #23314f
}

.doc-body code {
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 14px;
  font-family: Consolas, Menlo, monospace
}

.doc-body pre {
  background: #0f1729;
  color: #e3e9f7;
  padding: 16px 18px;
  border-radius: 9px;
  overflow-x: auto
}

.doc-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 14px;
  line-height: 1.6
}

.doc-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 14px
}

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

.doc-body th {
  background: #eef1f7;
  color: var(--navy);
  font-weight: 700
}

.doc-body tr:nth-child(even) td {
  background: #fafbfd
}

.menu-toggle {
  display: none
}

.comparison-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0
}
.comparison-controls strong {
  font-size: 14px;
  margin-right: 4px
}
.comparison-controls button {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--border);
  color: var(--navy);
  border-radius: 6px;
  cursor: pointer
}
.comparison-controls button[aria-pressed=true] {
  background: var(--navy);
  color: white
}
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}
.comparison-grid section {
  min-width: 0
}
.comparison-grid h3 {
  margin: 8px 0;
  font-size: 15px
}
.comparison-grid p {
  font-size: 14px;
  color: var(--muted);
  min-height: 40px
}
.comparison-grid iframe {
  width: 100%;
  height: 960px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff
}
.comparison-grid a {
  font-size: 14px
}
.content img {
  max-width: 100%;
  height: auto
}
@media(max-width:760px) {
  .comparison-grid {
    grid-template-columns: 1fr
  }
  .comparison-grid iframe {
    height: 820px
  }
}
@media (max-width:860px) {
  .menu-toggle {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 30;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  }

  .sidebar {
    position: fixed;
    z-index: 25;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform .22s
  }

  .sidebar.open {
    transform: translateX(0)
  }

  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 20
  }

  .backdrop.show {
    display: block
  }

  .main-inner {
    padding: 64px 18px 100px
  }

  .content {
    padding: 22px 18px
  }

  .detail-fab {
    right: 14px;
    bottom: 14px;
    padding: 11px 16px;
    font-size: 14px
  }

  .doc-body {
    padding: 20px 16px 70px
  }
}
    .doc-body { min-width: 0; }
    .guide-table-scroll { max-width: 100%; overflow-x: auto; margin-block: 16px; }
    .guide-table-scroll table { margin: 0; }
    .guide-table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .conversation-link { display: inline-block; font: inherit; font-weight: 600; line-height: 1.6; text-align: left; padding: 12px 16px; border-radius: 8px; border: 1px solid #d4ddea; background: #eef1f6; color: var(--navy); cursor: pointer; word-break: keep-all; }
    .conversation-link:hover { background: #dfe7f2; }
    .conversation-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

    .design-stages { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
    .design-stages button { padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--navy2); cursor: pointer; font-size: 14px; line-height: 1.5; text-align: left; }
    .design-stages button[aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
    .design-stages button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
    .demo-preview, .stage-preview, .baseline-preview { display: block; width: 100%; max-width: 480px; height: 920px; margin: 24px auto; border: 1px solid var(--border); border-radius: 12px; background: white; }
    .content .demo-controls { max-width: 480px; }
    .design-stage .stage-hint { font-size: 14px; color: var(--muted); }
    .main-inner:has(.baseline-preview) { max-width: 820px; }

    /* Reading rhythm for the lecture and expanded guides. */
.content,
.doc-body {
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  line-height: 1.85;
}

.content p,
.doc-body p {
  margin-block: 16px;
}

.content li,
.doc-body li {
  margin-block: 8px;
}

.content > h2,
.content > h3,
.doc-body > h2,
.doc-body > h3 {
  margin-top: 44px;
  margin-bottom: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}

.content > h3 {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 18px;
}

.content > h3:first-of-type {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

.content > hr,
.doc-body > hr {
  margin-block: 36px;
  border: 0;
  border-top: 1px solid var(--border);
}

.content a,
.doc-body a {
  color: var(--navy2);
  background: #eef1f6;
  border-radius: 4px;
  padding: 2px 5px;
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.content a:hover,
.doc-body a:hover {
  color: #14233e;
  background: #dfe7f2;
}

.content a:focus-visible,
.doc-body a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.content .resource-action,
.doc-body .resource-action {
  display: inline-block;
  margin: 3px 0;
  padding: 8px 12px;
  border: 1px solid #d4ddea;
  border-radius: 8px;
  background: #eef1f6;
  color: var(--navy2);
  font: inherit;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  word-break: keep-all;
  overflow-wrap: anywhere;
  box-decoration-break: slice;
}
.resource-action-hint {
  display: inline-block;
  margin-left: 10px;
  color: #526078;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}
.content .resource-action:hover,
.doc-body .resource-action:hover { background: #dfe7f2; }

.content pre,
.content pre code,
.doc-body pre,
.doc-body pre code {
  word-break: normal;
  overflow-wrap: normal;
}

@media (max-width: 760px) {
  .content > h2,
  .content > h3,
  .doc-body > h2,
  .doc-body > h3 {
    margin-top: 32px;
  }
}

/* Tables contain lecture content rather than auxiliary captions. */
.content table, .doc-body table {
  font-size: 16px;
}
/* Shared media panels keep lecture pages at the standard reading width. */
.preview-panel { margin: 24px 0; border: 1px solid var(--border); border-radius: 12px; background: #f3f5f9; overflow: hidden; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.preview-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.preview-toolbar button { font: inherit; min-height: 36px; padding: 6px 10px; border: 1px solid #c8d1df; border-radius: 6px; color: var(--navy); background: white; cursor: pointer; }
.preview-toolbar button[aria-pressed="true"] { background: var(--navy); color: white; }
.preview-toolbar output { min-width: 44px; text-align: center; font-size: 14px; }
.preview-toolbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview-viewport { height: 580px; max-height: 70vh; overflow: auto; padding: 12px; overscroll-behavior: contain; }
.preview-space { position: relative; margin: 0 auto; }
.preview-media { position: absolute; top: 0; left: 0; transform-origin: top left; }
.content .preview-media > img, .content .preview-media > iframe { display: block; max-width: none; margin: 0; border: 0; border-radius: 0; }
.preview-viewport.can-pan { cursor: grab; touch-action: none; user-select: none; }
.preview-viewport.can-pan .preview-media { pointer-events: none; }
.preview-viewport.is-dragging { cursor: grabbing; }
@media (max-width: 760px) {
  .preview-toolbar > span { width: 100%; }
  .preview-toolbar button { min-height: 40px; }
}
.preview-viewport { scrollbar-gutter: stable; }
/* Entry points and checkpoints follow each page's own task. */
.page-number { display: inline-block; margin-right: 6px; color: var(--muted); font-size: 16px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.practice-entry { margin: 24px 0 32px; padding: 20px; background: #f3f5f9; border-left: 3px solid #9cabc1; border-radius: 0 8px 8px 0; }
.content .practice-caption { margin: 12px 0 4px; font-size: 14px; font-weight: 600; color: #526078; }
.content .practice-entry > :first-child { margin-top: 0; }
.content .practice-context { margin: 0 0 12px; font-size: 16px; line-height: 1.8; }
.content .practice-phrase, .content .practice-followup { margin: 0; font-size: 16px; line-height: 1.8; }
.practice-check { margin: 32px 0; padding: 20px 0; border-block: 1px solid #d4ddea; }
.content .practice-check h3 { margin: 0 0 10px; font-size: 18px; }
.content .practice-check p { margin: 8px 0 0; }
.content .practice-question { font-weight: 600; }
.practice-check.is-decision { padding-inline: 20px; border-left: 3px solid #526a90; background: #f5f7fb; }
.content .practice-decision-note { font-size: 14px; color: #526078; }
.practice-details { margin: 24px 0; }
.practice-details > summary { cursor: pointer; color: #526078; font-size: 14px; font-weight: 600; padding: 12px 0; }
.practice-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) { .practice-entry { padding: 16px; } .practice-check.is-decision { padding-inline: 16px; } }
