/* 공통 토큰과 기본 스타일 (편집기·안내 페이지 공용) */

:root {
  color-scheme: light;
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --text: #1f2430;
  --muted: #5b6474;
  --faint: #8a93a3;
  --line: #e2e5ea;
  --accent: #2563eb;
  --accent-strong: #1d4fd8;
  --accent-weak: #e8efff;
  --danger: #e5484d;
  --danger-weak: #fdecec;
  --warn-bg: #fff4e5;
  --warn-text: #9a4b00;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(20, 30, 50, 0.12), 0 1px 3px rgba(20, 30, 50, 0.08);
  --shadow-sm: 0 1px 3px rgba(20, 30, 50, 0.12);
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: var(--accent);
}

svg {
  flex: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--surface-2);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

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

.btn-danger:hover {
  background: var(--danger-weak);
  border-color: #f6c6c7;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* 안내·방침 등 문서 페이지 */
.doc-body {
  background: var(--surface-2);
}

.doc-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.doc-brand svg {
  width: 28px;
  height: 28px;
}

.doc-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.doc-main h1 {
  margin: 8px 0 8px;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.doc-main h2 {
  margin: 36px 0 10px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.doc-main h3 {
  margin: 22px 0 6px;
  font-size: 16px;
}

.doc-main p,
.doc-main li {
  color: #3a4150;
}

.doc-main ul,
.doc-main ol {
  padding-left: 1.3em;
}

.doc-main li + li {
  margin-top: 4px;
}

.doc-lead {
  font-size: 16px;
  color: var(--muted);
}

.doc-card {
  margin: 16px 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}

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

.doc-table th {
  background: var(--surface-2);
  font-weight: 600;
}

.doc-cta {
  margin: 24px 0;
}

kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.85em;
}

.doc-footer {
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

.doc-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.doc-footer a {
  color: var(--muted);
  text-decoration: none;
}

/* 광고 자리 (설정에서 켤 때만 표시) */
.ad-slot {
  margin: 16px 0;
  min-height: 90px;
  overflow: hidden;
}

/* ---- 사이트 메뉴·가구 크기 안내 ---- */
.doc-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.doc-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.doc-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 520px) {
  .doc-brand span {
    display: none;
  }
}

.breadcrumb {
  color: var(--faint);
  font-size: 13px;
}

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

.table-wrap {
  margin: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.size-table {
  min-width: 520px;
}

.size-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.size-table .btn {
  min-height: 34px;
}

.doc-main .hint {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 13.5px;
}

.doc-main li .btn {
  margin: 4px 0 0;
}

.doc-disclaimer {
  margin: 28px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn-text) !important;
  font-size: 14px;
}

.doc-cta-box {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid #cddcff;
  border-radius: var(--radius);
  background: var(--accent-weak);
}

.doc-cta-box p {
  margin: 0;
}

.doc-cta-box .btn {
  justify-self: start;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 !important;
  list-style: none;
}

.related-list li + li {
  margin: 0;
}

.related-list a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.size-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.size-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.size-card:hover {
  border-color: var(--accent);
}

.size-card-title {
  font-size: 16px;
  font-weight: 700;
}

.size-card-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .size-table {
    min-width: 0;
    background: transparent;
  }

  .size-table thead {
    display: none;
  }

  .size-table,
  .size-table tbody,
  .size-table tr,
  .size-table td {
    display: block;
    width: auto !important;
  }

  .size-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .size-table td {
    padding: 2px 0;
    border: 0;
  }

  .size-table td:first-child {
    font-weight: 700;
  }

  .size-table td:not(:first-child)[data-label]:not([data-label=""])::before {
    content: attr(data-label) " · ";
    color: var(--faint);
    font-size: 12.5px;
  }

  .size-table td:last-child {
    padding-top: 8px;
  }

  .size-table td:empty {
    display: none;
  }
}
