/* 랩프레소 약관·방침 공용 스타일 — landing/legal.css → 공개 경로 /assets/legal.css
 *
 * 색·글꼴 토큰은 /assets/tokens.css(정본 docs/BRAND.md)를 쓴다. 다크 모드는 토큰이 처리한다.
 * 랜딩 CSP(style-src 'self')를 지키기 위해 약관 HTML에는 style 속성·<style>을 쓰지 않고 이 파일만 쓴다.
 * 쓰는 곳: landing/terms/index.html · landing/privacy/index.html · landing/terms/media/index.html · landing/terms/research/index.html
 */

/* 조항 안 항(①②…) 번호. 지원하지 않는 브라우저는 숫자로 표시된다. */
@counter-style lp-circled {
  system: fixed;
  symbols: "①" "②" "③" "④" "⑤" "⑥" "⑦" "⑧" "⑨" "⑩" "⑪" "⑫" "⑬" "⑭" "⑮";
  suffix: " ";
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 20px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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

a {
  color: var(--lp-crema-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--lp-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 600;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--lp-radius-sm);
  background: var(--lp-ink);
  color: var(--lp-bg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ── 상단 막대 ─────────────────────────────────────────── */
.site-bar {
  background: var(--lp-surface);
  border-bottom: 1px solid var(--lp-line);
}

.site-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lp-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 32px;
  height: 32px;
}

.site-bar__link {
  color: var(--lp-ink-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-bar__link:hover {
  color: var(--lp-ink);
  text-decoration: underline;
}

/* ── 문서 머리 ─────────────────────────────────────────── */
.doc-hero {
  padding: 32px 0 8px;
}

.doc-switch ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.doc-switch a {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-pill);
  background: var(--lp-surface);
  color: var(--lp-ink-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

.doc-switch a:hover {
  border-color: var(--lp-ink-faint);
  color: var(--lp-ink);
}

.doc-switch a[aria-current="page"] {
  border-color: var(--lp-ink);
  background: var(--lp-ink);
  color: var(--lp-bg);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lp-crema-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.doc-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 1.6rem + 1.4vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 46em;
  margin: 0;
  color: var(--lp-ink-muted);
  font-size: 17px;
  line-height: 1.7;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 20px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--lp-line);
  color: var(--lp-ink-muted);
  font-size: 14px;
}

.doc-meta div {
  display: flex;
  gap: 8px;
}

.doc-meta dt {
  color: var(--lp-ink);
  font-weight: 600;
}

.doc-meta dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* 한눈에 보기 */
.doc-summary {
  margin: 28px 0 0;
}

.doc-summary h2 {
  margin: 0 0 10px;
  color: var(--lp-ink-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.doc-summary ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-summary li {
  padding: 16px 18px;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-md);
  background: var(--lp-surface);
}

.doc-summary strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.doc-summary p {
  margin: 0;
  color: var(--lp-ink-muted);
  font-size: 14px;
  line-height: 1.65;
}

.doc-summary .summary-note {
  margin: 10px 0 0;
  color: var(--lp-ink-muted);
  font-size: 13px;
}

/* ── 목차 + 본문 ───────────────────────────────────────── */
.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding: 36px 0 72px;
}

.toc {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.toc h2 {
  margin: 0 0 8px;
  padding-left: 8px;
  color: var(--lp-ink-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.45;
}

.toc a {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--lp-radius-sm);
  color: var(--lp-ink-muted);
  text-decoration: none;
}

.toc a:hover {
  background: var(--lp-surface-alt);
  color: var(--lp-ink);
}

.toc .no {
  flex: none;
  min-width: 3.4em;
  color: var(--lp-ink-muted);
  font-variant-numeric: tabular-nums;
}

.doc {
  min-width: 0;
  max-width: 760px;
}

.doc > section {
  margin: 0 0 32px;
  padding: 0 0 32px;
  border-bottom: 1px solid var(--lp-line);
}

.doc > section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.doc h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.doc h2 .no {
  display: block;
  margin-bottom: 2px;
  color: var(--lp-crema-strong);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.doc h3 {
  margin: 24px 0 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.doc p {
  margin: 0 0 12px;
}

.doc ol.clauses {
  margin: 0 0 12px;
  padding-left: 1.7em;
  list-style-type: lp-circled;
}

.doc ol.clauses > li {
  margin: 0 0 10px;
  padding-left: 0.15em;
}

.doc ol.clauses > li::marker {
  color: var(--lp-ink-muted);
}

.doc ol.items {
  margin: 6px 0 0;
  padding-left: 1.5em;
  list-style-type: decimal;
}

.doc ol.items > li,
.doc ul.bullets > li {
  margin: 4px 0;
}

.doc ol.items > li::marker {
  color: var(--lp-ink-muted);
  font-variant-numeric: tabular-nums;
}

.doc ul.bullets {
  margin: 6px 0 12px;
  padding-left: 1.25em;
}

.doc ul.bullets > li::marker {
  color: var(--lp-ink-faint);
}

.muted {
  color: var(--lp-ink-muted);
}

.small {
  font-size: 14px;
}

/* 가린 번호·회사명처럼 중간에서 끊기면 읽기 어려운 짧은 표기 */
.nowrap {
  white-space: nowrap;
}

/* 아직 확정되지 않은 사항 표시 */
.pending {
  display: inline-block;
  margin: 0 2px;
  padding: 0 7px;
  border: 1px dashed var(--lp-ink-faint);
  border-radius: var(--lp-radius-pill);
  color: var(--lp-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

/* ── 안내 상자 ─────────────────────────────────────────── */
.callout {
  margin: 16px 0;
  padding: 14px 18px;
  border: 1px solid var(--lp-line);
  border-left: 3px solid var(--lp-crema);
  border-radius: 0 var(--lp-radius-md) var(--lp-radius-md) 0;
  background: var(--lp-surface);
}

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

.callout--status {
  border-left-color: var(--lp-info);
}

.callout__title {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.doc-hero .callout {
  max-width: 46em;
  margin-top: 20px;
}

/* 동의 체크박스 문구 */
.consent-wording {
  margin: 12px 0;
  padding: 14px 18px;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-md);
  background: var(--lp-surface-alt);
  font-weight: 600;
}

/* 정의 목록(운영자·연락처·국외 이전 등) */
.info-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 20px;
  margin: 12px 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-md);
  background: var(--lp-surface);
  font-size: 15px;
  line-height: 1.65;
}

.info-list dt {
  color: var(--lp-ink-muted);
  font-weight: 500;
}

.info-list dd {
  margin: 0;
  min-width: 0;
}

.info-list dd p {
  margin: 0 0 6px;
}

.info-list dd p:last-child {
  margin-bottom: 0;
}

/* ── 표 ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--lp-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--lp-radius-md);
  background: var(--lp-surface);
  font-size: 14.5px;
  line-height: 1.6;
}

.data-table caption {
  padding: 0 0 8px;
  caption-side: top;
  color: var(--lp-ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--lp-line);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: var(--lp-surface-alt);
  color: var(--lp-ink-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.data-table thead th:first-child {
  border-top-left-radius: var(--lp-radius-md);
}

.data-table thead th:last-child {
  border-top-right-radius: var(--lp-radius-md);
}

.data-table tbody th {
  font-weight: 600;
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.data-table td ul {
  margin: 0;
  padding-left: 1.1em;
}

.data-table .note {
  display: block;
  margin-top: 4px;
  color: var(--lp-ink-muted);
  font-size: 13px;
}

/* ── 하단 ─────────────────────────────────────────────── */
.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--lp-line);
  background: var(--lp-surface);
  color: var(--lp-ink-muted);
  font-size: 14px;
}

.site-footer h2 {
  margin: 0 0 10px;
  color: var(--lp-ink-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--lp-ink);
}

.site-footer a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
}

.site-footer p {
  margin: 0 0 4px;
}

.site-footer .copyright {
  margin-top: 12px;
  color: var(--lp-ink-muted);
  font-size: 13px;
}

/* ── 반응형 ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 28px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 12px 8px;
    border: 1px solid var(--lp-line);
    border-radius: var(--lp-radius-md);
    background: var(--lp-surface);
  }

  .doc {
    max-width: none;
  }
}

@media (min-width: 560px) and (max-width: 960px) {
  .toc ol {
    columns: 2;
    column-gap: 12px;
  }

  .toc li {
    break-inside: avoid;
  }
}

@media (max-width: 760px) {
  .doc-summary ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }

  .site-bar__inner {
    min-height: 56px;
  }

  .doc-hero {
    padding-top: 24px;
  }

  .lead {
    font-size: 16px;
  }

  .doc h2 {
    font-size: 20px;
  }

  /* 좁은 화면에서는 표를 행 단위 카드로 쌓는다. 열 이름은 td[data-label]에서 가져온다. */
  .data-table.stack,
  .data-table.stack tbody,
  .data-table.stack tr,
  .data-table.stack th,
  .data-table.stack td {
    display: block;
    width: 100%;
  }

  /* 표 제목(caption)이 테두리 밖에 오도록 테두리를 tbody로 옮긴다. */
  .data-table.stack {
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .data-table.stack caption {
    display: block;
  }

  .data-table.stack tbody {
    border: 1px solid var(--lp-line);
    border-radius: var(--lp-radius-md);
    background: var(--lp-surface);
  }

  .data-table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .data-table.stack tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--lp-line);
  }

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

  .data-table.stack th,
  .data-table.stack td,
  .data-table.stack tbody tr:last-child > * {
    padding: 4px 14px;
    border-bottom: 0;
  }

  .data-table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--lp-ink-muted);
    font-size: 12px;
    font-weight: 600;
  }

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

  .info-list dd {
    margin-bottom: 10px;
  }

  .info-list dd:last-child {
    margin-bottom: 0;
  }
}

/* ── 인쇄 ─────────────────────────────────────────────── */
@media print {
  /* 다크 모드 토큰(:root:not([data-theme="light"]))보다 우선하도록 선택자를 겹쳐 쓴다. */
  :root:root:root {
    color-scheme: light;
    --lp-bg: #ffffff;
    --lp-surface: #ffffff;
    --lp-surface-alt: #f1f1f1;
    --lp-line: #b8b8b8;
    --lp-ink: #000000;
    --lp-ink-muted: #333333;
    --lp-ink-faint: #555555;
    --lp-crema: #555555;
    --lp-crema-strong: #000000;
    --lp-info: #555555;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.6;
  }

  .skip-link,
  .site-bar__link,
  .doc-switch,
  .toc,
  .site-footer nav {
    display: none !important;
  }

  .site-bar,
  .site-footer {
    border: 0;
  }

  .wrap {
    width: auto;
  }

  .doc-layout {
    display: block;
    padding: 12pt 0 0;
  }

  .doc {
    max-width: none;
  }

  .doc > section {
    margin-bottom: 14pt;
    padding-bottom: 14pt;
  }

  .doc h2,
  .doc h3 {
    break-after: avoid;
  }

  .data-table,
  .callout,
  .info-list,
  .doc-summary li {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }

  .doc a[href^="http"]::after,
  .doc a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    overflow-wrap: anywhere;
  }
}
