/* 문서형 화면(결과 링크 /r/{id}, 이용약관, 개인정보처리방침) v1.1 — 흰 바탕 · 회색 타일(테두리 없음).
   색·글자·간격은 tokens.css 의 변수만 쓴다. 색은 블루와 무채색뿐이고, 판정은 색이 아니라 표식 모양으로 가른다:
   충족(tone-ok) = 꽉 찬 원 · 부족·일부(tone-warn) = 왼쪽 반원 · 없음(tone-bad) = 빈 원(굵은 글자). */

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

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

body.doc {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--t-body-fs);
  font-weight: var(--w-regular);
  line-height: var(--t-body-lh);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: var(--c-blue-soft);
}

.doc h1, .doc h2, .doc h3, .doc p, .doc ul, .doc ol, .doc dl, .doc dd, .doc blockquote { margin: 0; }
.doc h1, .doc h2, .doc h3 { font-weight: var(--w-semibold); text-wrap: balance; }
.doc ul, .doc ol { padding: 0; list-style: none; }

.doc a { color: var(--c-link); text-underline-offset: 0.2em; }
.doc a:hover { text-decoration: underline; }
.doc a:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }

.doc-wrap { width: 100%; max-width: calc(var(--body-w) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

.doc-skip {
  position: absolute; left: var(--gutter); top: -4rem;
  padding: 0.5rem 0.875rem; background: var(--c-bg); border-radius: var(--r-sm);
}
.doc-skip:focus { top: 0.5rem; z-index: var(--z-nav); }

/* 머리 · 바닥 */
.doc-top { background: var(--c-glass-light); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  position: sticky; top: 0; z-index: var(--z-nav); }
.doc-top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--nav-h); }
.doc a.doc-brand .logo { display: block; height: 20px; width: auto; }
.doc a.doc-brand { display: inline-flex; align-items: center; color: var(--c-text); font-weight: var(--w-semibold); letter-spacing: 0.02em; text-decoration: none; }
.doc-kind { font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); color: var(--c-text-2); }
.doc-label { font-size: var(--t-label-fs); line-height: var(--t-label-lh); letter-spacing: var(--t-label-ls); font-weight: var(--w-semibold); color: var(--c-text); }
.doc-bottom { margin-top: var(--sec-y); padding: 1.5rem 0 2.5rem; background: var(--c-bg-2);
  font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); color: var(--c-text-2); }
.doc-bottom a { color: inherit; }

.doc-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 11px 21px;
  background: var(--c-blue); color: var(--c-on-blue); border-radius: var(--r-pill);
  font-size: var(--t-body-fs); line-height: 1.2; font-weight: var(--w-regular); text-decoration: none; touch-action: manipulation;
  transition: background-color var(--dur-1) var(--ease-out);
}
.doc a.doc-btn { color: var(--c-on-blue); }
.doc a.doc-btn:hover { background: var(--c-blue-hover); color: var(--c-on-blue); text-decoration: none; }

/* 판정 표식(색 대신 모양) */
.tone-ok, .tone-warn, .tone-bad { display: inline-flex; align-items: center; gap: 0.5rem; }
.tone-ok::before, .tone-warn::before, .tone-bad::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; }
.tone-ok { color: var(--c-blue); font-weight: var(--w-semibold); }
.tone-ok::before { background: var(--c-blue); }
.tone-warn { color: var(--c-text-2); }
.tone-warn::before { background: linear-gradient(90deg, var(--c-blue) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--c-blue); }
.tone-bad { color: var(--c-text); font-weight: var(--w-semibold); }
.tone-bad::before { box-shadow: inset 0 0 0 1.5px var(--c-text); }

/* 없는 주소 · 만료 */
.doc-gone { padding: clamp(3rem, 12vw, 7rem) 0 2rem; display: grid; gap: 1.25rem; justify-items: start; }
.doc-gone h1 { font-size: var(--t-headline-r-fs); line-height: var(--t-headline-r-lh); }
.doc-gone p { color: var(--c-text-2); }

/* ---------- 결과 링크 ---------- */
.rp-head { padding: clamp(2.5rem, 8vw, 5rem) 0 2rem; display: grid; gap: 1rem; }
.rp-head h1 { font-size: var(--t-headline-r-fs); line-height: var(--t-headline-r-lh); }
.rp-meta { display: grid; gap: 0.25rem; font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); }
.rp-meta > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 0.75rem; }
.rp-meta dt { color: var(--c-text-3); }
.rp-meta dd { font-variant-numeric: tabular-nums; }
.rp-url { overflow-wrap: anywhere; word-break: break-word; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rp-chips li { padding: 0.25rem 0.875rem; border-radius: var(--r-pill); background: var(--c-bg-2);
  font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); color: var(--c-text); }
.rp-banner { padding: 0.875rem 1.25rem; border-radius: var(--r-sm); background: var(--c-bg-2); color: var(--c-text); font-weight: var(--w-semibold); }

.rp-cards { display: grid; gap: 1rem; }
.rp-card { display: grid; gap: 1rem; padding: var(--tile-pad); background: var(--c-bg-2); border-radius: var(--r-tile); min-width: 0; }
.rp-card h2 { font-size: var(--t-title-fs); line-height: var(--t-title-lh); letter-spacing: var(--t-title-ls); }
.rp-lead { font-size: var(--t-intro-fs); line-height: var(--t-intro-lh); letter-spacing: var(--t-intro-ls); font-weight: var(--w-semibold); }
.rp-sub, .rp-note { font-size: var(--t-body-fs); line-height: var(--t-body-lh); color: var(--c-text-2); }
.rp-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.rp-score { display: flex; align-items: baseline; gap: 0.375rem; line-height: 1; }
.rp-score-num { font-size: var(--t-score-fs); font-weight: var(--w-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--c-text); }
.rp-score-unit { font-size: var(--t-body-fs); color: var(--c-text-3); }
.rp-counts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); }
.rp-counts li { gap: 0.4rem; }
.rp-counts .rp-num { font-weight: var(--w-semibold); color: var(--c-text); }
.rp-dot { display: none; }   /* 표식은 li.tone-* 의 ::before 가 그린다 */

.rp-list { display: grid; }
.rp-list > li { display: grid; gap: 0.375rem; padding: 1rem 0; border-top: 1px solid var(--c-line); min-width: 0; }
.rp-list > li:first-child { border-top: 0; padding-top: 0; }
.rp-list > li:last-child { padding-bottom: 0; }
.rp-item-title { font-weight: var(--w-semibold); }
.rp-item-detail, .rp-item-group { font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); color: var(--c-text-2); }
.rp-item-group { color: var(--c-text-3); }
.rp-k { color: var(--c-text-3); margin-right: 0.25rem; }
.rp-tag { margin-right: 0.75rem; font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); vertical-align: 0.05em; }
.rp-kv { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); }
.rp-kv > div { display: flex; gap: 0.5rem; }
.rp-kv dt { color: var(--c-text-3); }
.rp-kv dd { font-variant-numeric: tabular-nums; }
.rp-quote { padding: 0.25rem 0 0.25rem 1rem; border-left: 2px solid var(--c-line);
  font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); color: var(--c-text-2); overflow-wrap: anywhere; }
.rp-plain { display: grid; gap: 0.375rem; }
.rp-plain li { position: relative; padding-left: 1.25rem; }
.rp-plain li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--c-blue); }

.rp-foot { display: grid; gap: 0.875rem; justify-items: start; padding-top: 2.5rem; }

/* ---------- 이용약관 · 개인정보처리방침 ---------- */
/* 초안 띠 · [확정 전] 표시는 경고색 대신 회색 바탕 + 굵은 글자 */
.lg-draft { background: var(--c-bg-2); color: var(--c-text);
  font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); font-weight: var(--w-semibold); text-align: center; padding: 0.875rem var(--gutter); }
.lg-head { padding: clamp(2.5rem, 8vw, 5rem) 0 2rem; display: grid; gap: 0.75rem; }
.lg-head h1 { font-size: var(--t-headline-r-fs); line-height: var(--t-headline-r-lh); }
.lg-head p { font-size: var(--t-caption-fs); line-height: var(--t-caption-lh); color: var(--c-text-2); }
.lg-body { display: grid; gap: 2.5rem; }
.lg-body section { display: grid; gap: 0.75rem; scroll-margin-top: calc(var(--nav-h) + 1rem); }
.lg-body h2 { font-size: var(--t-title-fs); line-height: var(--t-title-lh); letter-spacing: var(--t-title-ls); }
.lg-body ol, .lg-body ul { display: grid; gap: 0.5rem; }
.lg-body ol { counter-reset: lg; }
.lg-body ol > li { counter-increment: lg; position: relative; padding-left: 1.75rem; }
.lg-body ol > li::before { content: counter(lg) "."; position: absolute; left: 0; color: var(--c-text-3);
  font-variant-numeric: tabular-nums; }
.lg-body ul > li { position: relative; padding-left: 1rem; }
.lg-body ul > li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 0.375rem; height: 1px; background: var(--c-text-3); }
.lg-body li > ul { margin-top: 0.5rem; }
.lg-tbd { padding: 0 0.375rem; border-radius: 4px; background: var(--c-bg-2); color: var(--c-text); font-weight: var(--w-semibold); }
.lg-table { display: grid; border-radius: var(--r-sm); background: var(--c-bg-2); overflow: hidden; }
.lg-table > div { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 0.75rem;
  padding: 0.875rem 1.25rem; border-top: 1px solid var(--c-line); }
.lg-table > div:first-child { border-top: 0; }
.lg-table dt { font-weight: var(--w-semibold); }
.lg-table dd { color: var(--c-text-2); overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .lg-table > div { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
  .doc-btn { width: 100%; }
  .rp-foot, .doc-gone { justify-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-btn { transition: none; }
}

@media print {
  .doc-skip, .doc-btn { display: none; }
  .doc-top { position: static; }
}
