:root {
  --bg: #fbfbf8;
  --fg: #1d2327;
  --muted: #566069;
  --line: #cfd6dc;
  --panel: #ffffff;
  --accent: #1a5fb4;
  --notice-bg: #eef4fb;
  --ban-bg: #fde2e2;
  --ban-line: #b3261e;
  --review-bg: #fff1cc;
  --review-line: #8a5a00;
  --pass: #1b6e3c;
  --over: #b3261e;
  --focus: #0b57d0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c;
    --fg: #e8ecef;
    --muted: #a9b3bb;
    --line: #38424b;
    --panel: #1c2227;
    --accent: #8ab4f8;
    --notice-bg: #1b2733;
    --ban-bg: #5a1f1f;
    --ban-line: #ff9b94;
    --review-bg: #4d3b0d;
    --review-line: #ffd479;
    --pass: #7bd69a;
    --over: #ff9b94;
    --focus: #8ab4f8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.65;
}

/* 한글 낱말은 중간에서 줄을 바꾸지 않고(keep-all), 공백 없는 긴 토큰만 넘치기 전에 꺾는다. */
body, p, li, dt, dd, h1, h2, h3, h4, summary, label, caption, button, textarea, .text-view {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
td, th {
  word-break: keep-all;
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

.site-head, main, .site-foot {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-head { padding-top: 1.25rem; }
.site-foot { padding-bottom: 2.5rem; color: var(--muted); font-size: 0.9rem; }

h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 0.4rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
h4 { font-size: 1rem; margin: 0.8rem 0 0.3rem; }

p { margin: 0.5rem 0; }
.lead { color: var(--muted); margin-top: 0; }
.hint, .field-hint { color: var(--muted); font-size: 0.92rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
/* 문장 밖에 홀로 선 링크 — 폰에서 누르는 높이 44px 이상. 문장 안 링크는 그대로. */
.solo-link { margin: 0; }
.solo-link > a { display: inline-block; min-height: 44px; padding: 0.55rem 0; line-height: 1.5; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .text-view:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.notice, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}
.notice { background: var(--notice-bg); }
.notice h2 { font-size: 1.05rem; }

.field { margin: 0.9rem 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field-check { display: flex; align-items: center; gap: 0.6rem; }
.field-check > label { margin: 0; display: inline-block; }

input[type="checkbox"] { width: 1.5rem; height: 1.5rem; min-height: 0; flex: none; }

select, input[type="text"], textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.9rem 0 0.4rem; }
button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--fg);
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; border-style: dashed; color: var(--muted); border-color: var(--line); }

.summary { border-left: 4px solid var(--line); padding-left: 0.8rem; }
.item-name { color: var(--muted); margin: 0; }
.status { font-size: 1.15rem; margin: 0.2rem 0; }
.status-pass .status-word { color: var(--pass); }
.status-over .status-word { color: var(--over); text-decoration: underline double; }
.status-word { font-weight: 700; }
.counts { margin: 0.3rem 0 0; padding-left: 1.2rem; color: var(--muted); }

.unusual ul, .findings ul { padding-left: 1.2rem; }

.text-view {
  white-space: pre-wrap;
  max-width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

mark.hit { color: inherit; border-radius: 3px; padding: 0 0.1em; }
.hit-ban { background: var(--ban-bg); text-decoration: underline solid var(--ban-line) 2px; text-underline-offset: 0.2em; }
.hit-review { background: var(--review-bg); text-decoration: underline dashed var(--review-line) 2px; text-underline-offset: 0.2em; }
.mark-no { font-size: 0.7em; font-weight: 700; margin-left: 0.1em; }

.finding-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.finding { border: 1px solid var(--line); border-left-width: 6px; border-radius: 6px; padding: 0.5rem 0.8rem; margin: 0.7rem 0; }
.finding-ban { border-left-color: var(--ban-line); border-left-style: solid; }
.finding-review { border-left-color: var(--review-line); border-left-style: dashed; }
.finding p { margin: 0.3rem 0; }
.finding .exceptions { margin-bottom: 0; font-weight: 600; }
.finding-counts { font-weight: 700; }

.badge { display: inline-block; font-size: 0.82rem; font-weight: 700; padding: 0 0.5rem; border: 1px solid currentColor; border-radius: 999px; }
.badge-ban { color: var(--ban-line); }
.badge-review { color: var(--review-line); border-style: dashed; }
.badge-aux { color: var(--muted); }


.table-wrap { max-width: 100%; overflow-x: auto; }
.table-wrap:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
caption { text-align: left; font-weight: 600; padding: 0.3rem 0; }
th, td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--notice-bg); }

/* 금지 범주 쪽: 차례 · 범주별 사실 줄 · 예시 낱말 */
.toc { padding-left: 1.6rem; margin: 0.4rem 0 1.2rem; }
.toc a { display: inline-block; min-height: 44px; padding: 0.55rem 0; line-height: 1.5; }
.facts { margin: 0.6rem 0 0; }
.facts dt { font-weight: 700; margin-top: 0.7rem; }
.facts dd { margin: 0.2rem 0 0; }
.facts ul { margin: 0.2rem 0 0; padding-left: 1.2rem; }
.words { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.facts .words { padding: 0; }
.word { border: 1px solid var(--line); border-radius: 4px; padding: 0 0.5rem; }
section[id^="g"] { margin: 1.6rem 0; padding-top: 0.4rem; border-top: 1px solid var(--line); }

img, svg, video { max-width: 100%; height: auto; }

@media (max-width: 30rem) {
  h1 { font-size: 1.3rem; }
  .actions button { flex: 1 1 100%; }
}
