/* SHIFT 제작 가이드 — support.css 위에 얹는 가이드 전용 규격.
   고객센터와 같은 무채색 유리 문법을 따른다(색으로 강조하지 않고 명도·굵기로만). */

/* .doc a(밑줄·굵기)를 탐색용 링크에서는 끈다 */
.doc .guide-tabs a,
.doc .guide-nav a,
.doc .guide-cards a,
.doc .guide-next .btn {
  text-decoration: none;
}

/* ── 가이드 묶음 탭(세계관챗 · 작품 연재 · 오디오북) ── */
.guide-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 30px;
  padding: 6px;
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.guide-tabs::-webkit-scrollbar {
  display: none;
}

.guide-tabs a {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 150px;
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--sub);
  transition: background 0.14s ease, color 0.14s ease;
}

.guide-tabs a strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.guide-tabs a span {
  color: var(--muted);
  font-size: 12px;
}

.guide-tabs a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.guide-tabs a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
}

.guide-tabs a[aria-current="page"] span {
  color: var(--sub);
}

/* ── 본문 + 왼쪽 목차 ─────────────────── */
.guide-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.guide-nav {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 12px 10px;
  border-radius: var(--radius);
  scrollbar-width: thin;
}

.guide-nav .g {
  margin: 12px 10px 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.guide-nav .g:first-child {
  margin-top: 2px;
}

.guide-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--sub);
  font-size: 13.4px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.14s ease, color 0.14s ease;
}

.guide-nav a.sub {
  padding-left: 20px;
  font-weight: 500;
  font-size: 13px;
}

.guide-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.guide-nav a.on {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 700;
}

.guide-nav a:focus-visible,
.guide-tabs a:focus-visible,
.guide-cards a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

/* ── 본문 글 ───────────────────────────── */
.guide-body {
  min-width: 0;
}

.guide-body > section {
  scroll-margin-top: 78px;
  padding-bottom: 14px;
}

.guide-body > section + section {
  margin-top: 26px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-body h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.35;
  text-wrap: balance;
}

.guide-body h2 + .where {
  margin-bottom: 14px;
}

.guide-body h3 {
  scroll-margin-top: 78px;
  margin: 30px 0 8px;
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.guide-body h4 {
  margin: 20px 0 6px;
  color: var(--text);
  font-size: 14.6px;
  font-weight: 700;
}

.guide-body p,
.guide-body li {
  max-width: 72ch;
  color: var(--sub);
  font-size: 14.8px;
  line-height: 1.8;
}

.guide-body p {
  margin: 0 0 10px;
}

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

.guide-body li {
  margin-bottom: 4px;
}

.guide-body b {
  color: var(--text);
  font-weight: 650;
}

.guide-body a {
  color: var(--text);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

/* 화면 위치 표시: 스튜디오 › 세계관챗 › 프롬프트 › 기본 */
.where {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.8px;
  font-weight: 600;
}

.where span + span::before {
  content: "›";
  margin-right: 6px;
  color: var(--muted);
  opacity: 0.7;
}

/* 칸 표: 칸 · 설명 · 한도 */
.fields-wrap {
  margin: 12px 0 16px;
  border-radius: var(--radius);
  overflow-x: auto;
}

table.fields {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
}

table.fields th,
table.fields td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.65;
}

table.fields thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

table.fields tbody tr:last-child th,
table.fields tbody tr:last-child td {
  border-bottom: 0;
}

table.fields tbody th {
  width: 24%;
  color: var(--text);
  font-weight: 650;
}

table.fields td {
  color: var(--sub);
}

table.fields td.lim {
  width: 18%;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 누가 읽는 칸인지 — AI만 / 화면만 / 둘 다 */
.who {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.02em;
  vertical-align: 1px;
  white-space: nowrap;
}

.who.ai {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
}

/* 팁·주의 */
.tip {
  margin: 14px 0 16px;
  padding: 15px 18px;
  border-radius: 14px;
}

.tip > :last-child {
  margin-bottom: 0;
}

.tip .tl {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.tip p,
.tip li {
  font-size: 14.2px;
}

/* 단계 목록 — 실제 순서가 있는 절차에만 쓴다 */
ol.steps {
  list-style: none;
  counter-reset: st;
  padding-left: 0;
}

ol.steps > li {
  position: relative;
  counter-increment: st;
  padding-left: 36px;
  margin-bottom: 10px;
}

ol.steps > li::before {
  content: counter(st);
  position: absolute;
  left: 0;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 짧은 낱말 묶음(관계 단계, 감정 태그 등) */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
  padding: 0;
  list-style: none;
}

.tags li {
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sub);
  font-size: 13px;
  line-height: 1.6;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-width: 2px;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 20px;
  text-align: center;
}

code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre.sample {
  margin: 10px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--sub);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* 편집 화면 탭 구조 그림 */
.tabmap {
  margin: 14px 0 18px;
  padding: 16px;
  border-radius: var(--radius);
}

.tabmap .row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tabmap .row:last-child {
  border-bottom: 0;
}

.tabmap .row b {
  font-size: 14px;
}

.tabmap .row .tags {
  margin: 0;
}

/* 가이드 시작 화면 카드 */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-cards a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: var(--radius);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.guide-cards a:hover {
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.guide-cards strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.guide-cards span {
  color: var(--sub);
  font-size: 13.6px;
  line-height: 1.6;
}

.guide-cards em {
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 12.4px;
  line-height: 1.6;
}

.guide-next {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

@media (max-width: 960px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .guide-nav {
    min-width: 0;
    position: sticky;
    top: 58px;
    z-index: 5;
    display: flex;
    gap: 4px;
    max-height: none;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    scrollbar-width: none;
  }

  .guide-nav::-webkit-scrollbar {
    display: none;
  }

  /* 본문 위에 떠 있는 가로 목차 — 아래 글이 비치지 않게 거의 불투명하게 */
  .guide-nav.glass-soft {
    background: rgba(16, 16, 22, 0.9);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
  }

  /* 제목으로 건너뛸 때 상단바(58)와 가로 목차(약 52) 아래에 멈추게 */
  .guide-body > section,
  .guide-body h3 {
    scroll-margin-top: 124px;
  }

  .guide-nav .g,
  .guide-nav a.sub {
    display: none;
  }

  .guide-nav a {
    flex: none;
    white-space: nowrap;
  }

  .guide-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .guide-tabs a {
    min-width: 128px;
    padding: 10px 12px;
  }

  .guide-body h2 {
    font-size: 19px;
  }

  .tabmap .row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* 칸 표는 휴대폰에서 줄마다 카드처럼 쌓는다(가로 스크롤 대신) */
  table.fields {
    min-width: 0;
  }

  table.fields thead {
    display: none;
  }

  table.fields tr {
    display: block;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  table.fields tbody tr:last-child {
    border-bottom: 0;
  }

  table.fields th,
  table.fields td,
  table.fields tbody th,
  table.fields td.lim {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }

  table.fields tbody th {
    margin-bottom: 4px;
  }

  table.fields td.lim {
    margin-top: 5px;
    white-space: normal;
  }
}

/* ── 따라 하기(캡처 + 번호 설명) ───────────────── */
.step {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin: 18px 0 34px;
}

.step.wide {
  grid-template-columns: minmax(0, 1fr);
}

.step.duo {
  grid-template-columns: minmax(0, 300px) minmax(0, 300px) minmax(0, 1fr);
}

.shot {
  margin: 0;
}

.shot a {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0b0e;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.6px;
  text-align: center;
}

.points {
  margin: 0;
  padding: 0;
  list-style: none;
}

.points li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  max-width: none;
  margin: 0 0 13px;
}

.points .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  background: #e51818;
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.points .n.plain {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.points b {
  color: var(--text);
}

.step-text > p:first-child {
  margin-top: 2px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin: 16px 0 26px;
}

.gallery .shot figcaption {
  font-size: 12.4px;
  color: var(--sub);
}

.lim {
  color: var(--muted);
  font-size: 12.6px;
  font-weight: 600;
  white-space: nowrap;
}

.example {
  display: inline-block;
  margin: 2px 0;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 13.4px;
}

@media (max-width: 960px) {
  .step,
  .step.duo {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .step .shot {
    max-width: 320px;
  }

  .step.duo .shot {
    max-width: 260px;
  }

  .step.wide .shot {
    max-width: none;
  }
}
