/* ObsiKO 튜토리얼 전용 — 목록(/tutorials/: 학습 경로·필터·카드)과 본문(단계 레일·완료 표시)
   공용 토큰·상단바·본문 타이포그래피는 kb.css. 원본은 이 파일 — build-tutorials.py 는 링크만 건다. */

/* ═════════════════════ 목록 ═════════════════════ */
.kb-thub {
  padding-top: calc(var(--top-h) + var(--top-gap))
}

.th-hero {
  position: relative;
  isolation: isolate;
  width: min(var(--maxw), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  min-height: min(640px, 80vh);
  padding: 36px 0 24px
}

.th-sky {
  position: absolute;
  inset: -40px calc(50% - 50vw) 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(34% 50% at 76% 50%, rgba(230, 162, 74, .13), transparent 70%),
    radial-gradient(30% 40% at 12% 26%, rgba(63, 185, 143, .09), transparent 72%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent)
}

.th-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  margin: 0 0 20px;
  text-wrap: balance
}

.th-title em {
  font-style: normal;
  color: var(--gold)
}

.th-lede {
  margin: 0 0 26px;
  max-width: 44ch;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.14rem);
  line-height: 1.7
}

.th-lede strong {
  color: var(--text)
}

.th-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0 0 30px
}

.th-stats span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: .92rem
}

.th-stats b {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums
}

.th-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

/* 떠다니는 썸네일 더미 — 진짜 앱 화면(튜토리얼 썸네일)만 쓴다 */
.th-deck {
  position: relative;
  height: 470px;
  translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -10px);
  transition: translate .9s var(--flow)
}

.th-deck img {
  position: absolute;
  width: 50%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 244, 230, .16);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .95), 0 0 50px -30px rgba(230, 162, 74, .3);
  background: var(--surface);
  rotate: var(--r, 0deg);
  animation: thFloat var(--fd, 9s) ease-in-out infinite alternate;
  animation-delay: var(--fdl, 0s);
  transition: rotate .6s var(--flow), scale .6s var(--flow), margin .6s var(--flow), filter .4s
}

.th-deck img:nth-child(1) {
  left: 0;
  top: 7%;
  --r: -7deg;
  --fd: 10s;
  z-index: 1
}

.th-deck img:nth-child(2) {
  right: 0;
  top: 0;
  --r: 6deg;
  --fd: 12s;
  --fdl: -3s;
  z-index: 1
}

.th-deck img:nth-child(3) {
  left: 15%;
  top: 22%;
  width: 68%;
  --r: -1.5deg;
  --fd: 11s;
  --fdl: -6s;
  z-index: 3;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 1), 0 0 80px -30px rgba(230, 162, 74, .38)
}

.th-deck img:nth-child(4) {
  left: 1%;
  bottom: 0;
  width: 40%;
  --r: 5deg;
  --fd: 13s;
  --fdl: -2s;
  z-index: 4
}

.th-deck img:nth-child(5) {
  right: 3%;
  bottom: 4%;
  width: 40%;
  --r: -4deg;
  --fd: 9s;
  --fdl: -5s;
  z-index: 4
}

/* 올리면 부채꼴로 살짝 펼친다(뒤 카드는 바깥으로, 앞 카드는 앞으로) */
@media (hover: hover) {
  .th-deck:hover img:nth-child(1) {
    rotate: -11deg;
    margin: -10px 0 0 -18px
  }

  .th-deck:hover img:nth-child(2) {
    rotate: 10deg;
    margin: -14px -18px 0 0
  }

  .th-deck:hover img:nth-child(3) {
    rotate: 0deg;
    scale: 1.04
  }

  .th-deck:hover img:nth-child(4) {
    rotate: 8deg;
    margin: 0 0 -12px -14px
  }

  .th-deck:hover img:nth-child(5) {
    rotate: -7deg;
    margin: 0 -14px -14px 0
  }
}

@keyframes thFloat {
  from {
    translate: 0 0
  }

  to {
    translate: 0 -14px
  }
}

/* ── 섹션 공통 ── */
.th-sec {
  width: min(var(--maxw), calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 0
}

.th-sec-head {
  margin-bottom: 26px
}

/* ── 처음이라면 — 별자리 길 ── */
.th-path {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px
}

.th-path-wrap {
  position: relative
}

.th-path-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 60px;
  pointer-events: none;
  overflow: visible
}

.th-path-line path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-dasharray: 3 6;
  opacity: .5
}

.th-path li {
  position: relative
}

.th-path a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--text)
}

.th-star {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 2px 0 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--gold-line);
  color: var(--faint);
  box-shadow: 0 0 0 6px var(--bg);
  transition: color .4s, background .4s, box-shadow .4s, transform .45s var(--spring)
}

.th-star .ic {
  width: 24px;
  height: 24px;
  transition: transform .6s var(--spring)
}

.th-star .no {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  font: 700 .72rem var(--font-sans)
}

.th-path li.is-done .th-star {
  color: var(--gold-ink);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 6px var(--bg), 0 0 34px -2px rgba(230, 162, 74, .7)
}

.th-path li.is-done .th-star .ic {
  fill: var(--gold-ink);
  transform: rotate(72deg)
}

.th-path a:hover .th-star {
  transform: translateY(-3px) scale(1.06);
  color: var(--gold)
}

.th-path-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .3s, transform .35s var(--ease), box-shadow .35s
}

.th-path-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .8s var(--flow)
}

.th-path-card .tx {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px
}

.th-path-card b {
  line-height: 1.4;
  font-size: .98rem
}

.th-path a:hover .th-path-card {
  border-color: var(--gold-line);
  transform: translateY(-3px);
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, .95)
}

.th-path a:hover .th-path-card img {
  transform: scale(1.05)
}

.th-path-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .88rem
}

.th-path-foot .cnt b {
  color: var(--gold);
  font-variant-numeric: tabular-nums
}

.th-reset {
  appearance: none;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  color: var(--faint);
  font-size: .84rem;
  text-decoration: underline;
  text-underline-offset: 3px
}

.th-reset:hover {
  color: var(--gold)
}

/* ── 필터 막대(끈적) ── */
.th-filter {
  position: sticky;
  top: calc(var(--top-h) + var(--top-gap) + 8px);
  z-index: 20;
  width: min(var(--maxw), calc(100% - 40px));
  margin: 54px auto 0;
  padding: 10px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--well) 92%, transparent);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px -26px rgba(0, 0, 0, .9);
  transition: border-color .3s, box-shadow .3s
}

.th-filter.stuck {
  border-color: var(--border-strong);
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .95)
}

.th-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px
}

.th-cats::-webkit-scrollbar {
  display: none
}

.th-f {
  appearance: none;
  cursor: pointer;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s
}

.th-f .ic {
  width: 16px;
  height: 16px
}

.th-f i {
  font-style: normal;
  font-size: .74rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums
}

.th-f:hover {
  color: var(--text);
  background: var(--surface)
}

.th-f[aria-pressed=true] {
  color: var(--gold);
  background: var(--gold-tint);
  border-color: color-mix(in srgb, var(--gold) 34%, transparent)
}

.th-f[aria-pressed=true] i {
  color: color-mix(in srgb, var(--gold) 70%, transparent)
}

.th-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
  padding: 8px 4px 2px;
  border-top: 1px solid var(--border)
}

.th-grp {
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.th-grp .lbl {
  margin: 0 6px 0 4px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--faint)
}

.th-grp .th-f {
  height: 32px;
  padding: 0 12px;
  font-size: .84rem
}

.th-count {
  margin-left: auto;
  color: var(--muted);
  font-size: .86rem;
  font-variant-numeric: tabular-nums
}

.th-count b {
  color: var(--text)
}

.th-clear {
  appearance: none;
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: .84rem;
  font-weight: 700;
  padding: 4px 6px
}

/* ── 분류 섹션·카드 ── */
.th-cat {
  width: min(var(--maxw), calc(100% - 40px));
  margin: 0 auto;
  padding-top: 52px;
  scroll-margin-top: calc(var(--top-h) + var(--top-gap) + 120px)
}

.th-cat-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -.02em
}

.th-cat-h .ti {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--gold-tint);
  color: var(--gold)
}

.th-cat-h .ti .ic {
  width: 20px;
  height: 20px
}

.th-cat-h .n {
  font: 700 .82rem var(--font-sans);
  color: var(--faint)
}

.th-cat-intro {
  margin: 4px 0 0;
  color: var(--muted);
  max-width: 70ch
}

.th-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 22px
}

.th-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--well)));
  color: var(--text);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s
}

.th-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 30px 56px -30px rgba(0, 0, 0, .95)
}

.th-card.th-in {
  animation: kbFadeUp .45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 30ms)
}

.th-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2)
}

.th-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--flow), filter .4s
}

.th-card:hover .th-thumb img {
  transform: scale(1.06)
}

.th-thumb::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(9, 13, 21, .55));
  pointer-events: none
}

.th-no {
  position: absolute;
  left: 12px;
  bottom: 8px;
  z-index: 1;
  font: 700 2.2rem/1 var(--font-display);
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
  letter-spacing: -.04em
}

.th-ph {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--faint)
}

.th-ph .ic {
  width: 34px;
  height: 34px
}

.th-done {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: none;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: .74rem;
  font-weight: 800;
  box-shadow: 0 6px 18px -6px rgba(230, 162, 74, .8)
}

.th-done .ic {
  width: 14px;
  height: 14px
}

.th-card.is-done .th-done {
  display: inline-flex
}

.th-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 14px 16px 16px
}

.th-k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700
}

.th-k .ic {
  width: 14px;
  height: 14px;
  color: var(--gold)
}

.th-t {
  font-size: 1.04rem;
  line-height: 1.4;
  letter-spacing: -.01em;
  transition: color .2s
}

.th-card:hover .th-t {
  color: var(--gold)
}

.th-d {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.th-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  font-size: .8rem
}

.th-meta>span {
  display: inline-flex;
  align-items: center;
  gap: 5px
}

.th-meta .ic {
  width: 14px;
  height: 14px;
  color: var(--faint)
}

/* 난이도 점 — 색만으로 말하지 않게 글자도 함께 */
.lv i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3)
}

.lv i:first-child {
  margin-left: 1px
}

.lv-easy i:nth-child(-n+1),
.lv-normal i:nth-child(-n+2),
.lv-challenge i:nth-child(-n+3) {
  background: var(--gold)
}

.th-ai {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-weight: 800;
  font-size: .72rem
}

.th-card[hidden],
.th-cat[hidden] {
  display: none !important
}

.th-empty {
  width: min(var(--maxw), calc(100% - 40px));
  margin: 60px auto 0;
  padding: 50px 20px;
  text-align: center;
  border-radius: 24px;
  border: 1px dashed var(--border-strong);
  color: var(--muted)
}

.th-empty b {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1.1rem
}

.th-empty .kb-btn {
  margin-top: 16px
}

@media (max-width: 1100px) {
  .th-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 48px
  }

  .th-deck {
    height: 380px;
    width: min(640px, 100%);
    margin: 0 auto
  }

  .th-path {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .th-path-line {
    display: none
  }
}

@media (max-width: 760px) {

  .th-hero,
  .th-sec,
  .th-filter,
  .th-cat,
  .th-empty {
    width: calc(100% - 32px)
  }

  .th-deck {
    height: 250px
  }

  .th-stats b {
    font-size: 1.6rem
  }

  .th-path {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px
  }

  .th-path a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    align-items: start
  }

  .th-star {
    margin: 0
  }

  .th-path-card {
    flex-direction: row
  }

  .th-path-card img {
    width: 38%;
    aspect-ratio: auto;
    height: auto;
    min-height: 100%
  }

  .th-filter {
    margin-top: 40px;
    border-radius: 18px;
    padding: 8px
  }

  .th-sub {
    gap: 8px
  }

  /* 위에 붙어 결과를 훑는 동안엔 분류 줄만 — 세 줄이면 폰 화면의 1/5을 가린다 */
  .th-filter.stuck .th-sub {
    display: none
  }

  .th-count {
    margin-left: 0
  }

  .th-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px
  }

  .th-d {
    display: none
  }

  .th-body {
    padding: 10px 12px 12px
  }

  .th-t {
    font-size: .94rem
  }

  .th-meta {
    font-size: .74rem;
    gap: 4px 8px
  }

  .th-meta .pf {
    display: none
  }
}

/* ═════════════════════ 본문 ═════════════════════ */
.tut-page {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: calc(var(--top-h) + var(--top-gap) + 30px);
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 56px;
  align-items: start
}

.tut-main {
  min-width: 0
}

.tut-article {
  max-width: 780px
}

/* 왼쪽 단계 레일 — 지금 읽는 단계 하나만 표시한다(스크롤로 '완료' 체크는 하지 않는다) */
.tut-rail {
  position: sticky;
  top: calc(var(--top-h) + var(--top-gap) + 30px);
  max-height: calc(100vh - var(--top-h) - var(--top-gap) - 50px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 20px;
  view-transition-name: tut-rail
}

.tut-rail-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint)
}

.tut-rail-h .ic {
  width: 14px;
  height: 14px;
  color: var(--gold)
}

.tut-steps {
  position: relative;
  display: grid;
  gap: 2px
}

.tut-steps::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--border-strong)
}

.tut-steps a {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 8px 6px 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
  transition: color .2s
}

.tut-steps .b {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font: 700 .76rem var(--font-sans);
  transition: background .3s, color .3s, border-color .3s, box-shadow .3s, transform .35s var(--spring)
}

.tut-steps .b .ic {
  width: 13px;
  height: 13px
}

.tut-steps a .t {
  padding-top: 3px
}

.tut-steps a:hover {
  color: var(--text)
}

.tut-steps a.past .b {
  border-color: var(--gold-line);
  color: var(--gold)
}

.tut-steps a.on {
  color: var(--text);
  font-weight: 700
}

.tut-steps a.on .b {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-ink);
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--bg), 0 0 20px -2px rgba(230, 162, 74, .7)
}

.tut-steps .kb-spy-ind {
  display: none
}

.tut-head {
  margin-bottom: 26px
}

.tut-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px
}

.tut-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-soft);
  font-size: .84rem;
  font-weight: 600
}

.tut-badge .ic {
  width: 15px;
  height: 15px;
  color: var(--muted)
}

.tut-badge.ai {
  border-color: var(--gold-line);
  color: var(--gold)
}

/* 시리즈 띠(웹소설 10편) */
.tut-series {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent)
}

.tut-series .lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: .86rem;
  font-weight: 700
}

.tut-series .lbl .ic {
  width: 16px;
  height: 16px;
  color: var(--gold)
}

.tut-series .lbl b {
  color: var(--gold)
}

.tut-series ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0
}

.tut-series li a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  transition: border-color .2s, color .2s, background .2s, transform .25s var(--spring)
}

.tut-series li a:hover {
  border-color: var(--gold-line);
  color: var(--text);
  transform: translateY(-2px)
}

.tut-series li a.done {
  background: var(--gold-tint);
  border-color: var(--gold-line);
  color: var(--gold)
}

.tut-series li a.cur {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-ink)
}

/* 내려받기 링크(예제 zip) — 본문 링크와 구분되게 알약 버튼으로 */
.tut-body a[href$=".zip"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--gold-tint);
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s var(--ease), background .2s
}

.tut-body a[href$=".zip"]::before {
  content: '↓'
}

.tut-body a[href$=".zip"]:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--gold) 22%, transparent)
}

/* 스샷 자리표시 (배포 전 0이어야 함) */
.shot-todo {
  margin: 16px 0;
  padding: 34px 18px;
  border-radius: 14px;
  border: 2px dashed var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: .9rem
}

/* 본문 — 단계는 카드처럼 끊어 읽히게 */
.tut-body>.kb-lead {
  margin-bottom: 1.4em
}

.tut-hero-shot {
  position: relative;
  margin: 1.2em 0 1.6em
}

.tut-hero-shot img {
  border-radius: 18px;
  padding-top: 26px;
  background:
    radial-gradient(circle at 16px 13px, #ff6159 3.5px, transparent 4.2px),
    radial-gradient(circle at 30px 13px, #ffbd2e 3.5px, transparent 4.2px),
    radial-gradient(circle at 44px 13px, #28c941 3.5px, transparent 4.2px),
    linear-gradient(#2a3446, #2a3446) top / 100% 26px no-repeat,
    var(--surface);
  box-shadow: 0 40px 80px -36px rgba(0, 0, 0, 1), 0 0 90px -36px rgba(230, 162, 74, .28)
}

.tut-prep {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent)
}

.tut-prep>strong:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold)
}

.tut-step {
  position: relative;
  margin: 2.6em 0 0;
  padding-top: 2em;
  border-top: 1px solid var(--border)
}

.tut-step>h2 {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 .9em;
  padding: 0;
  border: 0
}

.tut-no {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  margin-top: -4px;
  border-radius: 14px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font: 700 1.35rem/1 var(--font-display)
}

.tut-step>h2 .tx {
  padding-top: 6px
}

.tut-step>h2 .kb-anchor {
  top: 20px
}

.tut-sec {
  margin: 2.6em 0 0;
  padding-top: 2em;
  border-top: 1px solid var(--border)
}

.tut-sec>h2 {
  margin-top: 0;
  padding-top: 0;
  border: 0
}

/* 막혔을 때 — 눈에 띄는 도움 상자 */
.tut-sec.is-stuck {
  padding: 22px 24px 8px;
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  border-radius: 20px;
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(230, 162, 74, .08), transparent 60%),
    color-mix(in srgb, var(--surface) 70%, transparent)
}

.tut-sec.is-stuck>h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem
}

.tut-sec.is-stuck>h2 .sos {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--gold-tint);
  color: var(--gold)
}

.tut-sec.is-stuck>h2 .sos .ic {
  width: 17px;
  height: 17px
}

/* 다 했어요 */
.tut-done-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 22px;
  margin: 56px 0 0;
  padding: 24px 26px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(60% 140% at 100% 0%, rgba(230, 162, 74, .12), transparent 60%),
    linear-gradient(160deg, var(--surface), var(--well));
  overflow: visible;
  transition: border-color .4s, box-shadow .4s
}

.no-js .tut-done-card {
  display: none
}

.tdc-star {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  color: var(--faint);
  transition: background .45s, color .45s, box-shadow .45s, transform .6s var(--spring)
}

.tdc-star .ic {
  width: 26px;
  height: 26px
}

.tdc-tx b {
  display: block;
  font-size: 1.1rem;
  color: var(--text)
}

.tdc-tx p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6
}

.tdc-btn .on {
  display: none
}

.tut-done-card.is-done {
  border-color: var(--gold-line);
  box-shadow: 0 0 60px -30px rgba(230, 162, 74, .5)
}

.tut-done-card.is-done .tdc-star {
  background: var(--gold);
  color: var(--gold-ink);
  box-shadow: 0 0 40px -4px rgba(230, 162, 74, .8);
  transform: rotate(72deg)
}

.tut-done-card.is-done .tdc-star .ic {
  fill: var(--gold-ink)
}

.tut-done-card.is-done .tdc-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none
}

.tut-done-card.is-done .tdc-btn .off {
  display: none
}

.tut-done-card.is-done .tdc-btn .on {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.tdc-btn .off {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

/* 반짝 — 버튼 둘레로 별 조각이 퍼진다(감속 모드면 없음) */
.kb-sparkle {
  position: absolute;
  z-index: 3;
  width: 10px;
  height: 10px;
  pointer-events: none;
  color: var(--gold)
}

.kb-sparkle svg {
  width: 100%;
  height: 100%;
  fill: currentColor
}

.tut-next {
  margin: 22px 0 0
}

.tut-next .k {
  margin: 0 0 10px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint)
}

.tut-next a {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .3s, transform .3s var(--ease)
}

.tut-next a:hover {
  border-color: var(--gold-line);
  transform: translateY(-2px)
}

.tut-next img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  display: block
}

.tut-next b {
  display: block;
  font-size: 1.04rem;
  line-height: 1.4
}

.tut-next .d {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.55
}

.tut-next .go {
  margin-right: 10px;
  color: var(--gold)
}

.tut-next .go .ic {
  width: 22px;
  height: 22px;
  transition: transform .3s var(--spring)
}

.tut-next a:hover .go .ic {
  transform: translateX(4px)
}

.tut-pn {
  margin-top: 26px
}

/* 좁은 화면 — 지금 몇 단계인지 띠 하나(누르면 단계 목록) */
.tut-mbar {
  display: none
}

@media (max-width: 1100px) {
  .tut-page {
    grid-template-columns: minmax(0, 1fr);
    width: min(820px, calc(100% - 40px))
  }

  .tut-rail {
    display: none
  }

  .tut-mbar {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 100px);
    padding: 8px 16px 8px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: color-mix(in srgb, var(--surface-2) 96%, transparent);
    box-shadow: var(--shadow-pop);
    color: var(--text-soft);
    font-size: .86rem;
    transform: translate(-50%, 140%);
    transition: transform .4s var(--spring);
    cursor: pointer
  }

  .tut-mbar.show {
    transform: translate(-50%, 0)
  }

  .tut-mbar .n {
    display: grid;
    place-items: center;
    flex: none;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--gold-ink);
    font-weight: 800;
    font-size: .8rem
  }

  .tut-mbar .t {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
  }
}

@media (max-width: 760px) {
  .tut-page {
    width: calc(100% - 32px);
    padding-top: calc(var(--top-h) + var(--top-gap) + 22px)
  }

  .tut-done-card {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 20px
  }

  .tdc-btn {
    grid-column: 1 / -1;
    width: 100%
  }

  .tut-next a {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px
  }

  .tut-next .go {
    display: none
  }

  .tut-no {
    min-width: 40px;
    height: 40px;
    font-size: 1.15rem
  }
}
