:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f3f6;
  --text: #121417;
  --muted: #69727f;
  --line: #dde3eb;
  --line-strong: #cbd4df;
  --accent: #df2f4d;
  --accent-soft: #fff3f6;
  --shadow: 0 24px 60px rgba(18, 24, 33, 0.08);
  --shadow-soft: 0 10px 30px rgba(18, 24, 33, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
  appearance: none;
}

.legal-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 68px;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.legal-header {
  max-width: 760px;
  margin-bottom: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 114px;
  height: 40px;
  color: #ffffff;
  background: var(--text);
  border-radius: 7px;
  text-decoration: none;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(18, 20, 23, 0.12);
}

.brand-mark {
  font-size: 15px;
  font-weight: 800;
}

.header-copy h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
}

.header-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.legal-sidebar,
.legal-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.legal-sidebar {
  position: sticky;
  top: 24px;
  padding: 16px;
}

.category-group + .category-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.category-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.doc-nav-button {
  display: block;
  width: 100%;
  margin: 3px 0;
  padding: 11px 12px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.doc-nav-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #ffd0da;
}

.doc-nav-button.is-active {
  color: #ffffff;
  background: var(--text);
  border-color: var(--text);
  box-shadow: 0 10px 24px rgba(18, 20, 23, 0.14);
}

.legal-main {
  min-height: 720px;
  padding: 42px 54px 58px;
  box-shadow: var(--shadow);
}

.language-toggle button {
  min-width: 84px;
  height: 36px;
  padding: 0 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.language-toggle button.is-active {
  color: #ffffff;
  background: var(--text);
}

.document-heading {
  max-width: 820px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.effective-date {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 0 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #ffd4dd;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.document-heading h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.22;
  font-weight: 800;
}

.document-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.legal-content {
  max-width: 820px;
  padding-top: 30px;
  color: #272c34;
  font-size: 16px;
  line-height: 1.88;
}

.legal-content h2 {
  margin: 42px 0 14px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
}

.legal-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-content h3 {
  margin: 28px 0 10px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
}

.legal-content p {
  margin: 0 0 14px;
}

.legal-content ol,
.legal-content ul {
  margin: 0 0 18px;
  padding-left: 24px;
}

.legal-content li {
  margin: 6px 0;
}

.legal-content li::marker {
  color: #555d68;
  font-weight: 800;
}

.legal-content strong {
  font-weight: 800;
}

.legal-content code {
  padding: 2px 5px;
  background: var(--surface-muted);
  border-radius: 4px;
  font-size: 0.92em;
}

@media (max-width: 860px) {
  .legal-shell {
    width: min(100% - 24px, 680px);
    padding: 24px 0 44px;
  }

  .legal-topbar {
    margin-bottom: 22px;
  }

  .header-copy h1 {
    font-size: 30px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    overflow-x: auto;
    padding: 10px;
  }

  .legal-main {
    padding: 24px 20px 34px;
    min-height: auto;
  }

  .language-toggle {
    flex: 0 0 auto;
  }

  .document-heading h2 {
    font-size: 27px;
  }

  .legal-content {
    font-size: 15px;
  }

  .category-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
  }

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

  .category-group,
  .category-group + .category-group {
    display: contents;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .category-title {
    display: none;
  }

  .doc-nav-button {
    flex: 0 0 auto;
    width: auto;
    max-width: 230px;
    margin: 0;
    padding: 9px 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  .legal-topbar {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 14px;
  }

  .brand {
    width: 108px;
  }

  .language-toggle {
    width: 100%;
  }

  .language-toggle button {
    min-width: 0;
  }
}
