/* ============================================================
   약관 및 정책(/terms) — preview 디자인 시스템 리스킨
   colors_and_type.css 토큰 기반 (preview_nav.css 가 import 함).
   부트스트랩/styles.css 충돌 방지를 위해 tm- 네임스페이스 사용.
   ============================================================ */

/* ---------- 페이지 셸 ---------- */
.tm-shell {
  position: relative;
  background: var(--w-cool-99);
  padding: 64px 0 96px;
  overflow: hidden;
}
.tm-shell::before {
  content: ""; position: absolute; top: -260px; right: -200px;
  width: 640px; height: 640px;
  background: radial-gradient(closest-side, rgba(79,55,255,0.10), transparent 70%);
  pointer-events: none;
}
.tm-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 히어로 ---------- */
.tm-hero { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.tm-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-accent-subtle);
  color: var(--w-blue-45);
  font: 600 12px/1 var(--font-sans);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tm-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tm-hero h1 {
  margin: 18px 0 0;
  font: 800 clamp(32px, 4.2vw, 46px)/1.16 var(--font-sans);
  letter-spacing: -0.03em;
  color: var(--fg-primary);
  word-break: keep-all;
}
.tm-hero-sub {
  margin: 14px auto 0;
  max-width: 560px;
  font: 500 16px/1.6 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--fg-neutral-subtle);
  word-break: keep-all;
  text-wrap: pretty;
}
.tm-hero-meta {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-top: 20px;
}
.tm-hero-meta span {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line-neutral-subtle);
  font: 600 12.5px/1 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--fg-neutral-muted);
}

/* ---------- 핵심 안내 요약 카드 ---------- */
.tm-summary {
  margin: 0 0 48px;
  background: white;
  border: 1px solid var(--line-neutral-subtle);
  border-radius: 24px;
  box-shadow: var(--shadow-normal);
  overflow: hidden;
}
.tm-summary-head {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line-neutral-subtle);
  background: linear-gradient(90deg, var(--bg-accent-subtle), rgba(238,235,255,0.25));
}
.tm-summary-head svg { width: 20px; height: 20px; color: var(--w-blue-50); flex: 0 0 20px; }
.tm-summary-head strong {
  font: 800 16.5px/1.3 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--fg-primary);
  word-break: keep-all;
  white-space: nowrap;
}
.tm-summary-head small {
  margin-left: auto;
  font: 500 12.5px/1.4 var(--font-sans);
  color: var(--fg-neutral-muted);
}
.tm-summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line-neutral-subtle);
}
.tm-summary-item { background: white; padding: 22px 24px 26px; }
.tm-summary-item .num {
  font: 800 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--w-blue-50);
}
.tm-summary-item h4 {
  margin: 10px 0 6px;
  font: 700 15px/1.4 var(--font-sans);
  letter-spacing: -0.012em;
  color: var(--fg-primary);
  word-break: keep-all;
}
.tm-summary-item p {
  margin: 0;
  font: 500 13px/1.6 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--fg-neutral-subtle);
  word-break: keep-all;
}
.tm-summary-item a {
  display: inline-block;
  margin-top: 8px;
  font: 600 12px/1.4 var(--font-sans);
  color: var(--w-blue-50);
  text-decoration: none;
}
.tm-summary-item a:hover { color: var(--w-blue-45); text-decoration: underline; }

/* ---------- 본문 레이아웃: 목차 + 문서 ---------- */
.tm-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* 목차 */
.tm-toc {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 4px;
}
.tm-toc .tm-toc-label {
  margin: 0 0 8px 12px;
  font: 800 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-neutral-muted);
}
.tm-toc a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  font: 500 13.5px/1.45 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--fg-neutral-subtle);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .14s ease, color .14s ease;
  word-break: keep-all;
}
.tm-toc a:hover { background: var(--bg-neutral); color: var(--fg-primary); text-decoration: none; }
.tm-toc a.active {
  background: white;
  border-color: var(--line-neutral-subtle);
  box-shadow: var(--shadow-normal);
  color: var(--w-blue-50);
  font-weight: 700;
}
.tm-toc a.doc {
  margin-top: 14px;
  font-weight: 700;
  color: var(--fg-primary);
}
.tm-toc a.doc:first-of-type { margin-top: 0; }
.tm-toc a.sub { padding-left: 24px; font-size: 13px; }

/* 문서 카드 공통 */
.tm-doc { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.tm-doc-card {
  background: white;
  border: 1px solid var(--line-neutral-subtle);
  border-radius: 24px;
  padding: 44px 48px 48px;
  scroll-margin-top: 84px;
}
.tm-doc-head { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line-neutral-subtle); }
.tm-doc-head .kicker {
  display: block;
  font: 800 11.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-blue-50);
  margin-bottom: 10px;
}
.tm-doc-head h2 {
  margin: 0;
  font: 800 clamp(22px, 2.6vw, 28px)/1.25 var(--font-sans);
  letter-spacing: -0.024em;
  color: var(--fg-primary);
}
.tm-doc-head .date {
  margin: 10px 0 0;
  font: 500 13px/1.5 var(--font-sans);
  color: var(--fg-neutral-muted);
}
.tm-doc-intro {
  margin: 0 0 8px;
  font: 500 15px/1.75 var(--font-sans);
  letter-spacing: -0.003em;
  color: var(--fg-neutral-subtle);
}

/* 장(챕터) 구분 */
.tm-chapter {
  margin: 36px 0 4px;
  display: flex; align-items: center; gap: 12px;
  scroll-margin-top: 84px;
}
.tm-chapter:first-of-type { margin-top: 8px; }
.tm-chapter span {
  flex: 0 0 auto;
  font: 800 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-blue-50);
}
.tm-chapter::after { content: ""; flex: 1; height: 1px; background: var(--line-neutral-subtle); }

/* 조항 */
.tm-article { padding: 22px 0 6px; scroll-margin-top: 84px; }
.tm-article h3 {
  margin: 0 0 10px;
  font: 700 17px/1.4 var(--font-sans);
  letter-spacing: -0.014em;
  color: var(--fg-primary);
  word-break: keep-all;
}
.tm-article h3 .badge-new,
.tm-article h3 .badge-amended {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font: 700 10.5px/1 var(--font-sans);
  letter-spacing: 0.02em;
  vertical-align: 2px;
}
.tm-article h3 .badge-new { background: var(--bg-accent-subtle); color: var(--w-blue-45); }
.tm-article h3 .badge-amended { background: var(--bg-energy-subtle); color: var(--w-violet-45); }
.tm-article h4 {
  margin: 18px 0 8px;
  font: 700 14.5px/1.4 var(--font-sans);
  letter-spacing: -0.008em;
  color: var(--fg-neutral);
}
.tm-article p {
  margin: 0 0 10px;
  font: 500 14.5px/1.8 var(--font-sans);
  letter-spacing: -0.002em;
  color: var(--fg-neutral-subtle);
}
.tm-article ol, .tm-article ul {
  margin: 2px 0 12px;
  padding-left: 22px;
  display: flex; flex-direction: column; gap: 5px;
}
.tm-article li {
  font: 500 14px/1.75 var(--font-sans);
  letter-spacing: -0.002em;
  color: var(--fg-neutral-subtle);
}
.tm-article li::marker { color: var(--fg-neutral-muted); font-weight: 600; }

/* 중요 조항 하이라이트 */
.tm-article.is-key {
  position: relative;
  margin: 10px 0;
  padding: 24px 28px 16px;
  background: var(--w-cool-99);
  border: 1px solid var(--line-neutral-subtle);
  border-left: 3px solid var(--w-blue-50);
  border-radius: 14px;
}

/* 부칙 */
.tm-appendix {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--w-cool-98);
  border: 1px solid var(--line-neutral-subtle);
  border-radius: 14px;
  scroll-margin-top: 84px;
}
.tm-appendix h3 {
  margin: 0 0 8px;
  font: 700 15px/1.4 var(--font-sans);
  color: var(--fg-primary);
}
.tm-appendix p {
  margin: 0 0 4px;
  font: 500 13.5px/1.7 var(--font-sans);
  color: var(--fg-neutral-subtle);
}

/* ---------- 서비스별 이용조건 카드 ---------- */
.tm-svc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 4px;
}
.tm-svc {
  border: 1px solid var(--line-neutral-subtle);
  border-radius: 18px;
  padding: 28px;
  background: var(--w-cool-99);
}
.tm-svc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.tm-svc-icon svg { width: 21px; height: 21px; display: block; }
.tm-svc.mp3 .tm-svc-icon { background: var(--bg-accent-subtle); color: var(--w-blue-45); }
.tm-svc.bcast .tm-svc-icon { background: var(--bg-energy-subtle); color: var(--w-violet-45); }
.tm-svc h3 {
  margin: 0 0 4px;
  font: 700 17px/1.35 var(--font-sans);
  letter-spacing: -0.014em;
  color: var(--fg-primary);
}
.tm-svc .svc-sub {
  margin: 0 0 16px;
  font: 500 12.5px/1.5 var(--font-sans);
  color: var(--fg-neutral-muted);
}
.tm-svc ol {
  margin: 0; padding-left: 20px;
  display: flex; flex-direction: column; gap: 7px;
}
.tm-svc li {
  font: 500 13.5px/1.7 var(--font-sans);
  letter-spacing: -0.002em;
  color: var(--fg-neutral-subtle);
  word-break: keep-all;
}
.tm-svc li strong { color: var(--fg-neutral); font-weight: 700; }
.tm-svc li::marker { color: var(--fg-neutral-muted); font-weight: 700; }

/* ---------- 문의 안내 배너 ---------- */
.tm-help {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  background: var(--w-cool-5);
  color: white;
  border-radius: 20px;
  padding: 28px 32px;
}
.tm-help .tx { display: flex; flex-direction: column; gap: 4px; }
.tm-help strong { font: 700 17px/1.4 var(--font-sans); letter-spacing: -0.014em; }
.tm-help p { margin: 0; font: 500 13.5px/1.6 var(--font-sans); color: rgba(255,255,255,0.66); }
.tm-help a {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 22px;
  border-radius: 11px;
  background: var(--w-blue-50);
  color: white;
  font: 700 14px/1 var(--font-sans);
  letter-spacing: -0.008em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tm-help a::after { content: "→"; font-size: 15px; }
.tm-help a:hover {
  background: var(--w-blue-45);
  color: white; text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79,55,255,0.34);
}

/* ---------- 반응형 ---------- */
@media (max-width: 960px) {
  .tm-summary-grid { grid-template-columns: 1fr 1fr; }
  .tm-layout { grid-template-columns: 1fr; gap: 24px; }
  .tm-toc {
    position: sticky; top: 64px; z-index: 20;
    flex-direction: row; gap: 8px;
    overflow-x: auto;
    margin: 0 -24px;
    padding: 12px 24px;
    background: rgba(252,252,253,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-neutral-subtle);
    scrollbar-width: none;
  }
  .tm-toc::-webkit-scrollbar { display: none; }
  .tm-toc .tm-toc-label { display: none; }
  .tm-toc a, .tm-toc a.doc { margin: 0; flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--line-neutral-subtle); background: white; }
  .tm-toc a.sub { display: none; }
  .tm-doc-card { padding: 28px 24px 32px; border-radius: 18px; }
  .tm-svc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tm-shell { padding: 44px 0 64px; }
  .tm-summary-grid { grid-template-columns: 1fr; }
  .tm-summary-head { padding: 18px 22px; flex-wrap: wrap; }
  .tm-summary-head small { flex-basis: 100%; margin-left: 30px; margin-top: -2px; }
  .tm-article.is-key { padding: 18px 18px 10px; }
  .tm-help { padding: 24px 22px; }
  .tm-help a { width: 100%; justify-content: center; }
}

/* ---------- 인쇄 ---------- */
@media print {
  .preview-site-nav, .tm-toc, .tm-help, footer { display: none !important; }
  .tm-shell { background: white; padding: 0; }
  .tm-shell::before { display: none; }
  .tm-doc-card { border: none; padding: 0 0 24px; }
  .tm-summary { box-shadow: none; }
}
