/*
 * olla.talk Docs — /docs, /docs/ko/
 * 랜딩과 같은 에디토리얼 톤(크림/코랄, Fraunces + Pretendard). ADR-014 에 따라
 * landing.css 와 CSS 런타임은 공유하지 않고 필요한 토큰만 복제한다.
 */
:root {
  color-scheme: light;
  --bg-cream: #F5F1E6;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --ink-mute: #8A8A82;
  --coral: #FF6B5C;
  --coral-soft: #FFE5E1;
  --coral-deep: #E8553F;
  --mint-soft: #EAF6EF;
  --line: rgba(26, 26, 26, 0.08);
  --line-strong: rgba(26, 26, 26, 0.15);
  --font-display: 'Fraunces', 'Pretendard', serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --header-h: 64px;
  --tocbar-h: 48px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg-cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--coral-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* 로그인 상태에 따른 CTA 분기 (landing.html 과 같은 계약) */
html[data-authed="1"] [data-cta-anon] { display: none !important; }
html:not([data-authed="1"]) [data-cta-authed] { display: none !important; }

/* ===== Header ===== */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--gutter);
  background: rgba(245, 241, 230, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.docs-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.docs-logo:hover { color: var(--ink); }
.docs-logo .dot { color: var(--coral); }
.docs-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}
.docs-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
}
.lang-switch a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}
.lang-switch a[aria-current="page"] { background: var(--ink); color: #fff; }
.header-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.header-cta:hover { background: var(--coral-deep); color: #fff; }

/* ===== Mobile TOC bar ===== */
.toc-bar { display: none; }

/* ===== Layout ===== */
.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
}

/* ===== Sidebar TOC ===== */
.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 16px;
}
.toc-title {
  margin: 0 0 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol > li { margin-bottom: 6px; }
.toc a {
  display: block;
  padding: 5px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: none;
}
.toc > ol > li > a { color: var(--ink); font-size: 14px; font-weight: 600; }
.toc ol ol a { padding-left: 24px; }
.toc a:hover { color: var(--ink); background: rgba(26, 26, 26, 0.04); }
.toc a.is-active {
  color: var(--coral-deep);
  border-left-color: var(--coral);
  background: var(--coral-soft);
}

/* ===== Content ===== */
.docs-content { min-width: 0; max-width: 760px; }

.docs-hero { margin-bottom: 8px; }
.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--coral-deep);
}
.docs-content h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.lead { margin: 0 0 28px; font-size: 18px; color: var(--ink-soft); }

.docs-section {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.docs-content h2 {
  margin: 28px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.docs-content h3 { margin: 40px 0 12px; font-size: 20px; font-weight: 700; line-height: 1.4; }
.docs-content h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 700; }
.docs-content p { margin: 0 0 14px; }
.docs-content ul,
.docs-content ol { margin: 0 0 16px; padding-left: 22px; }
.docs-content li { margin-bottom: 6px; }
.docs-content li > ul { margin: 6px 0 0; }

/* 화면에 보이는 버튼/메뉴 이름 */
.ui {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

/* 번호 단계 */
.steps { list-style: none; counter-reset: step; padding-left: 0 !important; }
.steps > li {
  position: relative;
  min-height: 28px;
  margin-bottom: 14px;
  padding-left: 42px;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 1px;
  left: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* 빠른 시작 */
.quickstart {
  margin: 0 0 8px;
  padding: 24px 24px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}
.quickstart h2 { margin-top: 0 !important; font-size: 22px !important; }

/* 안내 박스 */
.callout {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-size: 15px;
}
.callout > :last-child { margin-bottom: 0; }
.callout-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.callout-tip { background: var(--mint-soft); border-color: rgba(46, 125, 84, 0.18); }
.callout-tip .callout-label { color: #2E7D54; }
.callout-note { background: var(--coral-soft); border-color: rgba(232, 85, 63, 0.2); }
.callout-note .callout-label { color: var(--coral-deep); }

/* 초대 방법 카드 */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}
.method {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.method:hover { color: var(--ink); border-color: var(--coral); transform: translateY(-2px); }
.method strong { display: block; margin-bottom: 4px; font-size: 15px; }
.method span { display: block; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }

/* 표 */
.table-wrap {
  margin: 16px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.docs-content table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.docs-content th,
.docs-content td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-content th { background: rgba(26, 26, 26, 0.03); font-weight: 700; white-space: nowrap; }
.docs-content tr:last-child td { border-bottom: 0; }

/* ===== Screenshot placeholder =====
 * 스크린샷 준비 전: .shot-frame(테두리 박스 + 이미지 아이콘) — 화면에는 figure 째 숨긴다.
 *   "준비 중" 자리표시자는 미완성 문서로 보여 이용자 신뢰와 검색 품질 평가에 불리하다.
 * 스크린샷 준비 후: .shot-frame 을 <img> 로 교체 (data-shot-* 속성은 유지) → 자동으로 보인다.
 */
.shot-placeholder { margin: 20px 0 28px; }
.shot-placeholder:has(> .shot-frame) { display: none; }
.shot-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #EFEADF 0%, #E8E2D5 100%);
  color: var(--ink-mute);
}
.shot-frame svg { width: 40px; height: 40px; opacity: 0.7; }
.shot-frame span { font-size: 13px; font-weight: 600; }
.shot-placeholder img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 40px -15px rgba(26, 26, 26, 0.12), 0 5px 15px -5px rgba(26, 26, 26, 0.06);
}
.shot-placeholder[data-shot-viewport^="mobile"] .shot-frame,
.shot-placeholder[data-shot-viewport^="mobile"] img {
  max-width: 300px;
  margin: 0 auto;
}
.shot-placeholder[data-shot-viewport^="mobile"] .shot-frame { aspect-ratio: 390 / 844; }
.shot-placeholder figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-mute);
  text-align: center;
}

/* ===== FAQ ===== */
.faq-group h3 { margin-bottom: 14px; }
details.faq {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
details.faq[open] { border-color: var(--line-strong); }
details.faq summary {
  position: relative;
  padding: 15px 48px 15px 18px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-mute);
}
details.faq[open] summary::after { content: "\2212"; }
details.faq summary:hover { color: var(--coral-deep); }
.faq-body { padding: 0 18px 16px; font-size: 15px; color: var(--ink-soft); }
.faq-body > :last-child { margin-bottom: 0; }

/* ===== Support ===== */
.support-card {
  margin-top: 16px;
  padding: 28px;
  border-radius: 20px;
  background: var(--ink);
  color: #fff;
}
.support-card h2 { margin-top: 0 !important; color: #fff; }
.support-card p { color: rgba(255, 255, 255, 0.8); }
.support-card a { color: #fff; font-weight: 700; }
.support-card a:hover { color: var(--coral); }

/* ===== Footer ===== */
.docs-footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
}
.docs-footer a { margin: 0 8px; color: var(--ink-soft); }

/* ===== Mobile (<900px) ===== */
@media (max-width: 899px) {
  html { scroll-padding-top: calc(var(--header-h) + var(--tocbar-h) + 16px); }

  .docs-badge { display: none; }

  .toc-bar {
    display: block;
    position: sticky;
    top: var(--header-h);
    z-index: 25;
    height: var(--tocbar-h);
    background: rgba(245, 241, 230, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .toc-toggle {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 var(--gutter);
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  }
  .toc-toggle-label { flex-shrink: 0; font-weight: 700; }
  .toc-toggle-current {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-mute);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .toc-toggle svg { flex-shrink: 0; width: 16px; height: 16px; margin-left: auto; transition: transform 0.2s; }
  .toc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

  .docs-layout { display: block; padding-top: 28px; }

  .docs-sidebar {
    display: none;
    position: fixed;
    top: calc(var(--header-h) + var(--tocbar-h));
    left: 0;
    right: 0;
    z-index: 24;
    max-height: calc(100vh - var(--header-h) - var(--tocbar-h) - 24px);
    padding: 12px var(--gutter) 16px;
    background: var(--bg-cream);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 24px 40px -20px rgba(26, 26, 26, 0.3);
  }
  .docs-sidebar.is-open { display: block; }
  .docs-sidebar .toc-title { display: none; }

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

@media (max-width: 480px) {
  .header-cta { display: none; }
  .lead { font-size: 16.5px; }
  .quickstart { padding: 20px 18px 8px; }
  .support-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .method { transition: none; }
}
