/* ==========================================================================
   Xearch — public documents: 약관 · 개인정보 · 환불 · 도움말 · 404 · 점검
   Same voice as the landing page (built on css/tokens.css).
   ========================================================================== */

body.doc { min-height: 100svh; display: flex; flex-direction: column; }
.doc main { flex: 1; }
.doc a:not(.btn) { color: inherit; }

/* ---------- Header ---------- */
.d-nav { position: sticky; top: 0; z-index: 50; }
.d-nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(var(--paper) / .76); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-bottom: 1px solid var(--line); }
.d-nav-in { max-width: var(--maxw); margin: 0 auto; height: 60px; padding: 0 var(--gutter); display: flex; align-items: center; gap: 20px; }
.doc-logo { display: block; width: 100px; height: 40px; overflow: hidden; position: relative; flex: none; }
.doc-logo img { position: absolute; width: 140px; max-width: none; height: auto; left: -18px; top: -21px; mix-blend-mode: screen; }
:root[data-theme="light"] .doc-logo img { filter: invert(1) contrast(1.25); mix-blend-mode: multiply; }
.d-links { display: flex; gap: 4px; margin-left: auto; }
.d-links a { padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: color 160ms, background-color 160ms; }
.d-links a:hover, .d-links a[aria-current="page"] { color: var(--text); background: rgb(var(--ink) / .06); }
.d-actions { display: flex; align-items: center; gap: 8px; }
.d-actions .btn { white-space: nowrap; }

/* ---------- Page head ---------- */
.d-head { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter) 28px; }
.d-eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.d-head h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 760; }
.d-lead { max-width: 680px; margin: 16px 0 0; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.65; color: var(--muted); }
.d-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 20px 0 0; font-size: 13px; color: var(--dim); }
.d-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 22px 0 0; padding: 14px 18px; max-width: 760px; border-radius: 14px; font-size: 14px; line-height: 1.6; background: rgb(var(--ink) / .06); box-shadow: inset 0 0 0 1px var(--line-2); }
.d-notice b { margin-right: 6px; color: var(--text); }
.d-notice a { flex: none; color: var(--text); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Document body with table of contents ---------- */
.d-body { max-width: var(--maxw); margin: 0 auto; padding: 12px var(--gutter) clamp(64px, 9vw, 120px); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.toc { position: sticky; top: 84px; display: grid; gap: 2px; max-height: calc(100svh - 110px); overflow-y: auto; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc-t { margin: 0 0 8px 10px; font-size: 12px; font-weight: 650; letter-spacing: .06em; color: var(--dim); }
.toc a { padding: 7px 10px; border-radius: 9px; font-size: 13.5px; line-height: 1.4; color: var(--muted); transition: color 140ms, background-color 140ms; }
.toc a:hover { color: var(--text); background: rgb(var(--ink) / .05); }
.toc a.on { color: var(--text); background: rgb(var(--ink) / .08); font-weight: 600; }
.prose { min-width: 0; max-width: 760px; font-size: 15.5px; line-height: 1.8; color: var(--muted); }
.prose section { scroll-margin-top: 84px; padding-top: 8px; margin-bottom: 40px; }
.prose h2 { margin: 0 0 14px; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.35; letter-spacing: -0.02em; color: var(--text); font-weight: 700; }
.prose h3 { margin: 26px 0 8px; font-size: 17px; line-height: 1.45; color: var(--text); font-weight: 650; }
.prose p { margin: 0 0 12px; }
.prose strong, .prose b { color: var(--text); font-weight: 650; }
.prose ol, .prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--dim); }
.prose li > ul { margin: 6px 0; }
.prose h2 small { font-size: 14px; font-weight: 500; color: var(--dim); }
.prose a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.prose a:hover { text-decoration-color: var(--text); }
.prose .note { margin: 14px 0; padding: 14px 16px; border-radius: 14px; font-size: 14.5px; background: rgb(var(--ink) / .05); box-shadow: inset 0 0 0 1px var(--line); }
.tbl-wrap { margin: 12px 0 18px; overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.prose thead th { border-top: 0; font-size: 12.5px; font-weight: 650; color: var(--dim); background: rgb(var(--ink) / .04); }
.prose td:first-child { color: var(--text); font-weight: 600; }
.prose .ph { padding: 1px 6px; border-radius: 5px; font-weight: 600; color: var(--text); background: rgb(var(--ink) / .09); }
.appendix { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }

/* ---------- Help ---------- */
.h-search { position: relative; max-width: 560px; margin: 26px 0 0; }
.h-search svg { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.h-search input { width: 100%; height: 54px; padding: 0 18px 0 48px; border: 0; border-radius: 16px; font: inherit; font-size: 16px; color: var(--text); background: rgb(var(--ink) / .06); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 140ms; }
.h-search input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--text); }
.h-search input::placeholder { color: var(--dim); }
.h-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.h-quick a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); transition: color 140ms, background-color 140ms; }
.h-quick a:hover { color: var(--text); background: rgb(var(--ink) / .05); }
.prose .steps { list-style: none; margin: 8px 0 20px; padding: 0; counter-reset: s; display: grid; gap: 10px; }
.steps > li { counter-increment: s; position: relative; margin: 0; padding: 16px 18px 16px 62px; border-radius: 16px; background: rgb(var(--ink) / .035); box-shadow: inset 0 0 0 1px var(--line); }
.steps > li::before { content: counter(s); position: absolute; left: 18px; top: 16px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 750; color: var(--bg); background: var(--text); }
.steps > li > b { display: block; margin-bottom: 2px; color: var(--text); font-size: 15.5px; }
.steps > li p { margin: 0; font-size: 14.5px; line-height: 1.65; }
.screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0 20px; }
.screen { padding: 16px 18px; border-radius: 16px; background: rgb(var(--ink) / .035); box-shadow: inset 0 0 0 1px var(--line); }
.screen h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15.5px; }
.screen p { margin: 0; font-size: 14px; line-height: 1.65; }
.screen .tag-p { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; color: #fff; background: rgb(var(--accent-rgb)); }
.prose .notices { list-style: none; margin: 8px 0 20px; padding: 0; }
.notices li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.notices li:first-child { border-top: 0; }
.notices time { font-size: 13px; color: var(--dim); padding-top: 2px; }
.notices b { color: var(--text); font-size: 15px; }
.notices p { grid-column: 2; margin: 0; font-size: 14px; line-height: 1.6; }
.notices .n-body { grid-column: 2; display: grid; gap: 8px; }
.notices .n-body p { grid-column: auto; white-space: pre-line; }
.notices .n-more summary { width: max-content; min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.notices .n-more p { margin-top: 8px; }
.notices .n-wait { display: block; color: var(--muted); font-size: 14px; }
.notices .n-retry { min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.notices .kind { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 13px; font-weight: 700; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); vertical-align: 2px; }
.faq-d { display: grid; margin: 8px 0 12px; }
.faq-d details { border-top: 1px solid var(--line); }
.faq-d details:first-child { border-top: 0; }
.faq-d summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; font-size: 15.5px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; }
.faq-d summary::-webkit-details-marker { display: none; }
.faq-d summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 1.7px solid var(--dim); border-bottom: 1.7px solid var(--dim); transform: rotate(45deg) translateY(-3px); transition: transform 200ms var(--ease-out); }
.faq-d details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-d details p { margin: 0 0 16px; font-size: 14.5px; }
.faq-d mark { color: var(--text); background: rgb(var(--accent-rgb) / .28); border-radius: 3px; padding: 0 1px; }
.faq-empty { padding: 20px 0; font-size: 14px; color: var(--dim); }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 8px; padding: 22px 24px; border-radius: 20px; background: rgb(var(--ink) / .06); box-shadow: inset 0 0 0 1px var(--line-2); }
.cta-box b { display: block; color: var(--text); font-size: 17px; }
.cta-box span { font-size: 14px; }
.hidden-by-search { display: none !important; }

/* ---------- 404 · 점검 ---------- */
.solo { display: grid; place-items: center; text-align: center; padding: clamp(56px, 12vw, 140px) var(--gutter); }
.solo-in { max-width: 560px; }
.solo-code { margin: 0 0 10px; font-size: clamp(72px, 16vw, 148px); font-weight: 800; line-height: 1; letter-spacing: -0.05em; color: var(--text); text-shadow: 0 0 40px rgb(var(--ink) / .35); }
.solo h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.03em; line-height: 1.25; }
.solo p { margin: 14px 0 0; font-size: 16px; line-height: 1.65; color: var(--muted); }
.solo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.solo-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 22px; font-size: 14px; color: var(--dim); }
.solo-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.mt-status { display: grid; gap: 1px; margin: 28px auto 0; max-width: 440px; overflow: hidden; border-radius: 18px; text-align: left; background: var(--line); box-shadow: 0 0 0 1px var(--line-2); }
.mt-status div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; font-size: 14.5px; background: var(--bg); }
.mt-status span { color: var(--dim); }
.mt-status b { color: var(--text); }
.mt-bar { height: 6px; margin: 22px auto 0; max-width: 440px; border-radius: 3px; overflow: hidden; background: rgb(var(--ink) / .1); }
.mt-bar i { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width 900ms var(--ease-out); }
.live { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--text); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Footer (same structure as the landing) ---------- */
.d-foot { border-top: 1px solid var(--line); padding: 48px 0 calc(36px + env(safe-area-inset-bottom)); background: var(--bg); }
.d-foot-in { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 22px; }
.d-foot-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.d-foot-top p { margin: 8px 0 0; color: var(--dim); font-size: 14px; }
.d-cols { display: flex; gap: clamp(28px, 6vw, 72px); flex-wrap: wrap; }
.d-cols div { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.d-cols b { color: var(--text); font-size: 13px; }
.d-cols a { color: var(--muted); }
.d-cols a:hover { color: var(--text); }
.d-legal { display: grid; gap: 10px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.d-legal nav { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.d-legal nav a { color: var(--muted); }
.d-legal nav b { color: var(--text); font-weight: 650; }
.d-legal address { display: flex; flex-wrap: wrap; gap: 4px 14px; font-style: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .h-quick { display: none; }
  .d-body { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; grid-auto-flow: column; grid-auto-columns: max-content; gap: 6px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; }
  .toc-t { display: none; }
  .toc a { padding: 7px 12px; border-radius: 999px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
}
@media (max-width: 720px) {
  .d-links { display: none; }
  .d-actions { margin-left: auto; }
  .d-actions .d-login { display: none; }
  .screens { grid-template-columns: minmax(0, 1fr); }
  .notices li { grid-template-columns: minmax(0, 1fr); }
  .notices p, .notices .n-body { grid-column: 1; }
  .prose { font-size: 15px; }
  .steps > li { padding-left: 56px; }
  .steps > li::before { left: 16px; }
  .cta-box .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }
.prose s { color: var(--dim); font-weight: 400; margin-right: 4px; }
