.cd-is-open { overflow: hidden; }
.course-detail {
  --cd-ink: #17382e;
  --cd-green: #164d3b;
  --cd-line: #dce5df;
  --cd-muted: #52675d;
  position: fixed;
  inset: 0;
  padding: 0;
  border: 1px solid #d4dfd7;
  border-radius: 20px;
  margin: auto;
  width: min(1140px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  background: white;
  color: var(--cd-ink);
  font: inherit;
  text-align: left;
  box-shadow: 0 30px 110px #09251944;
}
.course-detail:not([open]), .course-detail [hidden] { display: none; }
.course-detail::backdrop { background: #12291fe0; }
.course-detail *, .course-detail { box-sizing: border-box; }
.course-detail :is(h2,h3,p,ul) { margin: 0; }
.course-detail :is(button,a,select) { font: inherit; }
.course-detail button { cursor: pointer; }
.course-detail :is(button,a,select):focus-visible { outline: 3px solid #729426; outline-offset: 2px; }
.course-detail svg { display: block; width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.cd-header { position: relative; padding: 26px 76px 23px 32px; border-bottom: 1px solid var(--cd-line); }
.cd-path { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; color: var(--cd-muted); font-size: .875rem; }
.cd-series, .cd-sample { padding: 3px 9px; border-radius: 6px; line-height: 1.45; }
.cd-series { background: #e7f0e9; color: var(--cd-green); font-weight: 650; }
.cd-sample { background: #f3f4d4; color: #4d542d; }
.cd-path-text { overflow-wrap: anywhere; }
.cd-header h2 { margin-top: 12px; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.35; font-weight: 700; letter-spacing: -.035em; }
.cd-header .cd-subtitle { margin-top: 6px; color: var(--cd-muted); font-size: 1rem; line-height: 1.6; }
.cd-header > .cd-icon-button { position: absolute; right: 23px; top: 21px; }
.cd-icon-button {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--cd-line);
  color: var(--cd-ink); background: white; border-radius: 50%; transition: background .15s ease;
}
.cd-icon-button:hover:enabled { background: #edf4ee; }
.cd-icon-button:disabled { cursor: default; opacity: .35; }
.cd-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(215px, 27%); gap: 28px; padding: 24px 32px 32px; }
.cd-viewer, .cd-files { min-width: 0; }
.cd-section-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cd-section-bar h3 { font-size: 1.08rem; font-weight: 680; line-height: 1.5; color: var(--cd-ink); }
.cd-page-status,.cd-file-count { color: var(--cd-muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.cd-stage { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: #edf1ed; border-radius: 10px; border: 1px solid var(--cd-line); }
.cd-full-slide { grid-area: 1 / 1; display: block; object-fit: contain; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.cd-stage .cd-image-error { grid-area: 1 / 1; }
.cd-image-error { text-align: center; padding: 20px; color: var(--cd-muted); }
.cd-controls { margin: 14px 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.cd-controls .cd-icon-button { width: 38px; height: 38px; }
.cd-page-select {
  appearance: none; min-height: 38px; padding: 6px 30px 6px 13px; border: 1px solid var(--cd-line); border-radius: 7px;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23164d3b' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--cd-ink); cursor: pointer;
}
.cd-strip { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; scrollbar-color: #b5c5bb transparent; }
.cd-thumb {
  position: relative; flex: 0 0 79px; padding: 0; height: 47px; overflow: hidden; display: block;
  background: #edf1ed; border: 2px solid transparent; border-radius: 5px; box-shadow: 0 0 0 1px var(--cd-line);
}
.cd-thumb[aria-current="page"] { border-color: white; box-shadow: 0 0 0 2px var(--cd-green); }
.cd-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cd-thumb span { position: absolute; bottom: 0; right: 0; min-width: 16px; padding: 0 3px; border-radius: 3px 0 0 0; font-size: .75rem; color: white; background: #12291fe6; }
.cd-files { border-left: 1px solid var(--cd-line); padding-left: 24px; }
.cd-file-list { padding: 0; list-style: none; }
.cd-file { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: start; padding: 14px 0; border-top: 1px solid var(--cd-line); }
.cd-file-icon { color: var(--cd-green); padding-top: 2px; }
.cd-file-name { font-size: .94rem; line-height: 1.6; overflow-wrap: anywhere; }
.cd-download { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 13px; margin-top: 4px; border-radius: 8px; text-decoration: none; background: var(--cd-green); color: white; font-weight: 600; }
.cd-download:hover { color: white; background: #0e3d2d; }
.cd-download svg { width: 17px; height: 17px; }
.cd-files .cd-note { color: var(--cd-muted); font-size: .875rem; line-height: 1.65; margin-top: 8px; }
@media (max-width: 760px) {
  .course-detail { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 15px; }
  .cd-header { padding: 20px 61px 17px 18px; }
  .cd-header > .cd-icon-button { top: 14px; right: 12px; }
  .cd-body { grid-template-columns: 1fr; padding: 18px; gap: 20px; }
  .cd-files { padding: 16px 0 0; border: none; border-top: 1px solid var(--cd-line); }
  .cd-thumb { flex-basis: 68px; height: 42px; }
  .cd-path-text { width: 100%; }
  .cd-download { justify-self: start; }
}
