/* 웹 접근성 검사기 — style.css */

:root {
  --bg: #f2ede2;
  --bg-elev: #fffcf5;
  --bg-sunk: #e8e0cd;
  --text: #14160f;
  --text-dim: #4f4d3f;
  --text-muted: #6b6a58;
  --border: #ddd3b8;
  --border-strong: #8a8264;
  --accent: #14503c;
  --accent-2: #0c3527;
  --accent-hover: #0e3d2d;
  --accent-soft: #e2ede4;
  --good: #147a3d;
  --warn: #b06a00;
  --warn-text: #7a4a00;
  --danger: #b8402f;
  --sev-critical: #a8281e;
  --sev-high: #b5650a;
  --sev-medium: #29618f;
  --sev-low: #86837a;
  /* ---- 고정 잉크(fill) 토큰 ----
     흰 글자를 얹는 배지·버튼의 배경은 라이트/다크 테마와 무관하게 항상 이 값을 쓴다.
     accent·sev-* 변수는 다크 테마에서 "어두운 배경 위 밝은 글자"용으로 밝게 뒤집히므로,
     그 값을 그대로 흰 글자 배경에 쓰면 대비가 무너진다(예: 밝은 민트 배경 + 흰 글자).
     그래서 흰 글자를 올리는 면(버튼·배지 채우기)만 테마와 분리된 고정 어두운 값을 쓴다. */
  --ink-accent: #175a41;
  --ink-accent-hover: #0f4530;
  --ink-critical: #a8281e;
  --ink-high: #a5590a;
  --ink-medium: #235684;
  --ink-low: #5c5a4d;
  --ink-danger: #a8382a;
  --radius: 16px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --mono: ui-monospace, "Cascadia Code", Consolas, "D2Coding", monospace;
  --sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 6%, transparent), 0 10px 28px color-mix(in srgb, var(--accent) 8%, transparent);
  --shadow-hover: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), 0 20px 44px color-mix(in srgb, var(--accent) 14%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* 이 사이트는 시스템/라이트/다크 3단 자체 스위치를 쓴다.
     'light dark'로 한 번에 선언하면 스크롤바·select 팝업 같은 네이티브 UI가
     사용자의 명시적 선택을 무시하고 OS 설정만 따라가므로, 테마별로 나눠 선언한다. */
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, .4), 0 20px 48px rgba(0, 0, 0, .46);
  --bg: #11160e;
  --bg-elev: #1b241a;
  --bg-sunk: #161d14;
  --text: #f1efe4;
  --text-dim: #c2c3b3;
  --text-muted: #8b8e7d;
  --border: #2a3227;
  --border-strong: #697362;
  --accent: #7fe3b3;
  --accent-2: #bff5da;
  --accent-hover: #a2edc5;
  --accent-soft: #12301f;
  --good: #45c874;
  --warn: #e0a233;
  --warn-text: #e5b657;
  --danger: #ea8073;
  --sev-critical: #f0796f;
  --sev-high: #e2a856;
  --sev-medium: #78bdec;
  --sev-low: #9aa0ae;
  --shadow: 0 1px 2px rgba(0, 0, 0, .34), 0 10px 30px rgba(0, 0, 0, .4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11160e;
    --bg-elev: #1b241a;
    --bg-sunk: #161d14;
    --text: #f1efe4;
    --text-dim: #c2c3b3;
    --text-muted: #8b8e7d;
    --border: #2a3227;
    --border-strong: #697362;
    --accent: #7fe3b3;
    --accent-2: #bff5da;
    --accent-hover: #a2edc5;
    --accent-soft: #12301f;
    --good: #45c874;
    --warn: #e0a233;
    --warn-text: #e5b657;
    --danger: #ea8073;
    --sev-critical: #f0796f;
    --sev-high: #e2a856;
    --sev-medium: #78bdec;
    --sev-low: #9aa0ae;
    --shadow: 0 1px 2px rgba(0, 0, 0, .34), 0 10px 30px rgba(0, 0, 0, .4);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, .4), 0 20px 48px rgba(0, 0, 0, .46);
  }
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

::selection { background: var(--ink-accent); color: #fff; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- 본문 바로가기(키보드 사용자용) ---------- */
/* 모든 페이지가 같은 규칙을 쓰도록 클래스로 둔다. 예전에는 index.html에만
   인라인 style + onfocus로 넣어 두어서 하위 문서 페이지에는 아예 없었다. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink-accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 0; text-decoration: none; font-size: 14px; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- 상단바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(155deg, var(--ink-accent), var(--ink-accent-hover));
  color: #fff; font-size: 15px;
  box-shadow: 0 1px 2px rgba(16, 20, 30, .14), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .2s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { color: var(--text-dim); font-size: 11.5px; }
.brand:hover .brand-text strong { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 테마 선택 ---------- */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-sunk); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.theme-opt {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: none; border-radius: 999px;
  color: var(--text-dim); font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 11px; cursor: pointer; white-space: nowrap; transition: .15s;
}
.theme-opt:hover { color: var(--text); }
.theme-opt[aria-checked="true"] { background: var(--bg-elev); color: var(--accent); box-shadow: 0 1px 2px rgba(16, 20, 30, .12); }
.theme-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-ico { font-size: 12.5px; line-height: 1; }

/* ---------- 히어로 ---------- */
/* 쇼케이스 패널(히어로 우측 증거 카드의 배경)은 라이트/다크 테마와 무관하게
   항상 짙은 포레스트 톤을 유지한다. 스크린샷 목업 카드처럼 "고정된 어두운 액자"
   역할이라 테마 토큰을 쓰지 않고 고정값을 둔다. */
.hero {
  position: relative; padding: 76px 0 52px; isolation: isolate; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 30px 60px; align-items: center;
}
.hero-copy { min-width: 0; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0 0 20px; padding: 5px 14px 5px 6px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elev); box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); letter-spacing: -.01em;
}
.hero-eyebrow .eyebrow-ico {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); flex: 0 0 auto;
}
.hero h1 {
  margin: 0 0 20px; font-size: clamp(32px, 4.4vw, 56px); font-weight: 800;
  line-height: 1.14; letter-spacing: -.04em;
}
.hero h1 em {
  font-style: normal; color: var(--accent); position: relative;
  background: linear-gradient(180deg, transparent 92%, color-mix(in srgb, var(--accent) 55%, transparent) 92%);
}
.hero-sub {
  margin: 0 0 28px; padding-top: 24px; border-top: 1px solid var(--border);
  color: var(--text-dim); max-width: 56ch; font-size: 16px; line-height: 1.7;
}

.trust-strip { display: flex; flex-wrap: wrap; gap: 11px 28px; }
.trust-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); font-weight: 500;
}
.trust-item svg { flex: 0 0 auto; color: var(--accent); }

/* ---------- 히어로 증거 카드 ---------- */
.hero-visual {
  --panel-1: #17251b; --panel-2: #0c1610; --panel-line: rgba(255, 255, 255, .075);
  min-width: 0; position: relative; isolation: isolate; overflow: hidden;
  display: flex; justify-content: center; align-items: center;
  padding: 30px 24px; border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(160deg, var(--panel-1), var(--panel-2));
  box-shadow: var(--shadow-hover);
}
.hero-visual::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, var(--panel-line) 0 1px, transparent 1px 30px);
  -webkit-mask-image: linear-gradient(100deg, transparent 4%, black 60%);
  mask-image: linear-gradient(100deg, transparent 4%, black 60%);
}
.proof-card {
  width: 100%; max-width: 380px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.proof-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(0, 0, 0, .34); }
.proof-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.proof-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--text-muted); }
.proof-url {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  background: var(--bg-sunk); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.proof-score {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.score-dial.mini { width: 84px; height: 84px; flex: 0 0 auto; }
.score-dial.mini .dial-bg, .score-dial.mini .dial-fg { stroke-width: 9; }
.score-dial.mini .dial-num { font-size: 22px; }
.score-dial.mini .dial-unit { font-size: 9.5px; }
.proof-delta { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.proof-delta strong { color: var(--good); }
.proof-code.code-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
.proof-code .code-label { font-size: 10.5px; padding: 4px 8px; }
.proof-code pre {
  margin: 0; padding: 8px 9px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px;
  background: var(--bg-elev); font-family: var(--mono); font-size: 10.8px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------- 스크롤 등장 모션 ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  [data-reveal].in-view { opacity: 1; transform: translateY(0); }
  [data-reveal][data-reveal-delay="1"] { transition-delay: .1s; }
  [data-reveal][data-reveal-delay="2"] { transition-delay: .18s; }
}

/* ---------- 카드 ---------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .2s var(--ease);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.step-no {
  display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%;
  background: linear-gradient(155deg, var(--ink-accent), var(--ink-accent-hover)); color: #fff; font-size: 12px; font-weight: 700;
}
.hidden { display: none !important; }
/* display:none으로는 스크린리더 접근 이름까지 지워질 수 있다(브라우저/AT 조합에 따라 이름 계산에서
   제외되는 경우가 있음). 시각적으로만 숨기고 접근성 트리에는 남겨야 하는 텍스트는 이 클래스를 쓴다. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-dim); font-weight: 400; }
.small { font-size: 12.8px; }
.note-card h2 { font-size: 15px; margin: 0 0 8px; }
.note-card p { margin: 0 0 8px; }

/* ---------- 버튼 ---------- */
.primary-btn, .ghost-btn, .danger-btn {
  font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--radius-pill); padding: 9px 19px; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .15s;
  text-decoration: none; display: inline-block;
}
.primary-btn { background: linear-gradient(155deg, var(--ink-accent), var(--ink-accent-hover)); color: #fff; box-shadow: 0 1px 2px rgba(16, 20, 30, .16); }
.primary-btn:hover { background: var(--ink-accent-hover); transform: translateY(-1px); box-shadow: 0 8px 18px color-mix(in srgb, var(--ink-accent) 40%, transparent); }
.primary-btn:active { transform: translateY(0) scale(.98); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.ghost-btn { background: transparent; color: var(--text-dim); border-color: var(--border-strong); }
.ghost-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.ghost-btn:active { transform: translateY(0) scale(.98); }
.danger-btn { background: transparent; color: var(--danger); border-color: var(--danger); }
.danger-btn:hover { background: var(--ink-danger); color: #fff; border-color: var(--ink-danger); }
.primary-btn:focus-visible, .ghost-btn:focus-visible, .danger-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.primary-btn.small, .ghost-btn.small, .danger-btn.small { padding: 6px 13px; font-size: 13px; }
.primary-btn.tiny, .ghost-btn.tiny, .danger-btn.tiny { padding: 3px 9px; font-size: 12px; }
.badge {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 5px; white-space: nowrap; }

/* ---------- 폼 ---------- */
textarea, input[type="text"], input[type="number"], input[type="url"], input[type="search"], select {
  width: 100%;
  background: var(--bg-sunk); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; font-size: 14.5px; line-height: 1.6;
}
textarea { resize: vertical; }
textarea, input, select { transition: border-color .15s, box-shadow .15s; }
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.field small.muted { font-size: 12px; }
.inline-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.8px; color: var(--text-dim); white-space: nowrap;
}
.inline-field select, .inline-field input { width: auto; min-width: 120px; padding: 6px 10px; font-size: 13.5px; }
.inline-field.grow { flex: 1 1 200px; min-width: 180px; }
.inline-field.grow input { width: 100%; }
.mini-input { padding: 4px 7px !important; font-size: 12.5px !important; min-width: 0; }

.rules-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; }
.filters-disclosure { margin: 0 0 10px; }
.filters-summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-dim);
  list-style: none; display: inline-flex; align-items: center; gap: 5px; padding: 4px 0;
}
.filters-summary::-webkit-details-marker { display: none; }
.filters-summary::before { content: '▶'; font-size: 10px; transition: transform .15s; }
.filters-disclosure[open] .filters-summary::before { transform: rotate(90deg); }
.filters-summary:hover { color: var(--text); }
.filters-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- 상태/진행 ---------- */
.status-line { font-size: 12.8px; color: var(--text-dim); }
.status-line.error { color: var(--danger); }
.progress-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.progress-row .progress { flex: 1 1 auto; margin-top: 0; }
.progress { height: 6px; background: var(--bg-sunk); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* 드롭존(.dropzone)·문서 목록(.doc-*) 스타일은 파일 업로드형 프로젝트에서 복사돼 온
   잔재였다. 이 서비스에는 해당 마크업이 전혀 없고, 특히
   `.dropzone:focus-visible { outline: none }` 때문에 자기 자신을 검사하면
   focus-outline-removed가 매번 잡혔다. 그래서 통째로 지웠다. */

/* ---------- 요약 ---------- */
.summary { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.sum-box {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 15px; min-width: 84px; background: var(--bg-sunk);
}
.sum-box strong { display: block; font-size: 20px; line-height: 1.2; }
.sum-box span { font-size: 12px; color: var(--text-dim); }
.sum-critical { border-left: 4px solid var(--sev-critical); }
.sum-high { border-left: 4px solid var(--sev-high); }
.sum-medium { border-left: 4px solid var(--sev-medium); }
.sum-low { border-left: 4px solid var(--sev-low); }

/* ---------- 심각도 배지 ---------- */
.sev {
  display: inline-block; border-radius: 999px; padding: 2px 10px;
  font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap;
}
.sev-critical { background: var(--ink-critical); }
.sev-high { background: var(--ink-high); }
.sev-medium { background: var(--ink-medium); }
.sev-low { background: var(--ink-low); }

/* ---------- 테이블 ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.data-table td.wrap-cell { white-space: normal; }
.data-table th { color: var(--text-dim); font-weight: 600; font-size: 12.5px; background: var(--bg-sunk); }
.data-table code { font-family: var(--mono); font-size: 12px; }
.findings-table tbody tr:hover { background: var(--bg-sunk); }
.finding-title { font-weight: 600; }
.finding-sub { margin-top: 1px; }
.row-done { opacity: .55; }
.row-done .finding-title { text-decoration: line-through; }
.table-empty { color: var(--text-muted); font-size: 13.5px; padding: 20px 0; text-align: center; }

/* ---------- 모달 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 18, .55);
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.modal-box {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; max-width: 560px; width: 100%; box-shadow: var(--shadow);
  max-height: 90vh; min-height: 0; overflow-y: auto;
}
.modal-box.wide { max-width: 780px; }
.modal-box h2 { margin-top: 0; font-size: 19px; }
.modal-box h3 { font-size: 14.5px; margin: 18px 0 6px; }
.help-list { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.help-list code { background: var(--bg-sunk); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12.5px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.detail-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.evidence {
  margin: 0 0 4px; padding: 10px 14px; border-left: 3px solid var(--border-strong);
  background: var(--bg-sunk); white-space: pre-wrap; font-size: 14px;
}
.doc-note {
  background: var(--bg-sunk); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 13px; color: var(--text-dim); margin: 16px 0 0;
}

/* ---------- 푸터 ---------- */
.foot { padding: 30px 20px 44px; color: var(--text-dim); font-size: 12.5px; text-align: center; }
.foot p { margin: 0; }
.foot-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.foot-links a { color: var(--text-dim); text-decoration: none; font-size: 12.5px; }
.foot-links a:hover { color: var(--accent); }
.foot-links span { color: var(--border-strong); }

/* ---------- 정적 문서 페이지 (가이드 / 방침 / 약관) ---------- */
.doc { padding: 32px 0 60px; max-width: 820px; }
.doc .back-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-dim); text-decoration: none; font-size: 13.5px; margin-bottom: 20px;
  transition: color .15s, gap .15s var(--ease);
}
.doc .back-link:hover { color: var(--accent); gap: 8px; }
.doc h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.02em; }
.doc-meta { color: var(--text-dim); font-size: 13px; margin: 0 0 26px; }
.doc h2 { font-size: 17px; margin: 1.9em 0 .6em; letter-spacing: -.01em; border-bottom: 1px solid var(--border); padding-bottom: .4em; }
.doc h3 { font-size: 14.5px; margin: 1.5em 0 .4em; }
.doc p, .doc li { margin: .55em 0; font-size: 14.5px; line-height: 1.8; }
.doc ul, .doc ol { padding-left: 1.4em; margin: .6em 0; }
.doc a { color: var(--accent); text-underline-offset: 2px; }
.doc a:hover { color: var(--accent-hover); }
.doc code {
  background: var(--bg-sunk); padding: 1px 5px; border-radius: 4px;
  font-family: var(--mono); font-size: 12.8px;
}
.doc table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1em 0; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.doc th, .doc td { border-bottom: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.doc tr:last-child td { border-bottom: none; }
.doc th { background: var(--bg-sunk); font-weight: 600; }
.doc blockquote {
  margin: 1em 0; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-sunk); color: var(--text-dim);
}
.doc-note-box {
  background: var(--bg-sunk); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13.5px; color: var(--text-dim); margin: 1.6em 0 0;
}

/* ---------- 반응형 ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .proof-card { max-width: 420px; }
}
@media (max-width: 720px) {
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 26px; }
  .hero-visual { padding: 22px 16px; }
  .card { padding: 16px; }
  .topbar-inner { height: 52px; }
  /* 라벨을 display:none으로 지우면 screen reader 접근 이름까지 함께 사라진다.
     아이콘만 보이게 하되 이름은 접근성 트리에 남기려면 visually-hidden 기법을 쓴다. */
  .theme-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .theme-opt { padding: 5px 9px; }
  .theme-ico { font-size: 14px; }
  .card-head-actions { width: 100%; }
  .findings-table th:nth-child(4), .findings-table td:nth-child(4) { display: none; }
}

/* ================================================================== */
/* 웹 접근성 검사기 전용 컴포넌트                                       */
/* ================================================================== */

/* ---------- 주소 입력 ---------- */
.url-form { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.url-form .url-input { flex: 1 1 320px; min-width: 0; font-size: 15.5px; padding: 12px 14px; }
.url-form .primary-btn { padding: 12px 26px; white-space: nowrap; }
.scan-options { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.check-field { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-dim); }
.check-field input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }
.sample-links {
  margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.8px; color: var(--text-muted);
}
.sample-links button {
  background: var(--bg-sunk); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--text-dim); cursor: pointer; transition: color .15s, border-color .15s, background-color .15s;
}
.sample-links button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 점수판 ---------- */
.score-board { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.score-dial { position: relative; width: 140px; height: 140px; flex: 0 0 auto; }
.score-dial svg { transform: rotate(-90deg); width: 100%; height: 100%; filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--accent) 18%, transparent)); }
.score-dial .dial-bg { fill: none; stroke: var(--bg-sunk); stroke-width: 10; }
.score-dial .dial-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .8s var(--ease), stroke .3s var(--ease); }
.score-dial .dial-label {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1;
}
.score-dial .dial-num { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.score-dial .dial-unit { font-size: 12px; color: var(--text-dim); }
.score-grade { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.grade-a { color: var(--good); }
.grade-b { color: var(--accent); }
.grade-c { color: var(--warn-text); }
.grade-d { color: var(--danger); }
.score-meta { flex: 1 1 260px; min-width: 0; }
.score-meta h3 { margin: 0 0 4px; font-size: 16px; }
.score-meta .score-url {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
  overflow-wrap: anywhere; margin: 0 0 10px;
}
.score-delta { font-size: 13px; font-weight: 600; margin-top: 6px; }
.delta-up { color: var(--good); }
.delta-down { color: var(--danger); }
.delta-same { color: var(--text-dim); }

/* ---------- 카테고리 막대 ---------- */
/* WCAG의 4대 원칙(인지·운용·이해·견고)으로 8개 분야를 4묶음으로 나눠 보여준다.
   한 화면에 8개를 한 그리드로 흩뿌리면 작업기억 권장 한도(4개)의 2배라 인지 부하가 높아진다. */
.cat-group + .cat-group { margin-top: 20px; }
.cat-group-title {
  font-size: 12.5px; font-weight: 700; color: var(--text-dim); margin: 0 0 10px; letter-spacing: .01em;
}
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 6px; }
.cat-row {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-sunk); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.cat-row-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; gap: 8px; }
.cat-row-head strong { font-weight: 700; }
.cat-row-head span { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.cat-bar { height: 8px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden; }
.cat-bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s var(--ease); }

/* ---------- 문제 카드 ---------- */
.finding-list { display: flex; flex-direction: column; gap: 10px; }
.finding-card {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm);
  background: var(--bg-sunk); overflow: hidden;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.finding-card:hover { box-shadow: var(--shadow); }
.finding-card.sev-l-critical { border-left-color: var(--sev-critical); }
.finding-card.sev-l-high { border-left-color: var(--sev-high); }
.finding-card.sev-l-medium { border-left-color: var(--sev-medium); }
.finding-card.sev-l-low { border-left-color: var(--sev-low); }
.finding-head {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  background: none; border: none; text-align: left; font: inherit; color: inherit;
  padding: 12px 14px; cursor: pointer;
}
.finding-head:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.finding-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.finding-head-main { flex: 1 1 auto; min-width: 0; }
.finding-head-main strong { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.finding-head-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 4px; font-size: 12px; color: var(--text-dim);
}
.wcag-tag {
  font-family: var(--mono); font-size: 11.5px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px;
}
.count-chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 9px; font-weight: 700; font-size: 11.5px; }
.finding-toggle { flex: 0 0 auto; color: var(--text-muted); font-size: 12px; transition: transform .15s; }
.finding-card.open .finding-toggle { transform: rotate(90deg); }
.finding-body { padding: 0 14px 14px; display: none; }
.finding-card.open .finding-body { display: block; }
.finding-body h4 { margin: 14px 0 5px; font-size: 13px; color: var(--text-dim); font-weight: 700; }
.finding-body h4:first-child { margin-top: 4px; }
.finding-body p { margin: 0 0 6px; font-size: 14px; }
.finding-body ol, .finding-body ul { margin: 0; padding-left: 20px; font-size: 14px; }
.finding-body li { margin: 3px 0; }

/* ---------- 코드 블록 / 수정 전후 ---------- */
.code-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.code-block { position: relative; min-width: 0; }
.code-block .code-label {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; padding: 5px 9px; border-radius: 6px 6px 0 0;
}
.code-before .code-label { background: color-mix(in srgb, var(--danger) 14%, var(--bg-elev)); color: var(--danger); }
.code-after .code-label { background: color-mix(in srgb, var(--good) 14%, var(--bg-elev)); color: var(--good); }
.code-block pre {
  margin: 0; padding: 10px 11px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px;
  background: var(--bg-elev); font-family: var(--mono); font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.code-block pre::-webkit-scrollbar { width: 8px; height: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.code-block pre::-webkit-scrollbar-track { background: transparent; }
.copy-btn {
  background: none; border: 1px solid currentColor; border-radius: 4px;
  font: inherit; font-size: 11px; padding: 1px 7px; cursor: pointer; color: inherit; opacity: .85;
}
.copy-btn:hover { opacity: 1; }
.contrast-swatch {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 6px; border: 1px solid var(--border); font-size: 13.5px; margin: 4px 6px 4px 0;
}
.ratio-pill { font-family: var(--mono); font-weight: 700; }

/* ---------- 작업 지시서 ---------- */
.order-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.order-chip {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 11px; font-size: 12px; color: var(--text-dim);
}
.order-chip strong { color: var(--text); font-weight: 600; }
.ai-pending { color: var(--text-muted); font-size: 13px; }
.ai-block { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 10px; }
.ai-tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 4px; padding: 1px 7px; font-size: 11px; font-weight: 700; margin-right: 6px;
}

/* ---------- 요약 / 알림 ---------- */
.overview-box {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px;
}
.overview-box h3 { margin: 0 0 6px; font-size: 14.5px; }
.overview-box p { margin: 0 0 8px; font-size: 14px; }
.overview-box ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.warn-box {
  background: color-mix(in srgb, var(--warn) 12%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; margin-bottom: 14px;
}
.page-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.page-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px;
  background: var(--bg-sunk); font-size: 13px;
}
.page-row .page-url { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.page-row.failed { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* ---------- 인쇄(PDF 보고서) ---------- */
@media print {
  .topbar, .foot, .no-print, .scan-options, .url-form, .sample-links,
  .hero, .skip-link { display: none !important; }   /* 마케팅 문구는 보고서에 넣지 않는다 */
  body { background: #fff; color: #000; font-size: 11pt; }
  .wrap { max-width: none; padding: 0; }
  .card { break-inside: avoid; box-shadow: none; border-color: #bbb; page-break-inside: avoid; }
  .finding-body { display: block !important; }
  .finding-card { break-inside: avoid; page-break-inside: avoid; border-color: #bbb; }
  .code-block pre { max-height: none; overflow: visible; border-color: #bbb; }
  .print-only { display: block !important; }
  h1, h2, h3 { page-break-after: avoid; }
}
.print-only { display: none; }

/* ---------- 반응형 보강 ---------- */
@media (max-width: 720px) {
  .code-pair { grid-template-columns: 1fr; }
  .score-board { gap: 14px; }
  .score-dial { width: 108px; height: 108px; }
  .score-dial .dial-num { font-size: 28px; }
}
