/*
 * 코들리 정책 사이트 공용 스타일 (cordly.kr)
 * - 빌드 없음, 외부 리소스 없음(글꼴 파일도 받지 않는다 — 기기에 Pretendard가 있으면 쓰고, 없으면 시스템 글꼴).
 * - 색은 packages/tokens/web/tokens.css 값에서 옮겼다. 토큰을 바꾸면 여기도 같이 바꾼다.
 * - 다크 모드는 기기 설정을 따른다. <html data-theme="light|dark">로 한쪽에 고정할 수도 있다.
 * - 쓰는 클래스: .draft-banner .site-header .logo .doc .updated .toc .table-wrap .note .fill .steps .faq .site-footer .footer-links .biz-info .skip-link
 *   (계정 삭제 본인 확인 페이지만: .flow .actions .btn(.btn-primary·.btn-danger·.btn-secondary) .check-row .dev-panel .mock-row)
 */

:root {
  /* 브랜드 토큰 — 라이트 (tokens.css 그대로) */
  --bg: #ffffff;
  --surface: #f7f6f9;
  --surface-2: #efedf3;
  --line: #e7e5ec;
  --line-strong: #8a8694;
  --text: #171a21;
  --text-muted: #6e6a78;
  --brand: #8e6fd6;
  --brand-tint: #f3effb;
  --brand-deep: #5b3ba6;
  --focus-ring: #5b3ba6;
  --success: #2f7d5e;
  --alert: #c93a40;
  --selection: #ddd4f3;

  /* 사이트에서만 쓰는 값(토큰에 없음) */
  --alert-tint: #fbeced;
  --fill-bg: #fff1c2;
  --fill-text: #5c4300;
  --fill-line: #d9a400;

  --font-sans: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content: 720px;
  --gutter: 16px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121117;
    --surface: #1c1a22;
    --surface-2: #26232d;
    --line: #2d2a35;
    --line-strong: #74707f;
    --text: #f2f1f6;
    --text-muted: #a19dab;
    --brand: #a68bea;
    --brand-tint: #2a2340;
    --brand-deep: #c9b8f5;
    --focus-ring: #c9b8f5;
    --success: #6fcfa3;
    --alert: #ff7a7e;
    --selection: #3e3656;
    --alert-tint: #3a1f24;
    --fill-bg: #4a3d14;
    --fill-text: #ffe08a;
    --fill-line: #b38a1a;
  }
}

:root[data-theme="dark"] {
  --bg: #121117;
  --surface: #1c1a22;
  --surface-2: #26232d;
  --line: #2d2a35;
  --line-strong: #74707f;
  --text: #f2f1f6;
  --text-muted: #a19dab;
  --brand: #a68bea;
  --brand-tint: #2a2340;
  --brand-deep: #c9b8f5;
  --focus-ring: #c9b8f5;
  --success: #6fcfa3;
  --alert: #ff7a7e;
  --selection: #3e3656;
  --alert-tint: #3a1f24;
  --fill-bg: #4a3d14;
  --fill-text: #ffe08a;
  --fill-line: #b38a1a;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* ───── 기본 ───── */

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

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

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

::selection {
  background: var(--selection);
}

a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  letter-spacing: -0.012em;
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.024em;
}

h2 {
  font-size: 21px;
  font-weight: 700;
  margin-top: 48px;
  padding-top: 8px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 28px;
}

p,
ul,
ol,
dl,
table,
blockquote {
  margin: 12px 0 0;
}

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 4px;
}

li > ul,
li > ol {
  margin-top: 4px;
}

strong {
  font-weight: 700;
}

small {
  font-size: 14px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ───── 초안 띠: 모든 페이지 맨 위 ───── */

.draft-banner {
  margin: 0;
  padding: 12px max(var(--gutter), calc((100% - var(--content)) / 2));
  background: var(--alert-tint);
  border-bottom: 2px solid var(--alert);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.draft-banner strong {
  color: var(--alert);
}

/* ───── 건너뛰기 링크 ───── */

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

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

/* ───── 머리글 ───── */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px max(var(--gutter), calc((100% - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
}

.logo {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  /* ✳(U+2733)가 이모지 그림으로 바뀌지 않게 */
  font-variant-emoji: text;
}

.logo:hover {
  color: var(--brand-deep);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 15px;
}

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* ───── 본문 문서 ───── */

.doc {
  max-width: var(--content);
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
}

.doc > header p {
  color: var(--text-muted);
}

.updated {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.lead {
  font-size: 17px;
  color: var(--text);
}

section[id],
h2[id],
h3[id] {
  scroll-margin-top: 16px;
}

/* 목차 */
.toc {
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.toc h2 {
  margin: 0;
  padding: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.toc ol {
  margin-top: 8px;
  font-size: 15px;
}

.toc a {
  color: var(--text);
  text-decoration: none;
}

.toc a:hover {
  color: var(--brand-deep);
  text-decoration: underline;
}

/* 표: 좁은 화면에서 가로 스크롤 */
.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.table-wrap table {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.table-wrap table {
  min-width: 560px;
}

caption {
  caption-side: top;
  text-align: left;
  padding: 12px 14px 0;
  font-size: 14px;
  color: var(--text-muted);
}

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

thead th {
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

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

tbody th {
  font-weight: 600;
}

/* 알림 상자 */
.note {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--brand-tint);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.note > :first-child {
  margin-top: 0;
}

.note.alert {
  background: var(--alert-tint);
  border-left-color: var(--alert);
}

/* 빈칸 — 출시 전에 반드시 채울 값: <mark class="fill">[[채울 값: …]]</mark> */
mark,
.fill {
  background: var(--fill-bg);
  color: var(--fill-text);
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--fill-line);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 단계 목록 */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  min-height: 28px;
}

.steps > li + li {
  margin-top: 12px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

/* 메뉴 경로 표시: <span class="path">내 정보 › 탈퇴(계정 삭제)</span> */
.path {
  font-weight: 600;
  white-space: normal;
}

/* 자주 묻는 질문 */
.faq details {
  border-bottom: 1px solid var(--line);
}

.faq details:first-of-type {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.faq summary {
  cursor: pointer;
  padding: 14px 32px 14px 0;
  font-weight: 600;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 12px;
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details > :not(summary) {
  margin-top: 0;
}

.faq details > div {
  padding-bottom: 16px;
}

.faq details > div > :first-child {
  margin-top: 0;
}

/* 링크 카드 목록(첫 화면) */
.link-list {
  list-style: none;
  padding: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.link-list li {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.link-list a {
  display: block;
  padding: 14px 0;
  color: var(--text);
  text-decoration: none;
}

.link-list a strong {
  display: block;
}

.link-list a span {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}

.link-list a:hover strong {
  color: var(--brand-deep);
  text-decoration: underline;
}

/* 변경 이력 */
.changelog {
  font-size: 15px;
}

/* ───── 바닥글(사업자 정보) ───── */

.site-footer {
  padding: 32px max(var(--gutter), calc((100% - var(--content)) / 2)) 48px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.site-footer a {
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
}

.footer-links a:hover {
  text-decoration: underline;
}

.biz-info {
  margin-top: 20px;
}

.biz-info h2 {
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.biz-info dl {
  margin: 6px 0 0;
}

.biz-info dl > div {
  display: inline;
}

.biz-info dl > div::after {
  content: "·";
  margin: 0 6px;
}

.biz-info dl > div:last-child::after {
  content: none;
}

.biz-info dt,
.biz-info dd {
  display: inline;
  margin: 0;
}

.biz-info dt::after {
  content: " ";
}

.biz-info dd {
  color: var(--text);
}

.biz-info p {
  margin-top: 8px;
}

.copyright {
  margin-top: 16px;
}

/* ───── 계정 삭제 본인 확인(/account-deletion/verify/) — 이 사이트에서 버튼·입력이 있는 유일한 페이지 ───── */

[hidden] {
  display: none !important;
}

.flow > section > h2 {
  margin-top: 32px;
}

.flow h2:focus {
  outline: none;
}

.flow h2:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 4px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-deep);
  color: var(--bg);
}

.btn-danger {
  background: var(--alert);
  color: var(--bg);
}

.btn-secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-weight: 600;
  cursor: pointer;
}

.check-row input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 4px 0 0;
  accent-color: var(--brand-deep);
}

.dev-panel {
  margin-top: 32px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
}

.dev-panel > :first-child {
  margin-top: 0;
}

.dev-panel label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
}

.mock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.mock-row input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

/* ───── 좁은 화면 ───── */

@media (max-width: 480px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 19px;
    margin-top: 40px;
  }

  .doc {
    padding-top: 28px;
  }

  .biz-info dl > div {
    display: block;
  }

  .biz-info dl > div::after {
    content: none;
  }

  .actions .btn {
    width: 100%;
  }
}

/* ───── 인쇄 ───── */

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --text-muted: #333333;
    --line: #bbbbbb;
    --brand-deep: #000000;
  }

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

  .skip-link,
  .site-header nav {
    display: none;
  }

  .site-header,
  .doc {
    padding-left: 0;
    padding-right: 0;
  }

  .draft-banner {
    padding: 8px 12px;
    border: 2px solid #000;
    background: none;
  }

  .draft-banner strong {
    color: #000;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  .table-wrap table {
    min-width: 0;
  }

  table,
  tr,
  .note,
  .faq details {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  .doc a[href^="http"]::after,
  .doc a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #333;
  }

  mark,
  .fill {
    background: none;
    box-shadow: none;
    border: 1px dashed #000;
    color: #000;
  }

  .site-footer {
    background: none;
    padding: 16px 0 0;
  }
}

/* 인쇄할 때 접힌 질문도 펼친다(지원하는 브라우저만) */
@media print {
  .faq details::details-content {
    content-visibility: visible;
    display: block;
  }
}

/* 변경 이력처럼 열이 적은 표는 가로 최소 폭을 두지 않는다 */
.table-wrap table.changelog,
.table-wrap table.compact {
  min-width: 0;
}
